r69805 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69804‎ | r69805 | r69806 >
Date:17:45, 23 July 2010
Author:nimishg
Status:ok
Tags:
Comment:
added "small input" class
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.classes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.classes.php
@@ -12,6 +12,7 @@
1313 'boolean' => 'PrefSwitchSurveyFieldBoolean',
1414 'dimensions' => 'PrefSwitchSurveyFieldDimensions',
1515 'text' => 'PrefSwitchSurveyFieldText',
 16+ 'smallinput' => 'PrefSwitchSurveyFieldSmallInput',
1617 );
1718
1819 /* Static Functions */
@@ -345,3 +346,23 @@
346347 );
347348 }
348349 }
 350+
 351+class PrefSwitchSurveyFieldSmallInput implements PrefSwitchSurveyField {
 352+
 353+ /* Static Functions */
 354+
 355+ public static function render( $question, $config, $answer, $answerData ) {
 356+ $html = Xml::tags( 'dt', null, wfMsgWikiHtml( $config['question'] ) );
 357+ $html .= Xml::tags(
 358+ 'dd', null, Xml::input( "prefswitch-survey-{$question}", 5, $answerData ? $answerData : '' )
 359+ );
 360+ return $html;
 361+ }
 362+ public static function save( $question, $request ) {
 363+ $answer = $request->getVal( "prefswitch-survey-{$question}" );
 364+ return array(
 365+ 'pss_answer' => null,
 366+ 'pss_answer_data' => $answer !== '' ? $answer : null,
 367+ );
 368+ }
 369+}

Status & tagging log