From dbb82a47ca0dc0037bf0c3cf08f096d8f63beb89 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 2 Apr 2008 06:09:56 +0000 Subject: [PATCH] MDL-14128, remove all uses of error(get_string()) --- admin/auth.php | 6 +++--- admin/block.php | 2 +- admin/enrol.php | 4 ++-- admin/enrol_config.php | 2 +- admin/lang.php | 4 ++-- admin/langimport.php | 8 ++++---- admin/mnet/access_control.php | 10 +++++----- admin/mnet/enr_course_enrol.php | 2 +- admin/mnet/enr_courses.php | 2 +- admin/mnet/peers.php | 17 ++++++++-------- admin/module.php | 2 +- admin/register.php | 2 +- admin/report/courseoverview/index.php | 2 +- admin/report/courseoverview/reportsgraph.php | 2 +- admin/settings.php | 4 ++-- admin/uploaduser.php | 2 +- auth/mnet/auth.php | 20 +++++++++---------- auth/shibboleth/auth.php | 2 +- auth/shibboleth/index.php | 6 +++--- blocks/admin_bookmarks/create.php | 6 +++--- blocks/admin_bookmarks/delete.php | 8 ++++---- blocks/rss_client/block_rss_client_action.php | 16 ++++++++------- blog/edit.php | 6 +++--- course/category.php | 2 +- course/delete.php | 2 +- course/editcategory.php | 2 +- course/import/groups/index.php | 15 +++++++------- course/info.php | 2 +- course/pending.php | 2 +- course/report/participation/index.php | 2 +- course/report/stats/lib.php | 2 +- course/report/stats/report.php | 2 +- course/user.php | 4 ++-- enrol/authorize/enrol.php | 2 +- enrol/authorize/locallib.php | 10 +++++----- file.php | 2 +- files/index.php | 4 ++-- lib/adminlib.php | 4 ++-- lib/componentlib.class.php | 4 ++-- lib/editor/htmlarea/coursefiles.php | 4 ++-- lib/moodlelib.php | 10 +++++----- login/change_password.php | 4 ++-- login/confirm.php | 2 +- login/forgot_password.php | 4 ++-- mnet/lib.php | 4 ++-- .../type/online/assignment.class.php | 2 +- mod/chat/gui_basic/index.php | 2 +- mod/chat/gui_header_js/users.php | 2 +- mod/data/edit.php | 4 ++-- mod/forum/lib.php | 2 +- mod/forum/post.php | 16 +++++++-------- mod/forum/subscribe.php | 2 +- mod/glossary/edit.php | 6 +++--- mod/hotpot/attempt.php | 4 ++-- mod/hotpot/grade.php | 2 +- mod/hotpot/report.php | 2 +- mod/hotpot/review.php | 6 +++--- mod/quiz/attempt.php | 14 ++++++------- mod/quiz/quizfile.php | 2 +- mod/quiz/reviewquestion.php | 6 +++--- mod/resource/type/ims/deploy.php | 4 ++-- mod/scorm/lib.php | 2 +- mod/wiki/admin.php | 4 ++-- mod/workshop/submissions.php | 2 +- question/category_class.php | 4 ++-- question/editlib.php | 2 +- question/file.php | 2 +- question/import.php | 6 +++--- question/preview.php | 4 ++-- search/add.php | 6 +++--- search/delete.php | 6 +++--- search/indexer.php | 6 +++--- search/indexersplash.php | 4 ++-- search/query.php | 4 ++-- search/stats.php | 2 +- search/update.php | 6 +++--- tag/edit.php | 2 +- tag/index.php | 2 +- tag/manage.php | 2 +- tag/search.php | 2 +- tag/tag_autocomplete.php | 2 +- user/pixgroup.php | 2 +- user/view.php | 2 +- 83 files changed, 189 insertions(+), 185 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index 61afb67c19f..41faab54ddc 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -30,7 +30,7 @@ if (empty($CFG->auth)) { } if (!empty($auth) and !exists_auth_plugin($auth)) { - error(get_string('pluginnotinstalled', 'auth', $auth), $url); + print_error('pluginnotinstalled', 'auth', $url, $auth); } //////////////////////////////////////////////////////////////////////////////// @@ -67,7 +67,7 @@ switch ($action) { $key = array_search($auth, $authsenabled); // check auth plugin is valid if ($key === false) { - error(get_string('pluginnotenabled', 'auth', $auth), $url); + print_error('pluginnotenabled', 'auth', $url, $auth); } // move down the list if ($key < (count($authsenabled) - 1)) { @@ -82,7 +82,7 @@ switch ($action) { $key = array_search($auth, $authsenabled); // check auth is valid if ($key === false) { - error(get_string('pluginnotenabled', 'auth', $auth), $url); + print_error('pluginnotenabled', 'auth', $url, $auth); } // move up the list if ($key >= 1) { diff --git a/admin/block.php b/admin/block.php index d21218f23c7..f5165324e6d 100644 --- a/admin/block.php +++ b/admin/block.php @@ -31,7 +31,7 @@ if ($config = data_submitted()) { if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if(!$block->has_config()) { error('This block does not support global configuration'); diff --git a/admin/enrol.php b/admin/enrol.php index 8e0cfdfd6bf..14b75d6b10d 100644 --- a/admin/enrol.php +++ b/admin/enrol.php @@ -18,7 +18,7 @@ if ($frm = data_submitted()) { if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if (empty($frm->enable)) { $frm->enable = array(); @@ -103,4 +103,4 @@ admin_externalpage_print_footer(); -?> \ No newline at end of file +?> diff --git a/admin/enrol_config.php b/admin/enrol_config.php index 6adca6d13c8..0ed836f7337 100644 --- a/admin/enrol_config.php +++ b/admin/enrol_config.php @@ -19,7 +19,7 @@ if ($frm = data_submitted()) { if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if ($enrolment->process_config($frm)) { redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1); diff --git a/admin/lang.php b/admin/lang.php index 830c3e0863d..c02aa34b8d9 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -435,7 +435,7 @@ if (isset($_POST['currentfile'])){ // Save a file if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } $newstrings = array(); @@ -707,7 +707,7 @@ if (isset($_POST['currentfile'])) { // Save a file if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if (lang_help_save_file($saveto, $currentfile, $_POST['filedata'])) { notify(get_string("changessaved")." ($saveto/$currentfile)", "notifysuccess"); diff --git a/admin/langimport.php b/admin/langimport.php index 2546bf290b8..80043340e60 100755 --- a/admin/langimport.php +++ b/admin/langimport.php @@ -63,9 +63,9 @@ $a = new object(); $a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip'; $a->dest= $CFG->dataroot.'/lang'; - error(get_string($cd->get_error(), 'error', $a), 'langimport.php'); + print_error($cd->get_error(), 'error', 'langimport.php', $a); } else { - error(get_string($cd->get_error(), 'error'), 'langimport.php'); + print_error($cd->get_error(), 'error', 'langimport.php'); } break; @@ -198,9 +198,9 @@ $a = new stdClass(); $a->url = 'http://download.moodle.org/lang16/'.$pack.'.zip'; $a->dest= $CFG->dataroot.'/lang'; - error(get_string($cd->get_error(), 'error', $a)); // not probable + print_error($cd->get_error(), 'error', "", $a)); // not probable } else { - error(get_string($cd->get_error(), 'error')); // not probable + print_error($cd->get_error(), 'error'); // not probable } break; case COMPONENT_UPTODATE: diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 9b3a34cebed..c8ac7cc81a4 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -19,7 +19,7 @@ admin_externalpage_setup('ssoaccesscontrol'); admin_externalpage_print_header(); if (!extension_loaded('openssl')) { - print_error('requiresopenssl', 'mnet', '', NULL, true); + print_error('requiresopenssl', 'mnet'); } $sitecontext = get_context_instance(CONTEXT_SYSTEM); @@ -39,13 +39,13 @@ if (!empty($action) and confirm_sesskey()) { // boot if insufficient permission if (!has_capability('moodle/user:delete', $sitecontext)) { - error(get_string('nomodifyacl','mnet')); + print_error('nomodifyacl','mnet'); } // fetch the record in question $id = required_param('id', PARAM_INT); if (!$idrec = get_record('mnet_sso_access_control', 'id', $id)) { - error(get_string('recordnoexists','mnet'), "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); + print_error('recordnoexists','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); } switch ($action) { @@ -60,7 +60,7 @@ if (!empty($action) and confirm_sesskey()) { // require the access parameter, and it must be 'allow' or 'deny' $accessctrl = trim(strtolower(required_param('accessctrl', PARAM_ALPHA))); if ($accessctrl != 'allow' and $accessctrl != 'deny') { - error(get_string('invalidaccessparam', 'mnet') , "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); + print_error('invalidaccessparam', 'mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); } if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) { @@ -84,7 +84,7 @@ if ($form = data_submitted() and confirm_sesskey()) { // check permissions and verify form input if (!has_capability('moodle/user:delete', $sitecontext)) { - error(get_string('nomodifyacl','mnet'), "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); + print_error('nomodifyacl','mnet', "$CFG->wwwroot/$CFG->admin/mnet/access_control.php"); } if (empty($form->username)) { $formerror['username'] = get_string('enterausername','mnet'); diff --git a/admin/mnet/enr_course_enrol.php b/admin/mnet/enr_course_enrol.php index 4ae894ee6bc..3cbd93db4a4 100644 --- a/admin/mnet/enr_course_enrol.php +++ b/admin/mnet/enr_course_enrol.php @@ -7,7 +7,7 @@ include_once($CFG->dirroot.'/mnet/xmlrpc/client.php'); if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } admin_externalpage_setup('mnetenrol'); diff --git a/admin/mnet/enr_courses.php b/admin/mnet/enr_courses.php index 8735ecc9db9..79aad8fa06f 100644 --- a/admin/mnet/enr_courses.php +++ b/admin/mnet/enr_courses.php @@ -6,7 +6,7 @@ require_once($CFG->libdir.'/adminlib.php'); if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } diff --git a/admin/mnet/peers.php b/admin/mnet/peers.php index d3ba9fb7ef9..60579966cd5 100644 --- a/admin/mnet/peers.php +++ b/admin/mnet/peers.php @@ -15,17 +15,17 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissio if (!extension_loaded('openssl')) { admin_externalpage_print_header(); - print_error('requiresopenssl', 'mnet', '', NULL, true); + print_error('requiresopenssl', 'mnet'); } if (!$site = get_site()) { admin_externalpage_print_header(); - print_error('nosite', '', '', NULL, true); + print_error('nosite', ''); } if (!function_exists('curl_init') ) { admin_externalpage_print_header(); - print_error('nocurl', 'mnet', '', NULL, true); + print_error('nocurl', 'mnet'); } /// Initialize variables. @@ -59,7 +59,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { if(!function_exists('xmlrpc_encode_request')) { trigger_error("You must have xml-rpc enabled in your PHP build to use this feature."); - error(get_string('xmlrpc-missing', 'mnet'),'peers.php'); + print_error('xmlrpc-missing', 'mnet','peers.php'); exit; } @@ -82,7 +82,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { $temp_wwwroot = clean_param($form->wwwroot, PARAM_URL); if ($temp_wwwroot !== $form->wwwroot) { trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc."); - error(get_string("invalidurl", 'mnet'),'peers.php'); + print_error("invalidurl", 'mnet','peers.php'); exit; } unset($temp_wwwroot); @@ -103,7 +103,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { if (isset($form->public_key)) { $form->public_key = clean_param($form->public_key, PARAM_PEM); if (empty($form->public_key)) { - error(get_string("invalidpubkey", 'mnet'),'peers.php?step=update&hostid='.$mnet_peer->id); + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id); exit; } else { $oldkey = $mnet_peer->public_key; @@ -115,7 +115,8 @@ if (($form = data_submitted()) && confirm_sesskey()) { foreach ($mnet_peer->error as $err) { $errmsg .= $err['code'] . ': ' . $err['text'].'
'; } - error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id); + //error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&hostid='.$mnet_peer->id); + print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $errmsg); exit; } } @@ -124,7 +125,7 @@ if (($form = data_submitted()) && confirm_sesskey()) { // PREVENT DUPLICATE RECORDS /////////////////////////////////////////// if ('input' == $form->step) { if ( isset($mnet_peer->id) && $mnet_peer->id > 0 ) { - error(get_string("hostexists", 'mnet', $mnet_peer->id),'peers.php?step=update&hostid='.$mnet_peer->id); + print_error("hostexists", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, $mnet_peer->id); } } diff --git a/admin/module.php b/admin/module.php index 3b2c8cc99e9..e503b8292e0 100644 --- a/admin/module.php +++ b/admin/module.php @@ -10,7 +10,7 @@ $module = optional_param('module', '', PARAM_SAFEDIR); if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if ($module != '') { diff --git a/admin/register.php b/admin/register.php index ce558f4824b..46a3e21a3d5 100644 --- a/admin/register.php +++ b/admin/register.php @@ -12,7 +12,7 @@ } if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } if (!$admin = get_admin()) { diff --git a/admin/report/courseoverview/index.php b/admin/report/courseoverview/index.php index b4651036c49..eab091a97ba 100644 --- a/admin/report/courseoverview/index.php +++ b/admin/report/courseoverview/index.php @@ -43,7 +43,7 @@ $timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth); if (empty($timeoptions)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id); + print_error('nostatstodisplay', "", $CFG->wwwroot.'/course/view.php?id='.$course->id); } echo '
'."\n"; diff --git a/admin/report/courseoverview/reportsgraph.php b/admin/report/courseoverview/reportsgraph.php index a03e2d4e2d1..e11ecf6265e 100644 --- a/admin/report/courseoverview/reportsgraph.php +++ b/admin/report/courseoverview/reportsgraph.php @@ -29,7 +29,7 @@ $courses = get_records_sql($sql, 0, $numcourses); if (empty($courses)) { - error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php'); + print_error('statsnodata', "", $CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php'); } diff --git a/admin/settings.php b/admin/settings.php index f4ead11bec3..1ee43582848 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -16,12 +16,12 @@ $adminroot =& admin_get_root(); // need all settings $page =& $adminroot->locate($section); if (empty($page) or !is_a($page, 'admin_settingpage')) { - error(get_string('sectionerror', 'admin'), "$CFG->wwwroot/$CFG->admin/"); + print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/"); die; } if (!($page->check_access())) { - error(get_string('accessdenied', 'admin')); + print_error('accessdenied', 'admin'); die; } diff --git a/admin/uploaduser.php b/admin/uploaduser.php index 35d080daeed..44886a2db00 100755 --- a/admin/uploaduser.php +++ b/admin/uploaduser.php @@ -94,7 +94,7 @@ if (empty($iid)) { if ($readcount === false) { error($cir->get_error(), $returnurl); } else if ($readcount == 0) { - error(get_string('csvemptyfile', 'error'), $returnurl); + print_error('csvemptyfile', 'error', $returnurl); } // continue to form2 diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index 87360ed5764..21041cf8615 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -175,12 +175,12 @@ class auth_plugin_mnet extends auth_plugin_base { or is_mnet_remote_user($USER) or $USER->username == 'guest' or empty($USER->id)) { - error(get_string('notpermittedtojump', 'mnet')); + print_error('notpermittedtojump', 'mnet'); } // check for SSO publish permission first if ($this->has_service($mnethostid, 'sso_sp') == false) { - error(get_string('hostnotconfiguredforsso', 'mnet')); + print_error('hostnotconfiguredforsso', 'mnet'); } // set RPC timeout to 30 seconds if not configured @@ -209,7 +209,7 @@ class auth_plugin_mnet extends auth_plugin_base { $mnet_session->expires = time() + (integer)ini_get('session.gc_maxlifetime'); $mnet_session->session_id = session_id(); if (! $mnet_session->id = insert_record('mnet_session', addslashes_object($mnet_session))) { - error(get_string('databaseerror', 'mnet')); + print_error('databaseerror', 'mnet'); } } else { $mnet_session->useragent = sha1($_SERVER['HTTP_USER_AGENT']); @@ -218,7 +218,7 @@ class auth_plugin_mnet extends auth_plugin_base { $mnet_session->expires = time() + (integer)ini_get('session.gc_maxlifetime'); $mnet_session->session_id = session_id(); if (false == update_record('mnet_session', addslashes_object($mnet_session))) { - error(get_string('databaseerror', 'mnet')); + print_error('databaseerror', 'mnet'); } } @@ -245,7 +245,7 @@ class auth_plugin_mnet extends auth_plugin_base { // verify the remote host is configured locally before attempting RPC call if (! $remotehost = get_record('mnet_host', 'wwwroot', $remotewwwroot)) { - error(get_string('notpermittedtoland', 'mnet')); + print_error('notpermittedtoland', 'mnet'); } // get the originating (ID provider) host info @@ -268,7 +268,7 @@ class auth_plugin_mnet extends auth_plugin_base { list($code, $message) = array_map('trim',explode(':', $errormessage, 2)); if($code == 702) { $site = get_site(); - print_error('mnet_session_prohibited','mnet', $remotewwwroot, format_string($site->fullname)); + print_error('mnet_session_prohibited', 'mnet', $remotewwwroot, format_string($site->fullname)); exit; } $message .= "ERROR $code:
$errormessage
"; @@ -291,15 +291,15 @@ class auth_plugin_mnet extends auth_plugin_base { // TODO: refactor into a separate function if (empty($localuser) || ! $localuser->id) { if (empty($this->config->auto_add_remote_users)) { - error(get_string('nolocaluser', 'mnet')); + print_error('nolocaluser', 'mnet'); } $remoteuser->mnethostid = $remotehost->id; if (! insert_record('user', addslashes_object($remoteuser))) { - error(get_string('databaseerror', 'mnet')); + print_error('databaseerror', 'mnet'); } $firsttime = true; if (! $localuser = get_record('user', 'username', addslashes($remoteuser->username), 'mnethostid', $remotehost->id)) { - error(get_string('nolocaluser', 'mnet')); + print_error('nolocaluser', 'mnet'); } } @@ -392,7 +392,7 @@ class auth_plugin_mnet extends auth_plugin_base { $mnet_session->expires = time() + (integer)$session_gc_maxlifetime; $mnet_session->session_id = session_id(); if (! $mnet_session->id = insert_record('mnet_session', addslashes_object($mnet_session))) { - error(get_string('databaseerror', 'mnet')); + print_error('databaseerror', 'mnet'); } } else { $mnet_session->expires = time() + (integer)$session_gc_maxlifetime; diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index 05c69a2b312..b5f76eb41e5 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -76,7 +76,7 @@ class auth_plugin_shibboleth extends auth_plugin_base { // Check whether we have got all the essential attributes if ( empty($_SERVER[$this->config->user_attribute]) ) { - error(get_string( 'shib_not_all_attributes_error', 'auth' , "'".$this->config->user_attribute."' ('".$_SERVER[$this->config->user_attribute]."'), '".$this->config->field_map_firstname."' ('".$_SERVER[$this->config->field_map_firstname]."'), '".$this->config->field_map_lastname."' ('".$_SERVER[$this->config->field_map_lastname]."') and '".$this->config->field_map_email."' ('".$_SERVER[$this->config->field_map_email]."')")); + print_error( 'shib_not_all_attributes_error', 'auth' , '', "'".$this->config->user_attribute."' ('".$_SERVER[$this->config->user_attribute]."'), '".$this->config->field_map_firstname."' ('".$_SERVER[$this->config->field_map_firstname]."'), '".$this->config->field_map_lastname."' ('".$_SERVER[$this->config->field_map_lastname]."') and '".$this->config->field_map_email."' ('".$_SERVER[$this->config->field_map_email]."')"); } $attrmap = $this->get_attributes(); diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index e01489458cc..50e2f3dcf02 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -21,7 +21,7 @@ // Check whether Shibboleth is configured properly if (empty($pluginconfig->user_attribute)) { - error(get_string( 'shib_not_set_up_error', 'auth')); + print_error('shib_not_set_up_error', 'auth'); } /// If we can find the Shibboleth attribute, save it in session and return to main login page @@ -88,9 +88,9 @@ // If we can find any (user independent) Shibboleth attributes but no user // attributes we probably didn't receive any user attributes elseif (!empty($_SERVER['HTTP_SHIB_APPLICATION_ID'])) { - error(get_string( 'shib_no_attributes_error', 'auth' , '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\'')); + print_error('shib_no_attributes_error', 'auth' , '', '\''.$pluginconfig->user_attribute.'\', \''.$pluginconfig->field_map_firstname.'\', \''.$pluginconfig->field_map_lastname.'\' and \''.$pluginconfig->field_map_email.'\''); } else { - error(get_string( 'shib_not_set_up_error', 'auth')); + print_error('shib_not_set_up_error', 'auth'); } ?> diff --git a/blocks/admin_bookmarks/create.php b/blocks/admin_bookmarks/create.php index d555f7873dc..c21e18e224b 100644 --- a/blocks/admin_bookmarks/create.php +++ b/blocks/admin_bookmarks/create.php @@ -12,7 +12,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey( $bookmarks = explode(',', get_user_preferences('admin_bookmarks')); if (in_array($section, $bookmarks)) { - error(get_string('bookmarkalreadyexists','admin')); + print_error('bookmarkalreadyexists','admin'); die; } @@ -28,7 +28,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey( set_user_preference('admin_bookmarks', $bookmarks); } else { - error(get_string('invalidsection','admin')); + print_error('invalidsection','admin'); die; } @@ -40,7 +40,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey( } } else { - error(get_string('invalidsection','admin')); + print_error('invalidsection','admin'); die; } diff --git a/blocks/admin_bookmarks/delete.php b/blocks/admin_bookmarks/delete.php index 1ad4f1519e3..cc06f0600d0 100644 --- a/blocks/admin_bookmarks/delete.php +++ b/blocks/admin_bookmarks/delete.php @@ -16,7 +16,7 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey( $key = array_search($section, $bookmarks); if ($key === false) { - error(get_string('nonexistentbookmark','admin')); + print_error('nonexistentbookmark','admin'); die; } @@ -38,12 +38,12 @@ if ($section = optional_param('section', '', PARAM_SAFEDIR) and confirm_sesskey( } - error(get_string('nobookmarksforuser','admin')); + print_error('nobookmarksforuser','admin'); die; } else { - error(get_string('invalidsection', 'admin')); + print_error('invalidsection', 'admin'); die; } -?> \ No newline at end of file +?> diff --git a/blocks/rss_client/block_rss_client_action.php b/blocks/rss_client/block_rss_client_action.php index 049722c0061..ba2eec2e755 100644 --- a/blocks/rss_client/block_rss_client_action.php +++ b/blocks/rss_client/block_rss_client_action.php @@ -27,7 +27,7 @@ if (isset($_SERVER['HTTP_REFERER'])) { // Ensure that the logged in user is not using the guest account if (isguest()) { - error(get_string('noguestpost', 'forum'), $referrer); + print_error('noguestpost', 'forum', $referrer); } @@ -99,9 +99,10 @@ if (isset($rss_record)) { if ($act == 'updfeed') { if (!$managefeeds) { - error(get_string('noguestpost', 'forum'). - ' You are not allowed to make modifications to this RSS feed at this time.', - $referrer); + //print_error(get_string('noguestpost', 'forum'). + // ' You are not allowed to make modifications to this RSS feed at this time.', + // $referrer); + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.'); } @@ -222,9 +223,10 @@ if ($act == 'updfeed') { } else if ($act == 'delfeed') { if (!$managefeeds) { - error(get_string('noguestpost', 'forum'). - ' You are not allowed to make modifications to this RSS feed at this time.', - $referrer); + //print_error(get_string('noguestpost', 'forum'). + // ' You are not allowed to make modifications to this RSS feed at this time.', + // $referrer); + print_error('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.'); } $file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml'; diff --git a/blog/edit.php b/blog/edit.php index ee2b426c09d..7b6bf68fab7 100755 --- a/blog/edit.php +++ b/blog/edit.php @@ -16,7 +16,7 @@ if (empty($CFG->bloglevel)) { } if (isguest()) { - error(get_string('noguestpost', 'blog')); + print_error('noguestpost', 'blog'); } $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID); @@ -31,13 +31,13 @@ if ($id) { } if (!blog_user_can_edit_post($existing)) { - error(get_string('notallowedtoedit', 'blog')); + print_error('notallowedtoedit', 'blog'); } $userid = $existing->userid; $returnurl = $CFG->wwwroot.'/blog/index.php?userid='.$existing->userid; } else { if (!has_capability('moodle/blog:create', $sitecontext)) { - error(get_string('nopost', 'blog')); // manageentries is not enough for adding + print_error('nopost', 'blog'); // manageentries is not enough for adding } $existing = false; $userid = $USER->id; diff --git a/course/category.php b/course/category.php index 7cac89ee24a..3cfa531ab29 100644 --- a/course/category.php +++ b/course/category.php @@ -49,7 +49,7 @@ } else { if (!$category->visible) { - error(get_string('notavailable', 'error')); + print_error('notavailable', 'error'); } $navbaritem = print_course_search("", true, "navbar"); $adminediting = false; diff --git a/course/delete.php b/course/delete.php index 02ed485bcae..7864fa02f89 100644 --- a/course/delete.php +++ b/course/delete.php @@ -53,7 +53,7 @@ } if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } // OK checks done, delete the course now. diff --git a/course/editcategory.php b/course/editcategory.php index 0b60a3d69fb..f139413834c 100644 --- a/course/editcategory.php +++ b/course/editcategory.php @@ -117,7 +117,7 @@ if ($id && !$categoryadd && !$categoryupdate && false) { } else { if (!$category->visible) { - error(get_string('notavailable', 'error')); + print_error('notavailable', 'error'); } $navbaritem = print_course_search("", true, "navbar"); $adminediting = false; diff --git a/course/import/groups/index.php b/course/import/groups/index.php index 231184f5279..bb251829edc 100755 --- a/course/import/groups/index.php +++ b/course/import/groups/index.php @@ -21,7 +21,7 @@ } //if (!confirm_sesskey()) { - // error(get_string('confirmsesskeybad', 'error')); + // print_error('confirmsesskeybad', 'error'); //} $strimportgroups = get_string("importgroups"); @@ -87,7 +87,7 @@ if ( !(isset($required[$h]) or isset($optionalDefaults[$h]) or isset($optional[$h])) ) { - error(get_string('invalidfieldname', 'error', $h), 'index.php?id='.$id.'&sesskey='.$USER->sesskey); + print_error('invalidfieldname', 'error', 'index.php?id='.$id.'&sesskey='.$USER->sesskey, $h); } if ( isset($required[$h]) ) { $required[$h] = 2; @@ -96,7 +96,7 @@ // check for required fields foreach ($required as $key => $value) { if ($value < 2) { - error(get_string('fieldrequired', 'error', $key), 'uploaduser.php?id='.$id.'&sesskey='.$USER->sesskey); + print_error('fieldrequired', 'error', 'uploaduser.php?id='.$id.'&sesskey='.$USER->sesskey, $key); } } $linenum = 2; // since header is line 1 @@ -121,10 +121,11 @@ foreach ($record as $name => $value) { // check for required values if (isset($required[$name]) and !$value) { - error(get_string('missingfield', 'error', $name). " ". - get_string('erroronline', 'error', $linenum) .". ". - get_string('processingstops', 'error'), - 'uploaduser.php?sesskey='.$USER->sesskey); + //error(get_string('missingfield', 'error', $name). " ". + // get_string('erroronline', 'error', $linenum) .". ". + // get_string('processingstops', 'error'), + // 'uploaduser.php?sesskey='.$USER->sesskey); + print_error('missingfield', 'error', 'uploaduser.php?sesskey='.$USER->sesskey, $name); } else if ($name == "groupname") { $newgroup->name = addslashes($value); diff --git a/course/info.php b/course/info.php index d4588375866..e359e6ec4da 100644 --- a/course/info.php +++ b/course/info.php @@ -30,7 +30,7 @@ $context = get_context_instance(CONTEXT_COURSE, $course->id); if ((!course_parent_visible($course) || (! $course->visible)) && !has_capability('moodle/course:viewhiddencourses', $context)) { - error(get_string('coursehidden'), $CFG->wwwroot .'/'); + print_error('coursehidden', '', $CFG->wwwroot .'/'); } print_header(get_string("summaryof", "", $course->fullname)); diff --git a/course/pending.php b/course/pending.php index 2fc6f89f95b..31c5640e8c9 100644 --- a/course/pending.php +++ b/course/pending.php @@ -67,7 +67,7 @@ exit; } else { - error(get_string('courseapprovedfailed')); + print_error('courseapprovedfailed'); exit; } } diff --git a/course/report/participation/index.php b/course/report/participation/index.php index 9e24ac23c5f..1acad29f757 100644 --- a/course/report/participation/index.php +++ b/course/report/participation/index.php @@ -139,7 +139,7 @@ $postfun = $cm->modname.'_get_post_actions'; if (!function_exists($viewfun) || !function_exists($postfun)) { - error(get_string('modulemissingcode','error',$cm->modname), $baseurl); + print_error('modulemissingcode', 'error', $baseurl, $cm->modname); } $viewnames = $viewfun(); diff --git a/course/report/stats/lib.php b/course/report/stats/lib.php index f281d210f1d..ab934ce700c 100644 --- a/course/report/stats/lib.php +++ b/course/report/stats/lib.php @@ -14,7 +14,7 @@ $reportoptions = stats_get_report_options($course->id, $mode); $timeoptions = report_stats_timeoptions($mode); if (empty($timeoptions)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id); + print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/view.php?id='.$course->id); } */ diff --git a/course/report/stats/report.php b/course/report/stats/report.php index fa5d2184854..8b9130441d2 100644 --- a/course/report/stats/report.php +++ b/course/report/stats/report.php @@ -14,7 +14,7 @@ $reportoptions = stats_get_report_options($course->id, $mode); $timeoptions = report_stats_timeoptions($mode); if (empty($timeoptions)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/view.php?id='.$course->id); + print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/view.php?id='.$course->id); } $table->width = 'auto'; diff --git a/course/user.php b/course/user.php index 0707f9f337a..703a256d8df 100644 --- a/course/user.php +++ b/course/user.php @@ -127,7 +127,7 @@ $timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth); if (empty($timeoptions)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline'); + print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline'); } // use the earliest. @@ -146,7 +146,7 @@ $stats = get_records_sql($sql); if (empty($stats)) { - error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline'); + print_error('nostatstodisplay', '', $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline'); } // MDL-10818, do not display broken graph when user has no permission to view graph diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 1bfbe915730..b88131bbffb 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -43,7 +43,7 @@ class enrolment_plugin_authorize if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) { // MDL-9836 if (empty($CFG->loginhttps)) { - error(get_string('httpsrequired', 'enrol_authorize')); + print_error('httpsrequired', 'enrol_authorize'); } else { $wwwsroot = str_replace('http:','https:', $CFG->wwwroot); redirect("$wwwsroot/course/enrol.php?id=$course->id"); diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 748125b8276..dd65af249ba 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -257,7 +257,7 @@ function authorize_print_order_details($orderno) if (!in_array(ORDER_CAPTURE, $status->actions)) { $a = new stdClass; $a->action = $authstrs->capture; - error(get_string('youcantdo', 'enrol_authorize', $a)); + print_error('youcantdo', 'enrol_authorize', '', $a); } if (empty($confirm)) { @@ -299,7 +299,7 @@ function authorize_print_order_details($orderno) if (!in_array(ORDER_REFUND, $status->actions)) { $a = new stdClass; $a->action = $authstrs->refund; - error(get_string('youcantdo', 'enrol_authorize', $a)); + print_error('youcantdo', 'enrol_authorize', '', $a); } $refunded = 0.0; @@ -363,7 +363,7 @@ function authorize_print_order_details($orderno) if (!in_array(ORDER_VOID, $status->actions)) { $a = new stdClass; $a->action = $authstrs->void; - error(get_string('youcantdo', 'enrol_authorize', $a)); + print_error('youcantdo', 'enrol_authorize', '', $a); } if (empty($confirm)) { $strvoidyes = get_string('voidyes', 'enrol_authorize'); @@ -404,7 +404,7 @@ function authorize_print_order_details($orderno) if (!in_array(ORDER_VOID, $refundedstatus->actions)) { $a = new stdClass; $a->action = $authstrs->void; - error(get_string('youcantdo', 'enrol_authorize', $a)); + print_error('youcantdo', 'enrol_authorize', '', $a); } unset($suborder->courseid); if (empty($confirm)) { @@ -448,7 +448,7 @@ function authorize_print_order_details($orderno) if (!in_array(ORDER_DELETE, $status->actions)) { $a = new stdClass; $a->action = $authstrs->delete; - error(get_string('youcantdo', 'enrol_authorize', $a)); + print_error('youcantdo', 'enrol_authorize', '', $a); } if (empty($confirm)) { $cbunenrol = print_checkbox('unenrol', '1', !empty($unenrol), '', '', '', true); diff --git a/file.php b/file.php index 80ad8f81093..e6e394bf033 100644 --- a/file.php +++ b/file.php @@ -169,6 +169,6 @@ function not_found($courseid) { global $CFG; header('HTTP/1.0 404 not found'); - error(get_string('filenotfound', 'error'), $CFG->wwwroot.'/course/view.php?id='.$courseid); //this is not displayed on IIS?? + print_error('filenotfound', 'error', $CFG->wwwroot.'/course/view.php?id='.$courseid); //this is not displayed on IIS?? } ?> diff --git a/files/index.php b/files/index.php index 96d710c1238..1e56388806c 100644 --- a/files/index.php +++ b/files/index.php @@ -474,7 +474,7 @@ } if (!zip_files($files,"$basedir$wdir/$name")) { - error(get_string("zipfileserror","error")); + print_error("zipfileserror","error"); } clearfilelist(); @@ -532,7 +532,7 @@ $file = basename($file); if (!unzip_file("$basedir$wdir/$file")) { - error(get_string("unzipfileserror","error")); + print_error("unzipfileserror","error"); } echo "
"; diff --git a/lib/adminlib.php b/lib/adminlib.php index b067bdef284..e38bc3238b8 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -3902,13 +3902,13 @@ function admin_externalpage_setup($section) { $extpage =& $adminroot->locate($section); if (empty($extpage) or !is_a($extpage, 'admin_externalpage')) { - error(get_string('sectionerror','admin'), "$CFG->wwwroot/$CFG->admin/"); + print_error('sectionerror', 'admin', "$CFG->wwwroot/$CFG->admin/"); die; } // this eliminates our need to authenticate on the actual pages if (!($extpage->check_access())) { - error(get_string('accessdenied', 'admin')); + print_error('accessdenied', 'admin'); die; } diff --git a/lib/componentlib.class.php b/lib/componentlib.class.php index a394d7786c0..e44115f1edf 100644 --- a/lib/componentlib.class.php +++ b/lib/componentlib.class.php @@ -84,9 +84,9 @@ // $a = new stdClass(); // $a->url = 'http://download.moodle.org/lang16/es_utf8.zip'; // $a->dest= $CFG->dataroot.'/lang'; -// error(get_string($cd->get_error(), 'error', $a)); +// print_error($cd->get_error(), 'error', '', $a); // } else { -// error(get_string($cd->get_error(), 'error')); +// print_error($cd->get_error(), 'error'); // } // break; // case COMPONENT_UPTODATE: diff --git a/lib/editor/htmlarea/coursefiles.php b/lib/editor/htmlarea/coursefiles.php index 6f2206f4394..822167033cf 100644 --- a/lib/editor/htmlarea/coursefiles.php +++ b/lib/editor/htmlarea/coursefiles.php @@ -439,7 +439,7 @@ } if (!zip_files($files,"$basedir/$wdir/$name")) { - error(get_string("zipfileserror","error")); + print_error("zipfileserror","error"); } clearfilelist(); @@ -491,7 +491,7 @@ $file = basename($file); if (!unzip_file("$basedir/$wdir/$file")) { - error(get_string("unzipfileserror","error")); + print_error("unzipfileserror","error"); } echo "
\n"; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 78e4858489a..ceb49882d3d 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1888,7 +1888,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) { } } } else { - error(get_string('nopasswordchangeforced', 'auth')); + print_error('nopasswordchangeforced', 'auth'); } } @@ -1901,7 +1901,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) { /// Make sure current IP matches the one for this session (if required) if (!empty($CFG->tracksessionip)) { if ($USER->sessionIP != md5(getremoteaddr())) { - error(get_string('sessionipnomatch', 'error')); + print_error('sessionipnomatch', 'error'); } } @@ -1930,7 +1930,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) { /// groupmembersonly access control if (!empty($CFG->enablegroupings) and $cm and $cm->groupmembersonly and !has_capability('moodle/site:accessallgroups', get_context_instance(CONTEXT_MODULE, $cm->id))) { if (isguestuser() or !groups_has_membership($cm)) { - error(get_string('groupmembersonlyerror', 'group'), $CFG->wwwroot.'/course/view.php?id='.$cm->course); + print_error('groupmembersonlyerror', 'group', $CFG->wwwroot.'/course/view.php?id='.$cm->course); } } @@ -2324,7 +2324,7 @@ function update_login_count() { if ($SESSION->logincount > $max_logins) { unset($SESSION->wantsurl); - error(get_string('errortoomanylogins')); + print_error('errortoomanylogins'); } } @@ -3153,7 +3153,7 @@ function complete_user_login($user) { redirect($CFG->httpswwwroot.'/login/change_password.php'); } } else { - error(get_string('nopasswordchangeforced', 'auth')); + print_error('nopasswordchangeforced', 'auth'); } } return $USER; diff --git a/login/change_password.php b/login/change_password.php index d6482463bae..1c9ea1872ea 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -46,7 +46,7 @@ $userauth = get_auth_plugin($USER->auth); if (!$userauth->can_change_password()) { - error(get_string('nopasswordchange', 'auth')); + print_error('nopasswordchange', 'auth'); } if ($changeurl = $userauth->change_password_url()) { @@ -65,7 +65,7 @@ } else if ($data = $mform->get_data()) { if (!$userauth->user_update_password(addslashes_recursive($USER), $data->newpassword1)) { - error(get_string('errorpasswordupdate', 'auth')); + print_error('errorpasswordupdate', 'auth'); } // register success changing password diff --git a/login/confirm.php b/login/confirm.php index f07a9865e4b..2aa7d4d0de1 100644 --- a/login/confirm.php +++ b/login/confirm.php @@ -68,7 +68,7 @@ error("Invalid confirmation data"); } } else { - error(get_string("errorwhenconfirming")); + print_error("errorwhenconfirming"); } redirect("$CFG->wwwroot/"); diff --git a/login/forgot_password.php b/login/forgot_password.php index 286729db1d4..5f376a298b7 100644 --- a/login/forgot_password.php +++ b/login/forgot_password.php @@ -41,7 +41,7 @@ if ($p_secret !== false) { $user = get_complete_user_data('username', $p_username); if (!empty($user) and $user->secret === '') { print_header($strforgotten, $strforgotten, $navigation); - error(get_string('secretalreadyused')); + print_error('secretalreadyused'); } else if (!empty($user) and $user->secret == stripslashes($p_secret)) { // make sure that url relates to a valid user @@ -78,7 +78,7 @@ if ($p_secret !== false) { } else { print_header($strforgotten, $strforgotten, $navigation); - error(get_string('forgotteninvalidurl')); + print_error('forgotteninvalidurl'); } die; //never reached diff --git a/mnet/lib.php b/mnet/lib.php index f373c6e2a27..bf3e1cb0d6f 100644 --- a/mnet/lib.php +++ b/mnet/lib.php @@ -487,7 +487,7 @@ function mnet_update_sso_access_control($username, $mnet_host_id, $accessctrl) { add_to_log(SITEID, 'admin/mnet', 'update', 'admin/mnet/access_control.php', "SSO ACL: $accessctrl user '$username' from {$mnethost->name}"); } else { - error(get_string('failedaclwrite','mnet', $username)); + print_error('failedaclwrite', 'mnet', '', $username); return false; } } else { @@ -499,7 +499,7 @@ function mnet_update_sso_access_control($username, $mnet_host_id, $accessctrl) { add_to_log(SITEID, 'admin/mnet', 'add', 'admin/mnet/access_control.php', "SSO ACL: $accessctrl user '$username' from {$mnethost->name}"); } else { - error(get_string('failedaclwrite','mnet', $username)); + print_error('failedaclwrite', 'mnet', '', $username); return false; } } diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index 593ffb2f51d..bff6727b78f 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -35,7 +35,7 @@ class assignment_online extends assignment_base { if ($editmode) { //guest can not edit or submit assignment if (!has_capability('mod/assignment:submit', $context)) { - error(get_string('guestnosubmit', 'assignment')); + print_error('guestnosubmit', 'assignment'); } } diff --git a/mod/chat/gui_basic/index.php b/mod/chat/gui_basic/index.php index 79509f18cf5..ca9e64eb8e7 100644 --- a/mod/chat/gui_basic/index.php +++ b/mod/chat/gui_basic/index.php @@ -49,7 +49,7 @@ } if (!$chatusers = chat_get_users($chat->id, $groupid, $cm->groupingid)) { - error(get_string('errornousers', 'chat')); + print_error('errornousers', 'chat'); } set_field('chat_users', 'lastping', time(), 'sid', $chat_sid); diff --git a/mod/chat/gui_header_js/users.php b/mod/chat/gui_header_js/users.php index ea1ef674a76..9a671f4de7a 100644 --- a/mod/chat/gui_header_js/users.php +++ b/mod/chat/gui_header_js/users.php @@ -55,7 +55,7 @@ /// Get list of users if (!$chatusers = chat_get_users($chatuser->chatid, $chatuser->groupid, $cm->groupingid)) { - error(get_string('errornousers', 'chat')); + print_error('errornousers', 'chat'); } ob_start(); diff --git a/mod/data/edit.php b/mod/data/edit.php index 58f7cc8c491..215f9a3508b 100755 --- a/mod/data/edit.php +++ b/mod/data/edit.php @@ -82,7 +82,7 @@ if ($rid) { // So do you have access? if (!(has_capability('mod/data:manageentries', $context) or data_isowner($rid)) or !confirm_sesskey() ) { - error(get_string('noaccess','data')); + print_error('noaccess','data'); } } @@ -341,7 +341,7 @@ // Print the stuff that need to come after the form fields. if (!$fields = get_records('data_fields', 'dataid', $data->id)) { - error(get_string('nofieldindatabase', 'data')); + print_error('nofieldindatabase', 'data'); } foreach ($fields as $eachfield) { $field = data_get_field($eachfield, $data); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index b3872402d4f..1c017a9ca57 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -5657,7 +5657,7 @@ function forum_check_throttling($forum) { $a->blockperiod = get_string('secondstotime'.$forum->blockperiod); if ($forum->blockafter <= $numposts) { - error(get_string('forumblockingtoomanyposts','error',$a),$CFG->wwwroot.'/mod/forum/view.php?f='.$forum->id); + print_error('forumblockingtoomanyposts', 'error', $CFG->wwwroot.'/mod/forum/view.php?f='.$forum->id, $a); } if ($forum->warnafter <= $numposts) { notify(get_string('forumblockingalmosttoomanyposts','forum',$a)); diff --git a/mod/forum/post.php b/mod/forum/post.php index 7d42ba5040a..26c5e60a228 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -91,7 +91,7 @@ } if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $coursecontext)) { - error(get_string("activityiscurrentlyhidden")); + print_error("activityiscurrentlyhidden"); } if (isset($_SERVER["HTTP_REFERER"])) { @@ -162,7 +162,7 @@ } } if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $coursecontext)) { - error(get_string("activityiscurrentlyhidden")); + print_error("activityiscurrentlyhidden"); } // Load up the $post variable. @@ -266,7 +266,7 @@ forum_go_back_to("discuss.php?d=$post->discussion")); } else if ($replycount && !has_capability('mod/forum:deleteanypost', $modcontext)) { - error(get_string("couldnotdeletereplies", "forum"), + print_error("couldnotdeletereplies", "forum", forum_go_back_to("discuss.php?d=$post->discussion")); } else { @@ -308,7 +308,7 @@ if ($replycount) { if (!has_capability('mod/forum:deleteanypost', $modcontext)) { - error(get_string("couldnotdeletereplies", "forum"), + print_error("couldnotdeletereplies", "forum", forum_go_back_to("discuss.php?d=$post->discussion")); } print_header(); @@ -480,7 +480,7 @@ $updatepost = $fromform; //realpost $updatepost->forum = $forum->id; if (!forum_update_post($updatepost, $message)) { - error(get_string("couldnotupdate", "forum"), $errordestination); + print_error("couldnotupdate", "forum", $errordestination); } // MDL-11818 @@ -488,7 +488,7 @@ $forum->intro = $updatepost->message; $forum->timemodified = time(); if (!update_record("forum", $forum)) { - error(get_string("couldnotupdate", "forum"), $errordestination); + print_error("couldnotupdate", "forum", $errordestination); } } @@ -554,7 +554,7 @@ redirect(forum_go_back_to("$discussionurl#p$fromform->id"), $message.$subscribemessage, $timemessage); } else { - error(get_string("couldnotadd", "forum"), $errordestination); + print_error("couldnotadd", "forum", $errordestination); } exit; @@ -597,7 +597,7 @@ redirect(forum_go_back_to("view.php?f=$fromform->forum"), $message.$subscribemessage, $timemessage); } else { - error(get_string("couldnotadd", "forum"), $errordestination); + print_error("couldnotadd", "forum", $errordestination); } exit; diff --git a/mod/forum/subscribe.php b/mod/forum/subscribe.php index 26c96b88ce6..e97a88b8031 100644 --- a/mod/forum/subscribe.php +++ b/mod/forum/subscribe.php @@ -92,7 +92,7 @@ } else { // subscribe if ($forum->forcesubscribe == FORUM_DISALLOWSUBSCRIBE && !has_capability('mod/forum:managesubscriptions', $context)) { - error(get_string('disallowsubscribe', 'forum'),$_SERVER["HTTP_REFERER"]); + print_error('disallowsubscribe', 'forum', $_SERVER["HTTP_REFERER"]); } if (!has_capability('mod/forum:viewdiscussion', $context)) { error("Could not subscribe you to that forum", $_SERVER["HTTP_REFERER"]); diff --git a/mod/glossary/edit.php b/mod/glossary/edit.php index 7a2734ffd30..c3ee5d56737 100644 --- a/mod/glossary/edit.php +++ b/mod/glossary/edit.php @@ -41,7 +41,7 @@ if ($e) { // if entry is specified $ineditperiod = ((time() - $entry->timecreated < $CFG->maxeditingtime) || $glossary->editalways); if (!has_capability('mod/glossary:manageentries', $context) and !($entry->userid == $USER->id and ($ineditperiod and has_capability('mod/glossary:write', $context)))) { //expired edit time is the most probable cause here - error(get_string('erredittimeexpired', 'glossary'), "view.php?id=$cm->id&mode=entry&hook=$e"); + print_error('erredittimeexpired', 'glossary', "view.php?id=$cm->id&mode=entry&hook=$e"); } } else { // new entry require_capability('mod/glossary:write', $context); @@ -174,9 +174,9 @@ if ($mform->is_cancelled()){ $ineditperiod = ((time() - $fromdb->timecreated < $CFG->maxeditingtime) || $glossary->editalways); if ((!$ineditperiod || $USER->id != $fromdb->userid) and !has_capability('mod/glossary:manageentries', $context)) { if ( $USER->id != $fromdb->userid ) { - error(get_string('errcannoteditothers', 'glossary')); + print_error('errcannoteditothers', 'glossary'); } elseif (!$ineditperiod) { - error(get_string('erredittimeexpired', 'glossary')); + print_error('erredittimeexpired', 'glossary'); } die; } diff --git a/mod/hotpot/attempt.php b/mod/hotpot/attempt.php index d7178618c19..344a577070d 100644 --- a/mod/hotpot/attempt.php +++ b/mod/hotpot/attempt.php @@ -29,7 +29,7 @@ // check user can access this hotpot activity if (!hotpot_is_visible($cm)) { - error(get_string("activityiscurrentlyhidden"), $next_url); + print_error("activityiscurrentlyhidden", 'hotpot', $next_url); } // update attempt record fields using incoming data @@ -220,7 +220,7 @@ function hotpot_set_attempt_details(&$attempt) { if (!$ok) { return; // error('Quiz type is missing or invalid'); - // error(get_string('error_invalidquiztype', 'hotpot')); + // print_error('error_invalidquiztype', 'hotpot'); // // script finishes here if quiztype is invalid // diff --git a/mod/hotpot/grade.php b/mod/hotpot/grade.php index eb511b019ad..dbfd904b09b 100644 --- a/mod/hotpot/grade.php +++ b/mod/hotpot/grade.php @@ -24,7 +24,7 @@ // check user can access this hotpot activity if (!hotpot_is_visible($cm)) { - error(get_string("activityiscurrentlyhidden")); + print_error("activityiscurrentlyhidden"); } if (has_capability('mod/hotpot:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) { diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index ec3e314f153..e659f22a2c4 100644 --- a/mod/hotpot/report.php +++ b/mod/hotpot/report.php @@ -42,7 +42,7 @@ // check user can access this hotpot activity if (!hotpot_is_visible($cm)) { - error(get_string("activityiscurrentlyhidden")); + print_error("activityiscurrentlyhidden"); } // get report mode diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php index 64f7f5d228b..4804979e2b2 100644 --- a/mod/hotpot/review.php +++ b/mod/hotpot/review.php @@ -36,16 +36,16 @@ // check user can access this hotpot activity if (!hotpot_is_visible($cm)) { - error(get_string("activityiscurrentlyhidden")); + print_error("activityiscurrentlyhidden"); } $context = get_context_instance(CONTEXT_MODULE, $cm->id); if (!has_capability('mod/hotpot:viewreport',$context)) { if (!$hotpot->review) { - error(get_string("noreview", "quiz")); + print_error("noreview", "quiz"); } //if (time() < $hotpot->timeclose) { - // error(get_string("noreviewuntil", "quiz", userdate($hotpot->timeclose))); + // print_error("noreviewuntil", "quiz", '', userdate($hotpot->timeclose)); //} if ($attempt->userid != $USER->id) { error("This is not your attempt!"); diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 56c16f01ec7..da45623c491 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -86,12 +86,12 @@ $numberofpreviousattempts = count_records_select('quiz_attempts', "quiz = '{$quiz->id}' AND " . "userid = '{$USER->id}' AND timefinish > 0 AND preview != 1"); if ($quiz->attempts and $numberofpreviousattempts >= $quiz->attempts) { - error(get_string('nomoreattempts', 'quiz'), "view.php?id={$cm->id}"); + print_error('nomoreattempts', 'quiz', "view.php?id={$cm->id}"); } /// Check subnet access if (!$ispreviewing && $quiz->subnet && !address_in_subnet(getremoteaddr(), $quiz->subnet)) { - error(get_string("subneterror", "quiz"), "view.php?id=$cm->id"); + print_error("subneterror", "quiz", "view.php?id=$cm->id"); } /// Check password access @@ -156,11 +156,11 @@ } if ($numattempts == 1 && $quiz->delay1) { if ($timenow - $quiz->delay1 < $lastattempt) { - error(get_string('timedelay', 'quiz'), 'view.php?q='.$quiz->id); + print_error('timedelay', 'quiz', 'view.php?q='.$quiz->id); } } else if($numattempts > 1 && $quiz->delay2) { if ($timenow - $quiz->delay2 < $lastattempt) { - error(get_string('timedelay', 'quiz'), 'view.php?q='.$quiz->id); + print_error('timedelay', 'quiz', 'view.php?q='.$quiz->id); } } } @@ -235,7 +235,7 @@ } if (!$questionlist) { - error(get_string('noquestionsfound', 'quiz'), 'view.php?q='.$quiz->id); + print_error('noquestionsfound', 'quiz', 'view.php?q='.$quiz->id); } $sql = "SELECT q.*, i.grade AS maxgrade, i.id AS instance". @@ -246,7 +246,7 @@ // Load the questions if (!$questions = get_records_sql($sql)) { - error(get_string('noquestionsfound', 'quiz'), 'view.php?q='.$quiz->id); + print_error('noquestionsfound', 'quiz', 'view.php?q='.$quiz->id); } // Load the question type specific information @@ -382,7 +382,7 @@ // Now is the right time to check the open and close times. if (!$ispreviewing && ($timestamp < $quiz->timeopen || ($quiz->timeclose && $timestamp > $quiz->timeclose))) { - error(get_string('notavailable', 'quiz'), "view.php?id={$cm->id}"); + print_error('notavailable', 'quiz', "view.php?id={$cm->id}"); } /// Print the quiz page //////////////////////////////////////////////////////// diff --git a/mod/quiz/quizfile.php b/mod/quiz/quizfile.php index 44d3b0f9348..f168a7d0145 100644 --- a/mod/quiz/quizfile.php +++ b/mod/quiz/quizfile.php @@ -106,6 +106,6 @@ send_file($pathname, $filename, $lifetime); } else { header('HTTP/1.0 404 not found'); - error(get_string('filenotfound', 'error')); //this is not displayed on IIS?? + print_error('filenotfound', 'error'); //this is not displayed on IIS?? } ?> diff --git a/mod/quiz/reviewquestion.php b/mod/quiz/reviewquestion.php index cc8c7f80516..54cdca52b46 100644 --- a/mod/quiz/reviewquestion.php +++ b/mod/quiz/reviewquestion.php @@ -66,14 +66,14 @@ // If not even responses are to be shown in review then we // don't allow any review if (!($quiz->review & QUIZ_REVIEW_RESPONSES)) { - error(get_string("noreview", "quiz")); + print_error("noreview", "quiz"); } if ((time() - $attempt->timefinish) > 120) { // always allow review right after attempt if ((!$quiz->timeclose or time() < $quiz->timeclose) and !($quiz->review & QUIZ_REVIEW_OPEN)) { - error(get_string("noreviewuntil", "quiz", userdate($quiz->timeclose))); + print_error("noreviewuntil", "quiz", '', userdate($quiz->timeclose)); } if ($quiz->timeclose and time() >= $quiz->timeclose and !($quiz->review & QUIZ_REVIEW_CLOSED)) { - error(get_string("noreview", "quiz")); + print_error("noreview", "quiz"); } } if ($attempt->userid != $USER->id) { diff --git a/mod/resource/type/ims/deploy.php b/mod/resource/type/ims/deploy.php index 9e5426df132..1eed7f40636 100644 --- a/mod/resource/type/ims/deploy.php +++ b/mod/resource/type/ims/deploy.php @@ -73,9 +73,9 @@ /// Security Constraints (sesskey and isteacheredit) if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); + print_error('confirmsesskeybad', 'error'); } else if (!has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $courseid))) { - error(get_string('onlyeditingteachers', 'error')); + print_error('onlyeditingteachers', 'error'); } /// diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 3361e65aa3f..3ba0bc0c4ea 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -61,7 +61,7 @@ function scorm_add_instance($scorm) { return $id; } else { - error(get_string('badpackage','scorm')); + print_error('badpackage','scorm'); } } diff --git a/mod/wiki/admin.php b/mod/wiki/admin.php index 77c207a3ab6..05a4cb38f20 100644 --- a/mod/wiki/admin.php +++ b/mod/wiki/admin.php @@ -58,7 +58,7 @@ /// Is an Action given ? if(!$action) { - error(get_string("noadministrationaction","wiki")); + print_error("noadministrationaction","wiki"); } /// Correct Action ? @@ -69,7 +69,7 @@ /// May the User administrate it ? if (($wiki_entry = wiki_get_entry($wiki, $course, $userid, $groupid)) === false || wiki_can_edit_entry($wiki_entry, $wiki, $USER, $course) === false) { - error(get_string("notadministratewiki","wiki")); + print_error("notadministratewiki","wiki"); } $canedit = wiki_can_edit_entry($wiki_entry, $wiki, $USER, $course); diff --git a/mod/workshop/submissions.php b/mod/workshop/submissions.php index 000165b4a13..2c5831deb2a 100644 --- a/mod/workshop/submissions.php +++ b/mod/workshop/submissions.php @@ -238,7 +238,7 @@ error("Edit submission: Userids do not match"); } if (($submission->timecreated < ($timenow - $CFG->maxeditingtime)) and ($workshop->assessmentstart < $timenow)) { - error(get_string('notallowed', 'workshop')); + print_error('notallowed', 'workshop'); } ?> diff --git a/question/category_class.php b/question/category_class.php index c4af0dbcf92..28ea8017fb3 100644 --- a/question/category_class.php +++ b/question/category_class.php @@ -363,7 +363,7 @@ class question_category_object { */ function add_category($newparent, $newcategory, $newinfo) { if (empty($newcategory)) { - error(get_string('categorynamecantbeblank', 'quiz')); + print_error('categorynamecantbeblank', 'quiz'); } list($parentid, $contextid) = explode(',', $newparent); //moodle_form makes sure select element output is legal no need for further cleaning @@ -396,7 +396,7 @@ class question_category_object { function update_category($updateid, $newparent, $newname, $newinfo) { global $CFG, $QTYPES; if (empty($newname)) { - error(get_string('categorynamecantbeblank', 'quiz')); + print_error('categorynamecantbeblank', 'quiz'); } list($parentid, $tocontextid) = explode(',', $newparent); diff --git a/question/editlib.php b/question/editlib.php index 7e1b22077d7..68aabb793fd 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -680,7 +680,7 @@ function question_edit_setup($edittab, $requirecmid = false, $requirecourseid = if (!empty($pagevars['cat'])){ $catparts = explode(',', $pagevars['cat']); if (!$catparts[0] || (FALSE !== array_search($catparts[1], $contextlistarr)) || !count_records_select("question_categories", "id = '".$catparts[0]."' AND contextid = $catparts[1]")) { - error(get_string('invalidcategory', 'quiz')); + print_error('invalidcategory', 'quiz'); } } else { $category = $defaultcategory; diff --git a/question/file.php b/question/file.php index 841a317bf5c..a6a5cb31b48 100644 --- a/question/file.php +++ b/question/file.php @@ -81,6 +81,6 @@ function question_attempt_not_found() { global $CFG; header('HTTP/1.0 404 not found'); - error(get_string('filenotfound', 'error'), $CFG->wwwroot); //this is not displayed on IIS?? + print_error('filenotfound', 'error', $CFG->wwwroot); //this is not displayed on IIS?? } ?> diff --git a/question/import.php b/question/import.php index ee11b55dee3..a763f375cf1 100644 --- a/question/import.php +++ b/question/import.php @@ -95,12 +95,12 @@ if (file_exists($importfile)) { $fileisgood = true; } else { - error(get_string('uploadproblem', 'moodle', $form->choosefile)); + print_error('uploadproblem', 'moodle', $form->choosefile); } } else { // must be upload file if (!$importfile = $import_form->get_importfile_name()) { - error(get_string('uploadproblem', 'moodle')); + print_error('uploadproblem', 'moodle'); }else { $fileisgood = true; } @@ -110,7 +110,7 @@ if ($fileisgood) { if (! is_readable("format/$form->format/format.php")) { - error(get_string('formatnotfound','quiz', $form->format)); + print_error('formatnotfound','quiz', $form->format); } require_once("format.php"); // Parent class diff --git a/question/preview.php b/question/preview.php index 2246b13fec1..489535489ba 100644 --- a/question/preview.php +++ b/question/preview.php @@ -98,7 +98,7 @@ // Load the question type specific information if (!get_question_options($questions)) { - error(get_string('newattemptfail', 'quiz')); + print_error('newattemptfail', 'quiz'); } // Create a dummy quiz attempt @@ -133,7 +133,7 @@ // Create an empty session for the question if (!$newstates = get_question_states($questions, $quiz, $attempt)) { - error(get_string('newattemptfail', 'quiz')); + print_error('newattemptfail', 'quiz'); } $SESSION->quizpreview->states = array($newstates); $states =& $SESSION->quizpreview->states; diff --git a/search/add.php b/search/add.php index dbe45333ca7..65ddd23c7c1 100644 --- a/search/add.php +++ b/search/add.php @@ -17,11 +17,11 @@ require_once("$CFG->dirroot/search/lib.php"); require_login(); if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } if (!isadmin()) { - error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php"); + print_error('beadmin', 'search', "$CFG->wwwroot/login/index.php"); } //check for php5 (lib.php) @@ -141,4 +141,4 @@ set_config("search_index_size", (int)$CFG->search_index_size + (int)$addition_co mtrace("Added $addition_count documents."); mtrace('Index size after: '.$index->count()); -?> \ No newline at end of file +?> diff --git a/search/delete.php b/search/delete.php index 11effeea0f4..4808c9ec48f 100644 --- a/search/delete.php +++ b/search/delete.php @@ -17,11 +17,11 @@ require_once("$CFG->dirroot/search/lib.php"); require_login(); if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } if (!isadmin()) { - error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php"); + print_error('beadmin', 'search', "$CFG->wwwroot/login/index.php"); } //if //check for php5 (lib.php) @@ -129,4 +129,4 @@ set_config("search_index_size", (int)$CFG->search_index_size - (int)$deletion_co mtrace("Finished $deletion_count removals."); mtrace('Index size after: '.$index->count()); -?> \ No newline at end of file +?> diff --git a/search/indexer.php b/search/indexer.php index d00928f425c..09c67342038 100644 --- a/search/indexer.php +++ b/search/indexer.php @@ -33,11 +33,11 @@ require_once("$CFG->dirroot/search/lib.php"); require_login(); if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } if (!isadmin()) { - error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php"); + print_error('beadmin', 'search', "$CFG->wwwroot/login/index.php"); } //if //confirmation flag to prevent accidental reindexing (indexersplash.php is the correct entry point) @@ -200,4 +200,4 @@ set_config('search_indexer_run_date', time()); //and the index size set_config('search_index_size', (int)$index->count()); -?> \ No newline at end of file +?> diff --git a/search/indexersplash.php b/search/indexersplash.php index 27edca42c0b..49381d512ce 100644 --- a/search/indexersplash.php +++ b/search/indexersplash.php @@ -16,11 +16,11 @@ require_once("$CFG->dirroot/search/lib.php"); require_login(); if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } if (!isadmin()) { - error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php"); + print_error('beadmin', 'search', "$CFG->wwwroot/login/index.php"); } //check for php5 (lib.php) diff --git a/search/query.php b/search/query.php index 03675ab9745..7c9bae0c594 100644 --- a/search/query.php +++ b/search/query.php @@ -35,7 +35,7 @@ if ($CFG->forcelogin) { } if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } $adv = new Object(); @@ -343,4 +343,4 @@ if ($sq->is_valid()) { } print_box_end(); print_footer(); -?> \ No newline at end of file +?> diff --git a/search/stats.php b/search/stats.php index cd956e0ceed..1d50be0d81b 100644 --- a/search/stats.php +++ b/search/stats.php @@ -18,7 +18,7 @@ if ($CFG->forcelogin) { } if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } //check for php5, but don't die yet diff --git a/search/update.php b/search/update.php index f641f1b39ff..b0f53797d86 100644 --- a/search/update.php +++ b/search/update.php @@ -17,11 +17,11 @@ require_once("$CFG->dirroot/search/lib.php"); require_login(); if (empty($CFG->enableglobalsearch)) { - error(get_string('globalsearchdisabled', 'search')); + print_error('globalsearchdisabled', 'search'); } if (!isadmin()) { - error(get_string('beadmin', 'search'), "$CFG->wwwroot/login/index.php"); + print_error('beadmin', 'search', "$CFG->wwwroot/login/index.php"); } //check for php5 (lib.php) @@ -140,4 +140,4 @@ set_config("search_indexer_update_date", $startupdatedate); mtrace("Finished $update_count updates"); -?> \ No newline at end of file +?> diff --git a/tag/edit.php b/tag/edit.php index 8fee2b462ea..0ce61b4a5e7 100644 --- a/tag/edit.php +++ b/tag/edit.php @@ -9,7 +9,7 @@ require_js(array('yui_dom-event', 'yui_connection', 'yui_animation', 'yui_autoco require_login(); if (empty($CFG->usetags)) { - error(get_string('tagsaredisabled', 'tag')); + print_error('tagsaredisabled', 'tag'); } $tag_id = optional_param('id', 0, PARAM_INT); diff --git a/tag/index.php b/tag/index.php index 082378072cc..7f0034e4e68 100644 --- a/tag/index.php +++ b/tag/index.php @@ -9,7 +9,7 @@ require_once($CFG->dirroot.'/blog/lib.php'); require_login(); if (empty($CFG->usetags)) { - error(get_string('tagsaredisabled', 'tag')); + print_error('tagsaredisabled', 'tag'); } $tagid = optional_param('id', 0, PARAM_INT); // tag id diff --git a/tag/manage.php b/tag/manage.php index 2a130e26a88..eb297377667 100644 --- a/tag/manage.php +++ b/tag/manage.php @@ -16,7 +16,7 @@ $perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); require_login(); if (empty($CFG->usetags)) { - error(get_string('tagsaredisabled', 'tag')); + print_error('tagsaredisabled', 'tag'); } //managing tags requires moodle/tag:manage capability diff --git a/tag/search.php b/tag/search.php index 42da0659874..cf6563d5780 100644 --- a/tag/search.php +++ b/tag/search.php @@ -8,7 +8,7 @@ global $CFG; require_login(); if( empty($CFG->usetags)) { - error(get_string('tagsaredisabled', 'tag')); + print_error('tagsaredisabled', 'tag'); } $query = optional_param('query', '', PARAM_RAW); diff --git a/tag/tag_autocomplete.php b/tag/tag_autocomplete.php index 7eaefb9c454..6d88cd0fad6 100644 --- a/tag/tag_autocomplete.php +++ b/tag/tag_autocomplete.php @@ -6,7 +6,7 @@ require_once('lib.php'); require_login(); if (empty($CFG->usetags)) { - error(get_string('tagsaredisabled', 'tag')); + print_error('tagsaredisabled', 'tag'); } $query = addslashes(optional_param('query', '', PARAM_RAW)); diff --git a/user/pixgroup.php b/user/pixgroup.php index 28aeedcbdcb..6f72d38704f 100644 --- a/user/pixgroup.php +++ b/user/pixgroup.php @@ -28,6 +28,6 @@ send_file($pathname, $image); } else { header('HTTP/1.0 404 not found'); - error(get_string('filenotfound', 'error')); //this is not displayed on IIS?? + print_error('filenotfound', 'error'); //this is not displayed on IIS?? } ?> diff --git a/user/view.php b/user/view.php index bbd03126be7..393af6bd0cf 100644 --- a/user/view.php +++ b/user/view.php @@ -116,7 +116,7 @@ if (!$gtrue) { $navigation = build_navigation($navlinks); print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, " ", navmenu($course)); - error(get_string("groupnotamember"), "../course/view.php?id=$course->id"); + print_error("groupnotamember", '', "../course/view.php?id=$course->id"); } } }