]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Tue, 13 May 2008 06:15:20 +0000 (06:15 +0000)
committerdongsheng <dongsheng>
Tue, 13 May 2008 06:15:20 +0000 (06:15 +0000)
course/format/topics/format.php
course/import/activities/index.php
course/report/log/graph.php
course/report/log/live.php
course/report/outline/index.php
course/report/stats/graph.php
course/report/stats/index.php
course/report/stats/report.php
lang/en_utf8/error.php

index 3dc459d44b7fd8c70f84dbd8a93f4943ec61f40b..10e37453ac0abb289940cf4885d10b04e76db450 100644 (file)
@@ -44,7 +44,7 @@
     if (($marker >=0) && has_capability('moodle/course:setcurrentsection', $context) && confirm_sesskey()) {
        $course->marker = $marker;
        if (! set_field("course", "marker", $marker, "id", $course->id)) {
-           print_error("Could not mark that topic for this course");
+           print_error("cannotmarktopic");
        }
     }
 
index 5677d865d74baec26e6cf3f0262041f432ea4860..136d540ac88b0d08413e49f01e9e3ef1f69326e8 100644 (file)
     $strimportactivities = get_string('importactivities');
 
     if (! ($course = get_record("course", "id", $id)) ) {
-        print_error("That's an invalid course id");
+        print_error("invalidcourseid");
     }
 
     if (!$site = get_site()){
-        print_error("Couldn't get site course");
+        print_error("siteisnotdefined", 'debug');
     }
 
     require_login($course->id);
@@ -28,7 +28,7 @@
     $syscontext = get_context_instance(CONTEXT_SYSTEM);
 
     if (!has_capability('moodle/course:manageactivities', $tocontext)) {
-        print_error("You need do not have the required permissions to import activities to this course");
+        print_error('nopermissiontoimportact');
     }
 
     // if we're not a course creator , we can only import from our own courses.
@@ -38,7 +38,7 @@
 
     if ($from = get_record('course', 'id', $fromcourse)) {
         if (!has_capability('moodle/course:manageactivities', $fromcontext)) {
-            print_error("You need to have the required permissions in the course you are importing data from, as well");
+            print_error('nopermissiontoimportact');
         }
         if (!empty($filename) && file_exists($CFG->dataroot.'/'.$filename) && !empty($SESSION->import_preferences)) {
             $restore = backup_to_restore_array($SESSION->import_preferences);
index ef7309b18dec5c652d5c17c6ce50d6c04b50fe93..c1f414f199022f0e938f0f1231407d09c0372b8b 100644 (file)
@@ -11,7 +11,7 @@
     $date = optional_param('date', 0, PARAM_INT);  // A time of a day (in GMT)
 
     if (! $course = get_record("course", "id", $id)) {
-        print_error("Course is misconfigured");
+        print_error('invalidcourseid');
     }
 
     require_login($course->id);
 
     if (! (has_capability('moodle/site:viewreports', $context)
                 or ($course->showreports and $USER->id == $user)) ) {
-        print_error("Sorry, you aren't allowed to see this.");
+        print_error("nopermissions");
     }
 
     if ($user) {
         if (! $user = get_record("user", "id", $user)) {
-            print_error("Can not find that user");
+            print_error("nousers");
         }
     }
 
index 732abadf99d730fc123ac9643c469db29228e220..859efe0fde4323566509b55e143e5f03ae0fc5f9 100644 (file)
@@ -8,14 +8,14 @@
     $page = optional_param('page', 0, PARAM_INT);     // which page to show
 
     if (! $course = get_record("course", "id", $id) ) {
-        print_error("That's an invalid course id");
+        print_error('invalidcourseid');
     }
 
     require_login($course);
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (!has_capability('moodle/site:viewreports', $context)) {
-        print_error('You need do not have the required permission to view this report');
+        print_error('nopermissions');
     }
 
     add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id); 
index 628cf0e61cdc5f646b5479793a4e491c55fea68b..27c2a2e9a00e76414f8aa3df55adfdca4f76cc9c 100644 (file)
@@ -8,7 +8,7 @@
     $id = required_param('id',PARAM_INT);       // course id
 
     if (!$course = get_record('course', 'id', $id)) {
-        print_error('Course id is incorrect.');
+        print_error('invalidcourseid');
     }
 
     require_login($course);
@@ -32,7 +32,7 @@
     print_heading(format_string($course->fullname));
 
     if (!$logstart = get_field_sql("SELECT MIN(time) FROM {$CFG->prefix}log")) {
-        print_error('Logs not available');
+        print_error('logfilenotavailable');
     }
 
     echo '<div class="loginfo">'.get_string('computedfromlogs', 'admin', userdate($logstart)).'</div>';
index 34e51a9838da1381d29bece3de9188e8a7ec175c..732116e91cce9e7be05790091a19744ebd369c3b 100644 (file)
     $roleid   = optional_param('roleid',0,PARAM_INT);
 
     if (!$course = get_record("course","id",$courseid)) {
-        print_error("That's an invalid course id");
+        print_error("invalidcourseid");
     }
 
     if (!empty($userid)) {
         if (!$user = get_record('user','id',$userid)) {
-            print_error("That's an invalid user id");
+            print_error("nousers");
         }
     }
 
@@ -25,7 +25,7 @@
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
 
     if (!has_capability('moodle/site:viewreports', $context)) {
-        print_error('You need do not have the required permission to view reports for this course');
+        print_error('nopermissions');
     }
 
     stats_check_uptodate($course->id);
index 7183df393b86d0c9c2d42f8ccd1cb42994ddb188..3f12f58f8837f955bccb87b77c9724dfd7034371 100644 (file)
@@ -5,7 +5,7 @@
     require_once($CFG->dirroot.'/course/report/stats/lib.php');
 
     if (empty($CFG->enablestats)) {
-        print_error("Stats is not enabled.");
+        print_error("statsdisable");
     }
 
     $courseid = required_param('course', PARAM_INT);
     }
 
     if (!$course = get_record("course","id",$courseid)) {
-        print_error("That's an invalid course id");
+        print_error("invalidcourseid");
     }
 
     if (!empty($userid)) {
         if (!$user = get_record('user','id',$userid)) {
-            print_error("That's an invalid user id");
+            print_error("nousers");
         }
     }
 
