From c5b149f89bcbc5cde6728dd10e1e1ce29003018e Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Sat, 1 May 2010 14:40:50 +0000 Subject: [PATCH] portfolio MDL-22264 add leap2a option for the mahara plugin --- portfolio/mahara/lang/en/portfolio_mahara.php | 1 + portfolio/mahara/lib.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/portfolio/mahara/lang/en/portfolio_mahara.php b/portfolio/mahara/lang/en/portfolio_mahara.php index 668032589be..30cb518baf1 100644 --- a/portfolio/mahara/lang/en/portfolio_mahara.php +++ b/portfolio/mahara/lang/en/portfolio_mahara.php @@ -23,6 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['enableleap2a'] = 'Enable Leap2a Portfolio support (requires Mahara 1.3)'; $string['err_invalidhost'] = 'This plugin is misconfigured to point to an invalid (or deleted) mnet host. This plugin relies on Moodle Networking peers with SSO IDP published, SSO_SP subscribed, and portfolio subscribed and published.'; $string['err_networkingoff'] = 'Moodle Networking is off entirely. Please enable it before trying to configure this pugin. Any instances of this plugin have been set to not visible until this is fixed - you will need to set them to visible again manully. They cannot be used until this happens'; $string['err_nomnetauth'] = 'The mnet authentication plugin is disabled, but is required for this service'; diff --git a/portfolio/mahara/lib.php b/portfolio/mahara/lib.php index de1b9a2e4b5..8f70a211af7 100644 --- a/portfolio/mahara/lib.php +++ b/portfolio/mahara/lib.php @@ -63,11 +63,14 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { } public static function get_allowed_config() { - return array('mnethostid'); + return array('mnethostid', 'enableleap2a'); } public function supported_formats() { - return array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_LEAP2A); + if ($this->get_config('enableleap2a')) { + return array(PORTFOLIO_FORMAT_FILE, PORTFOLIO_FORMAT_LEAP2A); + } + return array(PORTFOLIO_FORMAT_FILE); } public function expected_time($callertime) { @@ -89,6 +92,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { } $mform->addElement('select', 'mnethostid', get_string('mnethost', 'portfolio_mahara'), $hosts); $mform->addRule('mnethostid', $strrequired, 'required', null, 'client'); + $mform->addElement('selectyesno', 'enableleap2a', get_string('enableleap2a', 'portfolio_mahara')); } public function instance_sanity_check() {