2013-05-02 16:28:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of ExtensionMgr view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2013 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
|
|
|
require_once("class.Bootstrap.php");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for ExtensionMgr view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2013 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
|
|
|
|
|
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
2013-05-03 07:52:34 +00:00
|
|
|
$httproot = $this->params['httproot'];
|
2013-05-03 09:34:08 +00:00
|
|
|
$version = $this->params['version'];
|
2013-05-02 16:28:23 +00:00
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("admin_tools"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
|
|
|
$this->contentContainerStart();
|
2013-05-03 07:52:34 +00:00
|
|
|
echo "<table class=\"table table-condensed\">\n";
|
2013-05-02 16:28:23 +00:00
|
|
|
print "<thead>\n<tr>\n";
|
2013-05-03 07:52:34 +00:00
|
|
|
print "<th></th>\n";
|
2013-05-02 16:28:23 +00:00
|
|
|
print "<th>".getMLText('name')."</th>\n";
|
|
|
|
print "<th>".getMLText('version')."</th>\n";
|
|
|
|
print "<th>".getMLText('author')."</th>\n";
|
|
|
|
print "</tr></thead>\n";
|
2013-05-03 09:34:08 +00:00
|
|
|
$errmsgs = array();
|
2013-05-02 16:28:23 +00:00
|
|
|
foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) {
|
2013-05-03 09:34:08 +00:00
|
|
|
if(!isset($extconf['disable']) || $extconf['disable'] == false) {
|
|
|
|
/* check dependency on specific seeddms version */
|
|
|
|
if(isset($extconf['constraints']['depends']['seeddms'])) {
|
|
|
|
$tmp = explode('-', $extconf['constraints']['depends']['seeddms'], 2);
|
|
|
|
if($tmp[0] > $version->version() || ($tmp[1] && $tmp[1] < $version->version()))
|
|
|
|
$errmsgs[] = sprintf("Incorrect SeedDMS version (needs version %s)", $extconf['constraints']['depends']['seeddms']);
|
|
|
|
} else {
|
|
|
|
$errmsgs[] = "Missing dependency on SeedDMS";
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check dependency on specific php version */
|
|
|
|
if(isset($extconf['constraints']['depends']['php'])) {
|
|
|
|
$tmp = explode('-', $extconf['constraints']['depends']['php'], 2);
|
|
|
|
if($tmp[0] > phpversion() || ($tmp[1] && $tmp[1] < phpversion()))
|
|
|
|
$errmsgs[] = sprintf("Incorrect PHP version (needs version %s)", $extconf['constraints']['depends']['php']);
|
|
|
|
} else {
|
|
|
|
$errmsgs[] = "Missing dependency on PHP";
|
|
|
|
}
|
|
|
|
if($errmsgs)
|
|
|
|
echo "<tr class=\"error\">";
|
|
|
|
else
|
|
|
|
echo "<tr class=\"success\">";
|
|
|
|
} else
|
|
|
|
echo "<tr class=\"warning\">";
|
2013-05-03 07:52:34 +00:00
|
|
|
echo "<td>";
|
|
|
|
if($extconf['icon'])
|
|
|
|
echo "<img src=\"".$httproot."ext/".$extname."/".$extconf['icon']."\">";
|
|
|
|
echo "</td>";
|
2013-05-03 09:34:08 +00:00
|
|
|
echo "<td>".$extconf['title']."<br /><small>".$extconf['description']."</small>";
|
|
|
|
if($errmsgs)
|
|
|
|
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br />', $errmsgs)."</div>";
|
|
|
|
echo "</td>";
|
2013-05-03 07:52:34 +00:00
|
|
|
echo "<td>".$extconf['version']."<br /><small>".$extconf['releasedate']."</small></td>";
|
2013-05-02 16:28:23 +00:00
|
|
|
echo "<td><a href=\"mailto:".$extconf['author']['email']."\">".$extconf['author']['name']."</a><br /><small>".$extconf['author']['company']."</small></td>";
|
|
|
|
echo "</tr>\n";
|
|
|
|
}
|
|
|
|
echo "</table>\n";
|
|
|
|
$this->contentContainerEnd();
|
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|