From: tjhunt Date: Thu, 11 Dec 2008 09:08:20 +0000 (+0000) Subject: roles ui: Fix notices and XHTML strict. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a90d7cf93d109743074b0aa6884947d124a077b0;p=moodle.git roles ui: Fix notices and XHTML strict. --- diff --git a/admin/roles/lib.php b/admin/roles/lib.php index b2fccaedde..b4de6f2b67 100644 --- a/admin/roles/lib.php +++ b/admin/roles/lib.php @@ -109,7 +109,7 @@ abstract class capability_table_base { /// Table cell for the capability name. echo '' . get_capability_docs_link($capability) . - '' . $capability->name . ''; + '' . $capability->name . ''; /// Add the cells specific to this table. $this->add_row_cells($capability); @@ -466,7 +466,11 @@ class define_role_table_advanced extends capability_table_with_risks { $this->role->legacytype = get_legacy_type($this->roleid); $contextlevels = get_role_contextlevels($this->roleid); // Put the contextlevels in the array keys, as well as the values. - $this->contextlevels = array_combine($contextlevels, $contextlevels); + if (!empty($contextlevels)) { + $this->contextlevels = array_combine($contextlevels, $contextlevels); + } else { + $this->contextlevels = array(); + } } else { $this->role = new stdClass; $this->role->name = ''; @@ -646,7 +650,7 @@ class define_role_table_advanced extends capability_table_with_risks { $extraarguments .= 'checked="checked" '; } if (!$this->disabled) { - $output .= ''; + $output .= ''; } $output .= ' ';