Unyson - Version 2.6.13

Version Description

  • Fixed #2310, #2308, #961, #2073
Download this release

Release Info

Developer Unyson
Plugin Icon 128x128 Unyson
Version 2.6.13
Comparing to
See all releases

Code changes from version 2.6.12 to 2.6.13

framework/core/components/backend.php CHANGED
@@ -356,6 +356,10 @@ final class _FW_Component_Backend {
356
  'cancel' => __( 'Cancel', 'fw' ),
357
  'ok' => __( 'Ok', 'fw' )
358
  ),
 
 
 
 
359
  ) );
360
  }
361
 
356
  'cancel' => __( 'Cancel', 'fw' ),
357
  'ok' => __( 'Ok', 'fw' )
358
  ),
359
+ 'options_modal' => array(
360
+ /** @since 2.6.13 */
361
+ 'default_reset_bnt_disabled' => apply_filters('fw:option-modal:default:reset-btn-disabled', false)
362
+ ),
363
  ) );
364
  }
365
 
framework/core/components/extensions/manager/views/extension.php CHANGED
@@ -26,14 +26,25 @@ if (isset($lists['available'][$name])) {
26
  }
27
 
28
  {
29
- $thumbnail = $default_thumbnail;
30
-
31
  if (isset($lists['available'][$name])) {
32
  $thumbnail = $lists['available'][$name]['thumbnail'];
 
 
33
  }
34
 
35
  if (isset($lists['installed'][$name])) {
36
  $thumbnail = fw_akg('thumbnail', $lists['installed'][$name]['manifest'], $thumbnail);
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  }
39
 
26
  }
27
 
28
  {
 
 
29
  if (isset($lists['available'][$name])) {
30
  $thumbnail = $lists['available'][$name]['thumbnail'];
31
+ } else {
32
+ $thumbnail = $default_thumbnail;
33
  }
34
 
35
  if (isset($lists['installed'][$name])) {
36
  $thumbnail = fw_akg('thumbnail', $lists['installed'][$name]['manifest'], $thumbnail);
37
+
38
+ // local image
39
+ if (
40
+ substr($thumbnail, 0, 11) !== 'data:image/'
41
+ &&
42
+ !filter_var($thumbnail, FILTER_VALIDATE_URL)
43
+ &&
44
+ file_exists($thumbnail_path = $lists['installed'][$name]['path'] .'/'. $thumbnail)
45
+ ) {
46
+ $thumbnail = fw_get_path_url($thumbnail_path);
47
+ }
48
  }
49
  }
50
 
