3 // find all the tags this post uses
5 if (!empty($post->id
)) {
6 if ($tagsused = get_records('blog_tag_instance', 'entryid', $post->id
)) {
7 foreach ($tagsused as $usedtag) {
8 $usedtags[] = $usedtag -> tagid
;
14 // clean and convert to html before editting
15 $options = new object();
16 $options->smiley
= false;
17 $options->filter
= false;
18 $options->nocache
= true;
19 $post->summary
= format_text($post->summary
, $post->format
, $options);
23 <form name=
"entry" method=
"post" action=
"edit.php" enctype=
"multipart/form-data">
25 <table border=
"0" cellpadding=
"5">
27 <td align=
"right">
29 <td colspan=
"2"><strong><?php echo $strformheading; ?></strong>
33 <td align=
"right"><strong><?php print_string('entrytitle', 'blog'); ?>:
</strong></td>
35 <input type=
"text" name=
"subject" size=
"60" value=
"<?php p($post->subject) ?>" />
36 <?php
if (isset($errors["subject"])) formerr($errors["subject"]); ?>
40 <td align=
"right"><strong>
42 print_string('entrybody', 'blog');
47 helpbutton('writing', get_string('helpwriting'), 'moodle', true, true);
50 helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true);
52 emoticonhelpbutton('entry', 'body');
57 <td align=
"left" colspan=
"2">
58 <?php print_textarea($usehtmleditor, 25, 62, 500, 600, 'summary', $post->summary
); ?>
62 <td align=
"right"><strong><?php print_string('formattexttype'); ?>:
</strong></td>
65 if ($usehtmleditor) { /// Trying this out for a while
66 print_string('formathtml');
67 echo '<input type="hidden" name="format" value="'.FORMAT_HTML
.'" />';
69 choose_from_menu(format_text_menu(), 'format', $post->format
, '');
74 helpbutton('textformat', get_string('helpformatting'));
77 <?php if (isset($errors["summary"])) formerr($errors["summary"]); ?>
82 <strong><?php print_string('tags'); echo ':';?></strong>
89 <b><?php print_string('otags','blog'); ?></b>
92 <b><?php print_string('ptags','blog'); ?></b>
97 <select name=
"otags[]" multiple=
"multiple" size=
"8">
99 $otags = get_records_sql('SELECT * from '.$CFG->prefix
.'tags WHERE type=\'official\' ORDER by text ASC');
100 foreach ($otags as $otag) {
101 if (in_array($otag->id
, $usedtags)) {
102 echo '<option value="'.$otag->id
.'" selected="selected">'.$otag->text
.'</option>';
104 echo '<option value="'.$otag->id
.'">'.$otag->text
.'</option>';
113 if (!empty($post->id
)) {
114 $idsql = " AND bti.entryid = {$post->id}";
116 $idsql = " AND bti.entryid = 0";
120 if ($ptags = get_records_sql("SELECT t.* FROM
121 {$CFG->prefix}tags t,
122 {$CFG->prefix}blog_tag_instance bti
123 WHERE t.id = bti.tagid
124 AND t.type = 'personal'
127 foreach ($ptags as $ptag) {
128 $pptag .= $ptag->text
.',';
130 $pptag = rtrim($pptag, ",");
135 <input type=
"text" name=
"ptags" value=
"<?php echo $pptag;?>"/>
137 $sitecontext = get_context_instance(CONTEXT_SYSTEM
);
138 // only make sense to link if the user has capablity
139 if (has_capability('moodle/blog:managepersonaltags', $sitecontext) ||
has_capability('moodle/blog:manageofficialtags', $sitecontext)) {
141 link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'));
150 <td align=
"right"><b><?php print_string("attachment", "forum") ?>:
<br />(
<?php print_string(
"optional")
?>)
</b></td>
152 <?php $maxbytes = get_max_upload_file_size($CFG->maxbytes
); ?>
153 <input type=
"hidden" name=
"MAX_FILE_SIZE" value=
"<?php echo $maxbytes ?>" />
154 <input type
="file" name
="attachment" size
="40" alt
="<?php print_string("attachment
", "forum
") ?>" />
156 print_string("maxsize", "", display_size($maxbytes));
162 <strong><?php print_string('publishto', 'blog'); ?>:
</strong>
166 $options = blog_applicable_publish_states(); //$blogEntry may be null
167 choose_from_menu($options, 'publishstate', $post->publishstate
, '');
170 helpbutton('publish_state', get_string('helppublish', 'blog'), 'blog');
175 <td align=
"center" colspan=
"3">
176 <input type=
"hidden" name=
"sesskey" value=
"<?php echo sesskey(); ?>" />
177 <input type
="hidden" name
="action" value
="<?php echo $action; ?>" />
178 <input type
="hidden" name
="courseid" value
="<?php echo $courseid; ?>" />
180 if ($action == 'add') {
182 <input type=
"hidden" name=
"action" value=
"add" />
183 <input type=
"submit" value=
"<?php print_string('add'); ?>" /> 
;
184 <input type
="button" value
="<?php print_string('cancel'); ?>" onclick
="javascript:history.go(-1)" />
187 <input type=
"hidden" name=
"id" value=
"<?php echo $post->id; ?>" />
188 <input type
="submit" value
="<?php print_string('savechanges'); ?>" /> 
;
189 <input type
="button" value
="<?php print_string('cancel'); ?>" onclick
="javascript:history.go(-1)" />