$string['blocknameconflict'] = 'Naming conflict: block $a[0] has the same title with an existing block: $a[1]!';
$string['backupcontainexternal'] = 'This backup file contains external Moodle Network Hosts that are not configured locally';
$string['backuptablefail'] = 'Backup tables could NOT be set up successfully!';
+$string['boundsyntaxnotsupport'] = 'Pg $1, $2 bound syntax not supported yet :-(';
$string['cannotassignanthing'] = 'Cannot assign moodle/site:doanything';
$string['cannotassignrole'] = 'Cannot assign role in course';
$string['cannotassignselfasparent'] = 'Cannot assign self as parent!';
$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]\"';
+$string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"';
$string['cannotsavecomment'] = 'Cannot save comment';
$string['cannotsavefile'] = 'Cannot save the file\"$a[0]\/$a[1]\"!';
$string['cannotsavedata'] = 'Cannot save data';
$string['destinationcmnotexit'] = 'The destination course module does not exist';
$string['downloadedfilecheckfailed'] = 'Downloaded file check failed';
$string['duplicateusername'] = 'Duplicate username - skipping record';
+$string['duplicateparaminsql'] = 'ERROR: duplicate parameter name in query';
$string['duplicaterolename'] = 'There is already a role with this name!';
$string['duplicateroleshortname'] = 'There is already a role with this short name!';
$string['emailfail'] = 'Emailing failed';
$string['invalidmoduleid'] = 'Invalid module ID: $a';
$string['invalidmodulename'] = 'Invalid module name: $a';
$string['invalidnum'] = 'Invalid numeric value';
+$string['invalidnumkey'] = '$conditions array may not contain numeric keys, please fix the code!';
$string['invalidoutcome'] = 'Incorrect outcome id';
$string['invalidpagesize'] = 'Invalid page size';
$string['invalidpaymentmethod'] = 'Invalid payment method: $a';
+$stirng['invalidqueryparam'] = 'ERROR: Incorrect number of query parameters!!';
$string['invalidrequest'] = 'Invalid request';
$string['invalidrole'] = 'Invalid role';
+$string['invalidroleid'] = 'Invalid role ID';
$string['invalidscaleid'] = 'Incorrect scale id';
$string['invalidseeky'] = 'Incorrect sesskey submitted, form not accepted!';
$string['invalidsesskey'] = 'Incorrect sesskey submitted, form not accepted!';
$string['logfilenotavailable'] = 'Logs not available';
$string['messagingdisable'] = 'Messaging is disabled on this site';
$string['missingfield'] = 'Field \"$a\" is missing';
+$string['missingkeyinsql'] = 'ERROR: missing param \"$a\" in query'
$string['missingvarname'] = 'Required variable name is missing!';
$string['missinguseranditemid'] = 'Missing userid and itemid';
$string['missingparam'] = 'A required parameter ($a) was missing';
$string['missingrequiredfield'] = 'Some required field is missing';
$string['mimetexisnotexist'] = 'Your system is not configured to run mimeTeX. You need to download the appropriate executable for you PHP_OS platform from <a href=\"http://moodle.org/download/mimetex/\">http://moodle.org/download/mimetex/</a>, or obtain the C source from <a href=\"http://www.forkosh.com/mimetex.zip\"> http://www.forkosh.com/mimetex.zip</a>, compile it and put the executable into your moodle/filter/tex/ directory.';
$string['mimetexnotexecutable'] = 'Custom mimetex is not executable!';
+$string['mixedtypesqlparam'] = 'ERROR: Mixed types of sql query parameters!!';
$string['mnetdisable'] = 'MNET is disabled';
$string['mnetlocal'] = 'Remote MNET users cannot login locally';
$string['moduledoesnotexist'] = 'This module does not exist';
$string['nousers'] = 'No such user!';
$string['nonmeaningfulcontent'] = 'Non meaningful content';
$string['noparticipatorycms'] = 'Sorry, but you have no participatory course modules to report on';
+$string['noparticipants'] = 'No participants found for this course';
$string['nopermissions'] = 'Sorry, but you do not currently have permissions to do that ($a)';
$string['nopermissiontocomment'] = 'You can\'t add comments to this glossary!';
$string['nopermissiontodelentry'] = 'You can\'t delete other people\'s entries!';
$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['typenotimplement'] = 'TODO: type not 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['statsdisable'] = 'Stats is not enabled';
$string['wrongzipfilename'] = 'Wrong ZIP file name';
$string['xmldberror'] = 'XMLDB error!';
-?>
\ No newline at end of file
+?>
}
} else {
- error('todo: type not implemented');
+ print_error('typenotimplement');
}
return array($sql, $params);
}
}
if ($dollar_count) {
if ($count) {
- error('ERROR: Mixed types of sql query parameters!!');
+ print_error('mixedtypesqlparam');
}
$type = SQL_PARAMS_DOLLAR;
$count = $dollar_count;
}
if ($q_count) {
if ($count) {
- error('ERROR: Mixed types of sql query parameters!!');
+ print_error('mixedtypesqlparam');
}
$type = SQL_PARAMS_QM;
$count = $q_count;
}
if ($count > count($params)) {
- error('ERROR: Incorrect number of query parameters!!');
+ print_error('invalidqueryparam');
}
if ($type & $allowed_types) { // bitwise AND
foreach ($named_matches[0] as $key) {
$key = trim($key, ':');
if (!array_key_exists($key, $params)) {
- error('ERROR: missing param "'.$key.'" in query');
+ print_error('missingkeyinsql', '', '', $key);
}
$finalparams[$key] = $params[$key];
}
if ($count != count($finalparams)) {
- error('ERROR: duplicate parameter name in query');
+ print_error('duplicateparaminsql');
}
if ($target_type & SQL_PARAMS_QM) {
} else if ($target_type & SQL_PARAMS_NAMED) {
return array($sql, $finalparams, SQL_PARAMS_NAMED);
} else { // $type & SQL_PARAMS_DOLLAR
- error('Pg $1, $2 bound syntax not supported yet :-(');
+ print_error('boundsyntaxnotsupport');
}
} else if ($type == SQL_PARAMS_DOLLAR) {
- error('Pg $1, $2 bound syntax not supported yet :-(');
+ print_error('boundsyntaxnotsupport');
} else { // $type == SQL_PARAMS_QM
if (count($params) != $count) {
}
return array($sql, $finalparams, SQL_PARAMS_NAMED);
} else { // $type & SQL_PARAMS_DOLLAR
- error('Pg $1, $2 bound syntax not supported yet :-(');
+ print_error('boundsyntaxnotsupport');
}
}
}
$params = array();
foreach ($conditions as $key=>$value) {
if (is_int($key)) {
- error('$conditions array may not contain numeric keys, please fix the code!');
+ print_error('invalidnumkey');
}
if (is_null($value)) {
$where[] = "$key IS NULL";
$course = $COURSE;
} else {
if (!$course = $DB->get_record('course', array('id'=>$cm->course))) {
- error('Incorrect course id in cm');
+ print_error('invalidcourseid');
}
}
/// Capabilities
if (!update_capabilities('local')) {
- error('Could not set up the capabilities for local!');
+ print_error('cannotsetupcapformod', 'error', '', 'local');
}
upgrade_log_finish();
$id = required_param('id', PARAM_INT);
if (!$user = $DB->get_record('user', array('id' => $id))) {
- error("Unknown user ID");
+ print_error('invaliduserid');
}
$preferences = get_user_preferences(null, null, $user->id);
} else {
// update user email
if (!$DB->set_field('user', 'email', $user->email, array('id' => $user->id))) {
- error('Error updating user record');
-
+ print_error('cannotupdateuser');
} else {
events_trigger('user_updated', $user);
$a->email = $user->email;
if ($contextid) {
if (! $context = get_context_instance_by_id($contextid)) {
- error("Context ID is incorrect");
+ print_error('invalidcontext');
}
if (! $course = $DB->get_record('course', array('id'=>$context->instanceid))) {
- error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
} else {
if (! $course = $DB->get_record('course', array('id'=>$courseid))) {
- error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
if (! $context = get_context_instance(CONTEXT_COURSE, $course->id)) {
- error("Context ID is incorrect");
+ print_error('invalidcontext');
}
}
// not needed anymore
if (has_capability('moodle/role:assign', $context)) {
redirect($CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id);
} else {
- error ('No participants found for this course');
+ print_error('noparticipants');
}
}
// (at or below DEFAULT_PAGE_SIZE) and $USER can enrol/unenrol
// (will take 1 extra DB query - 2 on Oracle)
//
- if ($course->id != SITEID && $perpage <= DEFAULT_PAGE_SIZE
+ if ($course->id != SITEID && $perpage <= DEFAULT_PAGE_SIZE
&& has_capability('moodle/role:assign',$context)) {
$allowenroldetails=true;
} else {
if ($roleid > 0) {
if (!$currentrole = $DB->get_record('role', array('id'=>$roleid))) {
- error('That role does not exist');
+ print_error('invalidroleid');
}
$a->number = $totalcount;
// MDL-12217, use course specific rolename
$rastring .= ' ('. $ra['enrolplugin'] .')<br />';
}
}
- $data[] = $rastring;
+ $data[] = $rastring;
if ($groupmode != 0) {
// htmlescape with s() and implode the array
$data[] = implode(', ', array_map('s',$userlist_extra[$user->id]['group']));
// Note: this returns strange redundant rows, perhaps
// due to the multiple OUTER JOINs. If we can tweak the
// JOINs to avoid it ot
- $sql = "SELECT DISTINCT ra.userid,
- ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth,
+ $sql = "SELECT DISTINCT ra.userid,
+ ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth,
ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstanceid,
- cc.name AS ccname,
+ cc.name AS ccname,
ra.roleid AS roleid,
ra.enrol AS enrolplugin,
g.id AS gid, g.name AS gname
/* and if groupings is enabled... */
$gpjoin
- WHERE ra.userid IN ( $userids )
- AND ra.contextid in ( $contextids )
+ WHERE ra.userid IN ( $userids )
+ AND ra.contextid in ( $contextids )
$avoidrolescond
ORDER BY ra.userid, ctx.depth DESC";
// $extra [ $userid ] [ 'group' ] [ $groupid => 'group name']
// [ 'gping' ] [ $gpingid => 'gping name']
// [ 'ra' ] [ [ "$ctxid:$roleid" => [ctxid => $ctxid
- // ctxdepth => $ctxdepth,
+ // ctxdepth => $ctxdepth,
// ctxpath => $ctxpath,
// ctxname => 'name' (categories only)
- // ctxinstid =>
+ // ctxinstid =>
// roleid => $roleid
// enrol => $pluginname
//