mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-27 18:10:42 +00:00
just color the first column of a table row
This commit is contained in:
parent
e7e2fde718
commit
4f83063e12
|
|
@ -27,6 +27,24 @@
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
|
|
||||||
|
protected function showMessages($msgs, $icon) {
|
||||||
|
if(!$msgs)
|
||||||
|
return;
|
||||||
|
echo '<i class="fa fa-'.$icon.'"></i> '.implode('<br /><i class="fa fa-'.$icon.'"></i> ', $msgs)."";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function showErrorMessages($msgs) {
|
||||||
|
echo '<div class="text-danger">';
|
||||||
|
$this->showMessages($msgs, 'exclamation-triangle');
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function showWarningMessages($msgs) {
|
||||||
|
echo '<div class="text-warning">';
|
||||||
|
$this->showMessages($msgs, 'lightbulb-o');
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
function js() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
?>
|
?>
|
||||||
|
|
@ -137,26 +155,27 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
$list = $extmgr->getExtensionListByName($extname);
|
$list = $extmgr->getExtensionListByName($extname);
|
||||||
foreach($list as $re) {
|
foreach($list as $re) {
|
||||||
$extmgr->checkExtensionByName($re['name'], $re);
|
$extmgr->checkExtensionByName($re['name'], $re);
|
||||||
$checkmsgs = $extmgr->getErrorMsgs();
|
$errormsgs = $extmgr->getErrorMsgs();
|
||||||
|
$warningmsgs = $extmgr->getWarningMsgs();
|
||||||
$needsupdate = !isset($extconf[$re['name']]) || SeedDMS_Extension_Mgr::cmpVersion($re['version'], $extconf[$re['name']]['version']) > 0;
|
$needsupdate = !isset($extconf[$re['name']]) || SeedDMS_Extension_Mgr::cmpVersion($re['version'], $extconf[$re['name']]['version']) > 0;
|
||||||
echo "<tr";
|
$class = '';
|
||||||
if(isset($extconf[$re['name']])) {
|
if(isset($extconf[$re['name']])) {
|
||||||
if($needsupdate)
|
if($needsupdate)
|
||||||
echo " class=\"table-warning warning\"";
|
$class = " class=\"table-warning warning\"";
|
||||||
else
|
else
|
||||||
echo " class=\"table-success success\"";
|
$class = " class=\"table-success success\"";
|
||||||
}
|
}
|
||||||
echo ">";
|
echo "<tr>";
|
||||||
echo "<td width=\"32\">".($re['icon-data'] ? '<img width="32" height="32" alt="'.$re['name'].'" title="'.$re['name'].'" src="'.$re['icon-data'].'">' : '')."</td>";
|
echo "<td width=\"32\" ".$class.">".($re['icon-data'] ? '<img width="32" height="32" alt="'.$re['name'].'" title="'.$re['name'].'" src="'.$re['icon-data'].'">' : '')."</td>";
|
||||||
echo "<td>".$re['title']."<br /><small>".$re['description']."</small>";
|
echo "<td>".$re['title']."<br /><small>".$re['description']."</small>";
|
||||||
echo "<br /><small>".getMLText('author').": ".$re['author']['name'].", ".$re['author']['company']."</small>";
|
echo "<br /><small>".getMLText('author').": ".$re['author']['name'].", ".$re['author']['company']."</small>";
|
||||||
if($checkmsgs)
|
$this->showErrorMessages($errormsgs);
|
||||||
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br /><img src="'.$this->getImgPath("attention.gif").'"> ', $checkmsgs)."</div>";
|
$this->showWarningMessages($warningmsgs);
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td nowrap>".$re['version']."<br /><small>".$re['releasedate']."</small></td>";
|
echo "<td nowrap>".$re['version']."<br /><small>".$re['releasedate']."</small></td>";
|
||||||
echo "<td nowrap>";
|
echo "<td nowrap>";
|
||||||
echo "<div class=\"list-action\">";
|
echo "<div class=\"list-action\">";
|
||||||
if(!$checkmsgs && $extmgr->isWritableExtDir())
|
if(!$errormsgs && $extmgr->isWritableExtDir())
|
||||||
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
|
|
@ -231,29 +250,30 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
print "<th>".getMLText('version')."</th>\n";
|
print "<th>".getMLText('version')."</th>\n";
|
||||||
print "<th></th>\n";
|
print "<th></th>\n";
|
||||||
print "</tr></thead><tbody>\n";
|
print "</tr></thead><tbody>\n";
|
||||||
$errmsgs = array();
|
|
||||||
foreach($extconf as $extname=>$extconf) {
|
foreach($extconf as $extname=>$extconf) {
|
||||||
$errmsgs = array();
|
|
||||||
$check = $extmgr->checkExtensionByDir($extname);
|
$check = $extmgr->checkExtensionByDir($extname);
|
||||||
|
$class = "";
|
||||||
if(!$settings->extensionIsDisabled($extname)) {
|
if(!$settings->extensionIsDisabled($extname)) {
|
||||||
// if(!isset($extconf['disable']) || $extconf['disable'] == false) {
|
// if(!isset($extconf['disable']) || $extconf['disable'] == false) {
|
||||||
if(!$check)
|
if(!$check)
|
||||||
echo "<tr class=\"table-danger error\" ref=\"".$extname."\">";
|
$class = "class=\"table-danger error\"";
|
||||||
else
|
else
|
||||||
echo "<tr class=\"table-success success\" ref=\"".$extname."\">";
|
$class = "class=\"table-success success\"";
|
||||||
} else {
|
} else {
|
||||||
echo "<tr class=\"table-warning warning\" ref=\"".$extname."\">";
|
$class = "class=\"table-warning warning\"";
|
||||||
}
|
}
|
||||||
$errmsgs = $extmgr->getErrorMsgs();
|
echo "<tr ref=\"".$extname."\">";
|
||||||
echo "<td width=\"32\">";
|
$errormsgs = $extmgr->getErrorMsgs();
|
||||||
|
$warningmsgs = $extmgr->getWarningMsgs();
|
||||||
|
echo "<td width=\"32\" ".$class.">";
|
||||||
if($extconf['icon'])
|
if($extconf['icon'])
|
||||||
echo "<img width=\"32\" height=\"32\" src=\"".$httproot."ext/".$extname."/".$extconf['icon']."\" alt=\"".$extname."\" title=\"".$extname."\">";
|
echo "<img width=\"32\" height=\"32\" src=\"".$httproot."ext/".$extname."/".$extconf['icon']."\" alt=\"".$extname."\" title=\"".$extname."\">";
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td>".$extconf['title'];
|
echo "<td>".$extconf['title'];
|
||||||
echo "<br /><small>".$extconf['description']."</small>";
|
echo "<br /><small>".$extconf['description']."</small>";
|
||||||
echo "<br /><small>".getMLText('author').": <a href=\"mailto:".htmlspecialchars($extconf['author']['email'])."\">".$extconf['author']['name']."</a>, ".(!empty($extconf['author']['company']) ? $extconf['author']['company'] : '')."</small>";
|
echo "<br /><small>".getMLText('author').": <a href=\"mailto:".htmlspecialchars($extconf['author']['email'])."\">".$extconf['author']['name']."</a>, ".(!empty($extconf['author']['company']) ? $extconf['author']['company'] : '')."</small>";
|
||||||
if($errmsgs)
|
$this->showErrorMessages($errormsgs);
|
||||||
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br /><img src="'.$this->getImgPath("attention.gif").'"> ', $errmsgs)."</div>";
|
$this->showWarningMessages($warningmsgs);
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td nowrap>".$extconf['version'];
|
echo "<td nowrap>".$extconf['version'];
|
||||||
echo "<br /><small>".$extconf['releasedate']."</small>";
|
echo "<br /><small>".$extconf['releasedate']."</small>";
|
||||||
|
|
@ -362,29 +382,30 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style {
|
||||||
if(!$re)
|
if(!$re)
|
||||||
continue;
|
continue;
|
||||||
$extmgr->checkExtensionByName($en, $re);
|
$extmgr->checkExtensionByName($en, $re);
|
||||||
$checkmsgs = $extmgr->getErrorMsgs();
|
$errormsgs = $extmgr->getErrorMsgs();
|
||||||
|
$warningmsgs = $extmgr->getWarningMsgs();
|
||||||
$needsupdate = !isset($extconf[$re['name']]) || SeedDMS_Extension_Mgr::cmpVersion($re['version'], $extconf[$re['name']]['version']) > 0;
|
$needsupdate = !isset($extconf[$re['name']]) || SeedDMS_Extension_Mgr::cmpVersion($re['version'], $extconf[$re['name']]['version']) > 0;
|
||||||
echo "<tr";
|
$class = '';
|
||||||
if(isset($extconf[$re['name']])) {
|
if(isset($extconf[$re['name']])) {
|
||||||
if($needsupdate)
|
if($needsupdate)
|
||||||
echo " class=\"table-warning warning\"";
|
$class = "class=\"table-warning warning\"";
|
||||||
else
|
else
|
||||||
echo " class=\"table-success success\"";
|
$class = "class=\"table-success success\"";
|
||||||
}
|
}
|
||||||
echo ">";
|
echo "<tr>";
|
||||||
echo "<td width=\"32\">".($re['icon-data'] ? '<img width="32" height="32" alt="'.$re['name'].'" title="'.$re['name'].'" src="'.$re['icon-data'].'">' : '')."</td>";
|
echo "<td width=\"32\" ".$class.">".($re['icon-data'] ? '<img width="32" height="32" alt="'.$re['name'].'" title="'.$re['name'].'" src="'.$re['icon-data'].'">' : '')."</td>";
|
||||||
echo "<td>".$re['title'];
|
echo "<td>".$re['title'];
|
||||||
echo "<br /><small>".$re['description']."</small>";
|
echo "<br /><small>".$re['description']."</small>";
|
||||||
echo "<br /><small>".getMLText('author').": ".$re['author']['name'].", ".$re['author']['company']."</small>";
|
echo "<br /><small>".getMLText('author').": ".$re['author']['name'].", ".$re['author']['company']."</small>";
|
||||||
if($checkmsgs)
|
$this->showErrorMessages($errormsgs);
|
||||||
echo "<div><img src=\"".$this->getImgPath("attention.gif")."\"> ".implode('<br /><img src="'.$this->getImgPath("attention.gif").'"> ', $checkmsgs)."</div>";
|
$this->showWarningMessages($warningmsgs);
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td nowrap>".$re['version']."<br /><small>".$re['releasedate']."</small></td>";
|
echo "<td nowrap>".$re['version']."<br /><small>".$re['releasedate']."</small></td>";
|
||||||
echo "<td nowrap>";
|
echo "<td nowrap>";
|
||||||
echo "<div class=\"list-action\">";
|
echo "<div class=\"list-action\">";
|
||||||
echo $this->getModalBoxLink(array('target'=>'extensionInfo', 'remote'=>'out.ExtensionMgr.php?action=info_versions&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-list-ol"></i>'));
|
echo $this->getModalBoxLink(array('target'=>'extensionInfo', 'remote'=>'out.ExtensionMgr.php?action=info_versions&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-list-ol"></i>'));
|
||||||
echo $this->getModalBoxLink(array('target'=>'extensionChangelog', 'remote'=>'out.ExtensionMgr.php?action=info_changelog&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-reorder"></i>'));
|
echo $this->getModalBoxLink(array('target'=>'extensionChangelog', 'remote'=>'out.ExtensionMgr.php?action=info_changelog&extensionname='.$re['name'], 'class'=>'', 'title'=>'<i class="fa fa-reorder"></i>'));
|
||||||
if(!$checkmsgs && $settings->_enableExtensionImportFromRepository && $extmgr->isWritableExtDir())
|
if(!$errormsgs && $settings->_enableExtensionImportFromRepository && $extmgr->isWritableExtDir())
|
||||||
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
echo "<form style=\"display: inline-block; margin: 0px;\" method=\"post\" action=\"../op/op.ExtensionMgr.php\" id=\"".$re['name']."-import\">".createHiddenFieldWithKey('extensionmgr')."<input type=\"hidden\" name=\"action\" value=\"import\" /><input type=\"hidden\" name=\"currenttab\" value=\"repository\" /><input type=\"hidden\" name=\"url\" value=\"".$re['filename']."\" /><a class=\"import\" data-extname=\"".$re['name']."\" title=\"".getMLText('import_extension')."\"><i class=\"fa fa-download\"></i></a></form>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user