From: moodler Date: Sun, 10 Aug 2003 08:01:14 +0000 (+0000) Subject: Some cleanups of the admin page to make it X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=55e4b5f97d95fe73943154fd5428c7da2ec8e213;p=moodle.git Some cleanups of the admin page to make it - more explanatory - more expandable Apologies for the lost muscle memories, but I think this will work better in the long run. --- diff --git a/admin/admin.php b/admin/admin.php index 7b131087fd..daea0c42a6 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -40,6 +40,7 @@ "search", "searchagain", "toomanytoshow", + "users", "searchresults" ); @@ -56,8 +57,7 @@ print_header("$site->shortname: $strassignadmins", "$site->fullname", - "$stradministration -> - $strassignadmins", ""); + "$stradministration -> $strusers -> $strassignadmins", ""); /// Get all existing admins $admins = get_admins(); diff --git a/admin/auth.php b/admin/auth.php index c6fafff09c..7f1cdc83e9 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -86,9 +86,10 @@ $strauthentication = get_string("authentication"); $strauthenticationoptions = get_string("authenticationoptions","auth"); $strsettings = get_string("settings"); + $strusers = get_string("users"); print_header("$site->shortname: $strauthenticationoptions", "$site->fullname", - "$stradministration -> $strauthenticationoptions", "$focus"); + "$stradministration -> $strusers -> $strauthenticationoptions", "$focus"); echo "

"; echo "

framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">"; diff --git a/admin/creators.php b/admin/creators.php index 139e2231da..3505abab01 100755 --- a/admin/creators.php +++ b/admin/creators.php @@ -39,6 +39,7 @@ "removecreator", "search", "searchagain", + "users", "toomanytoshow", ); @@ -55,8 +56,8 @@ print_header("$site->shortname: $strassigncreators", "$site->fullname", - "$stradministration -> - $strassigncreators", ""); + "$stradministration -> $strusers -> + $strassigncreators", ""); /// Get all existing creators $creators = get_creators(); diff --git a/admin/index.php b/admin/index.php index f5a1f09255..9d2536c5fb 100644 --- a/admin/index.php +++ b/admin/index.php @@ -338,54 +338,66 @@ } /// Check for valid admin user - if (!iscreator()) { - error("You need to be an admin user or teacher to use this page.", "$CFG->wwwroot/login/index.php"); + if (!isadmin()) { + error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php"); } /// At this point everything is set up and the user is an admin, so print menu $stradministration = get_string("administration"); - print_header("$site->shortname: $stradministration","$site->fullname: $stradministration", "$stradministration"); - if (isadmin()) { - $table->head = array (get_string("site"), get_string("courses"), get_string("users")); - $table->align = array ("CENTER", "CENTER", "CENTER"); - $table->data[0][0] = "

".get_string("configvariables")."

". - "

".get_string("sitesettings")."

". - "

id\">".get_string("sitelogs")."

". - "

".get_string("choosetheme")."

". - "

".get_string("checklanguage")."

". - "

".get_string("managemodules")."

"; - if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) { - $table->data[0][0] .= "

dbtype/frame.php\">".get_string("managedatabase")."

"; - } - $table->data[0][1] = "

".get_string("coursemanagement")."

". - $table->data[0][1] .= "

id\">".get_string("courserestore")."

