From 51770f92eb0d51483bab29a82e332650603ad247 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 10 Apr 2008 05:58:13 +0000 Subject: [PATCH] MDL-14129, createing error string --- admin/report/backups/index.php | 2 +- admin/report/courseoverview/index.php | 2 +- admin/report/courseoverview/reportsgraph.php | 2 +- admin/report/stats/index.php | 4 ++-- lang/en_utf8/error.php | 4 ++++ lang/en_utf8/moodle.php | 2 -- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/admin/report/backups/index.php b/admin/report/backups/index.php index a8a4925dee..4591676982 100644 --- a/admin/report/backups/index.php +++ b/admin/report/backups/index.php @@ -15,7 +15,7 @@ /// Scheduled backups are disabled by the server admin if (!empty($CFG->disablescheduledbackups)) { - print_error('scheduledbackupsdisabled', '', '', NULL, true); + print_error('scheduledbackupsdisabled', 'error'); } /// Scheduled backups aren't active by the site admin diff --git a/admin/report/courseoverview/index.php b/admin/report/courseoverview/index.php index b4651036c4..7bbd95c491 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', 'error', $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 a03e2d4e2d..a0c71c0faa 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', 'error', $CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php'); } diff --git a/admin/report/stats/index.php b/admin/report/stats/index.php index 149f769af2..0d857c3284 100644 --- a/admin/report/stats/index.php +++ b/admin/report/stats/index.php @@ -32,12 +32,12 @@ } if (!$course = get_record("course","id",$courseid)) { - print_error("That's an invalid course id"); + print_error('invalidcourse', 'error'); } if (!empty($userid)) { if (!$user = get_record('user','id',$userid)) { - print_error("That's an invalid user id"); + print_error('invaliduser', 'error'); } } diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index ae4d520ab4..d173f6e917 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -33,6 +33,7 @@ $string['cannotsavezipfile'] = 'Cannot save ZIP file.'; $string['cannotsetupcategory'] = 'Serious Error! Could not set up a default course category!'; $string['cannotsetupsite'] = 'Serious Error! Could not set up the site!'; $string['cannotunzipfile'] = 'Cannot unzip file.'; +$string['cannotupdaterole'] = 'Cannot update role!'; $string['cannotviewprofile'] = 'You can not view the profile of this user.'; $string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.'; $string['cantunenrollinthisrole'] = 'You can not unenrol from this course while you are in your current role.'; @@ -77,6 +78,7 @@ $string['invalidmd5'] = 'Invalid md5'; $string['invalidrequest'] = 'Invalid request'; $string['invalidrole'] = 'Invalid role'; $string['invalidurl'] = 'Invalid url'; +$string['invaliduser'] = 'Invalid user'; $string['iplookupfailed'] = 'Can not find geo information about this IP address $a.'; $string['iplookupprivate'] = 'Can not display lookup of private IP address'; $string['invalidxmlfile'] = '\"$a\" is not a valid XML file'; @@ -104,6 +106,7 @@ $string['nonmeaningfulcontent'] = 'Non meaningful content'; $string['noparticipatorycms'] = 'Sorry, but you have no participatory course modules to report on.'; $string['nopermissions'] = 'Sorry, but you do not currently have permissions to do that ($a)'; $string['nosite'] = 'No sites'; +$string['nostatstodisplay'] = 'There is no available data to display, sorry.'; $string['notavailable'] = 'That is not currently available'; $string['onlyadmins'] = 'Only administrators can do that.'; $string['onlyeditingteachers'] = 'Only editing teachers can do that.'; @@ -123,6 +126,7 @@ $string['sessionipnomatch'] = 'Sorry, but your IP number seems to have changed f $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['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['statsnodata'] = 'There is no available data for that combination of course and time period.'; $string['unknowncourse'] = 'Unknown course named \"$a\"'; $string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"'; $string['unknowngroup'] = 'Unknown group \"$a\"'; diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index c97387c9fd..2958474bb9 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1078,7 +1078,6 @@ $string['noresults'] = 'No results'; $string['normal'] = 'Normal'; $string['normalfilter'] = 'Normal search'; $string['nosite'] = 'Could not find site-level course'; -$string['nostatstodisplay'] = 'There is no available data to display, sorry.'; $string['nostudentsfound'] = 'No $a found'; $string['nostudentsingroup'] = 'There are no students in this group yet'; $string['nostudentsyet'] = 'No students enrolled in this course yet'; @@ -1393,7 +1392,6 @@ $string['stats'] = 'Statistics'; $string['statslogins'] = 'Logins'; $string['statsmodedetailed'] = 'Detailed (user) view'; $string['statsmodegeneral'] = 'General view'; -$string['statsnodata'] = 'There is no available data for that combination of course and time period.'; $string['statsnodatauser'] = 'There is no available data for that combination of course, user and time period.'; $string['statsoff'] = 'Statistics is not currently enabled'; $string['statsreads'] = 'Views'; -- 2.39.5