2006-03-10 06:53:01 +00:00
|
|
|
<?php //$Id$
|
|
|
|
// get the category drop down form element
|
|
|
|
$blogFilter =& new BlogFilter($userid, '', '', $post->courseid);
|
|
|
|
if (!isset($post->groupid)) {
|
|
|
|
$post->groupid = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// find all the tags this post uses
|
2006-03-13 06:05:44 +00:00
|
|
|
if (isset($post->postid)) {
|
2006-03-10 06:53:01 +00:00
|
|
|
if ($tagsused = get_records('blog_tag_instance', 'entryid', $post->postid)) {
|
|
|
|
foreach ($tagsused as $usedtag) {
|
|
|
|
$usedtags[] = $usedtag -> tagid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!-- the following form is based on moodle/mod/forum/post.html -->
|
|
|
|
|
|
|
|
<form name="entry" method="post" action="<?php echo $CFG->wwwroot;?>/blog/edit.php" id="entry" <?php echo $onsubmit; ?> enctype="multipart/form-data">
|
2006-03-13 06:05:44 +00:00
|
|
|
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
|
2006-03-10 06:53:01 +00:00
|
|
|
<input type="hidden" name="realcourse" value="0" />
|
|
|
|
<input type="hidden" name="realgroup" value="0" />
|
|
|
|
|
|
|
|
<table border="0" cellpadding="5" id="edittable">
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right">
|
|
|
|
</td>
|
|
|
|
<td colspan="2"><strong><?php echo $formHeading; ?></strong>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right"><strong><?php print_string('entrytitle', 'blog'); ?>:</strong></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<input type="text" name="etitle" size="60" value="<?php p($post->etitle) ?>" id="etitle" />
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right">
|
|
|
|
<strong><?php print_string('publishto', 'blog'); ?>:</strong>
|
|
|
|
</td>
|
|
|
|
<td colspan="2">
|
|
|
|
<?php
|
|
|
|
$options = blog_applicable_publish_states($post->courseid); //$blogEntry may be null
|
|
|
|
choose_from_menu($options, 'publishstate', $post->publishstate, '');
|
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
helpbutton('publish_state', get_string('helppublish', 'blog'), 'blog');
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2006-03-16 08:22:53 +00:00
|
|
|
<td align="right">
|
|
|
|
<strong><?php print_string('tags'); echo ':';?></strong>
|
2006-03-10 06:53:01 +00:00
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
2006-03-16 08:22:53 +00:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<b><?php print_string('otags','blog'); ?></b>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<b><?php print_string('ptags','blog'); ?></b>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<select name="otags[]" multiple="multiple" size="8">
|
|
|
|
<?php
|
|
|
|
$otags = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'official\' ORDER by text ASC');
|
|
|
|
foreach ($otags as $otag) {
|
|
|
|
if (in_array($otag->id, $usedtags)) {
|
|
|
|
echo '<option value="'.$otag->id.'" selected="selected">'.$otag->text.'</option>';
|
|
|
|
} else {
|
|
|
|
echo '<option value="'.$otag->id.'">'.$otag->text.'</option>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td>
|
|
|
|
<select name="ptags[]" multiple="multiple" size="8">
|
|
|
|
<?php
|
|
|
|
$ptags = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' ORDER by text ASC');
|
|
|
|
foreach ($ptags as $ptag) {
|
|
|
|
if (in_array($ptag->id, $usedtags)) {
|
|
|
|
echo '<option value="'.$ptag->id.'" selected="selected">'.$ptag->text.'</option>';
|
|
|
|
} else {
|
|
|
|
echo '<option value="'.$ptag->id.'">'.$ptag->text.'</option>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2006-03-10 06:53:01 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
2006-03-16 08:22:53 +00:00
|
|
|
|
|
|
|
|
2006-03-10 06:53:01 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<?php
|
2006-03-13 08:46:13 +00:00
|
|
|
link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'));
|
2006-03-10 06:53:01 +00:00
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right"><strong>
|
|
|
|
<?php
|
|
|
|
if (isset($post->useextendedbody) && $post->useextendedbody) {
|
|
|
|
print_string('entryexcerpt', 'blog');
|
|
|
|
} else {
|
|
|
|
print_string('entrybody', 'blog');
|
|
|
|
}
|
|
|
|
?>:
|
|
|
|
</strong><br /><br />
|
|
|
|
<small><small>
|
|
|
|
<?php
|
|
|
|
helpbutton('reading', get_string('helpreading'), 'moodle', true, true);
|
|
|
|
echo '<br />';
|
|
|
|
helpbutton('writing', get_string('helpwriting'), 'moodle', true, true);
|
|
|
|
echo '<br />';
|
|
|
|
helpbutton('questions', get_string('helpquestions'), 'moodle', true, true);
|
|
|
|
echo '<br />';
|
|
|
|
if ($usehtmleditor) {
|
|
|
|
helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true);
|
|
|
|
} else {
|
|
|
|
emoticonhelpbutton('entry', 'body');
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</small></small>
|
|
|
|
</td>
|
|
|
|
<td align="left" colspan="2">
|
|
|
|
<?php
|
2006-03-14 06:36:51 +00:00
|
|
|
print_string('entrybodyonlydesc', 'blog');
|
2006-03-10 06:53:01 +00:00
|
|
|
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); ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
|
|
<td align="right"><strong><?php print_string('formattexttype'); ?>:</strong></td>
|
|
|
|
<td colspan="2">
|
|
|
|
<?php
|
|
|
|
choose_from_menu(format_text_menu(), 'format', $post->format, '');
|
|
|
|
?>
|
|
|
|
<small><small>
|
|
|
|
<?php
|
|
|
|
helpbutton('textformat', get_string('helpformatting'));
|
|
|
|
?>
|
|
|
|
</small></small>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td align="center" colspan="3">
|
|
|
|
<input type="hidden" name="editform" value="1" id="editform" />
|
|
|
|
<input type="hidden" name="userid" value="<?php echo $userid; ?>" id="userid" />
|
|
|
|
<input type="hidden" name="tem" id="tem" />
|
|
|
|
<?php
|
|
|
|
if (isset($post->postid) && ($post->postid != -1) ) {
|
2006-03-13 08:46:13 +00:00
|
|
|
?>
|
2006-03-10 06:53:01 +00:00
|
|
|
<input type="hidden" name="postid" value="<?php echo $post->postid; ?>" id="postid" />
|
|
|
|
<input type="hidden" name="act" value="update" id="act" />
|
|
|
|
<input type="submit" value="Update" id="Submit1" name="Submit1" />
|
|
|
|
<input type="button" value="Cancel" onclick="javascript:history.go(-1)" id="cancel" name="cancel" />
|
|
|
|
<?php
|
|
|
|
} else { ?>
|
|
|
|
<input type="hidden" name="act" value="save" id="act" />
|
|
|
|
<input type="submit" value="<?php print_string('savechanges'); ?>" id="savechanges" name="Submit2" />
|
|
|
|
<?php } ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|