"; - if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") { - $table->data[0][2] = "

".get_string("addnewuser")."

"; - } - $table->data[0][2] .= "

".get_string("edituser")."

". - "

".get_string("assignadmins")."

". - "

".get_string("assigncreators")."

". - "

".get_string("authentication")."

"; - } else { /// user is coursecreator - $table->head = array (get_string("courses")); - $table->align = array ("CENTER"); - $table->data[0][1] = "

".get_string("addnewcourse")."

". - "

".get_string("assignteachers")."

"; - } - + print_header("$site->shortname: $stradministration","$site->fullname", "$stradministration"); + print_simple_box_start("center", "80%", "#FFFFFF", 20); + print_heading($stradministration); + + $table->align = array ("right", "left"); + $table->data[] = array("".get_string("courses")."", + "".get_string("adminhelpcourses")); + $table->data[] = array("".get_string("users")."", + "".get_string("adminhelpusers")); + $table->data[] = array("".get_string("configvariables")."", + "".get_string("adminhelpconfiguration")); + $table->data[] = array("".get_string("sitesettings")."", + "".get_string("adminhelpsitesettings")); + $table->data[] = array("id\">".get_string("sitefiles")."", + "".get_string("adminhelpsitefiles")); + $table->data[] = array("".get_string("themes")."", + "".get_string("adminhelpthemes")); + $table->data[] = array("".get_string("language")."", + "".get_string("adminhelplanguage")); + $table->data[] = array("".get_string("managemodules")."", + "".get_string("adminhelpmanagemodules")); + $table->data[] = array("id.php\">".get_string("logs")."", + "".get_string("adminhelplogs")); + if (file_exists("$CFG->dirroot/admin/$CFG->dbtype")) { + $table->data[] = array("dbtype/frame.php\">".get_string("managedatabase")."", + "".get_string("adminhelpmanagedatabase")); + } + + $table->width = "90%"; + print_table($table); + + $copyrighttext = "Moodle ". + "$CFG->release ($CFG->version)
". + "Open Source under the terms of the ". + "GNU Public License
". + "Copyright © 2000-2003 Martin Dougiamas"; + + echo "

$copyrighttext

"; + - echo "
"; + echo ""; + echo ""; - echo "
"; + echo "
"; + echo "
"; print_single_button("$CFG->wwwroot/doc", NULL, get_string("documentation")); - echo ""; + echo ""; print_single_button("register.php", NULL, get_string("registration")); - echo ""; + echo "
"; - print_heading("Moodle $CFG->release ($CFG->version)", "CENTER", 1); + print_simple_box_end(); print_footer($site); diff --git a/admin/lang.php b/admin/lang.php index ed3f95931f..09f1013ebe 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -15,7 +15,7 @@ } $stradministration = get_string("administration"); - $strchecklanguage = get_string("checklanguage"); + $strlanguage = get_string("language"); $strcurrentlanguage = get_string("currentlanguage"); $strmissingstrings = get_string("missingstrings"); $strcomparelanguage = get_string("comparelanguage"); @@ -23,16 +23,16 @@ switch ($mode) { case "missing": - $navigation = "$strchecklanguage -> $strmissingstrings"; + $navigation = "$strlanguage -> $strmissingstrings"; $title = $strmissingstrings; break; case "compare": - $navigation = "$strchecklanguage -> $strcomparelanguage"; + $navigation = "$strlanguage -> $strcomparelanguage"; $title = $strcomparelanguage; break; default: - $title = $strchecklanguage; - $navigation = $strchecklanguage; + $title = $strlanguage; + $navigation = $strlanguage; break; } diff --git a/admin/user.php b/admin/user.php index 709576a383..3c23aa7f46 100644 --- a/admin/user.php +++ b/admin/user.php @@ -99,6 +99,7 @@ $stredituser = get_string("edituser"); $stradministration = get_string("administration"); + $strusers = get_string("users"); $stredit = get_string("edit"); $strdelete = get_string("delete"); $strdeletecheck = get_string("deletecheck"); @@ -106,7 +107,7 @@ $strshowallusers = get_string("showallusers"); print_header("$site->shortname: $stredituser", $site->fullname, - "$stradministration -> $stredituser"); + "$stradministration -> $strusers -> $stredituser"); if ($delete) { // Delete a selected user, after confirmation if (!$user = get_record("user", "id", "$delete")) { diff --git a/admin/users.php b/admin/users.php new file mode 100644 index 0000000000..5ae320f659 --- /dev/null +++ b/admin/users.php @@ -0,0 +1,47 @@ +shortname: $stradministration", "$site->fullname", + "$stradministration -> $strusers"); + + print_simple_box_start("center", "80%", "#FFFFFF", 20); + print_heading($strusers); + + $table->align = array ("right", "left"); + + if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){ + $table->data[] = array("wwwroot/$CFG->admin/user.php?newuser=true\">".get_string("addnewuser")."", + "".get_string("adminhelpaddnewuser")); + } + $table->data[] = array("".get_string("edituser")."", + "".get_string("adminhelpedituser")); + $table->data[] = array("".get_string("assignadmins")."", + "".get_string("adminhelpassignadmins")); + $table->data[] = array("".get_string("assigncreators")."", + "".get_string("adminhelpassigncreators")); + $table->data[] = array("".get_string("authentication")."", + "".get_string("adminhelpauthentication")); + + print_table($table); + + print_simple_box_end(); + + print_footer($site); + +?> + + diff --git a/course/lib.php b/course/lib.php index c5ee595a4e..11783de559 100644 --- a/course/lib.php +++ b/course/lib.php @@ -687,53 +687,37 @@ function print_admin_links ($siteid, $width=180) { global $CFG, $THEME; if (empty($THEME->custompix)) { - $icon = "wwwroot/pix/i/settings.gif\" height=16 width=16 alt=\"\">"; + $icon = "wwwroot/pix/i/admin.gif\" height=16 width=16 alt=\"\">"; } else { - $icon = "wwwroot/theme/$CFG->theme/pix/i/settings.gif\" height=16 width=16 alt=\"\">"; + $icon = "wwwroot/theme/$CFG->theme/pix/i/admin.gif\" height=16 width=16 alt=\"\">"; } + if (iscreator()) { + $moddata[]="wwwroot/course/index.php?edit=on\">".get_string("courses").""; + $modicon[]=$icon; + $fulladmin = ""; + } if (isadmin()) { + $moddata[]="wwwroot/$CFG->admin/users.php\">".get_string("users").""; + $modicon[]=$icon; $moddata[]="wwwroot/$CFG->admin/config.php\">".get_string("configvariables").""; $modicon[]=$icon; $moddata[]="wwwroot/$CFG->admin/site.php\">".get_string("sitesettings").""; $modicon[]=$icon; - $moddata[]="wwwroot/course/log.php?id=$siteid\">".get_string("sitelogs").""; + $moddata[]="wwwroot/files/index.php?id=$siteid\">".get_string("sitefiles").""; $modicon[]=$icon; - $moddata[]="wwwroot/theme/index.php\">".get_string("choosetheme").""; + $moddata[]="wwwroot/theme/index.php\">".get_string("themes").""; $modicon[]=$icon; - $moddata[]="wwwroot/$CFG->admin/lang.php\">".get_string("checklanguage").""; + $moddata[]="wwwroot/$CFG->admin/lang.php\">".get_string("language").""; $modicon[]=$icon; $moddata[]="wwwroot/$CFG->admin/modules.php\">".get_string("managemodules").""; $modicon[]=$icon; + $moddata[]="wwwroot/course/log.php?id=$siteid\">".get_string("logs").""; + $modicon[]=$icon; if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) { $moddata[]="wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".get_string("managedatabase").""; $modicon[]=$icon; } - $moddata[]="
"; - $modicon[]=""; - } - if (iscreator()) { - $moddata[]="wwwroot/course/index.php?edit=on\">".get_string("coursemanagement").""; - $modicon[]=$icon; - $fulladmin = ""; - } - if (isadmin()) { - $moddata[]="wwwroot/files/index.php?id=$siteid\">".get_string("courserestore").""; - $modicon[]=$icon; - $moddata[]="
"; - $modicon[]=""; - if($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual"){ - $moddata[]="wwwroot/$CFG->admin/user.php?newuser=true\">".get_string("addnewuser").""; - $modicon[]=$icon; - } - $moddata[]="wwwroot/$CFG->admin/user.php\">".get_string("edituser").""; - $modicon[]=$icon; - $moddata[]="wwwroot/$CFG->admin/admin.php\">".get_string("assignadmins").""; - $modicon[]=$icon; - $moddata[]="wwwroot/$CFG->admin/creators.php\">".get_string("assigncreators").""; - $modicon[]=$icon; - $moddata[]="wwwroot/$CFG->admin/auth.php\">".get_string("authentication").""; - $modicon[]=$icon; $fulladmin = "

