Skip to content

Commit

Permalink
#9682
Browse files Browse the repository at this point in the history
  • Loading branch information
AgelxNash committed Mar 22, 2013
1 parent e03e5cb commit 9b4cc6f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions manager/actions/mutate_settings.dynamic.php
Expand Up @@ -188,9 +188,9 @@ function confirmLangChange(el, lkey, elupd){

<div style="margin: 0 10px 0 20px">
<input type="hidden" name="site_id" value="<?php echo $site_id; ?>" />
<input type="hidden" name="settings_version" value="<?php echo $modx_version; ?>" />
<input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" />
<!-- this field is used to check site settings have been entered/ updated after install or upgrade -->
<?php if(!isset($settings_version) || $settings_version!=$modx_version) { ?>
<?php if(!isset($settings_version) || $settings_version!=$modx->getVersionData('version')) { ?>
<div class='sectionBody'><p><?php echo $_lang['settings_after_install']; ?></p></div>
<?php } ?>
<script type="text/javascript" src="media/script/tabpane.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions manager/actions/sysinfo.static.php
Expand Up @@ -21,12 +21,12 @@ function viewPHPInfo() {
<tr>
<td width="150"><?php echo $_lang['modx_version']?></td>
<td width="20">&nbsp;</td>
<td><b><?php echo $modx_version ?></b><?php echo $newversiontext ?></td>
<td><b><?php echo $modx->getVersionData('version') ?></b><?php echo $newversiontext ?></td>
</tr>
<tr>
<td width="150"><?php echo $_lang['release_date']?></td>
<td width="20">&nbsp;</td>
<td><b><?php echo $modx_release_date ?></b></td>
<td><b><?php echo $modx->getVersionData('release_date') ?></b></td>
</tr>
<tr>
<td>phpInfo()</td>
Expand Down
2 changes: 1 addition & 1 deletion manager/actions/welcome.static.php
Expand Up @@ -2,7 +2,7 @@

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

if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version!=$modx_version)) {
if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version!=$modx->getVersionData('version'))) {
// seems to be a new install - send the user to the configuration page
echo '<script type="text/javascript">document.location.href="index.php?a=17";</script>';
exit;
Expand Down
2 changes: 1 addition & 1 deletion manager/frames/menu.php
Expand Up @@ -217,7 +217,7 @@ function NavToggle(element) {
| <a href="index.php?a=9" target="main"><?php echo $_lang['help']?></a>
<?php } ?>
| <a href="index.php?a=8" target="_top"><?php echo $_lang['logout']?></a>
| <span title="<?php echo $site_name ?> &ndash; <?php echo $modx_full_appname ?>"><?php echo $modx_version ?></span>&nbsp;
| <span title="<?php echo $site_name ?> &ndash; <?php echo $modx->getVersionData('full_appname') ?>"><?php echo $modx->getVersionData('version') ?></span>&nbsp;
<!-- close #supplementalNav --></div>
</div>
</div>
Expand Down
22 changes: 14 additions & 8 deletions manager/includes/document.parser.class.inc.php
Expand Up @@ -47,6 +47,7 @@ class DocumentParser {
var $loadedjscripts;
var $documentMap;
var $forwards= 3;
private $version=array();

// constructor
function DocumentParser() {
Expand Down Expand Up @@ -1768,14 +1769,19 @@ function getConfig($name= '') {
}
}

function getVersionData() {
include $this->config["base_path"] . "manager/includes/version.inc.php";
$v= array ();
$v['version']= $modx_version;
$v['branch']= $modx_branch;
$v['release_date']= $modx_release_date;
$v['full_appname']= $modx_full_appname;
return $v;
function getVersionData($data=null) {
$out=array();
if(empty($this->version) || !is_array($this->version)){
//include for compatibility modx version < 1.0.10
include $this->config["base_path"] . "manager/includes/version.inc.php";
$this->version=array();
$this->version['version']= isset($modx_version) ? $modx_version : '';
$this->version['branch']= isset($modx_branch) ? $modx_branch : '';
$this->version['release_date']= isset($modx_release_date) ? $modx_release_date : '';
$this->version['full_appname']= isset($modx_full_appname) ? $modx_full_appname : '';
$this->version['new_version'] = isset($this->config['newversiontext']) ? $this->config['newversiontext'] : '';
}
return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version;
}

function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) {
Expand Down
5 changes: 3 additions & 2 deletions manager/index.php
Expand Up @@ -152,8 +152,9 @@
// send the charset header
header('Content-Type: text/html; charset='.$modx_manager_charset);

// include version info
include_once "version.inc.php";
/*
* include_once "version.inc.php"; //include version info. Use $modx->getVersionData()
*/

// accesscontrol.php checks to see if the user is logged in. If not, a log in form is shown
include_once "accesscontrol.inc.php";
Expand Down
5 changes: 3 additions & 2 deletions manager/processors/login.processor.php
Expand Up @@ -27,8 +27,9 @@
// get the settings from the database
include_once "settings.inc.php";

// include version info
include_once "version.inc.php";
/*
* include_once "version.inc.php"; //include version info. Use $modx->getVersionData()
*/

// include the logger
include_once "log.class.inc.php";
Expand Down

0 comments on commit 9b4cc6f

Please sign in to comment.