Skip to content

Commit

Permalink
MDL-36554 Admin settings: make tables class consistent throughout adm…
Browse files Browse the repository at this point in the history
…in settings
  • Loading branch information
Rossiani Wijaya committed Jan 14, 2013
1 parent ca48fe5 commit 6fc61f2
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 48 deletions.
14 changes: 6 additions & 8 deletions admin/renderer.php
Expand Up @@ -1245,10 +1245,9 @@ public function environment_check_table($result, $environment_results) {
get_string('report'),
get_string('status'),
);
$servertable->align = array('center', 'center', 'left', 'center');
$servertable->wrap = array('nowrap', '', '', 'nowrap');
$servertable->size = array('10', 10, '100%', '10');
$servertable->attributes['class'] = 'environmenttable generaltable';
$servertable->colclasses = array('centeralign name', 'centeralign status', 'leftalign report', 'centeralign info');
$servertable->attributes['class'] = 'admintable environmenttable generaltable';
$servertable->id = 'serverstatus';

$serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());

Expand All @@ -1258,10 +1257,9 @@ public function environment_check_table($result, $environment_results) {
get_string('report'),
get_string('status'),
);
$othertable->align = array('center', 'left', 'center');
$othertable->wrap = array('', '', 'nowrap');
$othertable->size = array(10, '100%', '10');
$othertable->attributes['class'] = 'environmenttable generaltable';
$othertable->colclasses = array('aligncenter info', 'alignleft report', 'aligncenter status');
$othertable->attributes['class'] = 'admintable environmenttable generaltable';
$othertable->id = 'otherserverstatus';

$otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());

Expand Down
12 changes: 5 additions & 7 deletions admin/roles/assign.php
Expand Up @@ -189,7 +189,7 @@
<form id="assignform" method="post" action="<?php echo $assignurl ?>"><div>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />

<table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
<table id="assigningrole" summary="" class="admintable roleassigntable generaltable" cellspacing="0">
<tr>
<td id="existingcell">
<p><label for="removeselect"><?php print_string('extusers', 'role'); ?></label></p>
Expand Down Expand Up @@ -278,15 +278,13 @@

// Print overview table
$table = new html_table();
$table->tablealign = 'center';
$table->width = '60%';
$table->id = 'assignrole';
$table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'role'));
$table->wrap = array('nowrap', '', 'nowrap');
$table->align = array('left', 'left', 'center');
$table->colclasses = array('leftalign role', 'leftalign', 'centeralign userrole');
$table->attributes['class'] = 'admintable generaltable';
if ($showroleholders) {
$table->headspan = array(1, 1, 2);
$table->wrap[] = 'nowrap';
$table->align[] = 'left';
$table->colclasses[] = 'leftalign roleholder';
}

