mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
Merge branch 'wip-MDL-51357-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
commit
5c6c4a986a
@ -163,9 +163,8 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
||||
protected abstract function add_permission_cells($capability);
|
||||
|
||||
protected function add_row_cells($capability) {
|
||||
$this->add_permission_cells($capability);
|
||||
$cells = $this->add_permission_cells($capability);
|
||||
// One cell for each possible risk.
|
||||
$cells = '';
|
||||
foreach ($this->allrisks as $riskname => $risk) {
|
||||
$cells .= '<td class="risk ' . str_replace('risk', '', $riskname) . '">';
|
||||
if ($risk & (int)$capability->riskbitmask) {
|
||||
|
@ -628,6 +628,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
|
||||
protected function add_permission_cells($capability) {
|
||||
// One cell for each possible permission.
|
||||
$content = '';
|
||||
foreach ($this->displaypermissions as $perm => $permname) {
|
||||
$strperm = $this->strperms[$permname];
|
||||
$extraclass = '';
|
||||
@ -638,11 +639,12 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
if ($this->permissions[$capability->name] == $perm) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
echo '<td class="' . $permname . $extraclass . '">';
|
||||
echo '<label><input type="radio" name="' . $capability->name .
|
||||
$content .= '<td class="' . $permname . $extraclass . '">';
|
||||
$content .= '<label><input type="radio" name="' . $capability->name .
|
||||
'" value="' . $perm . '" ' . $checked . '/> ';
|
||||
echo '<span class="note">' . $strperm . '</span>';
|
||||
echo '</label></td>';
|
||||
$content .= '<span class="note">' . $strperm . '</span>';
|
||||
$content .= '</label></td>';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
@ -45,19 +45,20 @@ class core_role_define_role_table_basic extends core_role_define_role_table_adva
|
||||
$perm = $this->permissions[$capability->name];
|
||||
$permname = $this->allpermissions[$perm];
|
||||
$defaultperm = $this->allpermissions[$this->parentpermissions[$capability->name]];
|
||||
echo '<td class="' . $permname . '">';
|
||||
$content = '<td class="' . $permname . '">';
|
||||
if ($perm == CAP_ALLOW || $perm == CAP_INHERIT) {
|
||||
$checked = '';
|
||||
if ($perm == CAP_ALLOW) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
echo '<input type="hidden" name="' . $capability->name . '" value="' . CAP_INHERIT . '" />';
|
||||
echo '<label><input type="checkbox" name="' . $capability->name .
|
||||
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . CAP_INHERIT . '" />';
|
||||
$content .= '<label><input type="checkbox" name="' . $capability->name .
|
||||
'" value="' . CAP_ALLOW . '" ' . $checked . '/> ' . $this->strallow . '</label>';
|
||||
} else {
|
||||
echo '<input type="hidden" name="' . $capability->name . '" value="' . $perm . '" />';
|
||||
echo $this->strperms[$permname] . '<span class="note">' . $this->stradvmessage . '</span>';
|
||||
$content .= '<input type="hidden" name="' . $capability->name . '" value="' . $perm . '" />';
|
||||
$content .= $this->strperms[$permname] . '<span class="note">' . $this->stradvmessage . '</span>';
|
||||
}
|
||||
echo '</td>';
|
||||
$content .= '</td>';
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
|
||||
// One cell for each possible permission.
|
||||
$content = '';
|
||||
foreach ($this->displaypermissions as $perm => $permname) {
|
||||
$strperm = $this->strperms[$permname];
|
||||
$extraclass = '';
|
||||
@ -83,8 +84,8 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
if ($this->permissions[$capability->name] == $perm) {
|
||||
$checked = 'checked="checked" ';
|
||||
}
|
||||
echo '<td class="' . $permname . $extraclass . '">';
|
||||
echo '<label><input type="radio" name="' . $capability->name .
|
||||
$content .= '<td class="' . $permname . $extraclass . '">';
|
||||
$content .= '<label><input type="radio" name="' . $capability->name .
|
||||
'" value="' . $perm . '" ' . $checked . $disabled . '/> ';
|
||||
if ($perm == CAP_INHERIT) {
|
||||
$inherited = $this->parentpermissions[$capability->name];
|
||||
@ -95,8 +96,9 @@ class core_role_override_permissions_table_advanced extends core_role_capability
|
||||
}
|
||||
$strperm .= ' (' . $inherited . ')';
|
||||
}
|
||||
echo '<span class="note">' . $strperm . '</span>';
|
||||
echo '</label></td>';
|
||||
$content .= '<span class="note">' . $strperm . '</span>';
|
||||
$content .= '</label></td>';
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ class core_role_view_role_definition_table extends core_role_define_role_table_a
|
||||
} else {
|
||||
$default = " ";
|
||||
}
|
||||
echo '<td class="' . $permname . '">' . $this->strperms[$permname] . '<span class="note">' .
|
||||
return '<td class="' . $permname . '">' . $this->strperms[$permname] . '<span class="note">' .
|
||||
$default . '</span></td>';
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user