Gantry 4 Framework - Version 4.1.5

Version Description

  • Fixed layout issues when using WPML and multilingual widgets
  • Fixed strict standards error in invertPositionOrder for RTL languages
  • Fixed Warning caused by $gantry being null when using WPTouch
  • Fixed RTL notices caused by using deprecated get_bloginfo calls
  • Added wp_nonce_field() to the Login Form widget
Download this release

Release Info

Developer gantry
Plugin Icon 128x128 Gantry 4 Framework
Version 4.1.5
Comparing to
See all releases

Code changes from version 4.1.4 to 4.1.5

CHANGELOG.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Gantry For Wordpress
4
  *
5
- * @version $Id: CHANGELOG.php 61350 2015-03-10 10:40:16Z jakub $
6
  * @author RocketTheme http://www.rockettheme.com
7
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
8
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -27,6 +27,13 @@ Legend:
27
  - -> Removed
28
  ! -> Note
29
 
 
 
 
 
 
 
 
30
  ------- 4.1.4 Release [] ------
31
  * Fixed potential security risk
32
 
2
  /**
3
  * Gantry For Wordpress
4
  *
5
+ * @version $Id: CHANGELOG.php 61395 2015-07-04 09:53:17Z jakub $
6
  * @author RocketTheme http://www.rockettheme.com
7
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
8
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
27
  - -> Removed
28
  ! -> Note
29
 
30
+ ------- 4.1.5 Release [] ------
31
+ # Fixed layout issues when using WPML and multilingual widgets
32
+ # Fixed strict standards error in invertPositionOrder for RTL languages
33
+ # Fixed Warning caused by $gantry being null when using WPTouch
34
+ # Fixed RTL notices caused by using deprecated get_bloginfo calls
35
+ + Added wp_nonce_field() to the Login Form widget
36
+
37
  ------- 4.1.4 Release [] ------
38
  * Fixed potential security risk
39
 
admin/forms/fields/imagepicker.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.4 March 11, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.5 July 6, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
admin/forms/fields/updater.php CHANGED
@@ -27,7 +27,7 @@ class GantryFormFieldUpdater extends GantryFormField
27
 
28
  $currentVersion = GANTRY_VERSION;
29
 
30
- if ($currentVersion == "\4.1.4") $currentVersion = "[DEV]";
31
 
32
  // curl check
33
  if (!function_exists('curl_version')) {
27
 
28
  $currentVersion = GANTRY_VERSION;
29
 
30
+ if ($currentVersion == "\4.1.5") $currentVersion = "[DEV]";
31
 
32
  // curl check
33
  if (!function_exists('curl_version')) {
admin/widgets/colorchooser/css/mooRainbow-2.0.css CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @version 4.1.4 March 11, 2015
3
  * @author RocketTheme http://www.rockettheme.com
4
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
5
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  /**
2
+ * @version 4.1.5 July 6, 2015
3
  * @author RocketTheme http://www.rockettheme.com
4
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
5
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
core/gantry.class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: gantry.class.php 61284 2015-01-28 12:11:17Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -1055,7 +1055,7 @@ class Gantry
1055
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1056
  }
1057
  $filename = strtolower(basename($path, '.css')) . rand(0, 1000);
1058
- wp_enqueue_style($filename, $path, array(), '4.1.4');
1059
  $deps[] = $path;
1060
  }
1061
  }
@@ -1068,11 +1068,11 @@ class Gantry
1068
  if ($this->baseUrl != "/") {
1069
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1070
  }
1071
- wp_enqueue_script($path, $path, $deps, '4.1.4');
1072
  $deps[] = $path;
1073
  }
1074
  foreach ($this->_header_full_scripts as $strSrc) {
1075
- wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.4');
1076
  $deps[] = $strSrc;
1077
  }
1078
 
@@ -1112,11 +1112,11 @@ class Gantry
1112
  if ($this->baseUrl != "/") {
1113
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1114
  }
1115
- wp_enqueue_script($path, $path, $deps, '4.1.4', true);
1116
  $deps[] = $path;
1117
  }
1118
  foreach ($this->_footer_full_scripts as $strSrc) {
1119
- wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.4', true);
1120
  $deps[] = $strSrc;
1121
  }
1122
 
@@ -1764,7 +1764,7 @@ class Gantry
1764
  if (!defined('GANTRY_FINALIZED')) {
1765
  $this->_styles[$priority][] = $link;
1766
  } else {
1767
- wp_enqueue_style($link->getUrl(), $link->getUrl(), array(), '4.1.4');
1768
  }
1769
  }
1770
  }
@@ -1878,7 +1878,7 @@ class Gantry
1878
  $this->_footerscripts[$full_path] = $check_url_path . $query_string;
1879
  }
1880
  } else {
1881
- wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.4', $in_footer);
1882
  }
1883
  break;
1884
  }
@@ -1916,7 +1916,7 @@ class Gantry
1916
  $this->_footerscripts[$check_path] = $check_url_path . $query_string;
1917
  }
1918
  } else {
1919
- wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.4', $in_footer);
1920
  }
1921
  break(2);
1922
  }
@@ -2400,7 +2400,7 @@ class Gantry
2400
  $checks = $this->browser->getChecks($file, $keep_path);
2401
 
2402
  // check if RTL version needed
2403
- if (get_bloginfo('text_direction') == 'rtl' && $this->get('rtl-enabled')) {
2404
  $checks[] = $path . $filename . '-rtl' . $ext;
2405
  }
2406
  return $checks;
1
  <?php
2
  /**
3
+ * @version $Id: gantry.class.php 61394 2015-07-04 09:48:11Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1055
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1056
  }
1057
  $filename = strtolower(basename($path, '.css')) . rand(0, 1000);
1058
+ wp_enqueue_style($filename, $path, array(), '4.1.5');
1059
  $deps[] = $path;
1060
  }
1061
  }
1068
  if ($this->baseUrl != "/") {
1069
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1070
  }
1071
+ wp_enqueue_script($path, $path, $deps, '4.1.5');
1072
  $deps[] = $path;
1073
  }
1074
  foreach ($this->_header_full_scripts as $strSrc) {
1075
+ wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.5');
1076
  $deps[] = $strSrc;
1077
  }
1078
 
1112
  if ($this->baseUrl != "/") {
1113
  $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path);
1114
  }
1115
+ wp_enqueue_script($path, $path, $deps, '4.1.5', true);
1116
  $deps[] = $path;
1117
  }
1118
  foreach ($this->_footer_full_scripts as $strSrc) {
1119
+ wp_enqueue_script($strSrc, $strSrc, $deps, '4.1.5', true);
1120
  $deps[] = $strSrc;
1121
  }
1122
 
1764
  if (!defined('GANTRY_FINALIZED')) {
1765
  $this->_styles[$priority][] = $link;
1766
  } else {
1767
+ wp_enqueue_style($link->getUrl(), $link->getUrl(), array(), '4.1.5');
1768
  }
1769
  }
1770
  }
1878
  $this->_footerscripts[$full_path] = $check_url_path . $query_string;
1879
  }
1880
  } else {
1881
+ wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.5', $in_footer);
1882
  }
1883
  break;
1884
  }
1916
  $this->_footerscripts[$check_path] = $check_url_path . $query_string;
1917
  }
1918
  } else {
1919
+ wp_enqueue_script($check_url_path, $check_url_path, array(), '4.1.5', $in_footer);
1920
  }
1921
  break(2);
1922
  }
2400
  $checks = $this->browser->getChecks($file, $keep_path);
2401
 
2402
  // check if RTL version needed
2403
+ if (is_rtl() && $this->get('rtl-enabled')) {
2404
  $checks[] = $path . $filename . '-rtl' . $ext;
2405
  }
2406
  return $checks;
core/renderers/gantrymainbodyrenderer.class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: gantrymainbodyrenderer.class.php 60976 2014-06-21 16:36:53Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -57,7 +57,7 @@ class GantryMainBodyRenderer
57
  }
58
 
59
  // If RTL then flip the array
60
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
61
  $schema = $gantry->flipBodyPosition($schema);
62
  }
63
 
@@ -84,13 +84,14 @@ class GantryMainBodyRenderer
84
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
85
 
86
  (isset($filtered_widgets['sidebar'])) ? $widgets = $filtered_widgets['sidebar'] : $widgets = array();
 
87
 
88
  // Map widgets to sidebars without the dividers
89
  $widget_map = array();
90
  $pos = 1;
91
  $pos_info_set = false;
92
 
93
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
94
  $main_body_pp = array_shift($pushPull);
95
  $pushPull = array_reverse($pushPull);
96
  array_unshift($pushPull, $main_body_pp);
@@ -115,7 +116,7 @@ class GantryMainBodyRenderer
115
 
116
 
117
  $sidebars = "";
118
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
119
  add_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
120
  }
121
  add_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
@@ -123,7 +124,7 @@ class GantryMainBodyRenderer
123
  dynamic_sidebar('sidebar');
124
  $sidebars .= ob_get_clean();
125
  remove_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
126
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
127
  remove_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
128
  }
129
 
@@ -154,7 +155,7 @@ class GantryMainBodyRenderer
154
  *
155
  * @return array
156
  */
