From 6da2a33ce3a2dab3e2f7dbad790232c382532089 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 20 Jan 2014 14:57:27 +0000 Subject: [PATCH] Do not use $version global variable Replace $version global var with MIBEW_VERSION constant --- src/mibew/install/dbinfo.php | 4 ++-- src/mibew/install/index.php | 2 +- src/mibew/libs/classes/Mibew/Style/PageStyle.php | 2 +- src/mibew/libs/common/constants.php | 2 +- src/mibew/operator/index.php | 2 +- src/mibew/operator/login.php | 2 +- src/mibew/operator/resetpwd.php | 2 +- src/mibew/operator/restore.php | 2 +- src/mibew/operator/updates.php | 2 +- src/mibew/styles/pages/default/views/inc_main.php | 2 +- src/mibew/styles/pages/default/views/menu.php | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mibew/install/dbinfo.php b/src/mibew/install/dbinfo.php index b0668181..dc4cd19d 100644 --- a/src/mibew/install/dbinfo.php +++ b/src/mibew/install/dbinfo.php @@ -288,9 +288,9 @@ $dbtables_can_update = array( function show_install_err($text) { - global $page, $version, $errors; + global $page, $errors; $page = array( - 'version' => $version, + 'version' => MIBEW_VERSION, 'localeLinks' => get_locale_links(MIBEW_WEB_ROOT . "/install/index.php"), 'title' => getlocal("install.err.title"), 'no_right_menu' => true, diff --git a/src/mibew/install/index.php b/src/mibew/install/index.php index a0ecc813..b26d46e4 100644 --- a/src/mibew/install/index.php +++ b/src/mibew/install/index.php @@ -59,7 +59,7 @@ require_once(MIBEW_FS_ROOT.'/libs/classes/Mibew/Style/PageStyle.php'); require_once(MIBEW_FS_ROOT.'/install/dbinfo.php'); $page = array( - 'version' => $version, + 'version' => MIBEW_VERSION, 'localeLinks' => get_locale_links(MIBEW_WEB_ROOT . "/install/index.php") ); diff --git a/src/mibew/libs/classes/Mibew/Style/PageStyle.php b/src/mibew/libs/classes/Mibew/Style/PageStyle.php index 502bd36d..cc1a81df 100644 --- a/src/mibew/libs/classes/Mibew/Style/PageStyle.php +++ b/src/mibew/libs/classes/Mibew/Style/PageStyle.php @@ -45,7 +45,7 @@ class PageStyle extends Style implements StyleInterface { public function render($template_name, $data = array()) { // We need to import some variables to make them visible to required // view. - global $page, $version, $errors; + global $page, $errors; // Add template root value to page variables $page['stylepath'] = MIBEW_WEB_ROOT . '/' . $this->filesPath(); diff --git a/src/mibew/libs/common/constants.php b/src/mibew/libs/common/constants.php index 8dd0f234..106da8c8 100644 --- a/src/mibew/libs/common/constants.php +++ b/src/mibew/libs/common/constants.php @@ -18,7 +18,7 @@ /** * Current version of Mibew Messenger */ -$version = '2.0'; +define('MIBEW_VERSION', '2.0'); /** * Current version of database structure diff --git a/src/mibew/operator/index.php b/src/mibew/operator/index.php index a45a81c5..8d15673d 100644 --- a/src/mibew/operator/index.php +++ b/src/mibew/operator/index.php @@ -29,7 +29,7 @@ force_password($operator); $isonline = is_operator_online($operator['operatorid']); $page = array( - 'version' => $version, + 'version' => MIBEW_VERSION, 'localeLinks' => get_locale_links(MIBEW_WEB_ROOT . "/operator/index.php"), 'needUpdate' => Settings::get('dbversion') != DB_VERSION, 'needChangePassword' => check_password_hash($operator['vclogin'], '', $operator['vcpassword']), diff --git a/src/mibew/operator/login.php b/src/mibew/operator/login.php index 323b82b9..1c2a5c12 100644 --- a/src/mibew/operator/login.php +++ b/src/mibew/operator/login.php @@ -23,7 +23,7 @@ require_once(dirname(dirname(__FILE__)).'/libs/init.php'); require_once(MIBEW_FS_ROOT.'/libs/operator.php'); $errors = array(); -$page = array('formisRemember' => true, 'version' => $version); +$page = array('formisRemember' => true, 'version' => MIBEW_VERSION); if (isset($_POST['login']) && isset($_POST['password'])) { $login = getparam('login'); diff --git a/src/mibew/operator/resetpwd.php b/src/mibew/operator/resetpwd.php index 182d8938..97c52ed3 100644 --- a/src/mibew/operator/resetpwd.php +++ b/src/mibew/operator/resetpwd.php @@ -26,7 +26,7 @@ require_once(MIBEW_FS_ROOT.'/libs/settings.php'); $errors = array(); $page = array( - 'version' => $version, + 'version' => MIBEW_VERSION, 'showform' => true, 'title' => getlocal("resetpwd.title"), 'headertitle' => getlocal("app.title"), diff --git a/src/mibew/operator/restore.php b/src/mibew/operator/restore.php index c9ac527e..b8934ae6 100644 --- a/src/mibew/operator/restore.php +++ b/src/mibew/operator/restore.php @@ -27,7 +27,7 @@ require_once(MIBEW_FS_ROOT.'/libs/notify.php'); $errors = array(); $page = array( - 'version' => $version, + 'version' => MIBEW_VERSION, 'title' => getlocal("restore.title"), 'headertitle' => getlocal("app.title"), 'show_small_login' => true, diff --git a/src/mibew/operator/updates.php b/src/mibew/operator/updates.php index bd273d6b..260b9ea2 100644 --- a/src/mibew/operator/updates.php +++ b/src/mibew/operator/updates.php @@ -32,7 +32,7 @@ $errors = array(); $page = array( 'localizations' => get_available_locales(), 'phpVersion' => phpversion(), - 'version' => $version, + 'version' => MIBEW_VERSION, 'title' => getlocal("updates.title"), 'menuid' => "updates", ); diff --git a/src/mibew/styles/pages/default/views/inc_main.php b/src/mibew/styles/pages/default/views/inc_main.php index f8dd9aba..f4aad630 100644 --- a/src/mibew/styles/pages/default/views/inc_main.php +++ b/src/mibew/styles/pages/default/views/inc_main.php @@ -84,7 +84,7 @@ $isrtl = getlocal("localedirection") == 'rtl';
 
\ No newline at end of file diff --git a/src/mibew/styles/pages/default/views/menu.php b/src/mibew/styles/pages/default/views/menu.php index c2b03833..a5851ab6 100644 --- a/src/mibew/styles/pages/default/views/menu.php +++ b/src/mibew/styles/pages/default/views/menu.php @@ -32,7 +32,7 @@ function menuseparator() { if(($menuItemsCount%3) == 0) { echo ""; } } -function tpl_content() { global $page, $current_locale, $menuItemsCount, $version; +function tpl_content() { global $page, $current_locale, $menuItemsCount; ?>
@@ -44,7 +44,7 @@ function tpl_content() { global $page, $current_locale, $menuItemsCount, $versio

-
+