r11995 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11994‎ | r11995 | r11996 >
Date:21:54, 6 December 2005
Author:hashar
Status:old
Tags:
Comment:
* stylesheet
* cleaner HTML source code
Modified paths:
  • /branches/wikidata/phase3/includes/SpecialNamespaces.php (modified) (history)
  • /branches/wikidata/phase3/skins/common/common.css (modified) (history)
  • /branches/wikidata/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: branches/wikidata/phase3/includes/SpecialNamespaces.php
@@ -75,36 +75,36 @@
7676 }
7777
7878 $addnshtmlform='
 79+<div id="addnsForm">
7980 <form name="addnamespaces" method="post" action="'.$action.'">
80 -<table border="0">
81 -<tr valign="top"><td>
82 -'.wfMsg('add_namespace_default_name').'</td>
83 -<td>
84 -<input type="hidden" name="nsAction" value="addnamespaces" />
85 -<input type="text" name="nsName" size="20"'.$talkpagejs.' />
86 -</td>
87 -</tr>
88 -<tr valign="top">
89 -<td>
90 -'.wfMsg('add_namespace_default_talk').'<br />
91 -</td>
92 -<td><input type="text" name="nsTalkName" size="20" />
93 -</td>
94 -</tr>
95 -<tr>
96 -<td colspan="2">
97 -<label><input type="checkbox" name="nsCreateTalk" checked />
98 -'.wfMsg('add_namespace_talk_confirm').'
99 -</label>
100 -</td>
101 -</tr>
 81+<table>
 82+ <tr valign="top">
 83+ <td>'.wfMsg('add_namespace_default_name').'</td>
 84+ <td>
 85+ <input type="hidden" name="nsAction" value="addnamespaces" />
 86+ <input type="text" name="nsName" size="20"'.$talkpagejs.' />
 87+ </td>
 88+ </tr>
 89+ <tr valign="top">
 90+ <td>'.wfMsg('add_namespace_default_talk').'<br /></td>
 91+ <td><input type="text" name="nsTalkName" size="20" /></td>
 92+ </tr>
 93+ <tr>
 94+ <td colspan="2">
 95+ <label>
 96+ <input type="checkbox" name="nsCreateTalk" checked />'.wfMsg('add_namespace_talk_confirm').'
 97+ </label>
 98+ </td>
 99+ </tr>
102100 </table>
103101 <input type="hidden" name="wpEditToken" value="'.$token.'" />
104102 <input type="submit" value="'.wfMsg('add_namespace_button').'" />
105 -</form>';
 103+</form>
 104+</div>
 105+';
106106 $wgOut->addHTML($addnshtmlform);
107107
108 - $wgOut->addWikiText( wfMsg( "modify_namespaces_header" ) );
 108+ $wgOut->addWikiText( wfMsg( 'modify_namespaces_header' ) );
109109
110110 // Array of messages to be used
111111 $nsMessages = array (
@@ -122,7 +122,7 @@
123123 }
124124
125125 // Initialise the form
126 - $htmlform=<<<END
 126+ $htmlform = <<<END
127127 <form name="changenamespaces" method="post" action="{$action}">
128128 <input type="hidden" name="nsAction" value="changenamespaces" />
129129 <input type="hidden" name="wpEditToken" value="{$token}" />
@@ -160,50 +160,36 @@
161161
162162 // TODO : fix code below, maybe use HTMLForm ?
163163
164 - $namespaceselect_html=<<<END
165 -<tr valign="top"><td colspan="2">
166 -{$namespace_child_of}<br />
167 -<select name="ns{$index}Parent" size="1">
168 -{$namespaceselect}
169 -</select>
170 -</td>
 164+ $namespaceselect_html = <<<END
 165+<tr valign="top">
 166+ <td colspan="2">{$namespace_child_of}<br />
 167+ <select name="ns{$index}Parent" size="1">{$namespaceselect}</select>
 168+ </td>
171169 </tr>
172170 END;
173 - $subpages_html=<<<END
174 -<tr valign="top"><td>
175 -{$namespace_support_subpages}
176 -</td>
177 -<td align="right">
178 -<input type="checkbox" name="ns{$index}Subpages" {$subpages} />
179 -</td>
180 -</tr>
 171+ $subpages_html = <<<END
 172+<tr valign="top">
 173+ <td>{$namespace_support_subpages}</td>
 174+ <td align="right"><input type="checkbox" name="ns{$index}Subpages" {$subpages} /></td>
 175+</tr>
181176 END;
182 - $searchdefault_html=<<<END
183 -<tr valign="top"><td>
184 -{$namespace_search_by_default}
185 -</td>
186 -<td align="right">
187 -<input type="checkbox" name="ns{$index}Search" {$searchdefault} />
188 -</td>
189 -</tr>
 177+ $searchdefault_html = <<<END
 178+<tr valign="top">
 179+ <td>{$namespace_search_by_default}</td>
 180+ <td align="right"><input type="checkbox" name="ns{$index}Search" {$searchdefault} /></td>
 181+</tr>
190182 END;
191 - $hide_html=<<<END
192 -<tr valign="top"><td>
193 -{$namespace_hide_in_lists}
194 -</td>
195 -<td align="right">
196 -<input type="checkbox" name="ns{$index}Hidden" {$hidden} />
197 -</td>
198 -</tr>
 183+ $hide_html = <<<END
 184+<tr valign="top">
 185+ <td>{$namespace_hide_in_lists}</td>
 186+ <td align="right"><input type="checkbox" name="ns{$index}Hidden" {$hidden} /></td>
 187+</tr>
