-<form action="override.php" method="post">
+<form name="overrideform" action="override.php" method="post">
<input type="hidden" name="contextid" value="<?php p($contextid) ?>">
<input type="hidden" name="roleid" value="<?php p($roleid) ?>">
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="userid" value="<?php p($userid) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
- <table class="override">
+
+ <table class="rolecap">
<tr>
- <td><?php print_string('capability','role') ?></td>
- <td><?php print_string('inherit','role') ?></td>
- <td><?php print_string('allow','role') ?></td>
- <td><?php print_string('prevent','role') ?></td>
- <td><?php print_string('prohibit','role') ?></td>
- <td><?php print_string('risks','role') ?></td>
+ <th class="name" align="left"><?php print_string('capability','role') ?></th>
+ <th class="inherit"><?php print_string('inherit','role') ?></th>
+ <th class="allow"><?php print_string('allow','role') ?></th>
+ <th class="prevent"><?php print_string('prevent','role') ?></th>
+ <th class="prohibit"><?php print_string('prohibit','role') ?></th>
+ <th class="risk"><?php print_string('risks','role') ?></th>
</tr>
<?php
foreach ($capabilities as $capability) {
// prints a breaker if component or name or context level
if ($capability->component != $component or $capability->contextlevel != $contextlevel) {
- echo ('<tr><td colspan="5"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
+ echo ('<tr class="rolecapheading header"><td colspan="6" class="header"><strong>'.get_component_string($capability->component, $capability->contextlevel).'</strong></td></tr>');
}
// these 2 are used to see to group same mod/core capabilities together
$isdisabled = $isprohibit || islegacy($capability->name);
+ $riskinfo = '';
+ $rowclasses = '';
+ if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
+ $riskinfo .= '<a title="'.get_string('riskmanagetrust', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">T</a>';
+ $rowclasses .= ' riskmanagetrust';
+ }
+ if (RISK_CONFIG & (int)$capability->riskbitmask) {
+ $riskinfo .= '<a title="'.get_string('riskconfig', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">C</a>';
+ $rowclasses .= ' riskconfig';
+ }
+ if (RISK_XSS & (int)$capability->riskbitmask) {
+ $riskinfo .= '<a title="'.get_string('riskxss', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">X</a>';
+ $rowclasses .= ' riskxss';
+ }
+ if (RISK_PERSONAL & (int)$capability->riskbitmask) {
+ $riskinfo .= '<a title="'.get_string('riskpersonal', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">P</a>';
+ $rowclasses .= ' riskpersonal';
+ }
+ if (RISK_SPAM & (int)$capability->riskbitmask) {
+ $riskinfo .= '<a title="'.get_string('riskspam', 'admin').'" href="'.$CFG->docroot.'/'.$lang.'/Risks">S</a>';
+ $rowclasses .= ' riskspam';
+ }
+
+
?>
- <tr>
- <td><?php echo get_capability_string($capability->name); ?></td>
+ <tr class="rolecap <?php echo $rowclasses; ?>">
+ <td class="name"><?php echo get_capability_string($capability->name); ?></td>
- <td align="center">
+ <td class="inherit">
<input type="radio" name="<?php echo $capability->name; ?>" value="0"
<?php
if ($localpermission == CAP_INHERIT) {echo 'checked="checked"';}
if ($isdisabled) {echo 'disabled="disabled"';}?> />
</td>
- <td align="center" <?php if ($isallow) {echo 'class="capcurrent"';} ?>>
+ <td class="inherit <?php if ($isallow) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_ALLOW.'"';
if ($localpermission == CAP_ALLOW) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
- <td align="center" <?php if ($isprevent) {echo 'class="capcurrent"';} ?>>
+ <td class="prevent <?php if ($isprevent) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_PREVENT.'"';
if ($localpermission == CAP_PREVENT) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
- <td align="center" <?php if ($isprohibit) {echo 'class="capcurrent"';} ?>>
+ <td class="prohibit <?php if ($isprohibit) {echo ' capcurrent';} ?>">
<input type="radio" name="<?php echo $capability->name; ?>"
<?php echo ' value="'.CAP_PROHIBIT.'"';
if ($localpermission == CAP_PROHIBIT) {echo ' checked="checked"';}
if ($isdisabled) {echo ' disabled="disabled"';}?> />
</td>
- <td><?php
- if (RISK_MANAGETRUST & (int)$capability->riskbitmask) {
- echo "T";
- }
- if (RISK_CONFIG & (int)$capability->riskbitmask) {
- echo "C";
- }
- if (RISK_XSS & (int)$capability->riskbitmask) {
- echo "X";
- }
- if (RISK_PERSONAL & (int)$capability->riskbitmask) {
- echo "P";
- }
- if (RISK_SPAM & (int)$capability->riskbitmask) {
- echo "S";
- }
- ?></td>
+ <td class="risk"><?php echo $riskinfo; ?></td>
</tr>
<?php } ?>