Unyson - Version 2.1.24

Version Description

  • Fixed access denied on Theme Settings and Unyson pages when qTranslate is active
  • Made all boxes open when Theme Settings Side Tabs is active (with default tabs only first box is open)
  • Minor fixes
Download this release

Release Info

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

Code changes from version 2.1.23 to 2.1.24

README.md CHANGED
@@ -84,4 +84,4 @@ If you have a bug report or feature request related to a specific extension, fol
84
  * [Mailer](https://github.com/ThemeFuse/Unyson-Mailer-Extension)
85
  * [Social](https://github.com/ThemeFuse/Unyson-Social-Extension)
86
  * [Population Methods](https://github.com/ThemeFuse/Unyson-PopulationMethods-Extension)
87
- * [Blog Posts](https://github.com/ThemeFuse/Unyson-Blog-Extension)
84
  * [Mailer](https://github.com/ThemeFuse/Unyson-Mailer-Extension)
85
  * [Social](https://github.com/ThemeFuse/Unyson-Social-Extension)
86
  * [Population Methods](https://github.com/ThemeFuse/Unyson-PopulationMethods-Extension)
87
+ * [Blog Posts](https://github.com/ThemeFuse/Unyson-Blog-Extension)
framework/core/components/backend.php CHANGED
@@ -386,6 +386,24 @@ final class _FW_Component_Backend
386
  return;
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  /**
390
  * Use this action if you what to add the settings page in a custom place in menu
391
  * Usage example http://pastebin.com/0KQXLPZj
@@ -393,15 +411,17 @@ final class _FW_Component_Backend
393
  do_action('fw_backend_add_custom_settings_menu', $data);
394
 
395
  /**
396
- * check if settings menu was added in the action above
397
  */
398
  {
399
- global $_registered_pages;
400
-
401
  $menu_exists = false;
402
 
403
  if (!empty($_registered_pages)) {
404
  foreach ( $_registered_pages as $hookname => $b ) {
 
 
 
 
405
  if ( strpos( $hookname, $data['slug'] ) !== false ) {
406
  $menu_exists = true;
407
  break;
@@ -847,6 +867,7 @@ final class _FW_Component_Backend
847
  $values = fw_get_db_settings_option();
848
  }
849
 
 
850
  $side_tabs = fw()->theme->get_config('settings_form_side_tabs');
851
 
852
  $data['attr']['class'] = 'fw-settings-form';
@@ -857,17 +878,20 @@ final class _FW_Component_Backend
857
 
858
  $data['submit']['html'] = '<!-- -->'; // is generated in view
859
 
 
 
 
 
 
860
  fw_render_view(fw_get_framework_directory('/views/backend-settings-form.php'), array(
861
  'options' => $options,
862
  'values' => $values,
863
  'focus_tab_input_name' => '_focus_tab',
864
  'reset_input_name' => '_fw_reset_options',
865
- 'ajax_submit' => fw()->theme->get_config('settings_form_ajax_submit'),
866
  'side_tabs' => $side_tabs,
867
  ), false);
868
 
869
-
870
-
871
  return $data;
872
  }
873
 
386
  return;
387
  }
388
 
389
+ /**
390
+ * Collect $hookname that contains $data['slug'] before the action
391
+ * and skip them in verification after action
392
+ */
393
+ {
394
+ global $_registered_pages;
395
+
396
+ $found_hooknames = array();
397
+
398
+ if (!empty($_registered_pages)) {
399
+ foreach ( $_registered_pages as $hookname => $b ) {
400
+ if ( strpos( $hookname, $data['slug'] ) !== false ) {
401
+ $found_hooknames[$hookname] = true;
402
+ }
403
+ }
404
+ }
405
+ }
406
+
407
  /**
408
  * Use this action if you what to add the settings page in a custom place in menu
409
  * Usage example http://pastebin.com/0KQXLPZj
411
  do_action('fw_backend_add_custom_settings_menu', $data);
412
 
413
  /**
414
+ * Check if settings menu was added in the action above
415
  */
416
  {
 
 
417
  $menu_exists = false;
418
 
419
  if (!empty($_registered_pages)) {
420
  foreach ( $_registered_pages as $hookname => $b ) {
421
+ if (isset($found_hooknames[$hookname])) {
422
+ continue;
423
+ }
424
+
425
  if ( strpos( $hookname, $data['slug'] ) !== false ) {
426
  $menu_exists = true;
427
  break;
867
  $values = fw_get_db_settings_option();
868
  }
869
 
870
+ $ajax_submit = fw()->theme->get_config('settings_form_ajax_submit');
871
  $side_tabs = fw()->theme->get_config('settings_form_side_tabs');
872
 
873
  $data['attr']['class'] = 'fw-settings-form';
878
 
879
  $data['submit']['html'] = '<!-- -->'; // is generated in view
880
 
881
+ do_action('fw_settings_form_render', array(
882
+ 'ajax_submit' => $ajax_submit,
883
+ 'side_tabs' => $side_tabs,
884
+ ));
885
+
886
  fw_render_view(fw_get_framework_directory('/views/backend-settings-form.php'), array(
887
  'options' => $options,
888
  'values' => $values,
889
  'focus_tab_input_name' => '_focus_tab',
890
  'reset_input_name' => '_fw_reset_options',
891
+ 'ajax_submit' => $ajax_submit,
892
  'side_tabs' => $side_tabs,
893
  ), false);
894
 
 
 
895
  return $data;
896
  }
897
 
framework/core/components/extensions/manager/class--fw-extensions-manager.php CHANGED
@@ -544,6 +544,24 @@ final class _FW_Extensions_Manager
544
  'content_callback' => array($this, '_display_page'),
545
  );
546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  /**
548
  * Use this action if you what to add the extensions page in a custom place in menu
549
  * Usage example http://pastebin.com/2iWVRPAU
@@ -551,15 +569,17 @@ final class _FW_Extensions_Manager
551
  do_action('fw_backend_add_custom_extensions_menu', $data);
552
 
553
  /**
554
- * check if menu was added in the action above
555
  */
556
  {
557
- global $_registered_pages;
558
-
559
  $menu_exists = false;
560
 
561
  if (!empty($_registered_pages)) {
562
  foreach ( $_registered_pages as $hookname => $b ) {
 
 
 
 
563
  if ( strpos( $hookname, $data['slug'] ) !== false ) {
564
  $menu_exists = true;
565
  break;
@@ -569,7 +589,7 @@ final class _FW_Extensions_Manager
569
  }
570
 
571
  if ($menu_exists) {
572
- //
573
  } else {
574
  add_menu_page(
575
  $data['title'],
@@ -2498,7 +2518,13 @@ final class _FW_Extensions_Manager
2498
 
2499
  if (!isset($installed_extensions[$extension_name])) {
2500
  return new WP_Error($wp_error_id,
2501
- sprintf(__('Cannot activate the %s extension because it is not installed.', 'fw'), fw_id_to_title($extension_name))
 
 
 
 
 
 
2502
  );
2503
  }
2504
 
@@ -2539,7 +2565,13 @@ final class _FW_Extensions_Manager
2539
  foreach ($required_extensions as $required_extension_name => $required_extension_data) {
2540
  if (!isset($installed_extensions[$required_extension_name])) {
2541
  return new WP_Error($wp_error_id,
2542
- sprintf(__('Cannot activate the %s extension because it is not installed.', 'fw'), fw_id_to_title($required_extension_name))
 
 
 
 
 
 
2543
  );
2544
  }
2545
 
544
  'content_callback' => array($this, '_display_page'),
545
  );
546
 
547
+ /**
548
+ * Collect $hookname that contains $data['slug'] before the action
549
+ * and skip them in verification after action
550
+ */
551
+ {
552
+ global $_registered_pages;
553
+
554
+ $found_hooknames = array();
555
+
556
+ if (!empty($_registered_pages)) {
557
+ foreach ( $_registered_pages as $hookname => $b ) {
558
+ if ( strpos( $hookname, $data['slug'] ) !== false ) {
559
+ $found_hooknames[$hookname] = true;
560
+ }
561
+ }
562
+ }
563
+ }
564
+
565
  /**
566
  * Use this action if you what to add the extensions page in a custom place in menu
567
  * Usage example http://pastebin.com/2iWVRPAU
569
  do_action('fw_backend_add_custom_extensions_menu', $data);
570
 
571
  /**
572
+ * Check if menu was added in the action above
573
  */
574
  {
 
 
575
  $menu_exists = false;
576
 
577
  if (!empty($_registered_pages)) {
578
  foreach ( $_registered_pages as $hookname => $b ) {
579
+ if (isset($found_hooknames[$hookname])) {
580
+ continue;
581
+ }
582
+
583
  if ( strpos( $hookname, $data['slug'] ) !== false ) {
584
  $menu_exists = true;
585
  break;
589
  }
590
 
591
  if ($menu_exists) {
592
+ // do nothing
593
  } else {
594
  add_menu_page(
595
  $data['title'],
2518
 
2519
  if (!isset($installed_extensions[$extension_name])) {
2520
  return new WP_Error($wp_error_id,
2521
+ sprintf(
2522
+ __('Cannot activate the %s extension because it is not installed. %s', 'fw'),
2523
+ fw_id_to_title($extension_name),
2524
+ fw_html_tag('a', array(
2525
+ 'href' => $this->get_link() .'&sub-page=install&extension='. $extension_name
2526
+ ), __('Install', 'fw'))
2527
+ )
2528
  );
2529
  }
2530
 
2565
  foreach ($required_extensions as $required_extension_name => $required_extension_data) {
2566
  if (!isset($installed_extensions[$required_extension_name])) {
2567
  return new WP_Error($wp_error_id,
2568
+ sprintf(
2569
+ __('Cannot activate the %s extension because it is not installed. %s', 'fw'),
2570
+ fw_id_to_title($required_extension_name),
2571
+ fw_html_tag('a', array(
2572
+ 'href' => $this->get_link() .'&sub-page=install&extension='. $required_extension_name
2573
+ ), __('Install', 'fw'))
2574
+ )
2575
  );
2576
  }
2577
 
framework/helpers/database.php CHANGED
@@ -19,7 +19,11 @@
19
  $option_id, $default_value, $get_original_value
20
  );
21
 
22
- if ( is_null( $value ) ) {
 
 
 
 
23
  /**
24
  * Maybe the options was never saved or the given option id does not exist
25
  * Extract the default values from the options array and try to find there the option id
19
  $option_id, $default_value, $get_original_value
20
  );
21
 
22
+ if (
23
+ (!is_null($option_id) && is_null($value)) // a specific option_id was requested
24
+ ||
25
+ (is_null($option_id) && empty($value)) // all options were requested but the db value is empty (this can happen after Reset)
26
+ ) {
27
  /**
28
  * Maybe the options was never saved or the given option id does not exist
29
  * Extract the default values from the options array and try to find there the option id
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.1.23';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.1.24';
framework/static/js/backend-options.js CHANGED
@@ -106,7 +106,17 @@ jQuery(document).ready(function($){
106
  fwEvents.on('fw:options:init', function (data) {
107
  var $boxes = data.$elements.find('.fw-postbox:not(.fw-postbox-initialized)');
108
 
109
- hideBoxEmptyTitles($boxes);
 
 
 
 
 
 
 
 
 
 
110
 
111
  setTimeout(function(){
112
  addPostboxToggles($boxes);
106
  fwEvents.on('fw:options:init', function (data) {
107
  var $boxes = data.$elements.find('.fw-postbox:not(.fw-postbox-initialized)');
108
 
109
+ {
110
+ hideBoxEmptyTitles($boxes);
111
+
112
+ /**
113
+ * some times the titles are not hidden (don't know why)
114
+ * so try to hide second time just to make sure
115
+ */
116
+ setTimeout(function(){
117
+ hideBoxEmptyTitles($boxes);
118
+ }, 300);
119
+ }
120
 
121
  setTimeout(function(){
122
  addPostboxToggles($boxes);
framework/views/backend-settings-form.php CHANGED
@@ -134,13 +134,10 @@ jQuery(function($){
134
  </script>
135
  <!-- end: reset warning -->
136
 
 
137
  <!-- ajax submit -->
138
  <script type="text/javascript">
139
  jQuery(function ($) {
140
- <?php if (!$ajax_submit): ?>
141
- return; // ajax submit is disabled in theme config
142
- <?php endif; ?>
143
-
144
  function isReset($submitButton) {
145
  return $submitButton.length && $submitButton.attr('name') == '<?php echo esc_js($reset_input_name) ?>';
146
  }
@@ -302,3 +299,22 @@ jQuery(function($){
302
  });
303
  </script>
304
  <!-- end: ajax submit -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  </script>
135
  <!-- end: reset warning -->
136
 
137
+ <?php if ($ajax_submit): ?>
138
  <!-- ajax submit -->
139
  <script type="text/javascript">
140
  jQuery(function ($) {
 
 
 
 
141
  function isReset($submitButton) {
142
  return $submitButton.length && $submitButton.attr('name') == '<?php echo esc_js($reset_input_name) ?>';
143
  }
299
  });
300
  </script>
301
  <!-- end: ajax submit -->
302
+ <?php endif; ?>
303
+
304
+ <?php if ($side_tabs): ?>
305
+ <!-- open all postboxes -->
306
+ <script type="text/javascript">
307
+ jQuery(function ($) {
308
+ var execTimeoutId = 0;
309
+
310
+ fwEvents.on('fw:options:init', function(data){
311
+ // use timeout to be executed after the script from backend-options.js
312
+ clearTimeout(execTimeoutId);
313
+ execTimeoutId = setTimeout(function(){
314
+ // undo not first boxes auto close
315
+ data.$elements.find('.fw-backend-postboxes > .fw-postbox:not(:first-child)').removeClass('closed');
316
+ }, 10);
317
+ });
318
+ });
319
+ </script>
320
+ <?php endif; ?>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: unyson, themefusecom
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
  Tested up to: 4.1
6
- Stable tag: 2.1.23
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -86,6 +86,11 @@ Yes; Unyson will work with any theme.
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
89
  = 2.1.23 =
90
  * Improved modal sizes *(Set max-width,max-height pixels instead of top,right,bottom,left percents)*
91
  * Added side tabs styles for Theme Settings page.
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
  Tested up to: 4.1
6
+ Stable tag: 2.1.24
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.1.24 =
90
+ * Fixed access denied on Theme Settings and Unyson pages when qTranslate is active
91
+ * Made all boxes open when Theme Settings Side Tabs is active (with default tabs only first box is open)
92
+ * Minor fixes
93
+
94
  = 2.1.23 =
95
  * Improved modal sizes *(Set max-width,max-height pixels instead of top,right,bottom,left percents)*
96
  * Added side tabs styles for Theme Settings page.
unyson.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.themefuse.com/
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.1.23
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
3
  * Plugin Name: Unyson
4
  * Plugin URI: http://unyson.themefuse.com/
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.1.24
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+