199188 END;
200 - $target_html=<<<END
201 -<tr valign="top"><td>
202 -{$namespace_default_link_prefix}
203 -</td>
204 -<td align="right">
205 -<input type="text" size="10" name="ns{$index}Linkprefix" value="{$linkprefix}" />
206 -</td>
207 -</tr>
 189+ $target_html = <<<END
 190+<tr valign="top">
 191+ <td>{$namespace_default_link_prefix}</td>
 192+ <td align="right"><input type="text" size="10" name="ns{$index}Linkprefix" value="{$linkprefix}" /></td>
 193+</tr>
208194 END;
209195 $special_html='';
210196
@@ -215,12 +201,7 @@
216202 $hide_html = '';
217203 $target_html = '';
218204 $special_namespace = wfMsg('special_namespace');
219 - $special_html = <<<END
220 -<tr valign="top"><td colspan="2">
221 -<em>{$special_namespace}</em>
222 -</td>
223 -</tr>
224 -END;
 205+ $special_html = '<tr valign="top"><td colspan="2"><em>'.$special_namespace.'</em></td></tr>' . "\n";
225206 }
226207
227208
@@ -229,12 +210,9 @@
230211 if( $ns->getSystemType() ) {
231212 // No delete link ?
232213 $systemtype_html = <<<END
233 -<tr valign="top"><td>
234 -<b><font color="red">{$namespace_system}</font></b>
235 -</td>
236 -<td align="right">
237 -<b>{$systemtype}</b>
238 -</td>
 214+<tr valign="top">
 215+ <td><b><font color="red">{$namespace_system}</font></b></td>
 216+ <td align="right"><b>{$systemtype}</b></td>
239217 </tr>
240218 END;
241219 $deletenamespace_html = '';
@@ -242,32 +220,31 @@
243221 // Give out a link to delete the namespace
244222 $sk = $wgUser->getSkin();
245223 $delete_link = $sk->makeKnownLinkObj( $wgTitle, wfMsg('delete_namespace'), 'action=delete&ns=' . $index );
246 - $deletenamespace_html = <<<END
247 -<tr valign="top"><td colspan="2">
248 -<b>{$delete_link}</b>
249 -</td>
250 -</tr>
251 -END;
 224+ $deletenamespace_html = '<tr valign="top"><td colspan="2"><b>'.$delete_link.'</b></td></tr>' . "\n";
252225 $systemtype_html='';
253226 }
254227
255228
256229 // Yet another table of tables :p
257 -
258230 $htmlform .= <<<END
259 -<table border="0">
 231+<table class="specialnamespaces">
260232 <tr valign="top"><td>
261233 <table border="0" style="margin-right:1em;" width="300">
262234 <tr><th colspan="2">{$namespace_properties}</th></tr>
263235 <tr><td>{$namespace_slot}</td><td align="right">{$index}</td></tr>
264 - {$systemtype_html}
265 - {$special_html}
266 - {$subpages_html}
267 - {$searchdefault_html}
268 - {$hide_html}
269 - {$target_html}
270 - {$namespaceselect_html}
271 - {$deletenamespace_html}
 236+END;
 237+ // Also add html part generated before
 238+ $htmlform .=
 239+ $systemtype_html
 240+ . $special_html
 241+ . $subpages_html
 242+ . $searchdefault_html
 243+ . $hide_html
 244+ . $target_html
 245+ . $namespaceselect_html
 246+ . $deletenamespace_html
 247+ ;
 248+$htmlform .= <<<END
272249 </table>
273250 </td><td>
274251 <table border="0">
@@ -323,16 +300,23 @@
324301 <td align="center"><input type="radio" name="ns{$index}Default" value="{$i}" /></td>
325302 <td align="center">&nbsp;</td>
326303 </tr>
 304+
327305 END;
328306 }
329 - $htmlform .= '</table></td></tr>';
330 - $htmlform .= '<tr><td colspan="2"><hr noshade /></td></tr>';
 307+ $htmlform .=
 308+<<<END
 309+</table>
 310+ </td></tr>
 311+</table>
 312+
 313+END;
331314 }
332315 $htmlform.=
333316 <<<END
334317 <tr><td><input type="submit" value="{$namespace_save_changes}" /></td></tr>
335318 </table>
336319 </form>
 320+
337321 END;
338322
339323 // Ouput the form
Index: branches/wikidata/phase3/skins/monobook/main.css
@@ -1337,7 +1337,19 @@
13381338 background-color: #f0f0ff;
13391339 }
13401340
 1341+/* SpecialNamespaces table */
 1342+table.specialnamespaces {
 1343+ border: 1px solid #aaa;
 1344+ margin-bottom: 1em;
 1345+}
13411346
 1347+div#addnsForm {
 1348+ margin-bottom: 1em;
 1349+ border: 1px solid #aaa;
 1350+ padding: 1.5em 2em;
 1351+ background-color: #f9f9f9;
 1352+}
 1353+
13421354 /* noarticletext */
13431355 div.noarticletext {
13441356 border: 1px solid #ccc;
@@ -1345,4 +1357,3 @@
13461358 padding: .2em 1em;
13471359 color: #000;
13481360 }
1349 -
Index: branches/wikidata/phase3/skins/common/common.css
@@ -373,6 +373,12 @@
374374 background-color: #f0f0ff;
375375 }
376376
 377+/* SpecialNamespace */
 378+table.specialnamespaces {
 379+ border : 1px solid black;
 380+}
 381+
 382+
377383 #jump-to-nav {
378384 display: none;
379 -}
\ No newline at end of file
 385+}

Status & tagging log