Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit 9b4cc6f

Browse files
committed
#9682
1 parent e03e5cb commit 9b4cc6f

File tree

7 files changed

+26
-18
lines changed

7 files changed

+26
-18
lines changed

manager/actions/mutate_settings.dynamic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ function confirmLangChange(el, lkey, elupd){
188188

189189
<div style="margin: 0 10px 0 20px">
190190
<input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
191-
<input type="hidden" name="settings_version" value="<?php echo $modx_version; ?>" />
191+
<input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" />
192192
<!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
193-
<?php if(!isset($settings_version) || $settings_version!=$modx_version) { ?>
193+
<?php if(!isset($settings_version) || $settings_version!=$modx->getVersionData('version')) { ?>
194194
<div class='sectionBody'><p><?php echo $_lang['settings_after_install']; ?></p></div>
195195
<?php } ?>
196196
<script type="text/javascript" src="media/script/tabpane.js"></script>

manager/actions/sysinfo.static.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ function viewPHPInfo() {
2121
<tr>
2222
<td width="150"><?php echo $_lang['modx_version']?></td>
2323
<td width="20">&nbsp;</td>
24-
<td><b><?php echo $modx_version ?></b><?php echo $newversiontext ?></td>
24+
<td><b><?php echo $modx->getVersionData('version') ?></b><?php echo $newversiontext ?></td>
2525
</tr>
2626
<tr>
2727
<td width="150"><?php echo $_lang['release_date']?></td>
2828
<td width="20">&nbsp;</td>
29-
<td><b><?php echo $modx_release_date ?></b></td>
29+
<td><b><?php echo $modx->getVersionData('release_date') ?></b></td>
3030
</tr>
3131
<tr>
3232
<td>phpInfo()</td>

manager/actions/welcome.static.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
44

5-
if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version!=$modx_version)) {
5+
if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version!=$modx->getVersionData('version'))) {
66
// seems to be a new install - send the user to the configuration page
77
echo '<script type="text/javascript">document.location.href="index.php?a=17";</script>';
88
exit;

manager/frames/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function NavToggle(element) {
217217
| <a href="index.php?a=9" target="main"><?php echo $_lang['help']?></a>
218218
<?php } ?>
219219
| <a href="index.php?a=8" target="_top"><?php echo $_lang['logout']?></a>
220-
| <span title="<?php echo $site_name ?> &ndash; <?php echo $modx_full_appname ?>"><?php echo $modx_version ?></span>&nbsp;
220+
| <span title="<?php echo $site_name ?> &ndash; <?php echo $modx->getVersionData('full_appname') ?>"><?php echo $modx->getVersionData('version') ?></span>&nbsp;
221221
<!-- close #supplementalNav --></div>
222222
</div>
223223
</div>

manager/includes/document.parser.class.inc.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class DocumentParser {
4747
var $loadedjscripts;
4848
var $documentMap;
4949
var $forwards= 3;
50+
private $version=array();
5051

5152
// constructor
5253
function DocumentParser() {
@@ -1768,14 +1769,19 @@ function getConfig($name= '') {
17681769
}
17691770
}
17701771

1771-
function getVersionData() {
1772-
include $this->config["base_path"] . "manager/includes/version.inc.php";
1773-
$v= array ();
1774-
$v['version']= $modx_version;
1775-
$v['branch']= $modx_branch;
1776-
$v['release_date']= $modx_release_date;
1777-
$v['full_appname']= $modx_full_appname;
1778-
return $v;
1772+
function getVersionData($data=null) {
1773+
$out=array();
1774+
if(empty($this->version) || !is_array($this->version)){
1775+
//include for compatibility modx version < 1.0.10
1776+
include $this->config["base_path"] . "manager/includes/version.inc.php";
1777+
$this->version=array();
1778+
$this->version['version']= isset($modx_version) ? $modx_version : '';
1779+
$this->version['branch']= isset($modx_branch) ? $modx_branch : '';
1780+
$this->version['release_date']= isset($modx_release_date) ? $modx_release_date : '';
1781+
$this->version['full_appname']= isset($modx_full_appname) ? $modx_full_appname : '';
1782+
$this->version['new_version'] = isset($this->config['newversiontext']) ? $this->config['newversiontext'] : '';
1783+
}
1784+
return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version;
17791785
}
17801786

17811787
function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) {

manager/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@
152152
// send the charset header
153153
header('Content-Type: text/html; charset='.$modx_manager_charset);
154154

155-
// include version info
156-
include_once "version.inc.php";
155+
/*
156+
* include_once "version.inc.php"; //include version info. Use $modx->getVersionData()
157+
*/
157158

158159
// accesscontrol.php checks to see if the user is logged in. If not, a log in form is shown
159160
include_once "accesscontrol.inc.php";

manager/processors/login.processor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
// get the settings from the database
2828
include_once "settings.inc.php";
2929

30-
// include version info
31-
include_once "version.inc.php";
30+
/*
31+
* include_once "version.inc.php"; //include version info. Use $modx->getVersionData()
32+
*/
3233

3334
// include the logger
3435
include_once "log.class.inc.php";

0 commit comments

Comments
 (0)