MediaWiki
REL1_23
|
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 'name' => $this->mName, 00019 'cols' => $this->getCols(), 00020 'rows' => $this->getRows(), 00021 ) + $this->getTooltipAndAccessKey(); 00022 00023 if ( $this->mClass !== '' ) { 00024 $attribs['class'] = $this->mClass; 00025 } 00026 00027 $allowedParams = array( 00028 'placeholder', 00029 'tabindex', 00030 'disabled', 00031 'readonly', 00032 'required', 00033 'autofocus' 00034 ); 00035 00036 $attribs += $this->getAttributes( $allowedParams ); 00037 00038 return Html::element( 'textarea', $attribs, $value ); 00039 } 00040 }