Skip to content

Commit

Permalink
MDL-15860 - add global portfolio enabled switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mjollnir_ committed Jul 29, 2008
1 parent a5a6351 commit a239f01
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions lang/en_utf8/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$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';
Expand Down
4 changes: 4 additions & 0 deletions lib/portfoliolib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions portfolio/add.php
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 5 additions & 0 deletions user/portfolio.php
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion user/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit a239f01

Please sign in to comment.