r94176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94175‎ | r94176 | r94177 >
Date:18:02, 10 August 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
some i1n8 msgs
Modified paths:
  • /trunk/extensions/PageSchemas/specials/PS_EditSchema.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php
@@ -83,41 +83,45 @@
8484 global $wgRequest, $wgOut, $wgUser;
8585 global $wgSkin;
8686 $this->setHeaders();
87 - $text_1 = '<p>This category does not exist yet. Create this category and its page schema: </p>';
88 - $text_2 = '<p>This category exists, but does not have a page schema. Create schema:" </p>';
89 - $text_3 = '<p>This category exists,have a page schema. Edit schema:" </p>';
 87+ $text_1 = '<p>'.wfMsg( 'page-desc-cat-not-exist' ).'</p>';
 88+ $text_2 = '<p>'.wfMsg( 'page-desc-ps-not-exist' ).'</p>';
 89+ $text_3 = '<p>'.wfMsg( 'page-desc-edit-schema' ).'</p>';
9090 $text_4 = '';
9191 self::addJavascript();
9292 $pageSchemaObj = null;
9393 $text_extensions = array(); //This var. will save the html text returned by the extensions
94 - $js_extensions = array();
95 - wfRunHooks( 'getHtmlTextForFieldInputs', array( &$js_extensions, &$text_extensions ));
96 - $text = "";
97 - $text .= '<p>This category does not exist yet. Create this category and its page schema: </p>';
 94+ $js_extensions = array();
 95+ wfRunHooks( 'getHtmlTextForFieldInputs', array( &$js_extensions, &$text_extensions ));
 96+ $text = "";
9897 $text .= ' <form id="createPageSchemaForm" action="" method="post">' . "\n";
99 - $text .= '<p>Name of schema: <input type="text" name="s_name"/> </p> ';
100 - $text .= '<p>Additional XML:
 98+ $text .= '<p>'.$schema_name_label.' <input type="text" name="s_name"/> </p> ';
 99+ $text .= '<p>'.$add_xml_label.'
101100 <textarea rows=4 style="width: 100%" name="ps_add_xml"></textarea>
102101 </p> ';
103102 if($text_extensions['sf_form'] != null){
104103 $text_ex = preg_replace('/starter/', '1', $text_extensions['sf_form']);
105104 $text .= $text_ex;
106105 }
 106+ $delimeter_label = wfMsg('delimeter-label');
 107+ $multiple_temp_label = wfMsg('multiple-temp-label');
 108+ $field_list_label = wfMsg('field-list-label');
 109+ $add_xml_label = wfMsg('add-xml-label');
 110+ $schema_name_label = wfMsg('schema-name-label');
107111 $text .= '<div id="templatesList">';
108112 $text .= '<div class="templateBox" >';
109113 $text .= '<fieldset style="background: #ddd;"><legend>Template</legend> ';
110114 $text .= '<p>Name: <input type="text" name="t_name_1"/></p> ';
111 - $text .= '<p><input type="checkbox" name="is_multiple_1"/> Allow multiple instances of this template</p> ';
 115+ $text .= '<p><input type="checkbox" name="is_multiple_1"/> '.$multiple_temp_label.'</p> ';
112116 $text .= '<div id="fieldsList_1">';
113117 $text .= '<div class="fieldBox" >';
114118 $text .= '<fieldset style="background: #bbb;"><legend>Field</legend>
115119 <p>Field name: <input size="15" name="f_name_1">
116120 Display label: <input size="15" name="f_label_1">
117121 </p>
118 - <p><input type="checkbox" name="f_is_list_1" class="isListCheckbox" />
119 - This field can hold a list of values
 122+ <p><input type="checkbox" name="f_is_list_1" class="isListCheckbox" />'.
 123+ $field_list_label.'
120124 </p>
121 - <div class="delimiterInput" style="display: none" ><p>Delimiter for values (default is ","): <input type="text" name="f_delimiter_1" /> </p></div>';
 125+ <div class="delimiterInput" style="display: none" ><p>'.$delimeter_label.' <input type="text" name="f_delimiter_1" /> </p></div>';
