Skip to content
This repository
Browse code

MINOR: Ensure all form fields Field() method has the same signature a…

…s FormField::Field(). Fixes E_STRICT warnings.
  • Loading branch information...
commit 4be59a8d4583ab8bbc4e102cf0c43725616f33c2 1 parent d368f36
Andrew O'Neil authored April 11, 2012
2  forms/AjaxUniqueTextField.php
@@ -28,7 +28,7 @@ function __construct($name, $title, $restrictedField, $restrictedTable, $value =
28 28
 		parent::__construct($name, $title, $value);	
29 29
 	}
30 30
 	 
31  
-	function Field() {
  31
+	function Field($properties = array()) {
32 32
 		Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
33 33
 		Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
34 34
 		Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
2  forms/CompositeField.php
@@ -134,7 +134,7 @@ function getAttributes() {
134 134
 		);
135 135
 	}
136 136
 
137  
-	public function Field() {
  137
+	public function Field($properties = array()) {
138 138
 		$content = '';
139 139
 
140 140
 		if($this->tag == 'fieldset' && $this->legend) {
2  forms/ConfirmedPasswordField.php
@@ -93,7 +93,7 @@ function __construct($name, $title = null, $value = "", $form = null, $showOnCli
93 93
 		$this->setValue($value);
94 94
 	}
95 95
 	
96  
-	function Field() {
  96
+	function Field($properties = array()) {
97 97
 		Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
98 98
 		Requirements::javascript(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
99 99
 		Requirements::css(SAPPHIRE_DIR . '/css/ConfirmedPasswordField.css');
2  forms/CreditCardField.php
@@ -6,7 +6,7 @@
6 6
  */
7 7
 class CreditCardField extends TextField {
8 8
 	
9  
-	function Field() {
  9
+	function Field($properties = array()) {
10 10
 		$parts = $this->value;
11 11
 		if(!is_array($parts)) $parts = explode("\n", chunk_split($parts,4,"\n"));
12 12
 		$parts = array_pad($parts, 4, "");
4  forms/CurrencyField.php
@@ -67,7 +67,7 @@ class CurrencyField_Readonly extends ReadonlyField{
67 67
 	/**
68 68
 	 * overloaded to display the correctly formated value for this datatype 
69 69
 	 */
70  
-	function Field() {
  70
+	function Field($properties = array()) {
71 71
 		if($this->value){
72 72
 			$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
73 73
 			$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
@@ -100,7 +100,7 @@ class CurrencyField_Disabled extends CurrencyField{
100 100
 	/**
101 101
 	 * overloaded to display the correctly formated value for this datatype 
102 102
 	 */
103  
-	function Field() {
  103
+	function Field($properties = array()) {
104 104
 		if($this->value){
105 105
 			$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
106 106
 			$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
4  forms/DateField.php
@@ -120,7 +120,7 @@ function FieldHolder() {
120 120
 		return $html;
121 121
 	}
122 122
 
123  
-	function Field() {
  123
+	function Field($properties = array()) {
124 124
 		$config = array(
125 125
 			'showcalendar' => $this->getConfig('showcalendar'),
126 126
 			'isoDateformat' => $this->getConfig('dateformat'),
@@ -425,7 +425,7 @@ class DateField_Disabled extends DateField {
425 425
 	
426 426
 	protected $disabled = true;
427 427
 		
428  
-	function Field() {
  428
+	function Field($properties = array()) {
429 429
 		if($this->valueObj) {
430 430
 			if($this->valueObj->isToday()) {
431 431
 				$val = Convert::raw2xml($this->valueObj->toString($this->getConfig('dateformat')) . ' ('._t('DateField.TODAY','today').')');
4  forms/DatetimeField.php
@@ -84,7 +84,7 @@ function FieldHolder() {
84 84
 		return parent::FieldHolder();
85 85
 	}
86 86
 	
87  
-	function Field() {
  87
+	function Field($properties = array()) {
88 88
 		Requirements::css(SAPPHIRE_DIR . '/css/DatetimeField.css');
89 89
 		
90 90
 		$tzField = ($this->getConfig('usertimezone')) ? $this->timezoneField->FieldHolder() : '';
@@ -287,7 +287,7 @@ class DatetimeField_Readonly extends DatetimeField {
287 287
 	
288 288
 	protected $readonly = true;
289 289
 		
290  
-	function Field() {
  290
+	function Field($properties = array()) {
291 291
 		$valDate = $this->dateField->dataValue();
292 292
 		$valTime = $this->timeField->dataValue();
293 293
 		if($valDate && $valTime) {
2  forms/FieldGroup.php
@@ -92,7 +92,7 @@ function Name(){
92 92
 	 * @todo Shouldn't use SmallFieldHolder() (very difficult to style), 
93 93
 	 * it is easier to overwrite the <div class="field"> behaviour in a more specific class
94 94
 	 */
95  
-	function Field() {
  95
+	function Field($properties = array()) {
96 96
 		$fs = $this->FieldList();
97 97
     	$spaceZebra = isset($this->zebra) ? " fieldgroup-$this->zebra" : '';
98 98
     	$idAtt = isset($this->id) ? " id=\"{$this->id}\"" : '';
2  forms/FileIFrameField.php
@@ -60,7 +60,7 @@ public function dataClass() {
60 60
 	/**
61 61
 	 * @return string
62 62
 	 */
63  
-	public function Field() {
  63
+	public function Field($properties = array()) {
64 64
 		Deprecation::notice('3.0', 'Use UploadField');
65 65
 
66 66
 		Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
2  forms/GroupedDropdownField.php
@@ -39,7 +39,7 @@
39 39
  */
40 40
 class GroupedDropdownField extends DropdownField {
41 41
 
42  
-	function Field() {
  42
+	function Field($properties = array()) {
43 43
 		$options = '';
44 44
 		foreach($this->getSource() as $value => $title) {
45 45
 			if(is_array($title)) {
4  forms/HtmlEditorField.php
@@ -56,7 +56,7 @@ public function __construct($name, $title = null, $value = '') {
56 56
 	/**
57 57
 	 * @return string
58 58
 	 */
59  
-	function Field() {
  59
+	function Field($properties = array()) {
60 60
 		// mark up broken links
61 61
 		$value  = new SS_HTMLValue($this->value);
62 62
 		
@@ -221,7 +221,7 @@ public function performDisabledTransformation() {
221 221
  * @subpackage fields-formattedinput
222 222
  */
223 223
 class HtmlEditorField_Readonly extends ReadonlyField {
224  
-	function Field() {
  224
+	function Field($properties = array()) {
225 225
 		$valforInput = $this->value ? Convert::raw2att($this->value) : "";
226 226
 		return "<span class=\"readonly typography\" id=\"" . $this->id() . "\">" . ( $this->value && $this->value != '<p></p>' ? $this->value : '<i>(not set)</i>' ) . "</span><input type=\"hidden\" name=\"".$this->name."\" value=\"".$valforInput."\" />";
227 227
 	}
2  forms/ImageFormAction.php
@@ -26,7 +26,7 @@ function __construct($action, $title = "", $image = "", $hoverImage = null, $cla
26 26
 		parent::__construct($action, $title, $form);
27 27
 	}
28 28
 
29  
-	function Field() {
  29
+	function Field($properties = array()) {
30 30
 		Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
31 31
 		Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
32 32
 		
4  forms/InlineFormAction.php
@@ -27,7 +27,7 @@ function performReadonlyTransformation() {
27 27
 		return new InlineFormAction_ReadOnly( $this->name, $this->title );
28 28
 	}
29 29
 	
30  
-	function Field() {
  30
+	function Field($properties = array()) {
31 31
 		if($this->includeDefaultJS) {
32 32
 			Requirements::javascriptTemplate(SAPPHIRE_DIR . '/javascript/InlineFormAction.js',array('ID'=>$this->id()));
33 33
 		}
@@ -59,7 +59,7 @@ class InlineFormAction_ReadOnly extends FormField {
59 59
 	
60 60
 	protected $readonly = true;
61 61
 	
62  
-	function Field() {
  62
+	function Field($properties = array()) {
63 63
 		return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action disabled$this->extraClass\" />";
64 64
 	}	
65 65
 	
2  forms/LiteralField.php
@@ -31,7 +31,7 @@ function FieldHolder() {
31 31
 		return is_object($this->content) ? $this->content->forTemplate() : $this->content; 
32 32
 	}
33 33
 
34  
-	function Field() {
  34
+	function Field($properties = array()) {
35 35
 		return $this->FieldHolder();
36 36
 	}
37 37
 
2  forms/LookupField.php
@@ -12,7 +12,7 @@ class LookupField extends DropdownField {
12 12
 	/**
13 13
 	 * Returns a readonly span containing the correct value.
14 14
 	 */
15  
-	function Field() {
  15
+	function Field($properties = array()) {
16 16
 		$source = $this->getSource();
17 17
 		
18 18
 		
2  forms/MemberDatetimeOptionsetField.php
@@ -5,7 +5,7 @@
5 5
  */
6 6
 class MemberDatetimeOptionsetField extends OptionsetField {
7 7
 
8  
-	function Field() {
  8
+	function Field($properties = array()) {
9 9
 		$options = '';
10 10
 		$odd = 0;
11 11
 		$source = $this->getSource();
2  forms/MoneyField.php
@@ -43,7 +43,7 @@ function __construct($name, $title = null, $value = "") {
43 43
 	/**
44 44
 	 * @return string
45 45
 	 */
46  
-	function Field() {
  46
+	function Field($properties = array()) {
47 47
 		return "<div class=\"fieldgroup\">" .
48 48
 			"<div class=\"fieldgroupField\">" . $this->fieldCurrency->SmallFieldHolder() . "</div>" . 
49 49
 			"<div class=\"fieldgroupField\">" . $this->fieldAmount->SmallFieldHolder() . "</div>" . 
2  forms/NullableField.php
@@ -76,7 +76,7 @@ function getIsNullId() {
76 76
 	 * (non-PHPdoc)
77 77
 	 * @see sapphire/forms/FormField#Field()
78 78
 	 */
79  
-	function Field() {
  79
+	function Field($properties = array()) {
80 80
 		if ( $this->isReadonly()) {
81 81
 			$nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
82 82
 		} else {
2  forms/NumericField.php
@@ -7,7 +7,7 @@
7 7
  */
8 8
 class NumericField extends TextField{
9 9
 	
10  
-	function Field() {
  10
+	function Field($properties = array()) {
11 11
 		$html = parent::Field();
12 12
 		Requirements::javascript(SAPPHIRE_DIR . 'javascript/NumericField.js');
13 13
 		
2  forms/PhoneNumberField.php
@@ -26,7 +26,7 @@ public function __construct( $name, $title = null, $value = '', $extension = nul
26 26
 		parent::__construct($name, $title, $value);
27 27
 	}
28 28
 	
29  
-	public function Field() {
  29
+	public function Field($properties = array()) {
30 30
 		$fields = new FieldGroup( $this->name );
31 31
 		$fields->setID("{$this->name}_Holder");
32 32
 		list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
4  forms/SimpleImageField.php
@@ -78,7 +78,7 @@ function __construct($name, $title = null, $value = null) {
78 78
 		$this->getValidator()->setAllowedExtensions(array('jpg','gif','png'));
79 79
 	}
80 80
 
81  
-	function Field() {
  81
+	function Field($properties = array()) {
82 82
 	    if($this->form) $record = $this->form->getRecord();
83 83
 	    $fieldName = $this->name;
84 84
 	    if(isset($record)&&$record) {
@@ -141,7 +141,7 @@ class SimpleImageField_Disabled extends FormField {
141 141
 	
142 142
 	protected $readonly = true;
143 143
 	
144  
-	function Field() {
  144
+	function Field($properties = array()) {
145 145
 		$record = $this->form->getRecord();
146 146
 	    $fieldName = $this->name;
147 147
 			
6  forms/TimeField.php
@@ -63,13 +63,13 @@ function __construct($name, $title = null, $value = ""){
63 63
 		parent::__construct($name,$title,$value);
64 64
 	}
65 65
 	
66  
-	function Field() {
  66
+	function Field($properties = array()) {
67 67
 		$config = array(
68 68
 			'timeformat' => $this->getConfig('timeformat')
69 69
 		);
70 70
 		$config = array_filter($config);
71 71
 		$this->addExtraClass(Convert::raw2json($config));
72  
-		return parent::Field();
  72
+		return parent::Field($properties);
73 73
 	}
74 74
 	
75 75
 	function Type() {
@@ -206,7 +206,7 @@ class TimeField_Readonly extends TimeField {
206 206
 	
207 207
 	protected $readonly = true;
208 208
 	
209  
-	function Field() {
  209
+	function Field($properties = array()) {
210 210
 		if($this->valueObj) {
211 211
 			$val = Convert::raw2xml($this->valueObj->toString($this->getConfig('timeformat')));
212 212
 		} else {
2  forms/ToggleField.php
@@ -46,7 +46,7 @@ function __construct($name, $title = "", $value = "") {
46 46
 		parent::__construct($name, $title, $value);
47 47
 	}
48 48
 
49  
-	function Field() {
  49
+	function Field($properties = array()) {
50 50
 		$content = '';
51 51
 		
52 52
 		Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
4  forms/TreeMultiselectField.php
@@ -78,7 +78,7 @@ function getItems() {
78 78
 	 * We overwrite the field attribute to add our hidden fields, as this 
79 79
 	 * formfield can contain multiple values.
80 80
 	 */
81  
-	function Field() {
  81
+	function Field($properties = array()) {
82 82
 		Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
83 83
 		
84 84
 		Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
@@ -178,7 +178,7 @@ class TreeMultiselectField_Readonly extends TreeMultiselectField {
178 178
 	
179 179
 	protected $readonly = true;
180 180
 	
181  
-	function Field() {
  181
+	function Field($properties = array()) {
182 182
 		$titleArray = $itemIDs = array();
183 183
 		$titleList = $itemIDsList = "";
184 184
 		if($items = $this->getItems()) {
2  forms/UploadField.php
@@ -310,7 +310,7 @@ public function getAttributes() {
310 310
 		);
311 311
 	}
312 312
 
313  
-	public function Field() {
  313
+	public function Field($properties = array()) {
314 314
 		$record = $this->getRecord();
315 315
 		$name = $this->getName();
316 316
 
2  forms/gridfield/GridField.php
@@ -448,7 +448,7 @@ public function FieldHolder() {
448 448
 			);
449 449
 	}
450 450
 	
451  
-	public function Field() {
  451
+	public function Field($properties = array()) {
452 452
 		return $this->FieldHolder();
453 453
 	}
454 454
 
2  security/PermissionCheckboxSetField.php
@@ -70,7 +70,7 @@ function getHiddenPermissions() {
70 70
 		return $this->hiddenPermissions;
71 71
 	}
72 72
 
73  
-	function Field() {
  73
+	function Field($properties = array()) {
74 74
 		Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
75 75
 		Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
76 76
 		

0 notes on commit 4be59a8

Please sign in to comment.
Something went wrong with that request. Please try again.