r84554 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84553‎ | r84554 | r84555 >
Date:20:35, 22 March 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved some formatting and HTML output
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -1008,14 +1008,16 @@
10091009 // call hooks - unfortunately this has to be split into two
10101010 // separate calls, because of the different variable names in
10111011 // each case
1012 - if ( $form_submitted )
 1012+ if ( $form_submitted ) {
10131013 wfRunHooks( 'sfCreateFormField', array( &$form_field, &$cur_value_in_template, true ) );
1014 - else
 1014+ } else {
10151015 wfRunHooks( 'sfCreateFormField', array( &$form_field, &$cur_value, false ) );
 1016+ }
10161017 // if this is not part of a 'multiple' template, increment the
10171018 // global tab index (used for correct tabbing)
1018 - if ( ! array_key_exists( 'part_of_multiple', $field_args ) )
 1019+ if ( ! array_key_exists( 'part_of_multiple', $field_args ) ) {
10191020 $sfgTabIndex++;
 1021+ }
10201022 // increment the global field number regardless
10211023 $sfgFieldNum++;
10221024 // if the field is a date field, and its default value was set
@@ -1366,17 +1368,11 @@
13671369 $page_article = new Article( $this->mPageTitle );
13681370 $edittime = $page_article->getTimestamp();
13691371 if ( !$is_query ) {
1370 - $form_text .= <<<END
1371 -
1372 - <input type="hidden" value="$starttime" name="wpStarttime" />
1373 - <input type="hidden" value="$edittime" name="wpEdittime" />
1374 -END;
 1372+ $form_text .= "\t" . Xml::hidden( 'wpStarttime', wfTimestampNow() ) . "\n";
 1373+ $form_text .= "\t" . Xml::hidden( 'wpEdittime', $page_article->getTimestamp() ) . "\n";
13751374 }
1376 - $form_text .= <<<END
1377 - </form>
 1375+ $form_text .= "\t</form>\n";
13781376
1379 -END;
1380 -
13811377 // add Javascript code for form-wide use
13821378 $javascript_text = "";
13831379 if ( $free_text_was_included && $showFCKEditor > 0 ) {