API CHANGE Removed $rows and $cols constructor arguments on TextareaField and HtmlEditorField, use setRows() and setCols() instead

This commit is contained in:
Ingo Schommer 2012-01-02 17:44:23 +01:00
parent d678c12ac8
commit 1a10e8bcf5
2 changed files with 8 additions and 9 deletions

View File

@ -19,8 +19,10 @@ class HtmlEditorField extends TextareaField {
/** /**
* @see TextareaField::__construct() * @see TextareaField::__construct()
*/ */
public function __construct($name, $title = null, $rows = 30, $cols = 20, $value = '', $form = null) { public function __construct($name, $title = null, $value = '') {
parent::__construct($name, $title, $rows, $cols, $value, $form); if(count(func_get_args()) > 3) Deprecation::notice('3.0', 'Use setRows() and setCols() instead of constructor arguments');
parent::__construct($name, $title, $value);
self::include_js(); self::include_js();
} }

View File

@ -31,15 +31,12 @@ class TextareaField extends FormField {
* *
* @param $name Field name * @param $name Field name
* @param $title Field title * @param $title Field title
* @param $rows The number of rows
* @param $cols The number of columns
* @param $value The current value * @param $value The current value
* @param $form The parent form. Auto-set when the field is placed in a form.
*/ */
function __construct($name, $title = null, $rows = 5, $cols = 20, $value = "", $form = null) { function __construct($name, $title = null, $value = '') {
$this->rows = $rows; if(count(func_get_args()) > 3) Deprecation::notice('3.0', 'Use setRows() and setCols() instead of constructor arguments');
$this->cols = $cols;
parent::__construct($name, $title, $value, $form); parent::__construct($name, $title, $value);
} }
function getAttributes() { function getAttributes() {