MDL-15860 - add global portfolio enabled switch
[moodle.git] / lib / portfoliolib.php
index 87ecce9..84863c1 100644 (file)
@@ -141,6 +141,10 @@ function portfolio_add_button($callbackclass, $callbackargs, $callbackfile=null,
 
     global $SESSION, $CFG, $COURSE, $USER;
 
+    if (empty($CFG->portfolioenabled)) {
+        return;
+    }
+
     if (!$instances = portfolio_instances()) {
         return;
     }