Automatic installer.php lang files by installer_builder (20070202)
[moodle.git] / blog / edit.html
blob6bc848742d35a8be94af7bf7613dfcd480cb4834
1 <?php //$Id$
3 if (!isset($post->groupid)) {
4 $post->groupid = 0;
7 // find all the tags this post uses
8 $usedtags = array();
9 if (isset($post->postid)) {
10 if ($tagsused = get_records('blog_tag_instance', 'entryid', $post->postid)) {
11 foreach ($tagsused as $usedtag) {
12 $usedtags[] = $usedtag -> tagid;
18 <!-- the following form is based on moodle/mod/forum/post.html -->
20 <form name="entry" method="post" action="<?php echo $CFG->wwwroot;?>/blog/edit.php" id="entry" <?php echo $onsubmit; ?> enctype="multipart/form-data">
21 <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
22 <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
25 <table border="0" cellpadding="5" id="edittable">
26 <tr valign="top">
27 <td align="right">&nbsp;
28 </td>
29 <td colspan="2"><strong><?php echo $formHeading; ?></strong>
30 </td>
31 </tr>
32 <tr valign="top">
33 <td align="right"><strong><?php print_string('entrytitle', 'blog'); ?>:</strong></td>
34 <td colspan="2">
35 <input type="text" name="etitle" size="60" value="<?php p($post->etitle) ?>" id="etitle" />
36 </td>
37 </tr>
38 <tr valign="top">
39 <td align="right">
40 <strong><?php print_string('publishto', 'blog'); ?>:</strong>
41 </td>
42 <td colspan="2">
43 <?php
44 $options = blog_applicable_publish_states(); //$blogEntry may be null
45 choose_from_menu($options, 'publishstate', $post->publishstate, '');
47 <?php
48 helpbutton('publish_state', get_string('helppublish', 'blog'), 'blog');
50 </td>
51 </tr>
52 <tr valign="top">
53 <td align="right">
54 <strong><?php print_string('tags'); echo ':';?></strong>
55 </td>
57 <td>
58 <table width="100%">
59 <tr>
60 <td>
61 <b><?php print_string('otags','blog'); ?></b>
62 </td>
63 <td>
64 <b><?php print_string('ptags','blog'); ?></b>
65 </td>
66 </tr>
67 <tr>
68 <td>
69 <select name="otags[]" multiple="multiple" size="8">
70 <?php
71 $otags = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'official\' ORDER by text ASC');
72 foreach ($otags as $otag) {
73 if (in_array($otag->id, $usedtags)) {
74 echo '<option value="'.$otag->id.'" selected="selected">'.$otag->text.'</option>';
75 } else {
76 echo '<option value="'.$otag->id.'">'.$otag->text.'</option>';
80 </select>
81 &nbsp;&nbsp;</td>
83 <td>
84 <select name="ptags[]" multiple="multiple" size="8">
85 <?php
86 $ptags = get_records_sql('SELECT * from '.$CFG->prefix.'tags WHERE type=\'personal\' ORDER by text ASC');
87 foreach ($ptags as $ptag) {
88 if (in_array($ptag->id, $usedtags)) {
89 echo '<option value="'.$ptag->id.'" selected="selected">'.$ptag->text.'</option>';
90 } else {
91 echo '<option value="'.$ptag->id.'">'.$ptag->text.'</option>';
95 </select>
96 <?php link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement')); ?>
97 </td>
98 </tr>
99 </table>
100 </td>
101 </tr>
105 <tr valign="top">
106 <td align="right"><strong>
107 <?php
108 if (isset($post->useextendedbody) && $post->useextendedbody) {
109 print_string('entryexcerpt', 'blog');
110 } else {
111 print_string('entrybody', 'blog');
114 </strong><br /><br />
115 <small><small>
116 <?php
117 helpbutton('writing', get_string('helpwriting'), 'moodle', true, true);
118 echo '<br />';
119 if ($usehtmleditor) {
120 helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true);
121 } else {
122 emoticonhelpbutton('entry', 'body');
125 </small></small>
126 </td>
127 <td align="left" colspan="2">
128 <?php print_textarea($usehtmleditor, 25, 62, 500, 600, 'body', $post->body); ?>
129 </td>
130 </tr>
131 <tr valign="top">
132 <td align="right"><strong><?php print_string('formattexttype'); ?>:</strong></td>
133 <td colspan="2">
134 <?php
135 if ($usehtmleditor) { /// Trying this out for a while
136 print_string('formathtml');
137 echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
138 } else {
139 choose_from_menu(format_text_menu(), "format", $post->format, "");
142 <small><small>
143 <?php
144 helpbutton('textformat', get_string('helpformatting'));
146 </small></small>
147 </td>
148 </tr>
149 <tr>
150 <td align="center" colspan="3">
151 <input type="hidden" name="editform" value="1" id="editform" />
152 <input type="hidden" name="userid" value="<?php echo $userid; ?>" id="userid" />
153 <input type="hidden" name="tem" id="tem" />
154 <?php
155 if (isset($post->postid) && ($post->postid != -1) ) {
157 <input type="hidden" name="postid" value="<?php echo $post->postid; ?>" id="postid" />
158 <input type="hidden" name="act" value="update" id="act" />
159 <input type="submit" value="Update" id="Submit1" name="Submit1" />&nbsp;
160 <input type="button" value="Cancel" onclick="javascript:history.go(-1)" id="cancel" name="cancel" />
161 <?php
162 } else { ?>
163 <input type="hidden" name="act" value="save" id="act" />
164 <input type="submit" value="<?php print_string('savechanges'); ?>" id="savechanges" name="Submit2" />&nbsp;
165 <?php } ?>
166 </td>
167 </tr>
168 </table>
169 </form>