Do not use $version global variable

Replace $version global var with MIBEW_VERSION constant
This commit is contained in:
Dmitriy Simushev 2014-01-20 14:57:27 +00:00
parent c1ae7b8eb9
commit 6da2a33ce3
11 changed files with 13 additions and 13 deletions

View File

@ -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,

View File

@ -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")
);

View File

@ -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();

View File

@ -18,7 +18,7 @@
/**
* Current version of Mibew Messenger
*/
$version = '2.0';
define('MIBEW_VERSION', '2.0');
/**
* Current version of database structure

View File

@ -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']),

View File

@ -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');

View File

@ -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"),

View File

@ -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,

View File

@ -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",
);

View File

@ -84,7 +84,7 @@ $isrtl = getlocal("localedirection") == 'rtl';
<div class="empty_inner" style="">&#160;</div>
</div>
<div id="footer">
<p id="legal"><a href="http://mibew.org/" target="_blank" class="flink">Mibew Messenger</a> <?php echo $version ?> | (c) 2011-2013 mibew.org</p>
<p id="legal"><a href="http://mibew.org/" target="_blank" class="flink">Mibew Messenger</a> <?php echo MIBEW_VERSION ?> | (c) 2011-2013 mibew.org</p>
</div>
</body>
</html>

View File

@ -32,7 +32,7 @@ function menuseparator() {
if(($menuItemsCount%3) == 0) { echo "</tr><tr>"; }
}
function tpl_content() { global $page, $current_locale, $menuItemsCount, $version;
function tpl_content() { global $page, $current_locale, $menuItemsCount;
?>
<br/>
@ -44,7 +44,7 @@ function tpl_content() { global $page, $current_locale, $menuItemsCount, $versio
<div id="formmessage"><?php echo getlocal2("install.updatedb",array($page['updateWizard'])) ?></div>
<br/>
<?php } else if($page['newFeatures']) { ?>
<div><div id="formmessage"><?php echo getlocal2("install.newfeatures",array($page['featuresPage'], $version)) ?></div></div>
<div><div id="formmessage"><?php echo getlocal2("install.newfeatures",array($page['featuresPage'], MIBEW_VERSION)) ?></div></div>
<br/>
<?php } ?>