r76286 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76285‎ | r76286 | r76287 >
Date:03:07, 8 November 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for "default=" parameter in free-text field, via code by Jean-Philippe Muller
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -699,7 +699,12 @@
700700 $field_args['cols'] = 80;
701701 $sfgTabIndex++;
702702 $sfgFieldNum++;
703 - list( $new_text, $new_javascript_text ) = SFFormInputs::textAreaHTML( '!free_text!', 'free_text', false, ( $form_is_disabled || $is_restricted ), $field_args );
 703+ if ( $cur_value == '' ) {
 704+ $default_value = '!free_text!';
 705+ } else {
 706+ $default_value = $cur_value;
 707+ }
 708+ list( $new_text, $new_javascript_text ) = SFFormInputs::textAreaHTML( $default_value, 'free_text', false, ( $form_is_disabled || $is_restricted ), $field_args );
704709 if ( in_array( 'edittools', $free_text_components ) ) {
705710 // borrowed from EditPage::showEditTools()
706711 $options[] = 'parse';

Status & tagging log