Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | END; |
115 | 115 | foreach ($categories as $category) { |
116 | 116 | $category = str_replace('_', ' ', $category); |
117 | | - $text .= " <option>$category</option>\n"; |
| 117 | + $text .= " " . Xml::element('option', null, $category) . "\n"; |
118 | 118 | } |
119 | 119 | $text .=<<<END |
120 | 120 | </select> |
— | — | @@ -123,10 +123,10 @@ |
124 | 124 | <input type="submit" id="wpPreview" name="wpPreview" value="$preview_button_text"></p> |
125 | 125 | </div> |
126 | 126 | <br /><hr /<br /> |
127 | | - <p>$create_form_link.</p> |
128 | 127 | |
129 | 128 | END; |
130 | 129 | |
| 130 | + $text .= " " . Xml::tags('p', null, $create_form_link . '.') . "\n"; |
131 | 131 | $text .= " </form>\n"; |
132 | 132 | |
133 | 133 | $wgOut->addLink( array( |
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -142,38 +142,31 @@ |
143 | 143 | $text .= ' <input type="hidden" name="title" value="' . $special_namespace . ':CreateForm">' . "\n"; |
144 | 144 | $text .= ' <p>' . wfMsg('sf_createform_nameinput') . ' ' . wfMsg('sf_createform_nameinputdesc') . ' <input size=25 name="form_name" value="' . $form_name . '">'; |
145 | 145 | if (! empty($form_name_error_str)) |
146 | | - $text .= ' <font color="red">' . $form_name_error_str . '</font>'; |
| 146 | + $text .= ' ' . Xml::element('font', array('color' => 'red'), $form_name_error_str); |
147 | 147 | $text .= "</p>\n"; |
148 | 148 | |
149 | 149 | $text .= $form->creationHTML(); |
150 | 150 | |
151 | 151 | $text .= ' <p>' . wfMsg('sf_createform_addtemplate') . "\n"; |
152 | | - $text .= ' <select name="new_template">' . "\n"; |
153 | 152 | |
| 153 | + $select_body = ""; |
154 | 154 | foreach ($all_templates as $template) { |
155 | | - $text .= " <option value=\"$template\">$template</option>\n"; |
| 155 | + $select_body .= " " . Xml::element('option', array('value' => $template), $template) . "\n"; |
156 | 156 | } |
157 | | - |
158 | | - $text .= " </select>\n"; |
| 157 | + $text .= ' ' . Xml::tags('select', array('name' => 'new_template'), $select_body) . "\n"; |
159 | 158 | // if a template has already been added, show a dropdown letting the |
160 | 159 | // user choose where in the list to add a new dropdown |
161 | 160 | if (count($form_templates) > 0) { |
162 | 161 | $before_template_msg = wfMsg('sf_createform_beforetemplate'); |
163 | | - $at_end_msg = wfMsg('sf_createform_atend'); |
164 | | - $text .=<<<END |
165 | | - $before_template_msg |
166 | | - <select name="before_template"> |
167 | | - |
168 | | -END; |
| 162 | + $text .= $before_template_msg; |
| 163 | + $select_body = ""; |
169 | 164 | foreach ($form_templates as $i => $ft) { |
170 | | - $text .= " <option value=\"$i\">{$ft->template_name}</option>\n"; |
| 165 | + $select_body .= " " . Xml::element('option', array('value' => $i), $ft->template_name) . "\n"; |
171 | 166 | } |
172 | 167 | $final_index = count($form_templates); |
173 | | - $text .=<<<END |
174 | | - <option value="$final_index" selected="selected">$at_end_msg</option> |
175 | | - </select> |
176 | | - |
177 | | -END; |
| 168 | + $at_end_msg = wfMsg('sf_createform_atend'); |
| 169 | + $select_body .= ' ' . Xml::element('option', array('value' => $final_index, 'selected' => 'selected'), $at_end_msg); |
| 170 | + $text .= Xml::tags('select', array('name' => 'before_template'), $select_body) . "\n"; |
178 | 171 | } |
179 | 172 | |
180 | 173 | // disable 'save' and 'preview' buttons if user has not yet added any |
— | — | @@ -199,14 +192,14 @@ |
200 | 193 | // explanatory message if buttons are disabled because no templates |
201 | 194 | // have been added |
202 | 195 | if (count($form_templates) == 0) { |
203 | | - $text .= " <p>(" . wfMsg('sf_createtemplate_addtemplatebeforesave') . ")</p>"; |
| 196 | + $text .= " " . Xml::element('p', null, "(" . wfMsg('sf_createtemplate_addtemplatebeforesave') . ")"); |
204 | 197 | } |
205 | 198 | $text .=<<<END |
206 | 199 | </form> |
207 | 200 | <hr /><br /> |
208 | | - <p>$create_template_link.</p> |
209 | 201 | |
210 | 202 | END; |
| 203 | + $text .= " " . Xml::tags('p', null, $create_template_link . '.'); |
211 | 204 | |
212 | 205 | $wgOut->addLink( array( |
213 | 206 | 'rel' => 'stylesheet', |
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php |
— | — | @@ -119,16 +119,16 @@ |
120 | 120 | <p>$name_label <input size="25" name="property_name" value=""> |
121 | 121 | <span style="color: red;">$property_name_error_str</span> |
122 | 122 | $type_label |
123 | | - <select id="property_dropdown" name="property_type" onChange="toggleDefaultForm(this.value);"> |
124 | 123 | END; |
| 124 | + $select_body = ""; |
125 | 125 | foreach ($datatype_labels as $label) { |
126 | | - $text .= " <option>$label</option>\n"; |
| 126 | + $select_body .= " " . Xml::element('option', null, $label) . "\n"; |
127 | 127 | } |
| 128 | + $text .= Xml::tags('select', array('id' => 'property_dropdown', 'name' => 'property_type', 'onChange' => 'toggleDefaultForm(this.value);'), $select_body) . "\n"; |
128 | 129 | |
129 | 130 | $default_form_input = wfMsg('sf_createproperty_linktoform'); |
130 | 131 | $values_input = wfMsg('sf_createproperty_allowedvalsinput'); |
131 | 132 | $text .=<<<END |
132 | | - </select> |
133 | 133 | <div id="default_form_div" style="padding: 5px 0 5px 0; margin: 7px 0 7px 0;"> |
134 | 134 | <p>$default_form_input |
135 | 135 | <input size="20" name="default_form" value=""></p> |
— | — | @@ -137,13 +137,13 @@ |
138 | 138 | <p>$values_input</p> |
139 | 139 | <p><input size="80" name="values" value=""></p> |
140 | 140 | </div> |
141 | | - <div class="editButtons"> |
142 | | - <input id="wpSave" type="submit" name="wpSave" value="$save_button_text"> |
143 | | - <input id="wpPreview" type="submit" name="wpPreview" value="$preview_button_text"> |
144 | | - </div> |
145 | | - </form> |
146 | 141 | |
147 | 142 | END; |
| 143 | + $edit_buttons = ' ' . Xml::element('input', array('id' => 'wpSave', 'type' => 'submit', 'name' => 'wpSave', 'value' => $save_button_text)); |
| 144 | + $edit_buttons .= ' ' . Xml::element('input', array('id' => 'wpPreview', 'type' => 'submit', 'name' => 'wpPreview', 'value' => $preview_button_text)); |
| 145 | + $text .= ' ' . Xml::tags('div', array('class' => 'editButtons'), $edit_buttons) . "\n"; |
| 146 | + $text .= " </form>\n"; |
| 147 | + |
148 | 148 | $wgOut->addLink( array( |
149 | 149 | 'rel' => 'stylesheet', |
150 | 150 | 'type' => 'text/css', |