r93988 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93987‎ | r93988 | r93989 >
Date:17:48, 5 August 2011
Author:ankitgarg833
Status:deferred
Tags:
Comment:
minor fixes.
Modified paths:
  • /trunk/extensions/PageSchemas/specials/PS_EditSchema.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PageSchemas/specials/PS_EditSchema.php
@@ -46,6 +46,9 @@
4747 });
4848 jQuery('#templatesList').append(newField);
4949 }
 50+function updateFieldNum(field_num){
 51+ fieldNum = field_num;
 52+}
5053 function addjQueryToCheckbox(){
5154 jQuery('.isListCheckbox').click(function() {
5255 if (jQuery(this).is(":checked"))
@@ -252,7 +255,7 @@
253256 $params['page_text'] = $pageText.$Xmltext;
254257 $jobs[] = new PSCreatePageJob( $title, $params );
255258 Job::batchInsert( $jobs );
256 - }
 259+ }
257260 }
258261 else{
259262 if ( $category != "" ) {
@@ -320,10 +323,10 @@
321324 $template_add_xml .= (string)$field_xml->asXML();
322325 }
323326 }
324 - foreach ($template_xml->children() as $field_xml) {
 327+ $text_4 .= '<div id="fieldsList_'.$template_num.'">';
 328+ foreach ($template_xml->children() as $field_xml) {
325329 if ( $field_xml->getName() == "Field" ){
326 - $fieldName = (string)$field_xml->attributes()->name;
327 - $text_4 .= '<div id="fieldsList_'.$template_num.'">';
 330+ $fieldName = (string)$field_xml->attributes()->name;
328331 $text_4 .= '<div class="fieldBox" >';
329332 $text_4 .= '<fieldset style="background: #bbb;"><legend>Field</legend> ';
330333 if( ((string)$field_xml->attributes()->list) == "list") {
@@ -337,11 +340,11 @@
338341 $fieldLabel = (string)$child;
339342 }
340343 }
341 - $text_4 .= '<p>Field name: <input size="15" name="f_name_'.$template_num.'" value="'.$fieldName.'" >';
 344+ $text_4 .= '<p>Field name: <input size="15" name="f_name_'.$field_count.'" value="'.$fieldName.'" >';
342345 $text_4 .= 'Display label: <input size="15" name="f_label_'.$field_count.'" value="'.$fieldLabel.'" >
343346 </p> ';
344347 if($list_values){
345 - $text_4 .= '<p><input type="checkbox" name="f_is_list_'.$template_num.'" checked class="isListCheckbox" /> This field can hold a list of values</p> ';
 348+ $text_4 .= '<p><input type="checkbox" name="f_is_list_'.$field_count.'" checked class="isListCheckbox" /> This field can hold a list of values</p> ';
346349 $text_4 .= '<div class="delimiterInput" style="display:" ><p>Delimiter for values (default is ","): <input type="text" name="f_delimiter_'.$field_count.'" value="'.$delimiter.'" /> </p></div>';
347350 }else{
348351 $text_4 .= '<p><input type="checkbox" name="f_is_list_'.$field_count.'" class="isListCheckbox" /> This field can hold a list of values</p> ';
@@ -355,23 +358,25 @@
356359 $text_ex = preg_replace('/starter/', $field_count, $text_ex_array[$field_count]);
357360 $text_4 .= $text_ex;
358361 }
359 - }
 362+ }
360363 $text_4 .= '<p>Additional XML:
361364 <textarea rows=4 style="width: 100%" name="f_add_xml_'.$field_count.'"></textarea>
362365 </p>
363366 <input type="button" value="Remove field" class="deleteField" /></fieldset>
364367 </div>
365 - </div>
366368 ';
367369 $field_count++;
368 - }
369 -
 370+ $text_4 .= '<script type="text/javascript">
 371+ updateFieldNum('.$field_count.');
 372+ </script>';
 373+ }
370374 }
 375+ $text_4 .= '</div>';
371376 $add_field_button = Xml::element( 'input',
372377 array(
373378 'type' => 'button',
374379 'value' => 'Add Field',
375 - 'onclick' => "createTemplateAddField(1)"
 380+ 'onclick' => "createTemplateAddField($template_num)"
376381 )
377382 );
378383 $text_4 .= Xml::tags( 'p', null, $add_field_button ) . "\n";
@@ -380,7 +385,7 @@
381386 <textarea rows=4 style="width: 100%" name="t_add_xml_'.$template_num.'">'.$template_add_xml.'</textarea>
382387 </p>
383388 <p><input type="button" value="Remove template" class="deleteTemplate" /></p>
384 - </fieldset> </div></div>';
 389+ </fieldset> </div>';
385390
386391 }
387392 }

Status & tagging log