check if extension from repository is suitable for current installation

This commit is contained in:
Uwe Steinmann 2018-03-14 11:21:21 +01:00
parent 0a3d3ea382
commit de0213d30e

View File

@ -172,10 +172,12 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
$list = $extmgr->importExtensionList($reposurl); $list = $extmgr->importExtensionList($reposurl);
foreach($list as $e) { foreach($list as $e) {
if($e[0] != '#') { if($e[0] != '#') {
$re = json_decode($e); $re = json_decode($e, true);
$needsupdate = !isset($GLOBALS['EXT_CONF'][$re->name]) || SeedDMS_Extension_Mgr::cmpVersion($re->version, $GLOBALS['EXT_CONF'][$re->name]['version']) > 0; $extmgr->checkExtension($re);
$checkmsgs = $extmgr->getErrorMsgs();
$needsupdate = !isset($GLOBALS['EXT_CONF'][$re['name']]) || SeedDMS_Extension_Mgr::cmpVersion($re['version'], $GLOBALS['EXT_CONF'][$re['name']]['version']) > 0;
echo "<tr"; echo "<tr";
if(isset($GLOBALS['EXT_CONF'][$re->name])) { if(isset($GLOBALS['EXT_CONF'][$re['name']])) {
if($needsupdate) if($needsupdate)
echo " class=\"warning\""; echo " class=\"warning\"";
else else
@ -183,13 +185,16 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Bootstrap_Style {
} }
echo ">"; echo ">";
echo "<td></td>"; echo "<td></td>";
echo "<td>".$re->title."<br /><small>".$re->description."</small></td>"; echo "<td>".$re['title']."<br /><small>".$re['description']."</small>";
echo "<td nowrap>".$re->version."<br /><small>".$re->releasedate."</small></td>"; if($checkmsgs)
echo "<td nowrap>".$re->author->name."<br /><small>".$re->author->company."</small></td>"; echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br /><img src="'.$this->getImgPath("attention.gif").'"> ', $checkmsgs)."</div>";
echo "</td>";
echo "<td nowrap>".$re['version']."<br /><small>".$re['releasedate']."</small></td>";
echo "<td nowrap>".$re['author']['name']."<br /><small>".$re['author']['company']."</small></td>";
echo "<td nowrap>"; echo "<td nowrap>";
echo "<div class=\"list-action\">"; echo "<div class=\"list-action\">";
if($needsupdate) if($needsupdate && !$checkmsgs)
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"url\" value=\"".$re->filename."\" /><a class=\"import\" data-extname=\"".$extname."\" title=\"".getMLText('import_extension')."\"><i class=\"icon-download\"></i></a></form>"; echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$extname."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$extname."\" title=\"".getMLText('import_extension')."\"><i class=\"icon-download\"></i></a></form>";
echo "</div>"; echo "</div>";
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";