r113230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113229‎ | r113230 | r113231 >
Date:14:09, 7 March 2012
Author:yaron
Status:deferred
Tags:
Comment:
Attempted fix for problem when calling the refreshLinks script; also some minor formatting improvements
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -539,11 +539,11 @@
540540 }
541541 // If $curPlaceholder is set, it means we want to insert a
542542 // multiple template form's HTML into the main form's HTML.
543 - // So, the HTML will be stored in $multipleTemplateString.
544 - if ( $allow_multiple ) {
545 - $multipleTemplateString .= "\t" . '<div class="multipleTemplateWrapper">' . "\n";
546 - $multipleTemplateString .= "\t" . '<div class="multipleTemplateList">' . "\n";
547 - }
 543+ // So, the HTML will be stored in $multipleTemplateString.
 544+ if ( $allow_multiple ) {
 545+ $multipleTemplateString .= "\t" . '<div class="multipleTemplateWrapper">' . "\n";
 546+ $multipleTemplateString .= "\t" . '<div class="multipleTemplateList">' . "\n";
 547+ }
548548 }
549549 if ( $curPlaceholder == null ) {
550550 $form_text .= $multipleTemplateString;
@@ -955,7 +955,7 @@
956956 } else {
957957 $sfgTabIndex++;
958958 $sfgFieldNum++;
959 - if ( $cur_value === '' || is_null( $cur_value ) ) {
 959+ if ( $cur_value === '' || is_null( $cur_value ) ) {
960960 $default_value = '!free_text!';
961961 } else {
962962 $default_value = $cur_value;
@@ -1537,11 +1537,11 @@
15381538 $form_text .= SFFormUtils::formBottom( $form_is_disabled );
15391539 }
15401540
1541 - $page_article = new Article( $this->mPageTitle, 0 );
15421541
15431542 if ( !$is_query ) {
15441543 $form_text .= Html::hidden( 'wpStarttime', wfTimestampNow() );
1545 - $form_text .= Html::hidden( 'wpEdittime', $page_article->getTimestamp() );
 1544+ $article = new Article( $this->mPageTitle, 0 );
 1545+ $form_text .= Html::hidden( 'wpEdittime', $article->getTimestamp() );
15461546 }
15471547
15481548 $form_text .= "\t</form>\n";
@@ -1565,8 +1565,9 @@
15661566 // Send the autocomplete values to the browser, along with the
15671567 // mappings of which values should apply to which fields.
15681568 // If doing a replace, the data text is actually the modified original page
1569 - if ( $wgRequest->getCheck( 'partial' ) )
 1569+ if ( $wgRequest->getCheck( 'partial' ) ) {
15701570 $data_text = $existing_page_content;
 1571+ }
15711572
15721573 if ( !$is_embedded ) {
15731574 $form_page_title = $wgParser->recursiveTagParse( str_replace( "{{!}}", "|", $form_page_title ) );
@@ -1592,7 +1593,7 @@
15931594 }
15941595
15951596 /**
1596 - * Create the HTML and Javascript to display this field within a form
 1597+ * Create the HTML and Javascript to display this field within a form.
15971598 */
15981599 function formFieldHTML( $form_field, $cur_value ) {
15991600 // Also get the actual field, with all the semantic information