Skip to content

Commit 4fdb2cd

Browse files
committed
Refactoring - removed not used default parameters from constructors.
1 parent 0fa8012 commit 4fdb2cd

13 files changed

Lines changed: 14 additions & 24 deletions

WEB-INF/lib/form/Checkbox.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ class Checkbox extends FormElement {
3232
var $checked = false;
3333
var $mOptions = null;
3434

35-
function __construct($name, $value = '') {
35+
function __construct($name) {
3636
$this->class = 'Checkbox';
3737
$this->name = $name;
38-
$this->value = $value;
3938
}
4039

4140
function setChecked($value) { $this->checked = $value; }

WEB-INF/lib/form/CheckboxGroup.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ class CheckboxGroup extends FormElement {
3838
var $lSelAll = "All";
3939
var $lSelNone = "None";
4040

41-
function __construct($name, $value = '') {
41+
function __construct($name) {
4242
$this->class = 'CheckboxGroup';
4343
$this->name = $name;
44-
$this->value = $value;
4544
}
4645

4746
function setChecked($value) { $this->mChecked = $value; }

WEB-INF/lib/form/Combobox.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ class Combobox extends FormElement {
4545
var $mDataDeep = 1;
4646
var $mDataKeys = array();
4747

48-
function __construct($name, $value = '') {
48+
function __construct($name) {
4949
$this->class = 'Combobox';
5050
$this->name = $name;
51-
$this->value = $value;
5251
}
5352

5453
function setMultiple($value) { $this->mMultiple = $value; }

WEB-INF/lib/form/Form.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function addInput($params) {
8585
case 'checkbox':
8686
import('form.Checkbox');
8787
$el = new Checkbox($params['name']);
88-
if (isset($params['checked'])) $el->setChecked(true);
88+
if (isset($params['checked'])) $el->setChecked($params['checked']);
8989

9090
// TODO: refactoring ongoing down from here.
9191
$el->setData(@$params["data"]);

WEB-INF/lib/form/Hidden.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030

3131
class Hidden extends FormElement {
3232

33-
function __construct($name, $value = '') {
33+
function __construct($name) {
3434
$this->class = 'Hidden';
3535
$this->name = $name;
36-
$this->value = $value;
3736
}
3837

3938
function getHtml() {

WEB-INF/lib/form/PasswordField.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030

3131
class PasswordField extends FormElement {
3232

33-
function __construct($name, $value='')
33+
function __construct($name)
3434
{
3535
$this->class = 'PasswordField';
3636
$this->name = $name;
37-
$this->value = $value;
3837
}
3938

4039
function getHtml() {

WEB-INF/lib/form/Submit.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030

3131
class Submit extends FormElement {
3232

33-
function __construct($name, $value = '')
33+
function __construct($name)
3434
{
3535
$this->class = 'Submit';
3636
$this->name = $name;
37-
$this->value = $value;
3837
}
3938

4039
function getHtml() {

WEB-INF/lib/form/Table.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ class Table extends FormElement {
4646
var $mHeaderOptions = array();
4747
var $mProccessed = false;
4848

49-
function __construct($name, $value='') {
49+
function __construct($name) {
5050
$this->class = 'Table';
5151
$this->name = $name;
52-
$this->value = $value;
5352
}
5453

5554
function setKeyField($value) {

WEB-INF/lib/form/TextArea.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ class TextArea extends FormElement {
3333
var $mRows = "";
3434
var $mOnKeyPress = "";
3535

36-
function __construct($name, $value = '')
36+
function __construct($name)
3737
{
3838
$this->class = 'TextArea';
3939
$this->name = $name;
40-
$this->value = $value;
4140
}
42-
41+
4342
function setColumns($value) { $this->mColumns = $value; }
4443
function getColumns() { return $this->mColumns; }
4544

WEB-INF/lib/form/TextField.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030

3131
class TextField extends FormElement {
3232

33-
function __construct($name, $value = '')
33+
function __construct($name)
3434
{
3535
$this->class = 'TextField';
3636
$this->name = $name;
37-
$this->value = $value;
3837
}
3938

4039
// TODO: refactoring ongoing down from here.

0 commit comments

Comments
 (0)