From 5b964974cd8432bfe5a9dac8f6b98a45f1c9e92c Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 21 Jan 2014 10:51:36 +0000 Subject: [PATCH] Do not use $menuItemsCount global variable --- src/mibew/styles/pages/default/views/menu.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mibew/styles/pages/default/views/menu.php b/src/mibew/styles/pages/default/views/menu.php index 56b5bbb9..9631f52a 100644 --- a/src/mibew/styles/pages/default/views/menu.php +++ b/src/mibew/styles/pages/default/views/menu.php @@ -27,12 +27,12 @@ function tpl_header() { global $page; } function menuseparator() { - global $menuItemsCount; - $menuItemsCount++; - if(($menuItemsCount%3) == 0) { echo ""; } + static $menu_items_count = 0; + $menu_items_count++; + if(($menu_items_count%3) == 0) { echo ""; } } -function tpl_content() { global $page, $menuItemsCount; +function tpl_content() { global $page; ?>
@@ -55,7 +55,8 @@ function tpl_content() { global $page, $menuItemsCount; - + + @@ -63,9 +64,7 @@ function tpl_content() { global $page, $menuItemsCount; - +