Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@ajoneil ajoneil authored
View
2  forms/AjaxUniqueTextField.php
@@ -28,7 +28,7 @@ function __construct($name, $title, $restrictedField, $restrictedTable, $value =
parent::__construct($name, $title, $value);
}
- function Field() {
+ function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
View
2  forms/CompositeField.php
@@ -134,7 +134,7 @@ function getAttributes() {
);
}
- public function Field() {
+ public function Field($properties = array()) {
$content = '';
if($this->tag == 'fieldset' && $this->legend) {
View
2  forms/ConfirmedPasswordField.php
@@ -93,7 +93,7 @@ function __construct($name, $title = null, $value = "", $form = null, $showOnCli
$this->setValue($value);
}
- function Field() {
+ function Field($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
Requirements::css(SAPPHIRE_DIR . '/css/ConfirmedPasswordField.css');
View
2  forms/CreditCardField.php
@@ -6,7 +6,7 @@
*/
class CreditCardField extends TextField {
- function Field() {
+ function Field($properties = array()) {
$parts = $this->value;
if(!is_array($parts)) $parts = explode("\n", chunk_split($parts,4,"\n"));
$parts = array_pad($parts, 4, "");
View
4 forms/CurrencyField.php
@@ -67,7 +67,7 @@ class CurrencyField_Readonly extends ReadonlyField{
/**
* overloaded to display the correctly formated value for this datatype
*/
- function Field() {
+ function Field($properties = array()) {
if($this->value){
$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
@@ -100,7 +100,7 @@ class CurrencyField_Disabled extends CurrencyField{
/**
* overloaded to display the correctly formated value for this datatype
*/
- function Field() {
+ function Field($properties = array()) {
if($this->value){
$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
View
4 forms/DateField.php
@@ -120,7 +120,7 @@ function FieldHolder() {
return $html;
}
- function Field() {
+ function Field($properties = array()) {
$config = array(
'showcalendar' => $this->getConfig('showcalendar'),
'isoDateformat' => $this->getConfig('dateformat'),
@@ -425,7 +425,7 @@ class DateField_Disabled extends DateField {
protected $disabled = true;
- function Field() {
+ function Field($properties = array()) {
if($this->valueObj) {
if($this->valueObj->isToday()) {
$val = Convert::raw2xml($this->valueObj->toString($this->getConfig('dateformat')) . ' ('._t('DateField.TODAY','today').')');
View
4 forms/DatetimeField.php
@@ -84,7 +84,7 @@ function FieldHolder() {
return parent::FieldHolder();
}
- function Field() {
+ function Field($properties = array()) {
Requirements::css(SAPPHIRE_DIR . '/css/DatetimeField.css');
$tzField = ($this->getConfig('usertimezone')) ? $this->timezoneField->FieldHolder() : '';
@@ -287,7 +287,7 @@ class DatetimeField_Readonly extends DatetimeField {
protected $readonly = true;
- function Field() {
+ function Field($properties = array()) {
$valDate = $this->dateField->dataValue();
$valTime = $this->timeField->dataValue();
if($valDate && $valTime) {
View
2  forms/FieldGroup.php
@@ -92,7 +92,7 @@ function Name(){
* @todo Shouldn't use SmallFieldHolder() (very difficult to style),
* it is easier to overwrite the <div class="field"> behaviour in a more specific class
*/
- function Field() {
+ function Field($properties = array()) {
$fs = $this->FieldList();
$spaceZebra = isset($this->zebra) ? " fieldgroup-$this->zebra" : '';
$idAtt = isset($this->id) ? " id=\"{$this->id}\"" : '';
View
2  forms/FileIFrameField.php
@@ -60,7 +60,7 @@ public function dataClass() {
/**
* @return string
*/
- public function Field() {
+ public function Field($properties = array()) {
Deprecation::notice('3.0', 'Use UploadField');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
View
2  forms/GroupedDropdownField.php
@@ -39,7 +39,7 @@
*/
class GroupedDropdownField extends DropdownField {
- function Field() {
+ function Field($properties = array()) {
$options = '';
foreach($this->getSource() as $value => $title) {
if(is_array($title)) {
View
4 forms/HtmlEditorField.php
@@ -56,7 +56,7 @@ public function __construct($name, $title = null, $value = '') {
/**
* @return string
*/
- function Field() {
+ function Field($properties = array()) {
// mark up broken links
$value = new SS_HTMLValue($this->value);
@@ -221,7 +221,7 @@ public function performDisabledTransformation() {
* @subpackage fields-formattedinput
*/
class HtmlEditorField_Readonly extends ReadonlyField {
- function Field() {
+ function Field($properties = array()) {
$valforInput = $this->value ? Convert::raw2att($this->value) : "";
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."\" />";
}
View
2  forms/ImageFormAction.php
@@ -26,7 +26,7 @@ function __construct($action, $title = "", $image = "", $hoverImage = null, $cla
parent::__construct($action, $title, $form);
}
- function Field() {
+ function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
View
4 forms/InlineFormAction.php
@@ -27,7 +27,7 @@ function performReadonlyTransformation() {
return new InlineFormAction_ReadOnly( $this->name, $this->title );
}
- function Field() {
+ function Field($properties = array()) {
if($this->includeDefaultJS) {
Requirements::javascriptTemplate(SAPPHIRE_DIR . '/javascript/InlineFormAction.js',array('ID'=>$this->id()));
}
@@ -59,7 +59,7 @@ class InlineFormAction_ReadOnly extends FormField {
protected $readonly = true;
- function Field() {
+ function Field($properties = array()) {
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action disabled$this->extraClass\" />";
}
View
2  forms/LiteralField.php
@@ -31,7 +31,7 @@ function FieldHolder() {
return is_object($this->content) ? $this->content->forTemplate() : $this->content;
}
- function Field() {
+ function Field($properties = array()) {
return $this->FieldHolder();
}
View
2  forms/LookupField.php
@@ -12,7 +12,7 @@ class LookupField extends DropdownField {
/**
* Returns a readonly span containing the correct value.
*/
- function Field() {
+ function Field($properties = array()) {
$source = $this->getSource();
View
2  forms/MemberDatetimeOptionsetField.php
@@ -5,7 +5,7 @@
*/
class MemberDatetimeOptionsetField extends OptionsetField {
- function Field() {
+ function Field($properties = array()) {
$options = '';
$odd = 0;
$source = $this->getSource();
View
2  forms/MoneyField.php
@@ -43,7 +43,7 @@ function __construct($name, $title = null, $value = "") {
/**
* @return string
*/
- function Field() {
+ function Field($properties = array()) {
return "<div class=\"fieldgroup\">" .
"<div class=\"fieldgroupField\">" . $this->fieldCurrency->SmallFieldHolder() . "</div>" .
"<div class=\"fieldgroupField\">" . $this->fieldAmount->SmallFieldHolder() . "</div>" .
View
2  forms/NullableField.php
@@ -76,7 +76,7 @@ function getIsNullId() {
* (non-PHPdoc)
* @see sapphire/forms/FormField#Field()
*/
- function Field() {
+ function Field($properties = array()) {
if ( $this->isReadonly()) {
$nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
} else {
View
2  forms/NumericField.php
@@ -7,7 +7,7 @@
*/
class NumericField extends TextField{
- function Field() {
+ function Field($properties = array()) {
$html = parent::Field();
Requirements::javascript(SAPPHIRE_DIR . 'javascript/NumericField.js');
View
2  forms/PhoneNumberField.php
@@ -26,7 +26,7 @@ public function __construct( $name, $title = null, $value = '', $extension = nul
parent::__construct($name, $title, $value);
}
- public function Field() {
+ public function Field($properties = array()) {
$fields = new FieldGroup( $this->name );
$fields->setID("{$this->name}_Holder");
list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
View
4 forms/SimpleImageField.php
@@ -78,7 +78,7 @@ function __construct($name, $title = null, $value = null) {
$this->getValidator()->setAllowedExtensions(array('jpg','gif','png'));
}
- function Field() {
+ function Field($properties = array()) {
if($this->form) $record = $this->form->getRecord();
$fieldName = $this->name;
if(isset($record)&&$record) {
@@ -141,7 +141,7 @@ class SimpleImageField_Disabled extends FormField {
protected $readonly = true;
- function Field() {
+ function Field($properties = array()) {
$record = $this->form->getRecord();
$fieldName = $this->name;
View
6 forms/TimeField.php
@@ -63,13 +63,13 @@ function __construct($name, $title = null, $value = ""){
parent::__construct($name,$title,$value);
}
- function Field() {
+ function Field($properties = array()) {
$config = array(
'timeformat' => $this->getConfig('timeformat')
);
$config = array_filter($config);
$this->addExtraClass(Convert::raw2json($config));
- return parent::Field();
+ return parent::Field($properties);
}
function Type() {
@@ -206,7 +206,7 @@ class TimeField_Readonly extends TimeField {
protected $readonly = true;
- function Field() {
+ function Field($properties = array()) {
if($this->valueObj) {
$val = Convert::raw2xml($this->valueObj->toString($this->getConfig('timeformat')));
} else {
View
2  forms/ToggleField.php
@@ -46,7 +46,7 @@ function __construct($name, $title = "", $value = "") {
parent::__construct($name, $title, $value);
}
- function Field() {
+ function Field($properties = array()) {
$content = '';
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
View
4 forms/TreeMultiselectField.php
@@ -78,7 +78,7 @@ function getItems() {
* We overwrite the field attribute to add our hidden fields, as this
* formfield can contain multiple values.
*/
- function Field() {
+ function Field($properties = array()) {
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
@@ -178,7 +178,7 @@ class TreeMultiselectField_Readonly extends TreeMultiselectField {
protected $readonly = true;
- function Field() {
+ function Field($properties = array()) {
$titleArray = $itemIDs = array();
$titleList = $itemIDsList = "";
if($items = $this->getItems()) {
View
2  forms/UploadField.php
@@ -310,7 +310,7 @@ public function getAttributes() {
);
}
- public function Field() {
+ public function Field($properties = array()) {
$record = $this->getRecord();
$name = $this->getName();
View
2  forms/gridfield/GridField.php
@@ -448,7 +448,7 @@ public function FieldHolder() {
);
}
- public function Field() {
+ public function Field($properties = array()) {
return $this->FieldHolder();
}
View
2  security/PermissionCheckboxSetField.php
@@ -70,7 +70,7 @@ function getHiddenPermissions() {
return $this->hiddenPermissions;
}
- function Field() {
+ function Field($properties = array()) {
Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
Please sign in to comment.
Something went wrong with that request. Please try again.