From 4f2a63c81e36e444eb62de8234afa9b219151a70 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Sun, 15 Jun 2008 10:13:30 +0000 Subject: [PATCH] "MDL-14129, fix print_error" --- lang/en_utf8/error.php | 2 ++ message/discussion.php | 2 +- theme/chameleon/ui/css.php | 4 ++-- theme/index.php | 4 ++-- theme/preview.php | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 08beca639d..12ad4cd865 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -109,6 +109,7 @@ $string['cannotsavezipfile'] = 'Cannot save ZIP file.'; $string['cannotsetparentforcatoritem'] = 'Can not set parent for category or course item!'; $string['cannotsetpassword'] = 'Could not set user password!'; $string['cannotsetprefgrade'] = 'Could not set preference aggregationview to $a for this grade category'; +$string['cannotsettheme'] = 'Could not set the theme!'; $string['cannotsetupblock'] = 'Blocks tables could NOT be set up successfully!'; $string['cannotsetupcategory'] = 'Serious Error! Could not set up a default course category!'; $string['cannotsetupcapforplugin'] = 'Could not set up the capabilities for $a'; @@ -356,6 +357,7 @@ $string['spellcheckernotconf'] = 'Spellchecker not configured'; $string['statscatchupmode'] = 'Statistics is currently in catchup mode. So far $a->daysdone day(s) have been processed and $a->dayspending are pending. Check back soon!'; $string['tagnotfound'] = 'The specified tag was not found in the database'; $string['tagdisabled'] = 'Tags are disabled!'; +$string['themenotinstall'] = 'This theme is not installed!'; $string['transactionvoid'] = 'Transaction can not be voided because of already been voided.'; $string['unicodeupgradeerror'] = 'Sorry, but your database is not already in Unicode, and this version of Moodle is not able to migrate your database to Unicode. Please upgrade to Moodle 1.7.x first and perform the Unicode migration from the Admin page. After that is done you should be able to migrate to Moodle $a'; $string['unspecifycourseid'] = 'Must specify course id, short name or idnumber'; diff --git a/message/discussion.php b/message/discussion.php index 03b0243933..aa84495084 100644 --- a/message/discussion.php +++ b/message/discussion.php @@ -19,7 +19,7 @@ /// Check the user we are talking to is valid if (! $user = $DB->get_record('user', array('id'=>$userid))) { - print_error("User ID was incorrect"); + print_error('invaliduserid'); } /// Check if frame&jsless mode selected diff --git a/theme/chameleon/ui/css.php b/theme/chameleon/ui/css.php index d7bd0fc565..2cfbcd3765 100644 --- a/theme/chameleon/ui/css.php +++ b/theme/chameleon/ui/css.php @@ -10,7 +10,7 @@ if (empty($THEME->chameleonenabled)) { $id = optional_param('id', SITEID, PARAM_INT); if (!$course = $DB->get_record('course', array('id'=>$id))) { - print_error('Incorrect course id'); + print_error('invalidcourseid'); } course_setup($course); // we should not require login here @@ -61,4 +61,4 @@ if (isset($_POST['css'])) { } -?> \ No newline at end of file +?> diff --git a/theme/index.php b/theme/index.php index 371e66b77c..636e4f5c82 100644 --- a/theme/index.php +++ b/theme/index.php @@ -23,7 +23,7 @@ if ($choose and confirm_sesskey()) { if (!is_dir($CFG->themedir .'/'. $choose)) { - print_error("This theme is not installed!"); + print_error('themenotinstall'); } if (set_config("theme", $choose)) { theme_setup($choose); @@ -47,7 +47,7 @@ admin_externalpage_print_footer(); exit; } else { - print_error("Could not set the theme!"); + print_error('cannotsettheme'); } } diff --git a/theme/preview.php b/theme/preview.php index 99b89e2c99..0776667eef 100644 --- a/theme/preview.php +++ b/theme/preview.php @@ -9,7 +9,7 @@ } if (! $site = get_site()) { - print_error("Site doesn't exist!"); + print_error('siteisnotdefined', 'debug'); } require_login(); -- 2.39.5