$id = required_param('id', PARAM_INT); // Category id
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', 20, PARAM_INT); // how many per page
- $edit = optional_param('edit', -1, PARAM_BOOL);
+ $categoryedit = optional_param('categoryedit', -1, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$moveup = optional_param('moveup', 0, PARAM_INT);
if (iscreator()) {
if ($edit !== -1) {
- $USER->categoryediting = $edit;
+ $USER->categoryediting = $categoryedit;
}
$navbaritem = update_category_button($category->id);
if ($creatorediting) {
if ($adminediting) {
- print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
- "<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> ".
- "<a href=\"index.php\">$strcategories</a> -> $category->name",
- "", "", true, $navbaritem);
+ // modify this to treat this as an admin page
+
+ require_once($CFG->dirroot . '/admin/adminlib.php');
+ admin_externalpage_setup('coursemgmt');
+ admin_externalpage_print_header();
} else {
print_header("$site->shortname: $category->name", "$site->fullname: $strcourses",
"<a href=\"index.php\">$strcategories</a> -> $category->name", "", "", true, $navbaritem);
print_course_search();
echo "</center>";
-
- print_footer();
+
+ if ($adminediting) {
+ admin_externalpage_print_footer();
+ } else {
+ print_footer();
+ }
?>
require_once("../config.php");
require_once("lib.php");
- $edit = optional_param('edit', -1,PARAM_BOOL);
+ $categoryedit = optional_param('categoryedit', -1,PARAM_BOOL);
$delete = optional_param('delete',0,PARAM_INT);
$hide = optional_param('hide',0,PARAM_INT);
$show = optional_param('show',0,PARAM_INT);
}
if (isadmin()) {
- if ($edit !== -1) {
- $USER->categoryediting = $edit;
+ if ($categoryedit !== -1) {
+ $USER->categoryediting = $categoryedit;
}
$adminediting = !empty($USER->categoryediting);
} else {
/// From now on is all the admin functions
- require_login();
- if (!isadmin()) {
- error("Only administrators can use this page!");
- }
+ require_once($CFG->dirroot . '/admin/adminlib.php');
+ admin_externalpage_setup('coursemgmt');
+
/// Print headings
$straction = get_string("action");
$straddnewcategory = get_string("addnewcategory");
- print_header("$site->shortname: $strcategories", "$site->fullname",
- "<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strcategories",
- "addform.addcategory", "", true, update_categories_button());
+
+
+ admin_externalpage_print_header();
print_heading($strcategories);
echo "<br />";
echo "</center>";
- print_footer();
+ admin_externalpage_print_footer();
echo " ";
}
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
- echo "<a $linkcss title=\"$str->edit\" href=\"category.php?id=$category->id&edit=on&sesskey=$USER->sesskey\">$category->name</a>";
+ echo "<a $linkcss title=\"$str->edit\" href=\"category.php?id=$category->id&categoryedit=on&sesskey=$USER->sesskey\">$category->name</a>";
echo "</td>";
echo "<td align=\"right\">$category->coursecount</td>";
<?php // $Id$
require_once("../config.php");
+ require_once($CFG->dirroot . '/admin/adminlib.php');
$choose = optional_param("choose",'',PARAM_FILE); // set this theme as default
- if (! $site = get_site()) {
- error("Site doesn't exist!");
- }
-
- require_login();
-
- if (!isadmin()) {
- error("You must be an administrator to change themes.");
- }
+ admin_externalpage_setup('themeselector');
unset($SESSION->theme);
}
if (set_config("theme", $choose)) {
theme_setup($choose);
-
- print_header("$site->shortname: $strthemes", $site->fullname,
- "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> ".
- "<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> $strthemes");
+ admin_externalpage_print_header();
print_heading(get_string("themesaved"));
print_continue("$CFG->wwwroot/");
echo format_text(implode('', $file), FORMAT_MOODLE);
print_simple_box_end();
}
- print_footer();
+ admin_externalpage_print_footer();
exit;
} else {
error("Could not set the theme!");
}
}
- print_header("$site->shortname: $strthemes", $site->fullname,
- "<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> ".
- "<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">$strconfiguration</a> -> $strthemes");
+ admin_externalpage_print_header('themeselector');
print_heading($strthemes);
$options["sub"] = "themes";
print_single_button("$CFG->wwwroot/doc/index.php", $options, get_string("howtomakethemes"));
echo "</div>";
- print_footer();
+ admin_externalpage_print_footer();
+
?>