157
- public function invertPositionOrder($sidebar_widgets)
158
  {
159
 
160
  $inverted_sidebar_widgets = array();
1
  <?php
2
  /**
3
+ * @version $Id: gantrymainbodyrenderer.class.php 61394 2015-07-04 09:48:11Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
57
  }
58
 
59
  // If RTL then flip the array
60
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
61
  $schema = $gantry->flipBodyPosition($schema);
62
  }
63
 
84
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
85
 
86
  (isset($filtered_widgets['sidebar'])) ? $widgets = $filtered_widgets['sidebar'] : $widgets = array();
87
+ $widgets = apply_filters('gantry_renderer_filtered_widgets', $widgets);
88
 
89
  // Map widgets to sidebars without the dividers
90
  $widget_map = array();
91
  $pos = 1;
92
  $pos_info_set = false;
93
 
94
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
95
  $main_body_pp = array_shift($pushPull);
96
  $pushPull = array_reverse($pushPull);
97
  array_unshift($pushPull, $main_body_pp);
116
 
117
 
118
  $sidebars = "";
119
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
120
  add_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
121
  }
122
  add_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
124
  dynamic_sidebar('sidebar');
125
  $sidebars .= ob_get_clean();
126
  remove_filter('dynamic_sidebar_params', array('GantryMainBodyRenderer', 'filterWidget'));
127
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
128
  remove_filter('sidebars_widgets', array('GantryMainBodyRenderer', 'invertPositionOrder'));
129
  }
130
 
155
  *
156
  * @return array
157
  */
158
+ public static function invertPositionOrder($sidebar_widgets)
159
  {
160
 
161
  $inverted_sidebar_widgets = array();
core/renderers/gantryorderedmainbodyrenderer.class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: gantryorderedmainbodyrenderer.class.php 60342 2014-01-03 17:12:22Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -58,7 +58,7 @@ class GantryOrderedMainBodyRenderer
58
  $end = end(array_keys($schema));
59
  $start = reset(array_keys($schema));
60
 
61
- $rtl_enabled = (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) ? true : false;
62
 
63
  // If RTL then flip the array
64
  if ($rtl_enabled) {
@@ -88,7 +88,8 @@ class GantryOrderedMainBodyRenderer
88
  // clean to max sidebars
89
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
90
 
91
- $widgets = $filtered_widgets['sidebar'];
 
92
 
93
  if (null == $widgets) $widgets = array();
94
  // Map widgets to sidebars without the dividers
1
  <?php
2
  /**
3
+ * @version $Id: gantryorderedmainbodyrenderer.class.php 61394 2015-07-04 09:48:11Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
58
  $end = end(array_keys($schema));
59
  $start = reset(array_keys($schema));
60
 
61
+ $rtl_enabled = (is_rtl() && $gantry->get('rtl-enabled')) ? true : false;
62
 
63
  // If RTL then flip the array
64
  if ($rtl_enabled) {
88
  // clean to max sidebars
89
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
90
 
91
+ (isset($filtered_widgets['sidebar'])) ? $widgets = $filtered_widgets['sidebar'] : $widgets = array();
92
+ $widgets = apply_filters('gantry_renderer_filtered_widgets', $widgets);
93
 
94
  if (null == $widgets) $widgets = array();
95
  // Map widgets to sidebars without the dividers
core/renderers/gantrywidgetsrenderer.class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: gantrywidgetsrenderer.class.php 60342 2014-01-03 17:12:22Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -56,7 +56,9 @@ class GantryWidgetsRenderer
56
  $sidebar['showmax'] = $showMaxParam;
57
 
58
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
 
59
  $widgets = $filtered_widgets[$positionStub];
 
60
 
61
  // Map widgets to positions without the dividers
62
  $widget_map = array();
@@ -109,7 +111,7 @@ class GantryWidgetsRenderer
109
 
110
  $sidebar['widget_map'] = $widget_map;
111
 
112
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
113
  add_filter('sidebars_widgets', array('GantryWidgetsRenderer', 'invertPositionOrder'));
114
  }
115
  add_filter('dynamic_sidebar_params', array('GantryWidgetsRenderer', 'filterWidget'));
@@ -119,7 +121,7 @@ class GantryWidgetsRenderer
119
  $output = ob_get_clean();
120
  remove_filter('dynamic_sidebar_params', array('GantryWidgetsRenderer', 'filterWidget'));
121
 
122
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
123
  remove_filter('sidebars_widgets', array('GantryWidgetsRenderer', 'invertPositionOrder'));
124
  }
125
  return $output;
1
  <?php
2
  /**
3
+ * @version $Id: gantrywidgetsrenderer.class.php 61394 2015-07-04 09:48:11Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
56
  $sidebar['showmax'] = $showMaxParam;
57
 
58
  $filtered_widgets = GantryWidgetsRenderer::filterWidgetCount($sidebars_widgets);
59
+
60
  $widgets = $filtered_widgets[$positionStub];
61
+ $widgets = apply_filters('gantry_renderer_filtered_widgets', $widgets);
62
 
63
  // Map widgets to positions without the dividers
64
  $widget_map = array();
111
 
112
  $sidebar['widget_map'] = $widget_map;
113
 
114
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
115
  add_filter('sidebars_widgets', array('GantryWidgetsRenderer', 'invertPositionOrder'));
116
  }
117
  add_filter('dynamic_sidebar_params', array('GantryWidgetsRenderer', 'filterWidget'));
121
  $output = ob_get_clean();
122
  remove_filter('dynamic_sidebar_params', array('GantryWidgetsRenderer', 'filterWidget'));
123
 
124
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
125
  remove_filter('sidebars_widgets', array('GantryWidgetsRenderer', 'invertPositionOrder'));
126
  }
127
  return $output;
core/utilities/gantrycache.class.php CHANGED
@@ -26,7 +26,7 @@ class GantryCache
26
  /**
27
  *
28
  */
29
- const ADMIN_GROUP_NAME = 'GantryAdmin-4.1.4';
30
 
31
  const ADMIN_LIFETIME = 86400;
32
 
@@ -122,7 +122,7 @@ class GantryCache
122
  $this->cache->addDriver('frontend', new WpTransientCacheDriver($this->group, $this->lifetime));
123
  } elseif (is_admin()) {
124
  // TODO get lifetime for backend cache
125
- $this->group = self::ADMIN_GROUP_NAME . '-4.1.4';
126
  $this->cache->addDriver('admin', new WpTransientCacheDriver($this->group, self::ADMIN_LIFETIME));
127
  }
128
  }
26
  /**
27
  *
28
  */
29
+ const ADMIN_GROUP_NAME = 'GantryAdmin-4.1.5';
30
 
31
  const ADMIN_LIFETIME = 86400;
32
 
122
  $this->cache->addDriver('frontend', new WpTransientCacheDriver($this->group, $this->lifetime));
123
  } elseif (is_admin()) {
124
  // TODO get lifetime for backend cache
125
+ $this->group = self::ADMIN_GROUP_NAME . '-4.1.5';
126
  $this->cache->addDriver('admin', new WpTransientCacheDriver($this->group, self::ADMIN_LIFETIME));
127
  }