framework/core/components/theme.php CHANGED
@@ -111,7 +111,11 @@ final class _FW_Component_Theme
111
  try {
112
  return FW_Cache::get($cache_key);
113
  } catch (FW_Cache_Not_Found_Exception $e) {
114
- $options = apply_filters('fw_post_options', $this->get_options('posts/'. $post_type), $post_type);
 
 
 
 
115
 
116
  FW_Cache::set($cache_key, $options);
117
 
@@ -126,8 +130,9 @@ final class _FW_Component_Theme
126
  try {
127
  return FW_Cache::get($cache_key);
128
  } catch (FW_Cache_Not_Found_Exception $e) {
129
- $options = apply_filters('fw_taxonomy_options',
130
- $this->get_options('taxonomies/'. $taxonomy),
 
131
  $taxonomy
132
  );
133
 
111
  try {
112
  return FW_Cache::get($cache_key);
113
  } catch (FW_Cache_Not_Found_Exception $e) {
114
+ $options = apply_filters(
115
+ 'fw_post_options',
116
+ apply_filters( "fw_post_options:$post_type", $this->get_options( 'posts/' . $post_type ) ),
117
+ $post_type
118
+ );
119
 
120
  FW_Cache::set($cache_key, $options);
121
 
130
  try {
131
  return FW_Cache::get($cache_key);
132
  } catch (FW_Cache_Not_Found_Exception $e) {
133
+ $options = apply_filters(
134
+ 'fw_taxonomy_options',
135
+ apply_filters( "fw_taxonomy_options:$taxonomy", $this->get_options( 'taxonomies/' . $taxonomy ) ),
136
  $taxonomy
137
  );
138
 
framework/helpers/general.php CHANGED
@@ -5,12 +5,17 @@
5
  * Convert to Unix style directory separators
6
  */
7
  function fw_fix_path($path) {
 
8
  $fixed_path = untrailingslashit( str_replace(array('//', '\\'), array('/', '/'), $path) );
9
 
10
  if (empty($fixed_path) && !empty($path)) {
11
  $fixed_path = '/';
12
  }
13
 
 
 
 
 
14
  return $fixed_path;
15
  }
16
 
5
  * Convert to Unix style directory separators
6
  */
7
  function fw_fix_path($path) {
8
+ $windows_network_path = isset($_SERVER['windir']) && in_array(substr($path, 0, 2), array('//', '\\\\'), true);
9
  $fixed_path = untrailingslashit( str_replace(array('//', '\\'), array('/', '/'), $path) );
10
 
11
  if (empty($fixed_path) && !empty($path)) {
12
  $fixed_path = '/';
13
  }
14
 
15
+ if ($windows_network_path) {
16
+ $fixed_path = '//'. ltrim($fixed_path, '/');
17
+ }
18
+
19
  return $fixed_path;
20
  }
21
 
framework/includes/option-types/gradient/class-fw-option-type-gradient.php CHANGED
@@ -43,13 +43,14 @@ class FW_Option_Type_Gradient extends FW_Option_Type
43
  */
44
  protected function _render($id, $option, $data)
45
  {
46
- $output = fw_render_view(fw_get_framework_directory('/includes/option-types/' . $this->get_type() . '/view.php'), array(
47
- 'id' => $id,
48
- 'option' => $option,
49
- 'data' => $data
50
- ));
51
-
52
- return $output;
 
53
  }
54
 
55
  public function get_type()
@@ -62,16 +63,33 @@ class FW_Option_Type_Gradient extends FW_Option_Type
62
  */
63
  protected function _get_value_from_input($option, $input_value)
64
  {
65
- if (is_array($input_value)) {
66
- if (!isset($input_value['primary']) || !preg_match('/^#[a-f0-9]{6}$/i', $input_value['primary'])) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  $input_value['primary'] = $option['value']['primary'];
68
  }
69
 
70
- if (!isset($input_value['secondary']) || !preg_match('/^#[a-f0-9]{6}$/i', $input_value['secondary'])) {
71
- $input_value['secondary'] = (isset($option['value']['secondary'])) ? $option['value']['secondary'] : false;
 
 
72
  }
73
- } else {
74
- $input_value = $option['value'];
75
  }
76
 
77
  return $input_value;
@@ -84,8 +102,8 @@ class FW_Option_Type_Gradient extends FW_Option_Type
84
  {
85
  return array(
86
  'value' => array(
87
- 'primary' => '#FF0000',
88
- 'secondary' => '#0000FF',
89
  )
90
  );
91
  }
43
  */
44
  protected function _render($id, $option, $data)
45
  {
46
+ return fw_render_view(
47
+ fw_get_framework_directory('/includes/option-types/' . $this->get_type() . '/view.php'),
48
+ array(
49
+ 'id' => $id,
50
+ 'option' => $option,
51
+ 'data' => $data
52
+ )
53
+ );
54
  }
55
 
56
  public function get_type()
63
  */
64
  protected function _get_value_from_input($option, $input_value)
65
  {
66
+ if (!is_array($input_value)) {
67
+ return $option['value'];
68
+ }
69
+
70
+ if (
71
+ isset($input_value['primary']) && $input_value['primary'] === ''
72
+ &&
73
+ isset($input_value['secondary']) && $input_value['secondary'] === ''
74
+ ) {
75
+ return array(
76
+ 'primary' => '',
77
+ 'secondary' => '',
78
+ );
79
+ } else {
80
+ $color_regex = '/^#([a-f0-9]{3}){1,2}$/i';
81
+
82
+ if (
83
+ !isset($input_value['primary']) || !preg_match($color_regex, $input_value['primary'])
84
+ ) {
85
  $input_value['primary'] = $option['value']['primary'];
86
  }
87
 
88
+ if (
89
+ !isset($input_value['secondary']) || !preg_match($color_regex, $input_value['secondary'])
90
+ ) {
91
+ $input_value['secondary'] = (isset($option['value']['secondary'])) ? $input_value['primary'] : false;
92
  }
 
 
93
  }
94
 
95
  return $input_value;
102
  {
103
  return array(
104
  'value' => array(
105
+ 'primary' => '',
106
+ 'secondary' => '',
107
  )
108
  );
109
  }
framework/includes/option-types/gradient/view.php CHANGED
@@ -42,7 +42,7 @@ $color_regex = '/^#[a-f0-9]{6}$/i';
42
  );
43
  ?>
44
  </div>
45
- <?php if ( ! empty( $option['value']['secondary'] ) ): ?>
46
  <div class="delimiter"><?php echo __( 'to', 'fw' ) ?></div>
47
  <div class="secondary-color">
48
  <?php
42
  );
43
  ?>
44
  </div>
45
+ <?php if ( isset( $option['value']['secondary'] ) ): ?>
46
  <div class="delimiter"><?php echo __( 'to', 'fw' ) ?></div>
47
  <div class="secondary-color">
48
  <?php
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.6.12';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.6.13';
framework/static/js/fw.js CHANGED
@@ -1217,7 +1217,11 @@ fw.getValuesFromServer = function (data) {
1217
  }
1218
  ];
1219
 
1220
- if (! settings.disableResetButton) {
 
 
 
 
1221
  buttons = buttons.concat([{
1222
  style: '',
1223
  text: _fw_localized.l10n.reset,
1217
  }
1218
  ];
1219
 
1220
+ if (!(
1221
+ typeof settings.disableResetButton === 'undefined'
1222
+ ? _fw_localized.options_modal.default_reset_bnt_disabled
1223
+ : settings.disableResetButton
1224
+ )) {
1225
  buttons = buttons.concat([{
1226
  style: '',
1227
  text: _fw_localized.l10n.reset,
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: unyson
3
  Tags: page builder, shortcodes, backup, seo, breadcrumbs, portfolio, framework
4
  Requires at least: 4.4
5
  Tested up to: 4.7
6
- Stable tag: 2.6.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -85,6 +85,9 @@ Yes; Unyson will work with any theme.
85
 
86
  == Changelog ==
87
 
 
 
 
88
  = 2.6.12 =
89
  * Fixed [#2283](https://github.com/ThemeFuse/Unyson/issues/2283), [#2265](https://github.com/ThemeFuse/Unyson/issues/2265), [#2286](https://github.com/ThemeFuse/Unyson/issues/2286), [#2288](https://github.com/ThemeFuse/Unyson/issues/2288)
90
 
3
  Tags: page builder, shortcodes, backup, seo, breadcrumbs, portfolio, framework
4
  Requires at least: 4.4
5
  Tested up to: 4.7
6
+ Stable tag: 2.6.13
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
85
 
86
  == Changelog ==
87
 
88
+ = 2.6.13 =
89
+ * Fixed [#2310](https://github.com/ThemeFuse/Unyson/issues/2310), [#2308](https://github.com/ThemeFuse/Unyson/issues/2308), [#961](https://github.com/ThemeFuse/Unyson/issues/961), [#2073](https://github.com/ThemeFuse/Unyson/issues/2073)
90
+
91
  = 2.6.12 =
92
  * Fixed [#2283](https://github.com/ThemeFuse/Unyson/issues/2283), [#2265](https://github.com/ThemeFuse/Unyson/issues/2265), [#2286](https://github.com/ThemeFuse/Unyson/issues/2286), [#2288](https://github.com/ThemeFuse/Unyson/issues/2288)
93
 
unyson.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.io/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
- * Version: 2.6.12
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.io/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
+ * Version: 2.6.13
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+