foreach ($assignableroles as $roleid => $rolename) {
Expand Down
7 changes: 3 additions & 4 deletions admin/roles/manage.php
Expand Up @@ -186,10 +186,9 @@

/// Initialise table.
$table = new html_table();
$table->tablealign = 'center';
$table->align = array('left', 'left', 'left', 'left');
$table->wrap = array('nowrap', '', 'nowrap','nowrap');
$table->width = '90%';
$table->colclasses = array('leftalign', 'leftalign', 'leftalign', 'leftalign');
$table->id = 'roles';
$table->attributes['class'] = 'admintable generaltable';
$table->head = array(
get_string('role') . ' ' . $OUTPUT->help_icon('roles', 'role'),
get_string('description'),
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/xmldb/actions/main_view/main_view.class.php
Expand Up @@ -120,7 +120,7 @@ function invoke() {
$result = $this->launch('get_db_directories');
// Display list of DB directories if everything is ok
if ($result && !empty($XMLDB->dbdirs)) {
$o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
$o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="admintable generaltable">';
$row = 0;
foreach ($XMLDB->dbdirs as $key => $dbdir) {
// Detect if this is the lastused dir
Expand Down
19 changes: 10 additions & 9 deletions admin/user.php
Expand Up @@ -256,25 +256,26 @@

$table = new html_table();
$table->head = array ();
$table->align = array();
$table->colclasses = array();
$table->head[] = $fullnamedisplay;
$table->align[] = 'left';
$table->attributes['class'] = 'admintable generaltable';
$table->colclasses[] = 'leftalign';
foreach ($extracolumns as $field) {
$table->head[] = ${$field};
$table->align[] = 'left';
$table->colclasses[] = 'leftalign';
}
$table->head[] = $city;
$table->align[] = 'left';
$table->colclasses[] = 'leftalign';
$table->head[] = $country;
$table->align[] = 'left';
$table->colclasses[] = 'leftalign';
$table->head[] = $lastaccess;
$table->align[] = 'left';
$table->colclasses[] = 'leftalign';
$table->head[] = get_string('edit');
$table->align[] = 'center';
$table->colclasses[] = 'centeralign';
$table->head[] = "";
$table->align[] = 'center';
$table->colclasses[] = 'centeralign';

$table->width = "95%";
$table->id = "users";
foreach ($users as $user) {
if (isguestuser($user)) {
continue; // do not display guest here
Expand Down
6 changes: 3 additions & 3 deletions cohort/index.php
Expand Up @@ -134,9 +134,9 @@
$table = new html_table();
$table->head = array(get_string('name', 'cohort'), get_string('idnumber', 'cohort'), get_string('description', 'cohort'),
get_string('memberscount', 'cohort'), get_string('component', 'cohort'), get_string('edit'));
$table->size = array('20%', '10%', '40%', '10%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'left','center', 'center');
$table->width = '80%';
$table->colclasses = array('leftalign name', 'leftalign id', 'leftalign description', 'leftalign size','centeralign source', 'centeralign action');
$table->id = 'cohorts';
$table->attributes['class'] = 'admintable generaltable';
$table->data = $data;
echo html_writer::table($table);
echo $OUTPUT->paging_bar($cohorts['totalcohorts'], $page, 25, $baseurl);
Expand Down
5 changes: 3 additions & 2 deletions comment/locallib.php
Expand Up @@ -160,8 +160,9 @@ public function print_comments($page = 0) {
get_string('content'),
get_string('action')
);
$table->align = array ('left', 'left', 'left', 'left');
$table->attributes = array('class'=>'generaltable commentstable');
$table->colclasses = array ('leftalign', 'leftalign', 'leftalign', 'leftalign');
$table->attributes = array('class'=>'admintable generaltable');
$table->id = 'commentstable';
$table->data = array();

$link = new moodle_url('/comment/index.php', array('action' => 'delete', 'sesskey' => sesskey()));
Expand Down
10 changes: 5 additions & 5 deletions course/index.php
Expand Up @@ -254,7 +254,7 @@
$displaylist[0] = get_string('top');
make_categories_list($displaylist, $parentlist);

echo '<table class="generaltable editcourse boxaligncenter"><tr class="header">';
echo '<table id="coursecategories" class="admintable generaltable editcourse"><tr class="header">';
echo '<th class="header" scope="col">'.$strcategories.'</th>';
echo '<th class="header" scope="col">'.$strcourses.'</th>';
echo '<th class="header" scope="col">'.$stredit.'</th>';
Expand Down Expand Up @@ -309,7 +309,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
$category->context = context_coursecat::instance($category->id);
}

echo '<tr><td align="left" class="name">';
echo '<tr><td class="leftalign name">';
for ($i=0; $i<$depth;$i++) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
}
Expand All @@ -319,9 +319,9 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
format_string($category->name, true, array('context' => $category->context)).'</a>';
echo '</td>';

echo '<td class="count">'.$category->coursecount.'</td>';
echo '<td class="centeralign count">'.$category->coursecount.'</td>';

echo '<td class="icons">'; /// Print little icons
echo '<td class="centeralign icons">'; /// Print little icons

if (has_capability('moodle/category:manage', $category->context)) {
echo '<a title="'.$str->edit.'" href="editcategory.php?id='.$category->id.'"><img'.
Expand Down Expand Up @@ -358,7 +358,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
}
echo '</td>';

echo '<td align="left">';
echo '<td class="leftalign">';
if (has_capability('moodle/category:manage', $category->context)) {
$tempdisplaylist = $displaylist;
unset($tempdisplaylist[$category->id]);
Expand Down
6 changes: 3 additions & 3 deletions report/configlog/index.php
Expand Up @@ -92,9 +92,9 @@

$table = new html_table();
$table->head = array($hcolumns['timemodified'], $fullnamedisplay, $hcolumns['plugin'], $hcolumns['name'], $hcolumns['value'], $hcolumns['oldvalue']);
$table->align = array('left', 'left', 'left', 'left', 'left', 'left');
$table->size = array('30%', '10%', '10%', '10%', '20%', '20%');
$table->width = '95%';
$table->colclasses = array('leftalign date', 'leftalign name', 'leftalign plugin', 'leftalign setting', 'leftalign newvalue', 'leftalign originalvalue');
$table->id = 'configchanges';
$table->attributes['class'] = 'admintable generaltable';
$table->data = array();

if ($sort == 'firstname' or $sort == 'lastname') {
Expand Down
12 changes: 6 additions & 6 deletions report/security/index.php
Expand Up @@ -76,9 +76,9 @@

$table = new html_table();
$table->head = array($strissue, $strstatus, $strdesc, $strconfig);
$table->size = array('30%', '10%', '50%', '10%' );
$table->align = array('left', 'left', 'left', 'left');
$table->attributes = array('class'=>'scurityreporttable generaltable');
$table->rowclasses = array('leftalign issue', 'leftalign status', 'leftalign desc', 'leftalign config');
$table->attributes = array('class'=>'admintable securityreport generaltable');
$table->id = 'securityissuereporttable';
$table->data = array();

// print detail of one issue only
Expand All @@ -103,9 +103,9 @@

$table = new html_table();
$table->head = array($strissue, $strstatus, $strdesc);
$table->size = array('30%', '10%', '60%' );
$table->align = array('left', 'left', 'left');
$table->attributes = array('class'=>'scurityreporttable generaltable');
$table->colclasses = array('leftalign issue', 'leftalign status', 'leftalign desc');
$table->attributes = array('class'=>'admintable securityreport generaltable');
$table->id = 'securityreporttable';
$table->data = array();

foreach ($issues as $issue) {
Expand Down

0 comments on commit 6fc61f2

Please sign in to comment.