From: moodler Date: Mon, 18 Aug 2003 16:40:27 +0000 (+0000) Subject: Trying something different with the admin links ... even I was starting X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2f4d324bd7f12e69967fe1dd6141eed19c2d2823;p=moodle.git Trying something different with the admin links ... even I was starting to get a bit lost occasionally. --- diff --git a/admin/config.php b/admin/config.php index d84f911fb7..6685df57a4 100644 --- a/admin/config.php +++ b/admin/config.php @@ -62,11 +62,13 @@ } $stradmin = get_string("administration"); + $strconfiguration = get_string("configuration"); $strconfigvariables = get_string("configvariables"); if ($site) { print_header("$site->shortname: $strconfigvariables", $site->fullname, - "$stradmin -> $strconfigvariables", $focus); + "$stradmin -> ". + "$strconfiguration -> $strconfigvariables", $focus); print_heading($strconfigvariables); } else { print_header(); diff --git a/admin/index.php b/admin/index.php index 1d5f05cf0a..449d98166f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -351,20 +351,46 @@ print_heading($stradministration); $table->align = array ("right", "left"); - $table->data[] = array("".get_string("configvariables")."", - get_string("adminhelpconfiguration")); - $table->data[] = array("".get_string("sitesettings")."", - get_string("adminhelpsitesettings")); + $table->cellpadding = 4; + $table->cellspacing = 3; + $table->width = "90%"; + + $configdata = "".get_string("configvariables")." - ". + get_string("adminhelpconfigvariables")."
"; + $configdata .= "".get_string("sitesettings")." - ". + get_string("adminhelpsitesettings")."
"; + $configdata .= "".get_string("themes")." - ". + get_string("adminhelpthemes")."
"; + $configdata .= "".get_string("language")." - ". + get_string("adminhelplanguage")."
"; + $configdata .= "".get_string("managemodules")." - ". + get_string("adminhelpmanagemodules")."
"; + + $table->data[] = array("".get_string("configuration")."", $configdata); + + + $userdata = "".get_string("authentication")." - ". + get_string("adminhelpauthentication")."
"; + + if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") { + $userdata .= "wwwroot/$CFG->admin/user.php?newuser=true\">". + get_string("addnewuser")." - ". + get_string("adminhelpaddnewuser")."
"; + } + $userdata .= "".get_string("edituser")." - ". + get_string("adminhelpedituser")."
"; + $userdata .= "".get_string("assignadmins")." - ". + get_string("adminhelpassignadmins")."
"; + $userdata .= "".get_string("assigncreators")." - ". + get_string("adminhelpassigncreators")."
"; + $userdata .= "".get_string("assignteachers")." - ". + get_string("adminhelpassignteachers"). + " "; + + $table->data[] = array("".get_string("users")."", $userdata); + $table->data[] = array("".get_string("courses")."", get_string("adminhelpcourses")); - $table->data[] = array("".get_string("users")."", - get_string("adminhelpusers")); - $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")); $table->data[] = array("id\">".get_string("sitefiles")."", @@ -374,8 +400,6 @@ get_string("adminhelpmanagedatabase")); } - $table->width = "90%"; - print_table($table); ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/admin/lang.php b/admin/lang.php index 09f1013ebe..59eb83a8e4 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -15,6 +15,7 @@ } $stradministration = get_string("administration"); + $strconfiguration = get_string("configuration"); $strlanguage = get_string("language"); $strcurrentlanguage = get_string("currentlanguage"); $strmissingstrings = get_string("missingstrings"); @@ -39,7 +40,8 @@ $currentlang = current_language(); print_header("$site->shortname: $title", "$site->fullname", - "$stradministration -> $navigation"); + "$stradministration -> ". + "$strconfiguration -> $navigation"); if (!$mode) { print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage")); diff --git a/admin/modules.php b/admin/modules.php index 93d0ee2c4f..c43ae811e0 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -21,6 +21,7 @@ /// Print headings $stradministration = get_string("administration"); + $strconfiguration = get_string("configuration"); $strmanagemodules = get_string("managemodules"); $strdelete = get_string("delete"); $strhide = get_string("hide"); @@ -29,7 +30,8 @@ $stractivitymodule = get_string("activitymodule"); print_header("$site->shortname: $strmanagemodules", "$site->fullname", - "admin/index.php\">$stradministration -> $strmanagemodules"); + "$stradministration -> ". + "$strconfiguration -> $strmanagemodules"); print_heading($strmanagemodules); diff --git a/admin/site.php b/admin/site.php index f6c74bbdc4..48f5b57e25 100644 --- a/admin/site.php +++ b/admin/site.php @@ -85,6 +85,7 @@ } $stradmin = get_string("administration"); + $strconfiguration = get_string("configuration"); $strsitesettings = get_string("sitesettings"); if ($firsttime) { @@ -94,7 +95,8 @@ echo "
"; } else { print_header("$site->shortname: $strsitesettings", "$site->fullname", - "$stradmin -> $strsitesettings", "$focus"); + "$stradmin -> ". + "$strconfiguration -> $strsitesettings", "$focus"); print_heading($strsitesettings); } diff --git a/course/lib.php b/course/lib.php index 9ba67fdbfe..bd5fdb947b 100644 --- a/course/lib.php +++ b/course/lib.php @@ -683,38 +683,36 @@ function print_admin_links ($siteid, $width=180) { global $CFG, $THEME; if (empty($THEME->custompix)) { - $icon = "wwwroot/pix/i/admin.gif\" height=16 width=16 alt=\"\">"; + $pixpath = "$CFG->wwwroot/pix"; } else { - $icon = "wwwroot/theme/$CFG->theme/pix/i/admin.gif\" height=16 width=16 alt=\"\">"; + $pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix"; } if (isadmin()) { - $moddata[]="wwwroot/$CFG->admin/config.php\">".get_string("configvariables").""; - $modicon[]=$icon; - $moddata[]="wwwroot/$CFG->admin/site.php\">".get_string("sitesettings").""; - $modicon[]=$icon; + $moddata[]="wwwroot/$CFG->admin/configure.php\">".get_string("configuration")."..."; + $modicon[]="\"\""; + + $moddata[]="wwwroot/$CFG->admin/users.php\">".get_string("users")."..."; + $modicon[]="\"\""; } + if (iscreator()) { $moddata[]="wwwroot/course/index.php?edit=on\">".get_string("courses").""; - $modicon[]=$icon; + $modicon[]="\"\""; $fulladmin = ""; } + if (isadmin()) { - $moddata[]="wwwroot/$CFG->admin/users.php\">".get_string("users").""; - $modicon[]=$icon; - $moddata[]="wwwroot/theme/index.php\">".get_string("themes").""; - $modicon[]=$icon; - $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; + $modicon[]="\"\""; + $moddata[]="wwwroot/files/index.php?id=$siteid\">".get_string("sitefiles").""; - $modicon[]=$icon; + $modicon[]="\"\""; + if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) { - $moddata[]="wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".get_string("managedatabase").""; - $modicon[]=$icon; + $moddata[]="wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">". + get_string("managedatabase").""; + $modicon[]="\"\""; } $fulladmin = "

