check for new versions

This commit is contained in:
Uwe Steinmann 2014-04-10 11:19:45 +02:00
parent 55a8d7275f
commit 100909a910
2 changed files with 21 additions and 1 deletions

View File

@ -30,9 +30,16 @@ if (!$user->isAdmin()) {
}
$v = new SeedDMS_Version;
if(@ini_get('allow_url_fopen') == '1') {
$lines = file('http://www.seeddms.org/latest', FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
$versions = array();
foreach($lines as $line) {
$versions[] = explode(':', $line);
}
}
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'version'=>$v));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'version'=>$v, 'availversions'=>$versions));
if($view) {
$view->show();
exit;

View File

@ -35,11 +35,24 @@ class SeedDMS_View_Info extends SeedDMS_Bootstrap_Style {
$dms = $this->params['dms'];
$user = $this->params['user'];
$version = $this->params['version'];
$availversions = $this->params['availversions'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
if($availversions) {
$newversion = '';
foreach($availversions as $availversion) {
if($availversion[0] == 'stable')
$newversion = $availversion[1];
}
if($newversion > $version->_number) {
$this->warningMsg(getMLText('no_current_version', array('latestversion'=>$newversion)));
}
} else {
$this->warningMsg(getMLText('no_version_check'));
}
$this->contentContainerStart();
echo $version->banner();
$this->contentContainerEnd();