]> git.mjollnir.org Git - moodle.git/commitdiff
Some quick styles added to match manage.html MDL-6725
authormoodler <moodler>
Sun, 1 Oct 2006 10:15:50 +0000 (10:15 +0000)
committermoodler <moodler>
Sun, 1 Oct 2006 10:15:50 +0000 (10:15 +0000)
admin/roles/override.html
admin/roles/override.php

index 476d3f0acf0061d69799c7a74a485ed8b5f549ca..0e91401affe925d823d894ab8c17c61a487f4091 100755 (executable)
@@ -1,17 +1,18 @@
-<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
 
@@ -22,7 +23,7 @@
         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 } ?>
index a5ebc4f7a4a3ee460b2a211bceafc3e657728683..b7ae73352345f2242f40b40f5a920e6b789c09bf 100755 (executable)
         $localoverrides = get_records_select('role_capabilities', "roleid = $roleid AND contextid = $context->id",
                                              '', 'capability, permission, id');
 
+        $lang = str_replace('_utf8', '', current_language());
+
         // Get the capabilities overrideable in this context
         if ($capabilities = fetch_context_capabilities($context)) {
             print_simple_box_start('center');