wwwroot/$CFG->admin/\">".get_string("admin")."..."; } diff --git a/lib/weblib.php b/lib/weblib.php index 2bd4e480d9..6e4ef37dde 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1073,6 +1073,114 @@ function print_table($table) { return true; } +function make_table($table) { +// Creates a nicely formatted table and returns it +// $table is an object with several properties. +// $table->head is an array of heading names. +// $table->align is an array of column alignments +// $table->size is an array of column sizes +// $table->wrap is an array of "nowrap"s or nothing +// $table->data[] is an array of arrays containing the data. +// $table->width is an percentage of the page +// $table->class is a class +// $table->fontsize is the size of all the text +// $table->tablealign align the whole table +// $table->cellpadding padding on each cell +// $table->cellspacing spacing between cells + + if (isset($table->align)) { + foreach ($table->align as $key => $aa) { + if ($aa) { + $align[$key] = " align=\"$aa\""; + } else { + $align[$key] = ""; + } + } + } + if (isset($table->size)) { + foreach ($table->size as $key => $ss) { + if ($ss) { + $size[$key] = " width=\"$ss\""; + } else { + $size[$key] = ""; + } + } + } + if (isset($table->wrap)) { + foreach ($table->wrap as $key => $ww) { + if ($ww) { + $wrap[$key] = " nowrap "; + } else { + $wrap[$key] = ""; + } + } + } + + if (empty($table->width)) { + $table->width = "80%"; + } + + if (empty($table->tablealign)) { + $table->tablealign = "center"; + } + + if (empty($table->cellpadding)) { + $table->cellpadding = "5"; + } + + if (empty($table->cellspacing)) { + $table->cellspacing = "1"; + } + + if (empty($table->class)) { + $table->class = "generaltable"; + } + + if (empty($table->fontsize)) { + $fontsize = ""; + } else { + $fontsize = "fontsize\">"; + } + + $output = "width\" valign=top align=\"$table->tablealign\" "; + $output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class\">\n"; + + if (!empty($table->head)) { + $output .= ""; + foreach ($table->head as $key => $heading) { + if (!isset($size[$key])) { + $size[$key] = ""; + } + if (!isset($align[$key])) { + $align[$key] = ""; + } + $output .= ""; + } + $output .= "\n"; + } + + foreach ($table->data as $row) { + $output .= ""; + foreach ($row as $key => $item) { + if (!isset($size[$key])) { + $size[$key] = ""; + } + if (!isset($align[$key])) { + $align[$key] = ""; + } + if (!isset($wrap[$key])) { + $wrap[$key] = ""; + } + $output .= ""; + } + $output .= "\n"; + } + $output .= "
class}header\">$fontsize$heading
class}cell\">$fontsize$item
\n"; + + return $output; +} + + function print_editing_switch($courseid) { global $CFG, $USER; diff --git a/theme/index.php b/theme/index.php index 82d5d1c809..6cf54d4d0a 100644 --- a/theme/index.php +++ b/theme/index.php @@ -31,6 +31,7 @@ } $stradministration = get_string("administration"); + $strconfiguration = get_string("configuration"); $strthemes = get_string("themes"); $strpreview = get_string("preview"); $strsavechanges = get_string("savechanges"); @@ -38,7 +39,8 @@ $strthemesaved = get_string("themesaved"); print_header("$site->shortname: $strthemes", $site->fullname, - "wwwroot/$CFG->admin/index.php\">$stradministration -> $strthemes"); + "wwwroot/admin/index.php\">$stradministration -> ". + "wwwroot/admin/configure.php\">$strconfiguration -> $strthemes"); if ($choose) { if (set_config("theme", $choose)) {