wwwroot/$CFG->admin/\">".get_string("admin")."..."; } diff --git a/files/index.php b/files/index.php index b6a48679cc..d6ec5a0b39 100644 --- a/files/index.php +++ b/files/index.php @@ -34,7 +34,15 @@ global $CFG; - $strfiles = get_string("files"); + if (! $site = get_site()) { + error("Invalid site!"); + } + + if ($course->id == $site->id) { + $strfiles = get_string("sitefiles"); + } else { + $strfiles = get_string("files"); + } if ($wdir == "/") { $fullnav = "$strfiles"; @@ -46,24 +54,24 @@ for ($i=1; $i<$numdirs; $i++) { $navigation .= " -> "; $link .= "/".urlencode($dirs[$i]); - $navigation .= "id&wdir=$link\">".$dirs[$i].""; + $navigation .= "id&wdir=$link\">".$dirs[$i].""; } $fullnav = "id&wdir=/\">$strfiles $navigation"; } - if (! $site = get_site()) { - error("Invalid site!"); - } - if ($course->id == $site->id) { print_header("$course->shortname: $strfiles", "$course->fullname", "admin/index.php\">".get_string("administration"). " -> $fullnav", $formfield); + + print_heading(get_string("publicsitefileswarning"), "center", 2); + } else { print_header("$course->shortname: $strfiles", "$course->fullname", "id\">$course->shortname". " -> $fullnav", $formfield); } + echo ""; echo ""; echo ""; + echo ""; print_cell("center", ""); - echo ""; + echo ""; $file_size = filesize($filename); print_cell("right", display_size($file_size)); print_cell("right", $filedate); if ($icon == "text.gif" || $icon == "html.gif") { - $edittext = "$stredit"; + $edittext = "$stredit"; } else if ($icon == "zip.gif") { - $edittext = "$strunzip "; - $edittext .= "$strlist "; + $edittext = "$strunzip "; + $edittext .= "$strlist "; if (!empty($CFG->backup_version) && isteacher($id)) { - $edittext .= "$strrestore "; + $edittext .= "$strrestore "; } } else { $edittext = ""; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index dabb3eccf4..4da25ea7af 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -25,6 +25,21 @@ $string['addadmin'] = "Add admin"; $string['addcreator'] = "Add course creator"; $string['addteacher'] = "Add teacher"; $string['admin'] = "Admin"; +$string['adminhelpaddnewuser'] = "To manually create a new user account"; +$string['adminhelpassignadmins'] = "Admins can do anything and go anywhere in the site"; +$string['adminhelpassigncreators'] = "Creators can create new courses and teach in them"; +$string['adminhelpauthentication'] = "Internal user accounts or external databases"; +$string['adminhelpconfiguration'] = "Configure variables that affect general operation of the site"; +$string['adminhelpcourses'] = "Define courses and categories and assign people to them"; +$string['adminhelpedituser'] = "Browse the list of user accounts and edit any of them"; +$string['adminhelplanguage'] = "For checking and editing the current language pack"; +$string['adminhelplogs'] = "Browse logs of all activity on this site"; +$string['adminhelpmanagemodules'] = "Manage installed modules and their settings"; +$string['adminhelpmanagedatabase'] = "Access your database directly"; +$string['adminhelpsitesettings'] = "Define the how the front page of the site looks"; +$string['adminhelpsitefiles'] = "For publishing general files or uploading external backups"; +$string['adminhelpthemes'] = "Choose how the site looks"; +$string['adminhelpusers'] = "Define your users and set up authentication"; $string['administration'] = "Administration"; $string['administrator'] = "Administrator"; $string['administrators'] = "Administrators"; @@ -109,7 +124,7 @@ $string['configslasharguments'] = "Files (images, uploads etc) are provided via $string['configsmtphosts'] = "Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg 'mail.a.com' or 'mail.a.com;mail.b.com'). If you leave it blank, Moodle will use the PHP default method of sending mail."; $string['configsmtpuser'] = "If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here."; $string['configunzip'] = "Indicate the location of your unzip program (Unix only, optional). If specified, this will be used to unpack zip archives on the server. If you leave this blank, then Moodle will use internal routines."; -$string['configvariables'] = "Configure variables"; +$string['configvariables'] = "Configuration"; $string['configzip'] = "Indicate the location of your zip program (Unix only, optional). If specified, this will be used to create zip archives on the server. If you leave this blank, then Moodle will use internal routines."; $string['confirmed'] = "Your registration has been confirmed"; $string['confirmednot'] = "Your registration has not yet been confirmed!"; @@ -131,7 +146,6 @@ $string['coursecreators'] = "Course creators"; $string['courseinfo'] = "Course info"; $string['coursefiles'] = "Course files"; $string['courseformats'] = "Course formats"; -$string['coursemanagement'] = "Course management"; $string['courserestore'] = "Course restore"; $string['courses'] = "Courses"; $string['courseupdates'] = "Course updates"; @@ -421,8 +435,8 @@ $string['logs'] = "Logs"; $string['makeafolder'] = "Make a folder"; $string['makeeditable'] = "If you make '\$a' editable by the web server process (eg apache) then you could edit this file directly from this page"; $string['mainmenu'] = "Main menu"; -$string['managedatabase'] = "Manage database"; -$string['managemodules'] = "Manage modules"; +$string['managedatabase'] = "Database"; +$string['managemodules'] = "Modules"; $string['markedthistopic'] = "This topic is highlighted as the current topic"; $string['markthistopic'] = "Highlight this topic as the current topic"; $string['maximumchars'] = "Maximum of \$a characters"; @@ -574,6 +588,7 @@ $string['publicdirectory'] = "Public directory"; $string['publicdirectory0'] = "Please do not publish this site"; $string['publicdirectory1'] = "Publish the site name only"; $string['publicdirectory2'] = "Publish the site name with a link"; +$string['publicsitefileswarning'] = "Note: files placed here can be accessed by anyone"; $string['question'] = "Question"; $string['readinginfofrombackup'] = "Reading info from backup"; $string['readme'] = "README"; // This is a file name @@ -636,6 +651,7 @@ $string['showtheselogs'] = "Show these logs"; $string['showallcourses'] = "Show all courses"; $string['site'] = "Site"; $string['sites'] = "Sites"; +$string['sitefiles'] = "Site files"; $string['sitelogs'] = "Site logs"; $string['sitenews'] = "Site news"; $string['sitesettings'] = "Site settings"; @@ -672,6 +688,7 @@ $string['texteditor'] = "Use standard web forms"; $string['timezone'] = "Timezone"; $string['thanks'] = "Thanks"; $string['theme'] = "Theme"; +$string['themes'] = "Themes"; $string['themesaved'] = "New theme saved"; $string['to'] = "To"; $string['today'] = "Today"; @@ -693,7 +710,6 @@ $string['unknowncategory'] = "Unknown category"; $string['unpacking'] = "Unpacking \$a"; $string['unsafepassword'] = "Unsafe password - try something else"; $string['unusedaccounts'] = "Accounts unused for more than \$a days are automatically unenrolled"; -$string['usingexistingcourse'] = "Using existing course"; $string['unzip'] = "Unzip"; $string['unzippingbackup'] = "Unzipping backup"; $string['update'] = "Update"; @@ -710,14 +726,15 @@ $string['uploadedfileto'] = "Uploaded \$a->file to \$a->directory"; $string['uploadnofilefound'] = "No file was found - are you sure you selected one to upload?"; $string['uploadproblem'] = "An unknown problem occurred while uploading the file '\$a' (perhaps it was too large?)"; $string['uploadthisfile'] = "Upload this file"; +$string['user'] = "User"; $string['userdeleted'] = "This user account has been deleted"; $string['userdescription'] = "Description"; $string['userfiles'] = "User Files"; $string['username'] = "Username"; $string['usernameexists'] = "This username already exists, choose another"; $string['userprofilefor'] = "User profile for \$a"; -$string['user'] = "User"; $string['users'] = "Users"; +$string['usingexistingcourse'] = "Using existing course"; $string['userzones'] = "User zones"; $string['webpage'] = "Web page"; $string['week'] = "Week"; diff --git a/lib/weblib.php b/lib/weblib.php index db95bfc867..2fd5d93779 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -259,7 +259,7 @@ function link_to_popup_window ($url, $name="popup", $linkname="click here", $options = "menubar=0,location=0,scrollbars,resizable,width=$width,height=$height"; $fullscreen = 0; - echo "wwwroot/$url\" ". + echo "wwwroot$url\" ". "onClick=\"return openpopup('$url', '$name', '$options', $fullscreen);\">$linkname\n"; } diff --git a/user/edit.php b/user/edit.php index 149b796802..416b6032a7 100644 --- a/user/edit.php +++ b/user/edit.php @@ -140,8 +140,8 @@ $stradministration = get_string("administration"); print_header("$course->shortname: $streditmyprofile", "$course->fullname", - "wwwroot/admin/\">$stradministration -> - $straddnewuser", ""); + "wwwroot/$CFG->admin/\">$stradministration -> ". + "wwwroot/$CFG->admin/users.php\">$strusers -> $straddnewuser", ""); } $teacher = strtolower($course->teacher); diff --git a/user/index.php b/user/index.php index 857ac2f319..2af4c3428b 100644 --- a/user/index.php +++ b/user/index.php @@ -11,6 +11,7 @@ optional_variable($dir,"DESC"); //how to sort students optional_variable($showall,""); //show all of the students? + if (! $course = get_record("course", "id", $id)) { error("Course ID is incorrect"); }
"; @@ -728,10 +736,10 @@ function displaydir ($wdir) { $fileurlsafe = rawurlencode($fileurl); $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); - echo "
"; + echo ""; if ($CFG->slasharguments) { $ffurl = "/file.php/$id$fileurl"; } else { @@ -740,22 +748,22 @@ function displaydir ($wdir) { link_to_popup_window ($ffurl, "display", "\"File\"", 480, 640); - echo ""; + echo ""; link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); - echo "