Trying something different with the admin links ... even I was starting
to get a bit lost occasionally.
This commit is contained in:
+3
-1
@@ -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,
|
||||
"<A HREF=\"index.php\">$stradmin</A> -> $strconfigvariables", $focus);
|
||||
"<a href=\"index.php\">$stradmin</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> $strconfigvariables", $focus);
|
||||
print_heading($strconfigvariables);
|
||||
} else {
|
||||
print_header();
|
||||
|
||||
+38
-14
@@ -351,20 +351,46 @@
|
||||
print_heading($stradministration);
|
||||
|
||||
$table->align = array ("right", "left");
|
||||
$table->data[] = array("<b><a href=\"config.php\">".get_string("configvariables")."</a></b>",
|
||||
get_string("adminhelpconfiguration"));
|
||||
$table->data[] = array("<b><a href=\"site.php\">".get_string("sitesettings")."</a></b>",
|
||||
get_string("adminhelpsitesettings"));
|
||||
$table->cellpadding = 4;
|
||||
$table->cellspacing = 3;
|
||||
$table->width = "90%";
|
||||
|
||||
$configdata = "<a href=\"config.php\">".get_string("configvariables")."</a> - <font size=-1>".
|
||||
get_string("adminhelpconfigvariables")."</font><br />";
|
||||
$configdata .= "<a href=\"site.php\">".get_string("sitesettings")."</a> - <font size=-1>".
|
||||
get_string("adminhelpsitesettings")."</font><br />";
|
||||
$configdata .= "<a href=\"../theme/index.php\">".get_string("themes")."</a> - <font size=-1>".
|
||||
get_string("adminhelpthemes")."</font><br />";
|
||||
$configdata .= "<a href=\"lang.php\">".get_string("language")."</a> - <font size=-1>".
|
||||
get_string("adminhelplanguage")."</font><br />";
|
||||
$configdata .= "<a href=\"modules.php\">".get_string("managemodules")."</a> - <font size=-1>".
|
||||
get_string("adminhelpmanagemodules")."</font><br />";
|
||||
|
||||
$table->data[] = array("<b><a href=\"configure.php\">".get_string("configuration")."</a></b>", $configdata);
|
||||
|
||||
|
||||
$userdata = "<a href=\"auth.php\">".get_string("authentication")."</a> - <font size=-1>".
|
||||
get_string("adminhelpauthentication")."</font><br />";
|
||||
|
||||
if ($CFG->auth == "email" || $CFG->auth == "none" || $CFG->auth == "manual") {
|
||||
$userdata .= "<a href=\"$CFG->wwwroot/$CFG->admin/user.php?newuser=true\">".
|
||||
get_string("addnewuser")."</a> - <font size=-1>".
|
||||
get_string("adminhelpaddnewuser")."</font><br />";
|
||||
}
|
||||
$userdata .= "<a href=\"user.php\">".get_string("edituser")."</a> - <font size=-1>".
|
||||
get_string("adminhelpedituser")."</font><br />";
|
||||
$userdata .= "<a href=\"admin.php\">".get_string("assignadmins")."</a> - <font size=-1>".
|
||||
get_string("adminhelpassignadmins")."</font><br />";
|
||||
$userdata .= "<a href=\"creators.php\">".get_string("assigncreators")."</a> - <font size=-1>".
|
||||
get_string("adminhelpassigncreators")."</font><br />";
|
||||
$userdata .= "<a href=\"../course/index.php?edit=on\">".get_string("assignteachers")."</a> - <font size=-1>".
|
||||
get_string("adminhelpassignteachers").
|
||||
" <img src=\"../pix/t/user.gif\" height=11 width=11>";
|
||||
|
||||
$table->data[] = array("<b><a href=\"users.php\">".get_string("users")."</a></b>", $userdata);
|
||||
|
||||
$table->data[] = array("<b><a href=\"../course/index.php?edit=on\">".get_string("courses")."</a></b>",
|
||||
get_string("adminhelpcourses"));
|
||||
$table->data[] = array("<b><a href=\"users.php\">".get_string("users")."</a></b>",
|
||||
get_string("adminhelpusers"));
|
||||
$table->data[] = array("<b><a href=\"../theme/index.php\">".get_string("themes")."</a></b>",
|
||||
get_string("adminhelpthemes"));
|
||||
$table->data[] = array("<b><a href=\"lang.php\">".get_string("language")."</a></b>",
|
||||
get_string("adminhelplanguage"));
|
||||
$table->data[] = array("<b><a href=\"modules.php\">".get_string("managemodules")."</a></b>",
|
||||
get_string("adminhelpmanagemodules"));
|
||||
$table->data[] = array("<b><a href=\"../course/log.php?id=$site->id.php\">".get_string("logs")."</a></b>",
|
||||
get_string("adminhelplogs"));
|
||||
$table->data[] = array("<b><a href=\"../files/index.php?id=$site->id\">".get_string("sitefiles")."</a></b>",
|
||||
@@ -374,8 +400,6 @@
|
||||
get_string("adminhelpmanagedatabase"));
|
||||
}
|
||||
|
||||
$table->width = "90%";
|
||||
|
||||
print_table($table);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+3
-1
@@ -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",
|
||||
"<a href=\"index.php\">$stradministration</a> -> $navigation");
|
||||
"<a href=\"index.php\">$stradministration</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> $navigation");
|
||||
|
||||
if (!$mode) {
|
||||
print_heading("$strcurrentlanguage: $currentlang - ".get_string("thislanguage"));
|
||||
|
||||
+3
-1
@@ -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",
|
||||
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strmanagemodules");
|
||||
"<a href=\"index.php\">$stradministration</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> $strmanagemodules");
|
||||
|
||||
print_heading($strmanagemodules);
|
||||
|
||||
|
||||
+3
-1
@@ -85,6 +85,7 @@
|
||||
}
|
||||
|
||||
$stradmin = get_string("administration");
|
||||
$strconfiguration = get_string("configuration");
|
||||
$strsitesettings = get_string("sitesettings");
|
||||
|
||||
if ($firsttime) {
|
||||
@@ -94,7 +95,8 @@
|
||||
echo "<br />";
|
||||
} else {
|
||||
print_header("$site->shortname: $strsitesettings", "$site->fullname",
|
||||
"<A HREF=\"index.php\">$stradmin</A> -> $strsitesettings", "$focus");
|
||||
"<a href=\"index.php\">$stradmin</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> $strsitesettings", "$focus");
|
||||
print_heading($strsitesettings);
|
||||
}
|
||||
|
||||
|
||||
+17
-19
@@ -683,38 +683,36 @@ function print_admin_links ($siteid, $width=180) {
|
||||
global $CFG, $THEME;
|
||||
|
||||
if (empty($THEME->custompix)) {
|
||||
$icon = "<img src=\"$CFG->wwwroot/pix/i/admin.gif\" height=16 width=16 alt=\"\">";
|
||||
$pixpath = "$CFG->wwwroot/pix";
|
||||
} else {
|
||||
$icon = "<img src=\"$CFG->wwwroot/theme/$CFG->theme/pix/i/admin.gif\" height=16 width=16 alt=\"\">";
|
||||
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/config.php\">".get_string("configvariables")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/site.php\">".get_string("sitesettings")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/configure.php\">".get_string("configuration")."</a>...";
|
||||
$modicon[]="<img src=\"$pixpath/i/admin.gif\" height=16 width=16 alt=\"\" />";
|
||||
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/users.php\">".get_string("users")."</a>...";
|
||||
$modicon[]="<img src=\"$pixpath/i/users.gif\" height=16 width=16 alt=\"\" />";
|
||||
}
|
||||
|
||||
if (iscreator()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/index.php?edit=on\">".get_string("courses")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$modicon[]="<img src=\"$pixpath/i/course.gif\" height=16 width=16 alt=\"\" />";
|
||||
$fulladmin = "";
|
||||
}
|
||||
|
||||
if (isadmin()) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/users.php\">".get_string("users")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/theme/index.php\">".get_string("themes")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/lang.php\">".get_string("language")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/modules.php\">".get_string("managemodules")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/course/log.php?id=$siteid\">".get_string("logs")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$modicon[]="<img src=\"$pixpath/i/log.gif\" height=16 width=16 alt=\"\" />";
|
||||
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/files/index.php?id=$siteid\">".get_string("sitefiles")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$modicon[]="<img src=\"$pixpath/i/files.gif\" height=16 width=16 alt=\"\" />";
|
||||
|
||||
if (file_exists("$CFG->dirroot/$CFG->admin/$CFG->dbtype")) {
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".get_string("managedatabase")."</a>";
|
||||
$modicon[]=$icon;
|
||||
$moddata[]="<a href=\"$CFG->wwwroot/$CFG->admin/$CFG->dbtype/frame.php\">".
|
||||
get_string("managedatabase")."</a>";
|
||||
$modicon[]="<img src=\"$pixpath/i/settings.gif\" height=16 width=16 alt=\"\" />";
|
||||
}
|
||||
$fulladmin = "<p><a href=\"$CFG->wwwroot/$CFG->admin/\">".get_string("admin")."</a>...";
|
||||
}
|
||||
|
||||
+108
@@ -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 = "<font size=\"$table->fontsize\">";
|
||||
}
|
||||
|
||||
$output = "<table width=\"$table->width\" valign=top align=\"$table->tablealign\" ";
|
||||
$output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class\">\n";
|
||||
|
||||
if (!empty($table->head)) {
|
||||
$output .= "<tr>";
|
||||
foreach ($table->head as $key => $heading) {
|
||||
if (!isset($size[$key])) {
|
||||
$size[$key] = "";
|
||||
}
|
||||
if (!isset($align[$key])) {
|
||||
$align[$key] = "";
|
||||
}
|
||||
$output .= "<th valign=top ".$align[$key].$size[$key]." nowrap class=\"{$table->class}header\">$fontsize$heading</th>";
|
||||
}
|
||||
$output .= "</tr>\n";
|
||||
}
|
||||
|
||||
foreach ($table->data as $row) {
|
||||
$output .= "<tr valign=top>";
|
||||
foreach ($row as $key => $item) {
|
||||
if (!isset($size[$key])) {
|
||||
$size[$key] = "";
|
||||
}
|
||||
if (!isset($align[$key])) {
|
||||
$align[$key] = "";
|
||||
}
|
||||
if (!isset($wrap[$key])) {
|
||||
$wrap[$key] = "";
|
||||
}
|
||||
$output .= "<td ".$align[$key].$size[$key].$wrap[$key]." class=\"{$table->class}cell\">$fontsize$item</td>";
|
||||
}
|
||||
$output .= "</tr>\n";
|
||||
}
|
||||
$output .= "</table>\n";
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
function print_editing_switch($courseid) {
|
||||
global $CFG, $USER;
|
||||
|
||||
|
||||
+3
-1
@@ -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,
|
||||
"<a href=\"$CFG->wwwroot/$CFG->admin/index.php\">$stradministration</a> -> $strthemes");
|
||||
"<a href=\"$CFG->wwwroot/admin/index.php\">$stradministration</a> -> ".
|
||||
"<a href=\"$CFG->wwwroot/admin/configure.php\">$strconfiguration</a> -> $strthemes");
|
||||
|
||||
if ($choose) {
|
||||
if (set_config("theme", $choose)) {
|
||||
|
||||
Reference in New Issue
Block a user