index 6093ac84191a404c20232e309149c7acccabd035..f85a32a967fa4868841190666d6ea8c9428b9ada 100644 (file)
@@ -31,7 +31,7 @@
             .' ORDER BY u.lastname, u.firstname ASC';
 
         if (!$us = get_records_sql($sql)) {
-            print_error('Cannot enter detailed view: No users found for this course.');
+            print_error('nousers');
         }
 
         foreach ($us as $u) {
@@ -68,7 +68,7 @@
 
     if (!empty($report) && !empty($time)) {
         if ($report == STATS_REPORT_LOGINS && $course->id != SITEID) {
-            print_error('This type of report is only available for the site course');
+            print_error('reportnotavailable');
         }
 
         $param = stats_get_parameters($time,$report,$course->id,$mode);
index b6c4f66aef4b29c7fc0a3f689085d71f4f6875a5..178117b1d5bf6c9d4bef6186b6a57dfab5419c31 100644 (file)
@@ -43,6 +43,7 @@ $string['cannotfindinfo'] = 'Cannot find info for: \"$a\"';
 $string['cannotfindhelp'] = 'Cannot find \"$a\" language help files';
 $string['cannotfindlang'] = 'Cannot find \"$a\" language pack!';
 $string['cannotfindsite'] = 'Cannot find site-level course';
+$string['cannotmarktopic'] = 'Could not mark that topic for this course';
 $string['cannotmoverolewithid'] = 'Cannot move role with ID $a';
 $string['cannotmetacourse'] = 'Could not add the selected course to this meta course!';
 $string['cannotoverridebaserole'] = 'Can not override base role capabilities';
@@ -149,6 +150,7 @@ $string['listcantmoveleft'] = 'Failed to move item left, it has no parent.';
 $string['listcantmoveright'] = 'Failed to move item right, their is no peer to make it a child of. Move it below another peer and then you can move it right.';
 $string['loginasonecourse'] = 'You can not enter this course.<br /> You have to terminate the \"Login as\" session before entering any other course.';
 $string['loginasnoenrol'] = 'You can not use enrol or unenrol when in course \"Login as\" session.';
+$string['logfilenotavailable] = 'Logs not available';
 $string['messagingdisable'] = 'Messaging is disabled on this site';
 $string['missingfield'] = 'Field \"$a\" is missing.';
 $string['missingrequiredfield'] = 'Some required field is missing';
@@ -177,6 +179,7 @@ $string['nousers'] = 'No such user!';
 $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['nopermissiontoimportact'] = 'You need do not have the required permissions to import activities to this course';
 $string['nopermissiontoviewpage'] = 'You are not allowed to look at this page';
 $string['nopermissiontomanagegroup'] = 'You do not have the required permissions to manage groups.';
 $string['nosite'] = 'No sites';
@@ -195,6 +198,7 @@ $string['processingstops'] = 'Processing stops here. Remaining records ignored.'
 $string['remotedownloaderror'] = 'Download of component to your server failed, please verify proxy settings, PHP cURL extension is highly recommended.<br /><br />You must download the <a href=\"$a->url\">$a->url</a> file manually, copy it to \"$a->dest\" in your server and unzip it there.';
 $string['remotedownloadnotallowed'] = 'Download of components to your server isn\'t allowed (allow_url_fopen is disabled).<br /><br />You must download the <a href=\"$a->url\">$a->url</a> file manually, copy it to \"$a->dest\" in your server and unzip it there.';
 $string['restricteduser'] = 'Sorry, but your current account \"$a\" is restricted from doing that.';
+$string['reportnotavailable'] = 'This type of report is only available for the site course';
 $string['rpcerror'] = 'RPC enrol/mnet/available_courses: ($a)';
 $string['scheduledbackupsdisabled'] = 'Scheduled backups have been disabled by the server admin';
 $string['sectionnotexist'] = 'This section does not exist';
@@ -207,6 +211,7 @@ $string['statscatchupmode'] = 'Statistics is currently in catchup mode. So far $
 $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['unspecifycourseid'] = 'Must specify course id, short name or idnumber';
+$string['statsdisable'] = 'Stats is not enabled.';
 $string['statsnodata'] = 'There is no available data for that combination of course and time period.';
 $string['statsdisable'] = 'Stats is not enabled.';
 $string['unenrolerror'] = 'An error occurred while trying to unenrol that person.';