r24682 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24681‎ | r24682 | r24683 >
Date:17:49, 8 August 2007
Author:yaron
Status:old
Tags:
Comment:
Added link to 'create template' form
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -15,7 +15,7 @@
1616 SpecialPage::addPage( new SpecialPage('CreateForm','',true,'doSpecialCreateForm',false) );
1717
1818 function doSpecialCreateForm() {
19 - global $wgOut, $wgRequest;
 19+ global $wgOut, $wgRequest, $wgUser;
2020 $fname = "CreateForm::doSpecialCreateForm()";
2121 $db =& wfGetDB( DB_SLAVE );
2222
@@ -119,6 +119,8 @@
120120 </script>
121121
122122 END;
 123+ $wgOut->addHTML($text);
 124+ return;
123125 }
124126 }
125127
@@ -126,7 +128,6 @@
127129 // set 'title' field, in case there's no URL niceness
128130 $text .= ' <input type="hidden" name="title" value="Special:CreateForm">' . "\n";
129131 $text .= ' <p>' . wfMsg('sf_createform_nameinput') . ' <input size=25 name="form_name" value="' . $form_name . '"> <font color="red">' . $form_name_error_str . '</font></p>' . "\n";
130 - $text .= " <br />\n";
131132
132133 $text .= $form->creationHTML();
133134
@@ -148,6 +149,9 @@
149150 $final_index = count($form_templates);
150151 $preview_button_text = wfMsg('preview');
151152 $add_button_text = wfMsg('sf_createform_add');
 153+ $sk = $wgUser->getSkin();
 154+ $ct = SpecialPage::getPage('CreateTemplate');
 155+ $create_template_link = $sk->makeKnownLinkObj($ct->getTitle(), $ct->getDescription());
152156 $text .= ' <option value="' . $final_index . '" selected="selected">' .
153157 wfMsg('sf_createform_atend') . "</option>\n";
154158 $text .=<<<END
@@ -156,9 +160,12 @@
157161 </p>
158162 <p><input type="submit" name="preview" value="$preview_button_text"></p>
159163 </form>
 164+ <br /><hr /<br />
 165+ <p>$create_template_link.</p>
160166
161167 END;
162168
 169+
163170 $wgOut->addLink( array(
164171 'rel' => 'stylesheet',
165172 'type' => 'text/css',

Status & tagging log