mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merged roles gui changes from stable
This commit is contained in:
parent
e2a3a0e741
commit
82350116ba
4 changed files with 38 additions and 13 deletions
|
@ -53,7 +53,7 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
print_heading(get_string('permissions','role'));
|
print_heading_with_help(get_string('permissions','role'), 'permissions');
|
||||||
|
|
||||||
$strinherit = get_string('inherit','role');
|
$strinherit = get_string('inherit','role');
|
||||||
$strallow = get_string('allow','role');
|
$strallow = get_string('allow','role');
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
<th class="allow"><?php p($strallow); ?></th>
|
<th class="allow"><?php p($strallow); ?></th>
|
||||||
<th class="prevent"><?php p($strprevent); ?></th>
|
<th class="prevent"><?php p($strprevent); ?></th>
|
||||||
<th class="prohibit"><?php p($strprohibit); ?></th>
|
<th class="prohibit"><?php p($strprohibit); ?></th>
|
||||||
<th class="risk"><?php print_string('risks','role') ?></th>
|
<th class="risk" colspan="5"><?php print_string('risks','role') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -81,7 +81,7 @@ $component = '';
|
||||||
foreach ($capabilities as $capability) {
|
foreach ($capabilities as $capability) {
|
||||||
// prints a breaker if component or name or context level
|
// prints a breaker if component or name or context level
|
||||||
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
|
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
|
||||||
echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.
|
echo ('<tr class="rolecapheading header"><td colspan="10" class="header"><strong>'.
|
||||||
get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
|
get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,40 +100,48 @@ foreach ($capabilities as $capability) {
|
||||||
|
|
||||||
$disabled = ($action != 'edit') ? ' disabled="disabled" ' : '';
|
$disabled = ($action != 'edit') ? ' disabled="disabled" ' : '';
|
||||||
|
|
||||||
$riskinfo = '';
|
$strrisks = htmlentities(get_string('risks', 'role'));
|
||||||
|
$strcapabilities = htmlentities(get_string('capabilities', 'role'));
|
||||||
|
|
||||||
|
$riskinfo = '<td class="risk managetrust">';
|
||||||
$rowclasses = '';
|
$rowclasses = '';
|
||||||
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
|
if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
|
||||||
$riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
|
$riskinfo .= '<a target="docspopup" title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">T</a>';
|
||||||
$rowclasses .= ' riskmanagetrust';
|
$rowclasses .= ' riskmanagetrust';
|
||||||
}
|
}
|
||||||
|
$riskinfo .= '</td><td class="risk config">';
|
||||||
if (RISK_CONFIG & (int)$capability->riskbitmask) {
|
if (RISK_CONFIG & (int)$capability->riskbitmask) {
|
||||||
$riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
|
$riskinfo .= '<a target="docspopup" title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">C</a>';
|
||||||
$rowclasses .= ' riskconfig';
|
$rowclasses .= ' riskconfig';
|
||||||
}
|
}
|
||||||
|
$riskinfo .= '</td><td class="risk xss">';
|
||||||
if (RISK_XSS & (int)$capability->riskbitmask) {
|
if (RISK_XSS & (int)$capability->riskbitmask) {
|
||||||
$riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
|
$riskinfo .= '<a target="docspopup" title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">X</a>';
|
||||||
$rowclasses .= ' riskxss';
|
$rowclasses .= ' riskxss';
|
||||||
}
|
}
|
||||||
|
$riskinfo .= '</td><td class="risk personal">';
|
||||||
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
|
if (RISK_PERSONAL & (int)$capability->riskbitmask) {
|
||||||
$riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
|
$riskinfo .= '<a target="docspopup" title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">P</a>';
|
||||||
$rowclasses .= ' riskpersonal';
|
$rowclasses .= ' riskpersonal';
|
||||||
}
|
}
|
||||||
|
$riskinfo .= '</td><td class="risk spam">';
|
||||||
if (RISK_SPAM & (int)$capability->riskbitmask) {
|
if (RISK_SPAM & (int)$capability->riskbitmask) {
|
||||||
$riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
|
$riskinfo .= '<a target="docspopup" title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/'.$strrisks.'">S</a>';
|
||||||
$rowclasses .= ' riskspam';
|
$rowclasses .= ' riskspam';
|
||||||
}
|
}
|
||||||
|
$riskinfo .= '</td>';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr class="rolecap <?php echo $rowclasses; ?>">
|
<tr class="rolecap <?php echo $rowclasses; ?>">
|
||||||
<td class="name"><span title="<?php echo $capability->name ?>"><?php echo get_capability_string($capability->name); ?></span></td>
|
<td class="name"><span class="cap-desc"><a target="docspopup" href="<?php echo $CFG->docroot.'/'.$lang.'/'.$strcapabilities.'/'.$capability->name ?>"><?php echo get_capability_string($capability->name); ?></a><span class="cap-name"><?php echo $capability->name ?></span></label></td>
|
||||||
<td class="inherit"><input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
<td class="inherit"><input type="radio" title="<?php p($strinherit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_INHERIT ?>" <?php if (!isset($localoverride->permission) || $localoverride->permission==CAP_INHERIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||||
<td class="allow"><input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
<td class="allow"><input type="radio" title="<?php p($strallow); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_ALLOW ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_ALLOW){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||||
<td class="prevent" ><input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
<td class="prevent" ><input type="radio" title="<?php p($strprevent); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PREVENT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PREVENT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||||
<td class="prohibit" ><input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
<td class="prohibit" ><input type="radio" title="<?php p($strprohibit); ?>" name="<?php echo $capability->name; ?>" value="<?php echo CAP_PROHIBIT ?>" <?php if (isset($localoverride->permission) && $localoverride->permission==CAP_PROHIBIT){ echo 'checked="checked"'; }?> <?php echo $disabled; ?>/></td>
|
||||||
<td class="risk"><?php
|
|
||||||
echo $riskinfo;
|
<?php echo $riskinfo; ?>
|
||||||
?></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
|
@ -976,3 +976,12 @@ body#mod-quiz-report table#attempts .r1 {
|
||||||
background-color:#FFFFFF;
|
background-color:#FFFFFF;
|
||||||
border: 1px solid #cecece;
|
border: 1px solid #cecece;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#admin-roles-manage .rolecap {
|
||||||
|
border:none;
|
||||||
|
border-bottom:1px solid;
|
||||||
|
border-bottom-color: #cecece;
|
||||||
|
}
|
||||||
|
#admin-roles-manage .rolecap .cap-desc .cap-name {
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
|
@ -227,6 +227,10 @@ body#admin-index .copyright {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#admin-roles-manage .rolecap .cap-desc .cap-name {
|
||||||
|
font-size: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
#adminsettings .form-shortname {
|
#adminsettings .form-shortname {
|
||||||
font-size: 75%;
|
font-size: 75%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,6 +549,10 @@ body#admin-roles-manage table.generalbox {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#admin-roles-manage .rolecap .cap-desc .cap-name {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
#adminsettings fieldset {
|
#adminsettings fieldset {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
padding: 1em 0.5em;
|
padding: 1em 0.5em;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue