mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Further excellent tidy-ups to the admin pages. They are actually starting
to look/work as slick as the rest of the site. :-)
This commit is contained in:
parent
a3447e1053
commit
2b25f2a09b
9 changed files with 109 additions and 66 deletions
|
@ -11,11 +11,17 @@
|
|||
error("You must be an administrator to use this page.");
|
||||
}
|
||||
|
||||
$stradmin = get_string("admin");
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
$strdeletecourse = get_string("deletecourse");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
if (!$id) {
|
||||
$strdelete = get_string("deletecourse");
|
||||
print_header($strdelete, $strdelete, "<A HREF=\"$CFG->wwwroot/admin\">$stradmin</A> -> $strdelete");
|
||||
print_header("$site->fullname : $strdeletecourse", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strdeletecourse");
|
||||
|
||||
if ($courses = get_records_sql("SELECT * from course WHERE category > 0 ORDER BY fullname")) {
|
||||
print_heading(get_string("choosecourse"));
|
||||
print_simple_box_start("CENTER");
|
||||
|
@ -38,8 +44,10 @@
|
|||
if (! $delete) {
|
||||
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
|
||||
$strdeletecheckfull = get_string("deletecheckfull");
|
||||
print_header($strdeletecheck, $strdeletecheck,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradmin</A> -> $strdeletecheck");
|
||||
print_header("$site->fullname : $strdeletecheck", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletecheck");
|
||||
|
||||
notice_yesno("$strdeletecheckfull<BR><BR>$course->fullname",
|
||||
"delete.php?id=$course->id&delete=".md5($course->timemodified),
|
||||
"delete.php");
|
||||
|
@ -51,10 +59,13 @@
|
|||
}
|
||||
|
||||
// OK checks done, delete the course now.
|
||||
$strdeletingcheck = get_string("deletingcheck", "", $course->shortname);
|
||||
print_header($strdeletingcheck, $strdeletingcheck,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradmin</A> -> $strdeletingcheck");
|
||||
print_heading($strdeletingcheck);
|
||||
$strdeletingcourse = get_string("deletingcourse", "", $course->shortname);
|
||||
|
||||
print_header("$site->fullname : $strdeletingcourse", $site->fullname,
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
<A HREF=\"delete.php\">$strdeletecourse</A> -> $strdeletingcourse");
|
||||
|
||||
print_heading($strdeletingcourse);
|
||||
|
||||
$strdeleted = get_string("deleted");
|
||||
// First delete every instance of every module
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
if (!isadmin()) {
|
||||
error("Only administrators can use this page");
|
||||
}
|
||||
}
|
||||
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/admin/");
|
||||
}
|
||||
if (! $site = get_site()) {
|
||||
redirect("$CFG->wwwroot/admin/");
|
||||
}
|
||||
|
||||
|
||||
|
@ -95,16 +95,17 @@
|
|||
$form->categories = get_records_sql_menu("SELECT id,name FROM course_categories");
|
||||
|
||||
$streditcoursesettings = get_string("editcoursesettings");
|
||||
$streditcoursesettings = get_string("editcoursesettings");
|
||||
$straddnewcourse = get_string("addnewcourse");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
if (isset($course)) {
|
||||
print_header($streditcoursesettings, "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
|
||||
-> $streditcoursesettings", $focus);
|
||||
} else {
|
||||
print_header(get_string("addnewcourse"), get_string("addnewcourse"),
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">".get_string("admin")."</A>
|
||||
-> ".get_string("addnewcourse"), $focus);
|
||||
print_header("$site->shortname : $straddnewcourse", "$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin/\">$stradministration</A>
|
||||
-> $straddnewcourse", $focus);
|
||||
}
|
||||
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
|
|
|
@ -496,6 +496,31 @@ function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) {
|
|||
echo "</TABLE><BR>\n\n";
|
||||
}
|
||||
|
||||
function print_admin_links () {
|
||||
global $THEME, $CFG;
|
||||
|
||||
print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
||||
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/log.php?id=$site->id\">".get_string("sitelogs")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/site.php\">".get_string("sitesettings")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/edit.php\">".get_string("addnewcourse")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/teacher.php\">".get_string("assignteachers")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/course/delete.php\">".get_string("deletecourse")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php?newuser=true\">".get_string("addnewuser")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<A HREF=\"$CFG->wwwroot/admin/user.php\">".get_string("edituser")."</A>";
|
||||
$modicon[]=$icon;
|
||||
$fulladmin = "<P><A HREF=\"$CFG->wwwroot/admin/\">".get_string("admin")."</A>...";
|
||||
print_side_block("", $moddata, "$fulladmin", $modicon);
|
||||
echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
function print_log_graph($course, $userid=0, $type="course.png", $date=0) {
|
||||
global $CFG;
|
||||
|
|
|
@ -15,8 +15,13 @@
|
|||
error("You must be an administrator to use this page.");
|
||||
}
|
||||
|
||||
$strassignteachers = get_string("assignteachers");
|
||||
$stradministration = get_string("administration");
|
||||
|
||||
if (!$id) {
|
||||
print_header("Add teachers to a course", "Add teachers to a course", "<A HREF=\"$CFG->wwwroot/admin\">Admin</A> -> Add teachers", "");
|
||||
print_header("$site->fullname: $strassignteachers", "$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> -> $strassignteachers");
|
||||
|
||||
if ($courses = get_records_sql("SELECT * from course WHERE category > 0 ORDER BY fullname")) {
|
||||
|
||||
print_heading("Choose a course to add teachers to");
|
||||
|
@ -38,7 +43,11 @@
|
|||
}
|
||||
|
||||
|
||||
print_header("Add teachers to $course->shortname", "Add teachers to a course", "<A HREF=\"$CFG->wwwroot/admin\">Admin</A> -> Add teachers to $course->shortname", "");
|
||||
print_header("$site->fullname: $course->shortname: $strassignteachers",
|
||||
"$site->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/admin\">$stradministration</A> ->
|
||||
<A HREF=\"teacher.php\">$strassignteachers</A> ->
|
||||
$course->shortname", "");
|
||||
print_heading($course->fullname);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue