function at_admin_entrypage($vars) { extract($vars); if (!$template) { $template = "entrypage.html"; } $admin = $all = $loggedin = $anonymous = ""; switch ($type) { case "admin": $admin = "selected"; break; case "all": $all = "selected"; break; case "loggedin": $loggedin = "selected"; break; default: $anonymous = "selected"; break; } $themepath = at_gettheme_path($themedir); $filelist = at_listfiles($themepath, "htm"); $output = "<table><tr><td>" . _AT_TEMPLATE . "</td>" . at_file_select($themedir, "template", $template, $filelist) . "</tr></table>" . _AT_APPLIESTO . " <select name=\"type\">\n" . "<option {$admin} value=\"admin\">" . _AT_ADMIN . "</option>\n" . "<option {$all} value=\"all\">" . _AT_ALL . "</option>\n" . "<option {$anonymous} value=\"anonymous\">" . _AT_ANONYMOUS . "</option>\n" . "<option {$loggedin} value=\"loggedin\">" . _AT_LOGGEDIN . "</option>\n" . "</select>\n"; return $output; }
function at_admin_maintenance($vars) { extract($vars); $themepath = at_gettheme_path($themedir); $filelist = at_listfiles($themepath, "htm"); $output = "<table><tr><td>" . _AT_TEMPLATE . "</td>" . at_file_select($themedir, "template", $template, $filelist) . "</tr></table>"; return $output; }
function at_admin_transitionpages($vars) { extract($vars); $themepath = at_gettheme_path($themedir); $filelist = at_listfiles($themepath, "htm"); $admin = $all = $loggedin = $anonymous = $yes = $no = ""; if ($visits < 2) { $visits = 0; } if ($rotate) { $yes = "checked"; } else { $no = "checked"; } switch ($type) { case "admin": $admin = "selected"; break; case "all": $all = "selected"; break; case "loggedin": $loggedin = "selected"; break; default: $anonymous = "selected"; break; } $i = 0; if (is_array($template)) { foreach ($template as $val) { $output .= "<table><tr><td>" . _AT_TEMPLATE . " " . ++$i . "</td>" . at_file_select($themedir, "template[]", $val, $filelist) . "</tr></table>"; } } $output .= "<table><tr><td>" . _AT_TEMPLATE . " " . ++$i . "</td>" . at_file_select($themedir, "template[]", $template, $filelist) . "</tr></table>" . _AT_ROTATE . "<br />" . "<input type=\"radio\" name=\"rotate\" value=\"1\" {$yes}>" . _YES . "\n" . "<input type=\"radio\" name=\"rotate\" value=\"0\" {$no}>" . _NO . "<br />\n" . _AT_VISITS . " <input type=\"text\" size=\"3\" name=\"visits\" value=\"{$visits}\"><br />\n" . _AT_APPLIESTO . " <select name=\"type\">\n" . "<option {$admin} value=\"admin\">" . _AT_ADMIN . "</option>\n" . "<option {$all} value=\"all\">" . _AT_ALL . "</option>\n" . "<option {$anonymous} value=\"anonymous\">" . _AT_ANONYMOUS . "</option>\n" . "<option {$loggedin} value=\"loggedin\">" . _AT_LOGGEDIN . "</option>\n" . "</select>\n"; return $output; }
function AutoTheme_admin_updatecmsblocks($var) { $var = atExportVar($var); extract($var); $themepath = at_gettheme_path($themedir); $themeconfig = atLoadThemeConfig($themepath); extract($themeconfig); if ($modops) { $themeblocks = $blockcontrol[$thememod][$modops]; } else { $themeblocks = $blockcontrol['default']; } if (isset($order)) { $boxes = atGetBlockConfig($themeblocks); switch ($order) { case "up": $boxes[$box]['weight']--; break; case "down": $boxes[$box]['weight']++; break; } if ($boxes[$box]['weight'] <= 0) { $boxes[$box]['weight'] = 1; } foreach ($boxes as $bkey => $b) { if ($bkey != $box && $b['position'] == $boxes[$box]['position']) { $result[$bkey] = $b; switch ($order) { case "up": if ($b['weight'] == $boxes[$box]['weight']) { $result[$bkey]['weight']++; } break; case "down": if ($b['weight'] == $boxes[$box]['weight']) { $result[$bkey]['weight']--; } break; } } } $boxes = array_merge((array) $boxes, (array) $result); } if (isset($reset) && !$modops) { $boxes = atGetBlocks(); } elseif (isset($reset) && $modops) { $boxes = array(); } uasort($boxes, 'at_block_sort'); $weight = 0; foreach ($boxes as $k => $v) { $result[$k]['position'] = $boxes[$k]['position']; $result[$k]['active'] = $boxes[$k]['active']; if ($boxes[$k]['position'] == $lastpos) { $weight++; } else { $weight = 1; } $result[$k]['weight'] = $weight; $lastpos = $boxes[$k]['position']; } $boxes = $result; if ($modops) { $blockcontrol[$thememod][$modops] = $boxes; } else { $blockcontrol['default'] = $boxes; } $var = compact("blockcontrol"); atSaveThemeConfig($themedir, $var); Header("Location: " . AT_ADMINPAGE . "?module=AutoTheme&op=cmsblocks&themedir=" . htmlentities(urlencode($themedir)) . "&thememod={$thememod}&modops={$modops}"); exit; }