From 778951f8997ccdf6f836b5727ffe63b9f5828229 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 21 Feb 2007 17:09:58 +0000 Subject: [PATCH] First cut of modules admin page re-styling. MDL-8419 --- admin/modules.php | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/admin/modules.php b/admin/modules.php index 04097c599f..7fe5a23c12 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -2,10 +2,15 @@ // Allows the admin to manage activity modules require_once('../config.php'); + require_once('../course/lib.php'); require_once($CFG->libdir.'/adminlib.php'); + require_once($CFG->libdir.'/tablelib.php'); + + // defines + define('MODULE_TABLE','module_administration_table'); + $adminroot = admin_get_root(); admin_externalpage_setup('managemodules', $adminroot); - require_once('../course/lib.php'); $show = optional_param('show', '', PARAM_SAFEDIR); $hide = optional_param('hide', '', PARAM_SAFEDIR); @@ -150,12 +155,20 @@ ksort($modulebyname); /// Print the table of all modules - - $table->head = array ($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings); - $table->align = array ("left", "right", "left", "center", "center", "center"); - $table->wrap = array ("nowrap", "", "", "", "",""); - $table->size = array ("100%", "10", "10", "10", "10","12"); - $table->width = "100"; + // construct the flexible table ready to display + $table = new flexible_table(MODULE_TABLE); + $table->define_columns(array('name', 'instances', 'version', 'hideshow', 'delete', 'settings')); + $table->column_style('instances', 'text-align', 'center'); + $table->column_style('version', 'text-align', 'center'); + $table->column_style('hideshow', 'text-align', 'center'); + $table->column_style('delete', 'text-align', 'center'); + $table->column_style('settings', 'text-align', 'center'); + $table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings)); + $table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php'); + $table->set_attribute('class', 'flexible generaltable generalbox'); + $table->set_attribute('style', 'margin:auto;'); + $table->set_attribute('cellpadding', '5'); + $table->setup(); foreach ($modulebyname as $modulename => $module) { @@ -186,18 +199,25 @@ } else { $visible = "name&sesskey=$USER->sesskey\" title=\"$strshow\">". "pixpath/i/show.gif\" class=\"icon\" alt=\"$strshow\" />"; - $class = "class=\"dimmed_text\""; + $class = " class=\"dimmed_text\""; } if ($module->name == "forum") { $delete = ""; $visible = ""; $class = ""; } - $table->data[] = array ("$icon $modulename", $countlink, $module->version, $visible, $delete, $settings); + + $table->add_data(array( + ''.$icon.' '.$modulename.'', + $countlink, + ''.$module->version.'', + $visible, + $delete, + $settings + )); } - print_table($table); - echo "

"; + $table->print_html(); admin_externalpage_print_footer($adminroot); -- 2.39.5