122126 if($text_extensions['smw'] != null){
123127 $text_ex = preg_replace('/starter/', '1', $text_extensions['smw']);
124128 $text .= $text_ex;
@@ -129,8 +133,9 @@
130134 if($text_extensions['sd'] != null){
131135 $text_ex = preg_replace('/starter/', '1', $text_extensions['sd']);
132136 $text .= $text_ex;
133 - }
134 - $text .= '<p>Additional XML:
 137+ }
 138+
 139+ $text .= '<p>'.$add_xml_label.'
135140 <textarea rows=4 style="width: 100%" name="f_add_xml_1"></textarea>
136141 </p>
137142 <input type="button" value="Remove field" class="deleteField" /></fieldset>
@@ -146,7 +151,7 @@
147152 );
148153 $text .= Xml::tags( 'p', null, $add_field_button ) . "\n";
149154 $text .= '<hr />
150 - <p>Additional XML:
 155+ <p>'.$add_xml_label.'
151156 <textarea rows=4 style="width: 100%" name="t_add_xml_1"></textarea>
152157 </p>
153158 <p><input type="button" value="Remove template" class="deleteTemplate" /></p>
@@ -175,7 +180,7 @@
176181 <p><input type="button" value="Add Field" onclick="createTemplateAddField(starter)" /></p>
177182
178183 <hr />
179 - <p>Additional XML:
 184+ <p>'.$add_xml_label.'
180185 <textarea rows=4 style="width: 100%" name="t_add_xml_starter"></textarea>
181186 </p>
182187 <p><input type="button" value="Remove template" class="deleteTemplate" /></p>
@@ -200,7 +205,7 @@
201206 if($text_extensions['sd'] != null){
202207 $starter_text .= $text_extensions['sd'];
203208 }
204 - $starter_text .= '<p>Additional XML:
 209+ $starter_text .= '<p>'.$add_xml_label.'
205210 <textarea rows=4 style="width: 100%" name="f_add_xml_starter"></textarea>
206211 </p>
207212 <input type="button" value="Remove field" class="deleteField" />
@@ -293,7 +298,7 @@
294299 Job::batchInsert( $jobs );
295300 }
296301 }
297 - else{
 302+ else{
298303 if ( $category != "" ) {
299304 $pageSchemaObj = new PSSchema( $category );
300305 $title = Title::newFromText( $category, NS_CATEGORY );
@@ -326,13 +331,13 @@
327332 $pageName = (string)$pageXml->attributes()->name;
328333 $text_4 .= '';
329334 $text_4 .= '<form id="editPageSchemaForm" action="" method="post">' . "\n";
330 - $text_4 .= '<p>Name of schema: <input type="text" name="s_name" value="'.$pageName.'" /> </p> ';
 335+ $text_4 .= '<p>'.$schema_name_label.' <input type="text" name="s_name" value="'.$pageName.'" /> </p> ';
331336 foreach ( $pageXml->children() as $template_xml ) {
332337 if ( ($template_xml->getName() != 'Template') && ($template_xml->getName() != 'Form') ){
333338 $ps_add_xml .= (string)$template_xml->asXML();
334339 }
335340 }
336 - $text_4 .= '<p>Additional XML:
 341+ $text_4 .= '<p>'.$add_xml_label.'
337342 <textarea rows=4 style="width: 100%" name="ps_add_xml" >'.$ps_add_xml.'</textarea>
338343 </p> ';
339344
@@ -417,7 +422,7 @@
418423 }
419424 }
420425
421 - $text_4 .= '<p>Additional XML:
 426+ $text_4 .= '<p>'.$add_xml_label.'
422427 <textarea rows=4 style="width: 100%" name="f_add_xml_'.$field_count.'"></textarea>
423428 </p>
424429 <input type="button" value="Remove field" class="deleteField" /></fieldset>
@@ -439,7 +444,7 @@
440445 );
441446 $text_4 .= Xml::tags( 'p', null, $add_field_button ) . "\n";
442447 $text_4 .= '<hr />
443 - <p>Additional XML:
 448+ <p>'.$add_xml_label.'
444449 <textarea rows=4 style="width: 100%" name="t_add_xml_'.$template_num.'">'.$template_add_xml.'</textarea>
445450 </p>
446451 <p><input type="button" value="Remove template" class="deleteTemplate" /></p>

Status & tagging log