*/
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('<tick>', "'", stripslashes_safe($entrydetails->summary));
$strftimedaydatetime = get_string('strftimedaydatetime');
} 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);
+ }
}
/**
?>
</td>
</tr>
-<tr>
+<tr valign="top">
<td align="right">
<strong><?php print_string('tags'); echo ':';?></strong>
</td>
}
?>
</select>
+ <?php link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement')); ?>
</td>
</tr>
</table>
- <?php
- link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'));
- ?>
</td>
</tr>
</small></small>
</td>
<td align="left" colspan="2">
- <?php
- print_string('entrybodyonlydesc', 'blog');
- print '<br />'."\n";
- // usage: print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value="", $courseid)
- print_textarea($usehtmleditor, 6, 60, 600, 500, 'body', $post->body, $post->courseid); ?>
+ <?php print_textarea($usehtmleditor, 25, 62, 500, 600, 'body', $post->body, $post->courseid); ?>
</td>
</tr>
<tr valign="top">
opener.document.entry[\'otags[]\'].insertBefore(o, null);
</script>';
} else {
- error ('there is already a tag with this name!');
+ notify(get_string('tagalready'));
}
break;
opener.document.entry[\'ptags[]\'].insertBefore(o, null);
</script>';
} else {
- error ('there is already a tag with this name!');
+ notify(get_string('tagalready'));
}
//write back to window.opener
break;