<tr valign="top">
<td align="right">an_authcode:</td>
<td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode)), 'an_authcode'); ?>
- <?php helpbutton('authcode', 'authcode', 'enrol/authorize'); ?><br />
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authcode', 'authcode', 'enrol/authorize')); ?><br />
<?php print_string("adminauthcode", "enrol_authorize") ?></td>
</tr>
</tr>
<tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?>
- <?php helpbutton('orderreview', 'orderreview', 'enrol/authorize'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('orderreview', 'orderreview', 'enrol/authorize')); ?>
</h4></td></tr>
<tr valign="top">
<td align="right">an_review:</td>
<td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review)), 'an_review'); ?>
- <?php helpbutton('review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol/authorize'); ?><br />
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol/authorize')); ?><br />
<?php print_string("adminreview", "enrol_authorize") ?></td>
</tr>
<tr valign="top">
<td align="right">an_capture_day:</td>
<td><input type="text" name="an_capture_day" size="2" maxlength="2" value="<?php p($frm->an_capture_day) ?>" />
- <?php helpbutton('captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol/authorize'); ?><br />
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol/authorize')); ?><br />
<?php print_string("reviewday", "enrol_authorize", $frm->an_capture_day) ?></td>
</tr>
// 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;
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)");
}
* @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
$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)) {
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'));
}
}
}
$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");
}
}
* 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;
}
// 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)){
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;
}
class enrolment_factory {
function factory($enrol = '') {
- global $CFG;
+ global $CFG, $OUTPUT;
if (!$enrol) {
$enrol = $CFG->enrol;
}
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");
}
}
}
<input type="checkbox" value="1" name="enrol_createnewusers" <?php if ($frm->enrol_createnewusers) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('createnewusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imsdeleteusers" <?php if ($frm->enrol_imsdeleteusers) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('deleteusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('deleteusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imssourcedidfallback" <?php if ($frm->enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<!--
<input type="text" <?php echo 'value="'.intval($frm->enrol_truncatecoursecodes).'"' ?> name="enrol_truncatecoursecodes" size="3" maxlength="3" />
</td>
<td>
- <?php helpbutton('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_createnewcourses" <?php if ($frm->enrol_createnewcourses) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('createnewcourses', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewcourses', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_createnewcategories" <?php if ($frm->enrol_createnewcategories) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('categorisation', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('categorisation', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imsunenrol" <?php if ($frm->enrol_imsunenrol) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('unenrol', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('unenrol', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<td align="right"><?php print_string('restricttarget', 'enrol_imsenterprise') ?>:</td>
<td colspan="2">
<input type="text" <?php echo 'value="'.htmlspecialchars($frm->enrol_imsrestricttarget).'"' ?> name="enrol_imsrestricttarget" size="20" maxlength="32" />
- <?php helpbutton('target', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('target', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imscapitafix" <?php if ($frm->enrol_imscapitafix) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php helpbutton('capita', 'More detail about this option', 'enrol/imsenterprise'); ?>
+ <?php echo $OUTPUT->help_icon(moodle_help_icon::make('capita', 'More detail about this option', 'enrol/imsenterprise')); ?>
</td>
</tr>
* This function syncs a user's enrolments with those on the LDAP server.
*/
function setup_enrolments(&$user) {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
//error_log('[ENROL_LDAP] setup_enrolments called');
$ldap_connection = $this->enrol_ldap_connect();
if (!$ldap_connection) {
@ldap_close($ldap_connection);
- notify("[ENROL_LDAP] LDAP-module cannot connect to server: {$CFG->enrol_ldap_host_url}");
+ echo $OUTPUT->notification("[ENROL_LDAP] LDAP-module cannot connect to server: {$CFG->enrol_ldap_host_url}");
return false;
}
/// sync enrolments with ldap, create courses if required.
function sync_enrolments($type, $enrol = false) {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
// Get the role. If it doesn't exist, that is bad.
$role = $DB->get_record('role', array('shortname'=>$type));
if (!$role) {
- notify("No such role: $type");
+ echo $OUTPUT->notification("No such role: $type");
return false;
}
$ldap_connection = $this->enrol_ldap_connect();
if (!$ldap_connection) {
@ldap_close($ldap_connection);
- notify("LDAP-module cannot connect to server: $CFG->ldap_host_url");
+ echo $OUTPUT->notification("LDAP-module cannot connect to server: $CFG->ldap_host_url");
return false;
}
function enrol_ldap_connect(){
/// connects to ldap-server
- global $CFG;
+ global $CFG, $OUTPUT;
$result = ldap_connect($CFG->enrol_ldap_host_url);
$CFG->enrol_ldap_bind_dn,
$CFG->enrol_ldap_bind_pw );
if (!$bind) {
- notify("Error in binding to LDAP server");
+ echo $OUTPUT->notification("Error in binding to LDAP server");
trigger_error("Error in binding to LDAP server $!");
}
}
return $result;
} else {
- notify("LDAP-module cannot connect to server: $CFG->enrol_ldap_host_url");
+ echo $OUTPUT->notification("LDAP-module cannot connect to server: $CFG->enrol_ldap_host_url");
return false;
}
}
/// makes bind to ldap for searching users
/// uses ldap_bind_dn or anonymous bind
- global $CFG;
+ global $CFG, $OUTPUT;
if ( ! empty($CFG->enrol_ldap_bind_dn) ){
//bind with search-user
if (!ldap_bind($ldap_connection, $CFG->enrol_ldap_bind_dn,$CFG->enrol_ldap_bind_pw)){
- notify("Error: could not bind ldap with ldap_bind_dn/pw");
+ echo $OUTPUT->notification("Error: could not bind ldap with ldap_bind_dn/pw");
return false;
}
} else {
//bind anonymously
if ( !ldap_bind($ldap_connection)){
- notify("Error: could not bind ldap anonymously");
+ echo $OUTPUT->notification("Error: could not bind ldap anonymously");
return false;
}
}
// you will want to call fix_course_sortorder() after your are done
// with course creation
function create_course ($course_ext,$skip_fix_course_sortorder=0){
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
// override defaults with template course
if (!empty($CFG->enrol_ldap_template)){
add_to_log($newcourseid, "course", "new", "view.php?id=$newcourseid", "enrol/ldap auto-creation");
} else {
error_log("Could not create new course from LDAP from DN:" . $course_ext['dn']);
- notify("Serious Error! Could not create the new course!");
+ echo $OUTPUT->notification("Serious Error! Could not create the new course!");
return false;
}
// output the form
-print_simple_box_start('center','90%','','20');
+echo $OUTPUT->box_start();
?>
<div class="allowedcoursesdiv">
</div>
<?php
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
echo $OUTPUT->heading(get_string('costorkey', 'enrol_paypal'));
}
- print_simple_box_start("center");
+ echo $OUTPUT->box_end();
if ($USER->username == 'guest') { // force login only for guest user, not real users with guest role
if (empty($CFG->loginhttps)) {
include($CFG->dirroot.'/enrol/paypal/enrol.html');
}
- print_simple_box_end();
+ echo $OUTPUT->box_end();
if ($course->password) { // Second option
$password = '';