128
  }
functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: functions.php 61146 2014-11-10 18:10:43Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -168,7 +168,7 @@ function gantry_construct()
168
  /**
169
  * @name GANTRY_VERSION
170
  */
171
- define('GANTRY_VERSION', '4.1.4');
172
 
173
 
174
  if (!defined('DS')) {
@@ -449,8 +449,10 @@ function gantry_addUrlVars($aVars)
449
  {
450
  /** @global $gantry Gantry */
451
  global $gantry;
452
- foreach ($gantry->_setbyurl as $queryvar) {
453
- $aVars[] = $queryvar;
 
 
454
  }
455
  $aVars[] = 'reset-settings';
456
  return $aVars;
1
  <?php
2
  /**
3
+ * @version $Id: functions.php 61393 2015-07-03 07:47:35Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
168
  /**
169
  * @name GANTRY_VERSION
170
  */
171
+ define('GANTRY_VERSION', '4.1.5');
172
 
173
 
174
  if (!defined('DS')) {
449
  {
450
  /** @global $gantry Gantry */
451
  global $gantry;
452
+ if( $gantry !== null ) {
453
+ foreach( $gantry->_setbyurl as $queryvar ) {
454
+ $aVars[] = $queryvar;
455
+ }
456
  }
457
  $aVars[] = 'reset-settings';
458
  return $aVars;
gantry.php CHANGED
@@ -10,7 +10,7 @@
10
  Plugin Name: Gantry Template Framework
11
  Plugin URI: http://www.gantry-framework.org/
12
  Description: This is a Framework to support easily modifiable themes that are very extensible.
13
- Version: 4.1.4
14
  Author: RocketTheme
15
  Author URI: http://www.rockettheme.com/wordpress
16
  License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
10
  Plugin Name: Gantry Template Framework
11
  Plugin URI: http://www.gantry-framework.org/
12
  Description: This is a Framework to support easily modifiable themes that are very extensible.
13
+ Version: 4.1.5
14
  Author: RocketTheme
15
  Author URI: http://www.rockettheme.com/wordpress
16
  License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
gizmos/rtl.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version $Id: rtl.php 59361 2013-03-13 23:10:27Z btowles $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -25,7 +25,7 @@ class GantryGizmoRTL extends GantryGizmo
25
  /** @global $gantry Gantry */
26
  global $gantry;
27
 
28
- if (get_bloginfo('text_direction') == 'rtl' && $gantry->get('rtl-enabled')) {
29
  $gantry->addBodyClass("rtl");
30
  $gantry->addStyle("rtl.css");
31
  }
1
  <?php
2
  /**
3
+ * @version $Id: rtl.php 61394 2015-07-04 09:48:11Z jakub $
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
25
  /** @global $gantry Gantry */
26
  global $gantry;
27
 
28
+ if (is_rtl() && $gantry->get('rtl-enabled')) {
29
  $gantry->addBodyClass("rtl");
30
  $gantry->addStyle("rtl.css");
31
  }
gizmos/wpml.php CHANGED
@@ -38,6 +38,9 @@ class GantryGizmoWPML extends GantryGizmo {
38
 
39
  // add WPML language conditional to WP_Query
40
  add_action( 'parse_query', array( &$this, 'query_add_wpml_language_conditionals' ) );
 
 
 
41
  }
42
 
43
  }
@@ -131,12 +134,56 @@ class GantryGizmoWPML extends GantryGizmo {
131
 
132
  }
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  // Re-registers ICL Language Switcher widget to extend it for missing form needed for widget variations
135
  function reregister_language_switcher_widget() {
136
  unregister_widget( 'ICL_Language_Switcher' );
137
  register_widget( 'Gantry_ICL_Language_Switcher' );
138
  }
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
  /**
38
 
39
  // add WPML language conditional to WP_Query
40
  add_action( 'parse_query', array( &$this, 'query_add_wpml_language_conditionals' ) );
41
+
42
+ // remove widgets that won't get displayed (for current language) from the widget list to make layout appear properly
43
+ add_filter( 'gantry_renderer_filtered_widgets', array( &$this, 'remove_unnecessary_widgets_from_list' ) );
44
  }
45
 
46
  }
134
 
135
  }
136
 
137
+ /**
138
+ * Remove widgets that won't get displayed (for current language) from the widget list to make layout appear properly
139
+ *
140
+ * @param $widgets
141
+ *
142
+ * @return mixed
143
+ */
144
+ function remove_unnecessary_widgets_from_list( $widgets ) {
145
+ global $gantry;
146
+
147
+ if( class_exists( 'WP_Widget_Text_Icl' ) || class_exists( 'WPML_Widgets' ) ) {
148
+ if( !empty( $widgets ) ) {
149
+ foreach( $widgets as $widget_id ) {
150
+ $widget_instance = $this->getWidgetInstanceParams( $widget_id );
151
+ if( ( isset( $widget_instance['icl_language'] ) && ( $widget_instance['icl_language'] != 'multilingual' && $widget_instance['icl_language'] != ICL_LANGUAGE_CODE ) )
152
+ || ( isset( $widget_instance['wpml_language'] ) && ( $widget_instance['wpml_language'] != 'all' && $widget_instance['wpml_language'] != ICL_LANGUAGE_CODE ) ) ) {
153
+ $found = array_search( $widget_id, $widgets );
154
+ unset( $widgets[ $found ] );
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ return $widgets;
161
+ }
162
+
163
  // Re-registers ICL Language Switcher widget to extend it for missing form needed for widget variations
164
  function reregister_language_switcher_widget() {
165
  unregister_widget( 'ICL_Language_Switcher' );
166
  register_widget( 'Gantry_ICL_Language_Switcher' );
167
  }
168
 
169
+ // Helper function to get the widget instance
170
+ function getWidgetInstanceParams( $widget_id ) {
171
+ global $wp_registered_widgets;
172
+ $widget_info =& $wp_registered_widgets[$widget_id];
173
+
174
+ if ( is_array( $widget_info['callback'] ) ) {
175
+ $widget =& $widget_info['callback'][0];
176
+ if ( is_object( $widget ) && $widget instanceof WP_Widget ) {
177
+ $instances = $widget->get_settings();
178
+ $instance_params = $instances[$widget_info['params'][0]['number']];
179
+ }
180
+ } else {
181
+ $instance_params = $wp_registered_widgets[$widget_id]['params'];
182
+ }
183
+ if ( empty( $instance_params ) ) $instance_params = array();
184
+ return $instance_params;
185
+ }
186
+
187
  }
188
 
189
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: gantry
3
  Author URI: http://gantry-framework.org
4
  Tags: gantry, framework, template, theme, widgets, flexible, extensible, configurable, 960px, grid, columns, powerful, buddypress
5
  Requires at least: 3.2
6
- Tested up to: 4.2
7
- Stable tag: 4.1.4
8
 
9
  Gantry is a comprehensive set of building blocks to enable the rapid development and realization of a design into a flexible and powerful web platform
10
 
@@ -87,6 +87,13 @@ Once you downloaded and installed Gantry Framework plugin, please download also
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
 
 
90
  = 4.1.4 =
91
  * Fixed potential security risk
92
 
@@ -397,6 +404,9 @@ Once you downloaded and installed Gantry Framework plugin, please download also
397
 
398
  == Upgrade Notice ==
399
 
 
 
 
400
  = 4.1.4 =
401
  Please remember to create a full site backup (files + database) before performing update.
402
 
3
  Author URI: http://gantry-framework.org
4
  Tags: gantry, framework, template, theme, widgets, flexible, extensible, configurable, 960px, grid, columns, powerful, buddypress
5
  Requires at least: 3.2
6
+ Tested up to: 4.2.2
7
+ Stable tag: 4.1.5
8
 
9
  Gantry is a comprehensive set of building blocks to enable the rapid development and realization of a design into a flexible and powerful web platform
10
 
87
 
88
  == Changelog ==
89
 
90
+ = 4.1.5 =
91
+ * Fixed layout issues when using WPML and multilingual widgets
92
+ * Fixed strict standards error in invertPositionOrder for RTL languages
93
+ * Fixed Warning caused by $gantry being null when using WPTouch
94
+ * Fixed RTL notices caused by using deprecated get_bloginfo calls
95
+ * Added wp_nonce_field() to the Login Form widget
96
+
97
  = 4.1.4 =
98
  * Fixed potential security risk
99
 
404
 
405
  == Upgrade Notice ==
406
 
407
+ = 4.1.5 =
408
+ Please remember to create a full site backup (files + database) before performing update.
409
+
410
  = 4.1.4 =
411
  Please remember to create a full site backup (files + database) before performing update.
412
 
widgets/breadcrumbs.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.4 March 11, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.5 July 6, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
widgets/loginbutton.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.4 March 11, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
1
  <?php
2
  /**
3
+ * @version 4.1.5 July 6, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
widgets/loginform.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @version 4.1.4 March 11, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
@@ -40,6 +40,7 @@ class GantryWidgetLoginForm extends GantryWidget {
40
  <?php if(!is_user_logged_in()) : ?>
41
 
42
  <form action="<?php echo wp_login_url($_SERVER['REQUEST_URI']); ?>" method="post" id="login-form">
 
43
  <?php if ($instance['pretext'] != ''): ?>
44
  <div class="pretext">
45
  <p><?php echo $instance['pretext']; ?></p>
@@ -80,6 +81,7 @@ class GantryWidgetLoginForm extends GantryWidget {
80
  <?php else : ?>
81
 
82
  <form action="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>" method="post" id="login-form">
 
83
  <div class="login-greeting">
84
  <p><?php echo $instance['user_greeting']; ?> <?php echo $current_user->display_name; ?></p>
85
  </div>
1
  <?php
2
  /**
3
+ * @version 4.1.5 July 6, 2015
4
  * @author RocketTheme http://www.rockettheme.com
5
  * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
6
  * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
40
  <?php if(!is_user_logged_in()) : ?>
41
 
42
  <form action="<?php echo wp_login_url($_SERVER['REQUEST_URI']); ?>" method="post" id="login-form">
43
+ <?php wp_nonce_field(); ?>
44
  <?php if ($instance['pretext'] != ''): ?>
45
  <div class="pretext">
46
  <p><?php echo $instance['pretext']; ?></p>
81
  <?php else : ?>
82
 
83
  <form action="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>" method="post" id="login-form">
84
+ <?php wp_nonce_field(); ?>
85
  <div class="login-greeting">
86
  <p><?php echo $instance['user_greeting']; ?> <?php echo $current_user->display_name; ?></p>
87
  </div>