mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-15860 - add global portfolio enabled switch
This commit is contained in:
parent
a5a63515e3
commit
a239f01e57
@ -13,6 +13,7 @@ $string['confirmsummary'] = 'Summary of your export';
|
||||
$string['configure'] = 'Configure';
|
||||
$string['continuetoportfolio'] = 'Continue to your portfolio';
|
||||
$string['deleteportfolio'] = 'Delete portfolio instance';
|
||||
$string['disabled'] = 'Sorry, but portfolio exports are not enabled in this site';
|
||||
$string['dontwait'] = 'Don\'t wait';
|
||||
$string['err_uniquename'] = 'Portfolio name must be unique (per plugin)';
|
||||
$string['enabled'] = 'Enable portfolios';
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
<?php
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
|
||||
if (empty($CFG->portfolioenabled)) {
|
||||
print_error('disabled', 'portfolio');
|
||||
}
|
||||
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
|
||||
$exporter = null;
|
||||
|
@ -1,6 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/config.php');
|
||||
|
||||
if (empty($CFG->portfolioenabled)) {
|
||||
print_error('disabled', 'portfolio');
|
||||
}
|
||||
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
|
||||
$config = optional_param('config', 0, PARAM_INT);
|
||||
|
@ -239,7 +239,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($userindexpage) && $user->id == $USER->id) {
|
||||
if (empty($userindexpage) && $user->id == $USER->id && !empty($CFG->portfolioenabled)) {
|
||||
|
||||
/// Portfolio tab
|
||||
require_once($CFG->libdir . '/portfoliolib.php');
|
||||
|
Loading…
x
Reference in New Issue
Block a user