From: moodler Date: Tue, 21 Mar 2006 08:04:15 +0000 (+0000) Subject: Small patches while I contemplate rewriting all those patches from scratch X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0ad2f602852de008a8e1a8c0b88ab17e607392af;p=moodle.git Small patches while I contemplate rewriting all those patches from scratch --- diff --git a/blog/class.BlogEntry.php b/blog/class.BlogEntry.php index 0e2edb000b..0df5000dd0 100755 --- a/blog/class.BlogEntry.php +++ b/blog/class.BlogEntry.php @@ -68,13 +68,9 @@ class BlogEntry { */ function BlogEntry(&$entrydetails) { global $db, $CFG; -// print_object($entrydetails); //debug $this->entryId = $entrydetails->id; -// print "Debug: entryId: $this->entryId"; //debug -// print_object($this->entryCategoryIds); //debug - $this->entryBody = ereg_replace('', "'", stripslashes_safe($entrydetails->summary)); $strftimedaydatetime = get_string('strftimedaydatetime'); @@ -96,9 +92,14 @@ class BlogEntry { } else { $this->entryPublishState = 'draft'; } - $this->entryAuthorName = fullname($entrydetails); // firstname and lastname defined - $this->entryAuthorEmail = $entrydetails->email; - + if (isset($entrydetails->email)) { + $this->entryAuthorEmail = $entrydetails->email; + $this->entryAuthorName = fullname($entrydetails); // firstname and lastname defined + } else { + $user = get_record('user', 'id', $entrydetails->userid); + $this->entryAuthorEmail = $user->email; + $this->entryAuthorName = fullname($user); + } } /** diff --git a/blog/edit.html b/blog/edit.html index 65b5153f10..d8c9a7b3e7 100755 --- a/blog/edit.html +++ b/blog/edit.html @@ -49,7 +49,7 @@ ?> - + @@ -93,12 +93,10 @@ } ?> + - @@ -131,11 +129,7 @@ - '."\n"; - // usage: print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value="", $courseid) - print_textarea($usehtmleditor, 6, 60, 600, 500, 'body', $post->body, $post->courseid); ?> + body, $post->courseid); ?> diff --git a/blog/tags.php b/blog/tags.php index 38495ca7f7..ce4157b94a 100755 --- a/blog/tags.php +++ b/blog/tags.php @@ -23,7 +23,7 @@ switch ($mode) { opener.document.entry[\'otags[]\'].insertBefore(o, null); '; } else { - error ('there is already a tag with this name!'); + notify(get_string('tagalready')); } break; @@ -45,7 +45,7 @@ switch ($mode) { opener.document.entry[\'ptags[]\'].insertBefore(o, null); '; } else { - error ('there is already a tag with this name!'); + notify(get_string('tagalready')); } //write back to window.opener break;