mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-22864 More tidying up of blog display
This commit is contained in:
parent
753c1de5ca
commit
8397492bd0
@ -149,7 +149,7 @@ function blog_sync_external_entries($externalblog) {
|
||||
$externalblog->failedlastsync = 1;
|
||||
$DB->update_record('blog_external', $externalblog);
|
||||
return false;
|
||||
} else if ($externalblog->failedlastsync) {
|
||||
} else if (!empty($externalblog->failedlastsync)) {
|
||||
$externalblog->failedlastsync = 0;
|
||||
$DB->update_record('blog_external', $externalblog);
|
||||
}
|
||||
|
@ -113,13 +113,12 @@ class blog_entry {
|
||||
$this->summary = file_rewrite_pluginfile_urls($this->summary, 'pluginfile.php', SYSCONTEXTID, 'blog_post', $this->id);
|
||||
|
||||
$template['body'] = format_text($this->summary, $this->summaryformat, $options);
|
||||
$template['title'] = '<a id="b'. s($this->id) .'" />';
|
||||
$template['title'] .= '<span class="nolink">'. format_string($this->subject) .'</span>';
|
||||
$template['title'] = format_string($this->subject);
|
||||
$template['userid'] = $user->id;
|
||||
$template['author'] = fullname($user);
|
||||
$template['created'] = userdate($this->created);
|
||||
|
||||
if($this->created != $this->lastmodified){
|
||||
if ($this->created != $this->lastmodified) {
|
||||
$template['lastmod'] = userdate($this->lastmodified);
|
||||
}
|
||||
|
||||
@ -140,6 +139,7 @@ class blog_entry {
|
||||
$table = new html_table();
|
||||
$table->cellspacing = 0;
|
||||
$table->attributes['class'] = 'forumpost blog_entry blog'. ($unassociatedentry ? 'draft' : $template['publishstate']);
|
||||
$table->attributes['id'] = 'b'.$this->id;
|
||||
$table->width = '100%';
|
||||
|
||||
$picturecell = new html_table_cell();
|
||||
@ -150,7 +150,8 @@ class blog_entry {
|
||||
|
||||
$topiccell = new html_table_cell();
|
||||
$topiccell->attributes['class'] = 'topic starter';
|
||||
$topiccell->text = $OUTPUT->container($template['title'], 'subject');
|
||||
$titlelink = html_writer::link(new moodle_url('/blog/index.php', array('entryid' => $this->id)), $template['title']);
|
||||
$topiccell->text = $OUTPUT->container($titlelink, 'subject');
|
||||
$topiccell->text .= $OUTPUT->container_start('author');
|
||||
|
||||
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $PAGE->course->id)));
|
||||
@ -164,7 +165,7 @@ class blog_entry {
|
||||
if ($this->uniquehash && $this->content) {
|
||||
if ($externalblog = $DB->get_record('blog_external', array('id' => $this->content))) {
|
||||
$urlparts = parse_url($externalblog->url);
|
||||
$topiccell->text .= $OUTPUT->container(get_string('retrievedfrom', 'blog') . html_writer::link($urlparts['scheme'].'://'.$urlparts['host'], $externalblog->name), 'externalblog');
|
||||
$topiccell->text .= $OUTPUT->container(get_string('retrievedfrom', 'blog') .': '. html_writer::link($urlparts['scheme'].'://'.$urlparts['host'], $externalblog->name), 'externalblog');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
$string['addnewentry'] = 'Add a new entry';
|
||||
$string['addnewexternalblog'] = 'Register an external blog...';
|
||||
$string['addnewexternalblog'] = 'Register an external blog';
|
||||
$string['assocdescription'] = 'If you are writing about a course and/or activity modules, select them here.';
|
||||
$string['associated'] = 'Associated {$a}';
|
||||
$string['associatewithcourse'] = 'Blog about course {$a->coursename}';
|
||||
@ -67,6 +67,7 @@ $string['courseblogdisable'] = 'Course blogs are not enabled';
|
||||
$string['courseblogs'] = 'Users can only see blogs for people who share a course';
|
||||
$string['deleteblogassociations'] = 'Delete blog associations';
|
||||
$string['deleteblogassociations_help'] = 'If ticked then blog entries will no longer be associated with this course or any course activities or resources. The blog entries themselves will not be deleted.';
|
||||
$string['deleteexternalblog'] = 'Unregister this external blog';
|
||||
$string['deleteotagswarn'] = 'Are you sure you want to remove these tags from all blog posts and remove it from the system?';
|
||||
$string['description'] = 'Description';
|
||||
$string['description_help'] = 'Enter a sentence or two summarising the contents of your external blog. (If no description is supplied, the description recorded in your external blog will be used).';
|
||||
|
Loading…
x
Reference in New Issue
Block a user