예제 #1
0
function BuildRows($appli, $SockStatus, $internetkey, $noupgrade = false)
{
    $ini = new Bs_IniHandler();
    if ($GLOBALS["INDEXFF"] == null) {
        $GLOBALS["INDEXFF"] = @file_get_contents(dirname(__FILE__) . '/ressources/index.ini');
    }
    $ini->loadString($GLOBALS["INDEXFF"]);
    $tpl = new templates();
    $button_text = $tpl->_parse_body('{install_upgrade}');
    if (strlen($button_text) > 27) {
        $button_text = substr($button_text, 0, 24) . "...";
    }
    $bgcolor = "style='background-color:#DFFDD6'";
    $version = ParseAppli($SockStatus, $appli);
    $uninstall = ParseUninstall($SockStatus, $appli);
    if ($version == "0" or strlen($version) == 0) {
        $version = "{not_installed}";
        $bgcolor = null;
        $uninstall = null;
    }
    if (file_exists(dirname(__FILE__) . "/ressources/install/{$appli}.dbg")) {
        $dbg_exists = imgtootltip('22-logs.png', "{events}", "InstallLogs('{$appli}')");
        $styledbg = "background-color:yellow;border:1px solid black";
    } else {
        $dbg_exists = "<img src='img/fw_bold.gif'>";
    }
    $appli_text = $tpl->_ENGINE_parse_body("{{$appli}}");
    $appli_text = replace_accents($appli_text);
    if (strlen($appli_text) > 30) {
        $appli_text = texttooltip(substr($appli_text, 0, 27) . "...", $appli_text, null, null, 1);
    }
    $button_install = button($button_text, "ApplicationSetup('{$appli}')");
    if ($GLOBALS["ArticaMetaDisableSetupCenter"] == 1) {
        $button_install = null;
        $uninstall = null;
    }
    // UNINSTALL
    if ($uninstall != null) {
        $version = "<table><tr><td style='font-size:13px' valign='middle'>{$version}</td>\n\t\t\t<td valign='middle'>" . imgtootltip("ed_delete.gif", "{uninstall} {{$appli}}", "SetupCenterRemove('{$uninstall}','{$appli}')") . "</td></tr></table>";
    }
    if ($ini->_params["NEXT"]["{$internetkey}"] == null) {
        writelogs("Unable to stat NEXT/{$internetkey} \"{$ini->_params["NEXT"]["{$internetkey}"]}\"", __FUNCTION__, __FILE__, __LINE__);
        $ini->_params["NEXT"]["{$internetkey}"] = "<div style='color:#d32d2d'>{error_network}</div>";
        $button_install = null;
    }
    if ($internetkey == "openldap") {
        $sock = new sockets();
        if ($sock->GET_INFO("AllowUpgradeLdap") != 1) {
            $button_install = null;
        }
    }
    if ($noupgrade) {
        $button_install = null;
    }
    return "\n\t<tr {$bgcolor}>\n\t\t<td width=2% style=\"{$styledbg}\">{$dbg_exists}</td>\n\t\t<td style='font-size:13px' nowrap>{$appli_text}</td>\n\t\t<td style='font-size:13px'>{$version}</td>\n\t\t<td style='font-size:13px'>{$ini->_params["NEXT"]["{$internetkey}"]}</td>\n\t\t<td style='font-size:11px'>{$button_install}</td>\n\t\t<td style='font-size:13px'><div style='width:100px;height:22px;border:1px solid #CCCCCC' id='STATUS_{$appli}'>" . install_status($appli) . "</div></td>\n\t</tr>\n\t";
}
예제 #2
0
function BuildRows($appli, $SockStatus, $internetkey, $noupgrade = false)
{
    $ini = new Bs_IniHandler();
    $ini->loadFile(dirname(__FILE__) . '/ressources/index.ini');
    $tpl = new templates();
    $button_text = $tpl->_parse_body('{install_upgrade}');
    if (strlen($button_text) > 27) {
        $button_text = substr($button_text, 0, 24) . "...";
    }
    $bgcolor = "style='background-color:#DFFDD6'";
    $version = ParseAppli($SockStatus, $appli);
    $uninstall = ParseUninstall($SockStatus, $appli);
    if ($version == "0" or strlen($version) == 0) {
        $version = "{not_installed}";
        $bgcolor = null;
        $uninstall = null;
    }
    if (file_exists(dirname(__FILE__) . "/ressources/install/{$appli}.dbg")) {
        $dbg_exists = imgtootltip('22-logs.png', "{events}", "InstallLogs('{$appli}')");
        $styledbg = "background-color:yellow;border:1px solid black";
    } else {
        $dbg_exists = "<img src='img/fw_bold.gif'>";
    }
    $appli_text = $tpl->javascript_parse_text("{{$appli}}");
    $appli_text = html_entity_decode($appli_text, ENT_QUOTES, "UTF-8");
    if (strlen($appli_text) > 30) {
        $appli_text = texttooltip(htmlentities(substr($appli_text, 0, 27)) . "...", htmlentities($appli_text), null, null, 1);
    }
    $button_install = button($button_text, "ApplicationSetup('{$appli}')");
    // UNINSTALL
    if ($uninstall != null) {
        $version = "<table><tr><td style='font-size:13px' valign='middle'>{$version}</td>\n\t\t\t<td valign='middle'>" . imgtootltip("ed_delete.gif", "{uninstall} {{$appli}}", "SetupCenterRemove('{$uninstall}','{$appli}')") . "</td></tr></table>";
    }
    if ($ini->_params["NEXT"]["{$internetkey}"] == null) {
        $ini->_params["NEXT"]["{$internetkey}"] = "<div style='color:red'>{error_network}</div>";
        $button_install = null;
    }
    if ($noupgrade) {
        $button_install = null;
    }
    return "\n\t<tr {$bgcolor}>\n\t\t<td width=2% style=\"{$styledbg}\">{$dbg_exists}</td>\n\t\t<td style='font-size:13px' nowrap>{$appli_text}</td>\n\t\t<td style='font-size:13px'>{$version}</td>\n\t\t<td style='font-size:13px'>{$ini->_params["NEXT"]["{$internetkey}"]}</td>\n\t\t<td style='font-size:11px'>{$button_install}</td>\n\t\t<td style='font-size:13px'><div style='width:100px;height:22px;border:1px solid #CCCCCC' id='STATUS_{$appli}'>" . install_status($appli) . "</div></td>\n\t</tr>\n\t";
}