Esempio n. 1
0
function AutoTheme_admin_extraops($var)
{
    $autoconfig = atGetAutoConfig();
    extract($autoconfig);
    $var = atExportVar($var);
    extract($var);
    $extra = atExtraLoad($extraname);
    $description = "_AT_" . strtoupper($extraname) . "_DESCRIPTION";
    $name = "_AT_" . strtoupper($extraname) . "_NAME";
    $help = "_AT_" . strtoupper($extraname) . "_HELP";
    if (!defined($description)) {
        $description = $extra['description'];
    } else {
        $description = constant($description);
    }
    if (!defined($name)) {
        $name = $extra['name'];
    } else {
        $name = constant($name);
    }
    if (!defined($help)) {
        $help = _AT_NOHELP;
    } else {
        $help = constant($help);
    }
    if ($thememod) {
        atAdminThemeLinks($themedir, $name, $var, 1);
        $extrafunc = $extra['modadmin'];
        $themepath = at_gettheme_path($themedir);
        $themeconfig = atLoadThemeConfig($themepath);
        extract($themeconfig);
    } elseif ($themedir) {
        atAdminThemeLinks($themedir, $name, $var);
        $extrafunc = $extra['themeadmin'];
        $themepath = at_gettheme_path($themedir);
        $themeconfig = atLoadThemeConfig($themepath);
        extract($themeconfig);
    } elseif (!$themedir) {
        atAdminHeader($extra['name']);
        $extrafunc = $extra['atadmin'];
    }
    if (is_array(${$extraname})) {
        if ($thememod) {
            if ($modops) {
                $args = ${$extraname}[$thememod][$modops];
            } else {
                $args = ${$extraname}['default'];
            }
        } else {
            $args = ${$extraname};
        }
    } else {
        $args = array();
    }
    $args = array_merge((array) $var, (array) $args);
    if (function_exists("{$extrafunc}")) {
        $output = $extrafunc($args);
    } else {
        Header("Location: " . AT_ADMINPAGE . "?module=AutoTheme&op=extras");
    }
    atAdminOpenTable();
    echo "<b>" . _AT_DESCRIPTION . "</b>: {$description}<br />";
    echo "<b>" . _AT_VERSION . "</b>: " . $extra['version'] . "<br />";
    echo "<b>" . _AT_AUTHOR . "</b>: " . $extra['author'] . "<br />";
    echo "<b>" . _AT_CONTACT . "</b>: " . $extra['contact'] . "<br />";
    atAdminCloseTable();
    echo "<br /><b>{$name}</b>: " . $help . "<br /><br />";
    atAdminOpenTable();
    echo "<form method=\"POST\" action=\"" . AT_ADMINPAGE . "\">\n" . "  <input type=\"hidden\" name=\"op\" value=\"updateextraops\">\n" . "  <input type=\"hidden\" name=\"module\" value=\"AutoTheme\">\n" . "  <input type=\"hidden\" name=\"themedir\" value=\"{$themedir}\">\n" . "  <input type=\"hidden\" name=\"extraname\" value=\"{$extraname}\">\n" . "  <input type=\"hidden\" name=\"thememod\" value=\"{$thememod}\">\n" . "  <input type=\"hidden\" name=\"modops\" value=\"{$modops}\">\n" . $output . "<br />" . "  <input type=\"submit\" value=\"" . _AT_SAVE . "\" name=\"B1\">\n" . "</form>\n";
    atAdminCloseTable();
    atAdminFooter();
}
Esempio n. 2
0
function atExtraLoadAll()
{
    $globalconfig = atGetGlobalConfig();
    extract($globalconfig);
    $result = array();
    $lang = atGetLang();
    foreach ($autoextra as $name => $val) {
        if ($val) {
            $extra = atExtraLoad($name);
            array_push($result, $extra);
        }
    }
    return $result;
}