MediaWiki  REL1_24
HTMLTextAreaField.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class HTMLTextAreaField extends HTMLFormField {
00004     const DEFAULT_COLS = 80;
00005     const DEFAULT_ROWS = 25;
00006 
00007     function getCols() {
00008         return isset( $this->mParams['cols'] ) ? $this->mParams['cols'] : static::DEFAULT_COLS;
00009     }
00010 
00011     function getRows() {
00012         return isset( $this->mParams['rows'] ) ? $this->mParams['rows'] : static::DEFAULT_ROWS;
00013     }
00014 
00015     function getInputHTML( $value ) {
00016         $attribs = array(
00017                 'id' => $this->mID,
00018                 'cols' => $this->getCols(),
00019                 'rows' => $this->getRows(),
00020             ) + $this->getTooltipAndAccessKey();
00021 
00022         if ( $this->mClass !== '' ) {
00023             $attribs['class'] = $this->mClass;
00024         }
00025 
00026         $allowedParams = array(
00027             'placeholder',
00028             'tabindex',
00029             'disabled',
00030             'readonly',
00031             'required',
00032             'autofocus'
00033         );
00034 
00035         $attribs += $this->getAttributes( $allowedParams );
00036         return Html::textarea( $this->mName, $value, $attribs );
00037     }
00038 }