}
if ($targetdb->get_tables()) {
// TODO add exception or string...
- error('Sorry, tables already exist in selected database. Can not continue.');
+ print_error('ddltablealreadyexists');
}
admin_externalpage_print_header();
dbtransfer_transfer_database($DB, $targetdb);
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
} else {
- error("Stats is not enabled.");
+ print_error('statsdisable');
}
}
/// Define variables used in page
if (!$site = get_site()) {
- error("No site found!");
+ print_error('nosite');
}
if (empty($CFG->langmenu)) {
//Get and check course
if (! $course = get_record("course", "id", $id)) {
- error("Course ID was incorrect (can't find it)");
+ print_error('invalidcourseid');
}
// To some reasons, course_startdateoffset value was lost during restoring
// See MDL-17469
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('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');
+ print_error('cannotmakemodification', 'rss_client', $referrer);
}
} 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('noguestpost', 'forum', $referrer, 'You are not allowed to make modifications to this RSS feed at this time.');
+ print_error('cannotmakemodification', 'rss_client', $referrer);
}
$file = $CFG->dataroot .'/cache/rsscache/'. $rssid .'.xml';
$id = optional_param('id', 0, PARAM_INT);// Course ID
if (!$course = $DB->get_record('course', array('id'=>$id)) ) {
- error('That\'s an invalid course id'.$id);
+ print_error('invalidcourseid');
}
require_login($course);
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
} else {
- error("Stats is not enabled.");
+ print_error('statsdisable');
}
}
// Make sure course is OK and user has access to manage groups
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
- error('Course ID was incorrect');
+ print_error('invalidcourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$groupnames = array();
foreach($groupidarray as $groupid) {
if (!$group = $DB->get_record('groups', array('id' => $groupid))) {
- error('Group ID was incorrect');
+ print_error('invalidgroupid');
}
if ($courseid != $group->courseid) {
- error('Group not on required course');
+ print_error('groupunknown', '', '', $group->courseid);
}
$groupnames[] = format_string($group->name);
}
$string['addheadlineblock'] = 'Add RSS headline block';
$string['addnew'] = 'Add New';
$string['blockname'] = 'RSS Client';
+$string['cannotmakemodification'] = 'You are not allowed to make modifications to this RSS feed at this time.';
$string['choosefeedlabel'] = 'Choose the feeds which you would like to make available in this block:';
$string['clientchannellink'] = 'Source site...';
$string['clientnumentries'] = 'The default number of entries to show per feed.';
$string['cannotopenforwrit'] = 'Cannot open for writing: $a';
$string['cannotopenfile'] = 'Cannot open file ($a)';
$string['cannotopentemplate'] = 'Cannot open template file ($a)';
+$string['cannotopenzip'] = 'Can not open zip file, probably zip extension bug on 64bit os';
$string['cannotoverridebaserole'] = 'Cannot override base role capabilities';
$string['cannotoverriderolehere'] = 'You are not allowed to override this role (id = $a->roleid) in this context ($a->context)';
$string['cannotreadtmpfile'] = 'Error reading temporary file';
$string['tagdisabled'] = 'Tags are disabled!';
$string['themenotinstall'] = 'This theme is not installed!';
$string['transactionvoid'] = 'Transaction cannot be voided because it has already been voided';
+$string['TODO'] = 'TODO';
$string['importformatnotimplement'] = 'Sorry, importing this format is not yet implemented!';
$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['missingoption'] = 'The cloze question $a is missing its options';
$string['missingimportantcode'] = 'This question type is missing important code: $a.';
$string['missingcourseorcmid'] = 'Need to provide courseid or cmid to print_question.';
+$string['missingcourseorcmidtolink'] = 'Need to provide courseid or cmid to get_question_edit_link.';
$string['modified'] = 'Last saved';
$string['move']= 'Move from $a and change links.';
$string['movecategory']= 'Move Category';
array_unshift($params, $newvalue);
break;
default:
- $this->lastError = 'Unknown parameter type in file ' . __FILE__ . ' on line ' . __LINE__ . '.';
- error($this->lastError);
+ $this->lastError = __FILE__ . ' LINE: ' . __LINE__ . '.';
+ print_error(unknowparamtype, 'error', '', $this->lastError);
}
}
$sql = "UPDATE {{$table}} SET $newfield $select";
}
public function sql_concat() {
- error('TODO');
+ print_error('TODO');
}
public function sql_concat_join($separator="' '", $elements=array()) {
- error('TODO');
+ print_error('TODO');
}
public function begin_sql() {
$this->close();
$res = $this->open($this->archivepathname, file_archive::OPEN, $this->encoding);
if ($res !== true) {
- error('Can not open zip file, probably zip extension bug on 64bit os'); //TODO ??
+ print_error('cannotopenzip'); //TODO ??
}
}
$this->close();
$res = $this->open($this->archivepathname, file_archive::OPEN, $this->encoding);
if ($res !== true) {
- error('Can not open zip file, probably zip extension bug on 64bit os'); //TODO ??
+ print_error('cannotopenzip'); //TODO ??
}
}
$this->usedmem += strlen($contents);
return ($this->pos < $this->count());
}
-}
\ No newline at end of file
+}
// Get the course object and related bits.
if (! $course = $DB->get_record("course", array("id"=> $quiz->course))) {
- error("This course doesn't exist");
+ print_error('invalidcourseid');
}
//you need mod/quiz:manage in addition to question capabilities to access this page.
require_capability('mod/quiz:manage', $contexts->lowest());
print_header_simple($streditingquiz, '', $navigation, "", "", true, $strupdatemodule);
if (!$quizname = $DB->get_field($cm->modname, 'name', array('id'=> $cm->instance))) {
- error('Cannot get the module name in build navigation.');
+ print_error('invalidcoursemodule');
}
print_heading(get_string("addrandomquestiontoquiz","quiz",$quizname), 'left', 2);
$qcobject->display_randomquestion_user_interface($addonpage);
print_footer($course);
-?>
\ No newline at end of file
+?>
$timenow = time();
if ($scorm->timeclose !=0) {
if ($scorm->timeopen > $timenow) {
- error(get_string("notopenyet", "scorm", userdate($scorm->timeopen)));
+ print_error('notopenyet', 'scorm', null, userdate($scorm->timeopen));
} else if ($timenow > $scorm->timeclose) {
- error(get_string("expired", "scorm", userdate($scorm->timeclose)));
+ print_error('expired', 'scorm', null, userdate($scorm->timeclose));
}
}
}
?>
</body>
-</html>
\ No newline at end of file
+</html>
} else if (!empty($cmoptions->course)) {
$linkurl .= '&courseid=' . $cmoptions->course;
} else {
- error('Need to provide courseid or cmid to get_question_edit_link.');
+ print_error('missingcourseorcmidtolink', 'question');
}
/// Work out the contents of the link.