From: nicolasconnault Date: Tue, 18 Aug 2009 04:59:01 +0000 (+0000) Subject: MDL-19795 Upgraded calls to helpbutton, print_simple_box* and notify X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c60e66aee3da08b726be8ba33957747f97fefc6d;p=moodle.git MDL-19795 Upgraded calls to helpbutton, print_simple_box* and notify --- diff --git a/enrol/authorize/config_form.php b/enrol/authorize/config_form.php index cc2c98249b..a8df96869c 100755 --- a/enrol/authorize/config_form.php +++ b/enrol/authorize/config_form.php @@ -131,7 +131,7 @@ if (!isset($frm->acceptechecktypes)) { an_authcode: checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode)), 'an_authcode'); ?> -
+ help_icon(moodle_help_icon::make('authcode', 'authcode', 'enrol/authorize')); ?>
@@ -177,20 +177,20 @@ if (!isset($frm->acceptechecktypes)) {

- + help_icon(moodle_help_icon::make('orderreview', 'orderreview', 'enrol/authorize')); ?>

an_review: checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review)), 'an_review'); ?> -
+ help_icon(moodle_help_icon::make('review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol/authorize')); ?>
an_capture_day: -
+ help_icon(moodle_help_icon::make('captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol/authorize')); ?>
an_capture_day) ?> diff --git a/enrol/authorize/db/upgrade.php b/enrol/authorize/db/upgrade.php index 09440a6564..592ec1b3f7 100644 --- a/enrol/authorize/db/upgrade.php +++ b/enrol/authorize/db/upgrade.php @@ -21,7 +21,7 @@ // before any action that may take longer time to finish. function xmldb_enrol_authorize_upgrade($oldversion) { - global $CFG, $DB; + global $CFG, $DB, $OUTPUT; $dbman = $DB->get_manager(); $result = true; @@ -31,7 +31,7 @@ function xmldb_enrol_authorize_upgrade($oldversion) { if ($result && $oldversion < 2008020500 && is_enabled_enrol('authorize')) { require_once($CFG->dirroot.'/enrol/authorize/localfuncs.php'); if (!check_curl_available()) { - notify("You are using the authorize.net enrolment plugin for payment handling but cUrl is not available. + echo $OUTPUT->notification("You are using the authorize.net enrolment plugin for payment handling but cUrl is not available. PHP must be compiled with cURL+SSL support (--with-curl --with-openssl)"); } diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 6e73035772..08491e7b38 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -453,19 +453,18 @@ class enrolment_plugin_authorize * @param object $frm * @access public */ - public function config_form($frm) - { - global $CFG, $DB; + public function config_form($frm) { + global $CFG, $DB, $OUTPUT; $mconfig = get_config('enrol/authorize'); if (!check_curl_available()) { - notify('PHP must be compiled with cURL+SSL support (--with-curl --with-openssl)'); + echo $OUTPUT->notification('PHP must be compiled with cURL+SSL support (--with-curl --with-openssl)'); } if (empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') { $a = new stdClass; $a->url = "$CFG->wwwroot/$CFG->admin/settings.php?section=httpsecurity"; - notify(get_string('adminconfighttps', 'enrol_authorize', $a)); + echo $OUTPUT->notification(get_string('adminconfighttps', 'enrol_authorize', $a)); return; // notice breaks the form and xhtml later } elseif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) { // MDL-9836 @@ -473,12 +472,12 @@ class enrolment_plugin_authorize $wwwsroot = str_replace('http:', 'https:', $wwwsroot); $a = new stdClass; $a->url = $wwwsroot; - notify(get_string('adminconfighttpsgo', 'enrol_authorize', $a)); + echo $OUTPUT->notification(get_string('adminconfighttpsgo', 'enrol_authorize', $a)); return; // notice breaks the form and xhtml later } if (optional_param('verifyaccount', 0, PARAM_INT)) { - notify(authorize_verify_account()); + echo $OUTPUT->notification(authorize_verify_account()); } if (!empty($frm->an_review)) { @@ -487,7 +486,7 @@ class enrolment_plugin_authorize if ($captureday > 0 || $emailexpired > 0) { $lastcron = $DB->get_field_sql('SELECT max(lastcron) FROM {modules}'); if ((time() - intval($lastcron) > 3600 * 24)) { - notify(get_string('admincronsetup', 'enrol_authorize')); + echo $OUTPUT->notification(get_string('admincronsetup', 'enrol_authorize')); } } } @@ -496,15 +495,15 @@ class enrolment_plugin_authorize $a = new stdClass; $a->count = $count; $a->url = $CFG->wwwroot."/enrol/authorize/index.php?status=".AN_STATUS_AUTH; - notify(get_string('adminpendingorders', 'enrol_authorize', $a)); + echo $OUTPUT->notification(get_string('adminpendingorders', 'enrol_authorize', $a)); } if (data_submitted()) { if (empty($mconfig->an_login)) { - notify("an_login required"); + echo $OUTPUT->notification("an_login required"); } if (empty($mconfig->an_tran_key) && empty($mconfig->an_password)) { - notify("an_tran_key or an_password required"); + echo $OUTPUT->notification("an_tran_key or an_password required"); } } diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 99c0c2e696..78271630da 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -174,13 +174,13 @@ function setup_enrolments(&$user) { * used. */ function sync_enrolments($role = null) { - global $CFG, $DB; + global $CFG, $DB, $OUTPUT; error_reporting(E_ALL); // Connect to the external database $enroldb = $this->enrol_connect(); if (!$enroldb) { - notify("enrol/database cannot connect to server"); + echo $OUTPUT->notification("enrol/database cannot connect to server"); return false; } @@ -554,7 +554,7 @@ function process_config($config) { // you will want to call fix_course_sortorder() after your are done // with course creation function create_course ($course,$skip_fix_course_sortorder=0){ - global $CFG, $DB; + global $CFG, $DB, $OUTPUT; // define a template if (!empty($CFG->enrol_db_template)){ @@ -616,7 +616,7 @@ function create_course ($course,$skip_fix_course_sortorder=0){ add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "enrol/database auto-creation"); } else { trigger_error("Could not create new course $extcourse from from database"); - notify("Serious Error! Could not create the new course!"); + echo $OUTPUT->notification("Serious Error! Could not create the new course!"); return false; } diff --git a/enrol/enrol.class.php b/enrol/enrol.class.php index 97ba121930..50e719efa7 100644 --- a/enrol/enrol.class.php +++ b/enrol/enrol.class.php @@ -6,7 +6,7 @@ class enrolment_factory { function factory($enrol = '') { - global $CFG; + global $CFG, $OUTPUT; if (!$enrol) { $enrol = $CFG->enrol; } @@ -16,7 +16,7 @@ class enrolment_factory { return new $class; } else { trigger_error("$CFG->dirroot/enrol/$enrol/enrol.php does not exist"); - notify("Enrolment file $enrol/enrol.php does not exist"); + echo $OUTPUT->notification("Enrolment file $enrol/enrol.php does not exist"); } } } diff --git a/enrol/imsenterprise/config.html b/enrol/imsenterprise/config.html index 1addc678af..f53c716220 100644 --- a/enrol/imsenterprise/config.html +++ b/enrol/imsenterprise/config.html @@ -38,7 +38,7 @@ enrol_createnewusers) echo "checked=\"checked\"" ?> /> - + help_icon(moodle_help_icon::make('createnewusers', 'More detail about this option', 'enrol/imsenterprise')); ?> @@ -48,7 +48,7 @@ enrol_imsdeleteusers) echo "checked=\"checked\"" ?> /> - + help_icon(moodle_help_icon::make('deleteusers', 'More detail about this option', 'enrol/imsenterprise')); ?> @@ -78,7 +78,7 @@ enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> /> - + help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>