From e6edb40e7a0e95b89fc716cec8a3bd0d817229ed Mon Sep 17 00:00:00 2001 From: dongsheng Date: Sun, 15 Jun 2008 11:47:27 +0000 Subject: [PATCH] "MDL-14129, fix print_error" --- lang/en_utf8/debug.php | 1 + lang/en_utf8/error.php | 1 + lib/accesslib.php | 2 +- lib/adminlib.php | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/en_utf8/debug.php b/lang/en_utf8/debug.php index bded62dd24..365bcba1c4 100644 --- a/lang/en_utf8/debug.php +++ b/lang/en_utf8/debug.php @@ -11,6 +11,7 @@ $string['cannotupgradecapabilities'] = 'Had trouble upgrading the core capabilit $string['cannotupdateversion'] = 'Upgrade failed! (Could not update version in config table)'; $string['cannotupdaterelease'] = 'ERROR: Could not update release version in database!!'; $string['cannotsetupsite'] = 'Serious Error! Could not set up the site!'; +$string['cannotsetuptable'] = '$a tables could NOT be set up successfully!'; $string['cannotfindadmin'] = 'Could not find an admin user!'; $string['cannotupgradedbcustom'] = 'Upgrade of local database customisations failed! (Could not update version in config table)'; $string['configmoodle'] = 'Moodle has not been configured yet. You need to edit config.php first.'; diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index 090ccf7f80..a1aaa5aba0 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -18,6 +18,7 @@ $string['cannotaddcoursemodule'] = 'Could not add a new course module'; $string['cannotaddcoursemoduletosection'] = 'Could not add the new course module to that section'; $string['cannotaddcmtosection'] = 'Could not add the new course module to that section'; $string['cannotaddrss'] = 'You do not have permission to add rss feeds'; +$string['cannotaddmodule'] = '$a module could not be added to the module list!'; $string['cannotaddnewmodule'] = 'Could not add a new module of $a'; $string['cannotaddnewinstance'] = 'Could not add a new instance of $a'; $string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"'; diff --git a/lib/accesslib.php b/lib/accesslib.php index e72cc41021..4f6eeb5578 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -880,7 +880,7 @@ function require_capability($capability, $context, $userid=NULL, $doanything=tru if (!has_capability($capability, $context, $userid, $doanything)) { $capabilityname = get_capability_string($capability); - print_error($errormessage, $stringfile, $errorlink, $capabilityname); + print_error('nopermissions', '', $errorlink, $capabilityname); } } diff --git a/lib/adminlib.php b/lib/adminlib.php index 3cae116116..6a1a87b045 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -558,10 +558,10 @@ function upgrade_activity_modules($return) { echo '
'; } } else { - print_error($module->name .' module could not be added to the module list!'); + print_error('cannotaddmodule', '', '', $module->name); } } else { - print_error($module->name .' tables could NOT be set up successfully!'); + print_error('cannotsetuptable', 'debug', '', $module->name); } } -- 2.39.5