require_login($courseid);
if (empty($CFG->bloglevel)) {
- print_error('Blogging is disabled!');
+ print_error('blogdisable', 'blog');
}
if (isguest()) {
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
if (!has_capability('moodle/blog:create', $sitecontext) and !has_capability('moodle/blog:manageentries', $sitecontext)) {
- print_error('You can not post or edit blogs.');
+ print_error('cannoteditpostorblog');
}
// Make sure that the person trying to edit have access right
if ($id) {
if (!$existing = get_record('post', 'id', $id)) {
- print_error('Wrong blog post id');
+ print_error('wrongpostid', 'blog');
}
if (!blog_user_can_edit_post($existing)) {
if ($action=='delete'){
if (!$existing) {
- print_error('Incorrect blog post id');
+ print_error('wrongpostid', 'blog');
}
if (data_submitted() and $confirm and confirm_sesskey()) {
do_delete($existing);
case 'edit':
if (!$existing) {
- print_error('Incorrect blog post id');
+ print_error('wrongpostid', 'blog');
}
do_edit($fromform, $blogeditform);
break;
default :
- print_error('Unknown action!');
+ print_error('invalidaction');
}
redirect($returnurl);
}
case 'edit':
if (!$existing) {
- print_error('Incorrect blog post id');
+ print_error('wrongpostid', 'blog');
}
$post->id = $existing->id;
$post->subject = $existing->subject;
}
break;
default :
- print_error('Unknown action!');
+ print_error('unknowaction');
}
// done here in order to allow deleting of posts with wrong user id above
if (!$user = get_record('user', 'id', $userid)) {
- print_error('Incorrect user id');
+ print_error('invaliduserid');
}
$navlinks = array();
$navlinks[] = array('name' => fullname($user), 'link' => "$CFG->wwwroot/user/view.php?id=$userid", 'type' => 'misc');
add_to_log(SITEID, 'blog', 'delete', 'index.php?userid='. $post->userid, 'deleted blog entry with entry id# '. $post->id);
if (!$status) {
- print_error('Error occured while deleting post', '', $returnurl);
+ print_error('deleteposterror', 'blog', $returnurl);
}
}
add_to_log(SITEID, 'blog', 'add', 'index.php?userid='.$post->userid.'&postid='.$post->id, $post->subject);
} else {
- print_error('There was an error adding this post in the database', '', $returnurl);
+ print_error('deleteposterror', 'blog', $returnurl);
}
}
add_to_log(SITEID, 'blog', 'update', 'index.php?userid='.$USER->id.'&postid='.$post->id, $post->subject);
} else {
- print_error('There was an error updating this post in the database', '', $returnurl);
+ print_error('deleteposterror', 'blog', $returnurl);
}
}
if (!$course = get_record('course', 'id', $courseid)) {
- print_error('The course number was incorrect ('. $courseid .')');
+ print_error('invalidcourseid', '', '', $courseid);
}
// Bounds for block widths
// needed also for user tabs later
if (!$course = get_record('course', 'id', $courseid)) {
- print_error('Wrong course id');
+ print_error('invalidcourseid', '', '', $courseid);
}
$navlinks = array();
print_header("$course->shortname: $blogstring", $course->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
}
} else {
- print_error('Unable to find group');
+ print_error('cannotfindgroup');
}
break;
case 'user':
$participants = get_string('participants');
if (!$user = get_record('user', 'id', $filterselect)) {
- print_error('Wrong user id');
+ print_error('invaliduserid');
}
if ($course->id != SITEID) {
$string['courseblogs'] = 'Users can only see blogs for people who share a course';
$strign['donothaveblog'] = 'You do not have your own blog, sorry.';
$string['deleteotagswarn'] = 'Are you sure you want to remove this / these tags <br />from all blog posts and remove it from the system?';
+$string['deleteposterror'] = 'Error occured while deleting post';
$string['disableblogs'] = 'Disable blog system completely';
$string['emptybody'] = 'Blog entry body can not be empty';
$string['emptytitle'] = 'Blog entry title can not be empty';
$string['viewcourseentries'] = 'View course entries';
$string['viewmyentries'] = 'View my entries';
$string['viewsiteentries'] = 'View site entries';
+$string['wrongpostid'] = 'Wrong blog post id';
$string['worldblogs'] = 'The world can read entries set to be world-accessible';
?>
$string['cannotdownloadcomponents'] = 'Cannot download components.';
$string['cannotdownloadlanguageupdatelist'] = 'Cannot download list of language updates from download.moodle.org';
$string['cannotdownloadzipfile'] = 'Cannot download ZIP file.';
+$string['cannoteditpostorblog'] = 'You can not post or edit blogs.';
$string['cannoteditmasterlang'] = 'You do not have permission to edit master language package. This permission is controlled by the capability "moodle/site:langeditmaster". Set this capability to allow you to edit master language packages in case you are the maintainer of a package.';
$string['cannotfindcomponent'] = 'Cannot find component.';
$string['cannotfindcategory'] = 'Cannot find category record from database by ID - $a';
$string['cannotfinddocs'] = 'Cannot find \"$a\" language docs files';
+$string['cannotfindgroup'] = 'Unable to find group';
$string['cannotfindinfo'] = 'Cannot find info for: \"$a\"';
$string['cannotfindhelp'] = 'Cannot find \"$a\" language help files';
$string['cannotfindlang'] = 'Cannot find \"$a\" language pack!';
$string['invalidarguments'] = 'No valid arguments supplied';
$string['invalidaccessparameter'] = 'Invalid access parameter.';
$string['invalidcourse'] = 'Invalid course';
-$string['invalidcourseid'] = 'You are tring to view an invalid course. Id: $a';
+$string['invalidcourseid'] = 'You are tring to use an invalid course ID: ($a)';
$string['invalidcoursemodule'] = 'Bad course module ID';
$string['invalidfieldname'] = '\"$a\" is not a valid field name';
$string['invalidfiletype'] = '\"$a\" is not a valid file type';
$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['unknowaction']= 'Unknown action!';
$string['unknowncourse'] = 'Unknown course named \"$a\"';
$string['unknowncourseidnumber'] = 'Unknown Course ID \"$a\"';
$string['unknowngroup'] = 'Unknown group \"$a\"';