admin modules tables styling. Points 1 & 2. MDL-8419

Backporting from HEAD.
This commit is contained in:
stronk7
2007-02-22 17:55:46 +00:00
parent d0afc97d3e
commit a081748db4
5 changed files with 69 additions and 45 deletions
+3 -7
View File
@@ -165,11 +165,8 @@
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'multiple', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strmultiple, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'generaltable generalbox');
$table->set_attribute('class', 'flexible generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
foreach ($blockbyname as $blockname => $blockid) {
@@ -216,7 +213,7 @@
$table->add_data(array(
'<span'.$class.'>'.$blockobject->get_title().'</span>',
$blocklist,
$blockobject->get_version(),
'<span'.$class.'>'.$blockobject->get_version().'</span>',
$visible,
$multiple,
$delete,
@@ -235,9 +232,8 @@
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'incompatible');
$table->set_attribute('class', 'generaltable generalbox');
$table->set_attribute('class', 'flexible generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
+2 -7
View File
@@ -182,15 +182,10 @@
// construct the flexible table ready to display
$table = new flexible_table(FILTER_TABLE);
$table->define_columns(array('name', 'hideshow', 'order', 'settings'));
$table->column_style('hideshow', 'text-align', 'center');
$table->column_style('order', 'text-align', 'center');
$table->column_style('settings', 'text-align', 'center');
$table->define_headers(array($txt->name, $txt->hideshow, $txt->updown, $txt->settings));
$table->define_baseurl("$CFG->wwwroot/$CFG->admin/filters.php");
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'flexible generaltable generalbox');
$table->set_attribute('style', 'margin:auto;');
$table->set_attribute('cellpadding', '5');
$table->set_attribute('id', 'filters');
$table->set_attribute('class', 'flexible generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
// iterate through filters adding to display table
+26 -12
View File
@@ -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,14 @@
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->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'flexible generaltable generalbox boxaligncenter boxwidthwide');
$table->setup();
foreach ($modulebyname as $modulename => $module) {
@@ -186,18 +193,25 @@
} else {
$visible = "<a href=\"modules.php?show=$module->name&amp;sesskey=$USER->sesskey\" title=\"$strshow\">".
"<img src=\"$CFG->pixpath/i/show.gif\" class=\"icon\" alt=\"$strshow\" /></a>";
$class = "class=\"dimmed_text\"";
$class = " class=\"dimmed_text\"";
}
if ($module->name == "forum") {
$delete = "";
$visible = "";
$class = "";
}
$table->data[] = array ("<span $class>$icon $modulename</span>", $countlink, $module->version, $visible, $delete, $settings);
}
print_table($table);
echo "<br /><br />";
$table->add_data(array(
'<span'.$class.'>'.$icon.' '.$modulename.'</span>',
$countlink,
'<span'.$class.'>'.$module->version.'</span>',
$visible,
$delete,
$settings
));
}
$table->print_html();
admin_externalpage_print_footer($adminroot);
+5 -3
View File
@@ -528,10 +528,12 @@ class flexible_table {
}
else {
// took out nowrap for accessibility, might need replacement
if (!is_array($this->column_style[$column])) {
$usestyles = array('white-space:nowrap');
if (!is_array($this->column_style[$column])) {
// $usestyles = array('white-space:nowrap');
$usestyles = '';
} else {
$usestyles = $this->column_style[$column]+array('white-space'=>'nowrap');
// $usestyles = $this->column_style[$column]+array('white-space'=>'nowrap');
$usestyles = $this->column_style[$column];
}
echo '<th class="header c'.$index.$this->column_class[$column].'" '.$this->make_styles_string($usestyles).' scope="col">'.$this->headers[$index].$icon_sort.'<div class="commands">'.$icon_hide.'</div></th>';
}
+33 -16
View File
@@ -294,6 +294,11 @@ table.formtable tbody .htmlarea th
padding: 0;
}
.flexible th
{
white-space: nowrap;
}
.paging {
text-align: center;
margin: 10px 0 10px 0;
@@ -682,34 +687,46 @@ body#admin-index .c1 {
vertical-align: middle;
}
body#admin-modules table.generaltable td.cell,
body#admin-modules .generaltablecell {
body#admin-blocks table.generaltable th,
body#admin-filters table.generaltable th,
body#admin-modules table.generaltable th
{
white-space: nowrap;
}
body#admin-modules .generaltablecell
{
padding-top: 2px;
padding-bottom: 2px;
}
body#admin-blocks table#blocks,
body#admin-blocks table#incompatible {
width: 70%;
margin: auto;
}
body#admin-blocks table#blocks th,
body#admin-blocks table#incompatible th,
body#admin-blocks table#blocks td.cell,
body#admin-blocks table#incompatible td.cell {
body#admin-blocks table.generaltable th,
body#admin-blocks table.generaltable td.cell,
body#admin-filters table.generaltable th,
body#admin-filters table.generaltable td.cell,
body#admin-modules table.generaltable th,
body#admin-modules table.generaltable td.cell
{
padding: 4px;
text-align: center;
vertical-align: middle;
}
body#admin-blocks table#blocks td.c0,
body#admin-blocks table#blocks th.c0,
body#admin-blocks table#incompatible td.c0,
body#admin-blocks table#incompatible th.c0 {
body#admin-blocks table.generaltable th.c0,
body#admin-blocks table.generaltable td.c0,
body#admin-filters table.generaltable th.c0,
body#admin-filters table.generaltable td.c0,
body#admin-modules table.generaltable th.c0,
body#admin-modules table.generaltable td.c0
{
text-align: left;
}
body#admin-modules table.generaltable td.c0
{
white-space: nowrap;
}
#admin-blocks
#admin-config .confighelp {
display: block;