From 15add7bd29f01bc3479d66c3153a8f0d6ca4d9a2 Mon Sep 17 00:00:00 2001 From: danstowell Date: Sat, 30 Sep 2006 17:46:15 +0000 Subject: [PATCH] Fixed PHP 4 compatibility re MDL-6753 --- enrol/imsenterprise/config.html | 4 ++-- enrol/imsenterprise/enrol.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/enrol/imsenterprise/config.html b/enrol/imsenterprise/config.html index 75820ffb46..58086a483e 100644 --- a/enrol/imsenterprise/config.html +++ b/enrol/imsenterprise/config.html @@ -115,7 +115,7 @@ $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID); $assignableroles = get_assignable_roles($sitecontext); $assignableroles = array('0' => get_string('ignore')) + $assignableroles; -foreach(enrolment_plugin_imsenterprise::$imsroles as $imsrolenum=>$imsrolename){ +foreach($this->imsroles as $imsrolenum=>$imsrolename){ ?> "" (): @@ -125,7 +125,7 @@ foreach(enrolment_plugin_imsenterprise::$imsroles as $imsrolenum=>$imsrolename){ $configref = "enrol_imse_imsrolemap" . $imsrolenum; choose_from_menu($assignableroles, 'enrol_imse_imsrolemap'.$imsrolenum, - strlen($frm->$configref) ? $frm->$configref : enrolment_plugin_imsenterprise::determine_default_rolemapping($imsrolenum), ''); + strlen($frm->$configref) ? $frm->$configref : $this->determine_default_rolemapping($imsrolenum), ''); ?> diff --git a/enrol/imsenterprise/enrol.php b/enrol/imsenterprise/enrol.php index dd2e489886..6590f714b6 100644 --- a/enrol/imsenterprise/enrol.php +++ b/enrol/imsenterprise/enrol.php @@ -48,7 +48,7 @@ class enrolment_plugin_imsenterprise { var $log; // The "roles" hard-coded in the IMS specification are: -public static $imsroles = array( +var $imsroles = array( '01'=>'Learner', '02'=>'Instructor', '03'=>'Content Developer', @@ -67,7 +67,7 @@ public static $imsroles = array( * decide which role assignments to recommend by default. * For example, IMS role '01' is 'Learner', so may map to 'student' in Moodle. */ -public static function determine_default_rolemapping($imscode) { +function determine_default_rolemapping($imscode) { switch($imscode) { case '01': case '04': @@ -192,7 +192,7 @@ function process_config($config) { - foreach(enrolment_plugin_imsenterprise::$imsroles as $imsrolenum=>$imsrolename){ + foreach($this->imsroles as $imsrolenum=>$imsrolename){ $configref = 'enrol_imse_imsrolemap' . $imsrolenum; if (!isset($config->$configref)) { echo "

Resetting config->$configref

"; @@ -872,7 +872,7 @@ function decode_timeframe($string){ // Pass me the INNER CONTENTS of a rolemappings = array(); - foreach(enrolment_plugin_imsenterprise::$imsroles as $imsrolenum=>$imsrolename) { + foreach($this->imsroles as $imsrolenum=>$imsrolename) { $this->rolemappings[$imsrolenum] = $this->rolemappings[$imsrolename] = get_field('config', 'value', 'name', 'enrol_imse_imsrolemap' . $imsrolenum); } -- 2.39.5