]> git.mjollnir.org Git - moodle.git/commitdiff
Added capability for showing documentation links
authormoodler <moodler>
Sun, 3 Sep 2006 16:26:55 +0000 (16:26 +0000)
committermoodler <moodler>
Sun, 3 Sep 2006 16:26:55 +0000 (16:26 +0000)
lib/db/access.php
lib/weblib.php
version.php

index a533ec284723c4885ed7146d5fc5f43a0bcbcd09..d29e889f6594055e8f99457002433b3d323a0fd7 100644 (file)
@@ -753,6 +753,19 @@ $moodle_capabilities = array(
             'coursecreator' => CAP_ALLOW,
             'admin' => CAP_ALLOW
         )
+    ),
+
+    'moodle/site:doclinks' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'guest' => CAP_PREVENT,
+            'student' => CAP_PREVENT,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'coursecreator' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
     )
 );
 
index a568ac1796bef0a0a13ef65c60e73cefe8c58935..273d1426a4fd45dc86bb4d8d912d96d170602394 100644 (file)
@@ -5178,7 +5178,7 @@ function print_tabs($tabrows, $selected=NULL, $inactive=NULL, $activetwo=NULL, $
 function page_doc_link($text='', $iconpath='') {
     global $ME, $CFG;
 
-    if (empty($CFG->docroot) || !isteacherinanycourse()) {
+    if (empty($CFG->docroot) || !has_capability('moodle/site:doclinks')) {
         return '';
     }
 
@@ -5213,4 +5213,4 @@ function page_doc_link($text='', $iconpath='') {
 
 
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
\ No newline at end of file
+?>
index 9f6bce77a17ed4a02b9de15f6a5bf863fd94613b..e913367aa081ac1df40474205be6707b8a37e84b 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-   $version = 2006090200;  // YYYYMMDD = date
+   $version = 2006090300;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.7 dev';    // Human-friendly version name