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 have FieldHolder() with identical signa…

…ture to FormField::FieldHolder(). Fixes E_STRICT warnings.
  • Loading branch information...
commit 716ff9dcfaedee08b63c7e61af07e1fe2a60e04d 1 parent 142a073
Andrew O'Neil ajoneil authored
2  forms/ComplexTableField.php
View
@@ -206,7 +206,7 @@ function isComposite() {
/**
* @return String
*/
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/greybox/AmiJS.js");
2  forms/CompositeField.php
View
@@ -158,7 +158,7 @@ public function Field($properties = array()) {
/**
* Returns the fields nested inside another DIV
*/
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
$content = '';
if($this->tag == 'fieldset' && $this->legend) {
4 forms/DatalessField.php
View
@@ -32,8 +32,8 @@ function getAttributes() {
* Returns the field's representation in the form.
* For dataless fields, this defaults to $Field.
*/
- function FieldHolder() {
- return $this->Field();
+ function FieldHolder($properties = array()) {
+ return $this->Field($properties);
}
/**
2  forms/DateField.php
View
@@ -110,7 +110,7 @@ function __construct($name, $title = null, $value = null) {
parent::__construct($name, $title, $value);
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
// TODO Replace with properly extensible view helper system
$d = DateField_View_JQuery::create($this);
$d->onBeforeRender();
4 forms/DatetimeField.php
View
@@ -74,14 +74,14 @@ function setForm($form) {
return $this;
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
$config = array(
'datetimeorder' => $this->getConfig('datetimeorder'),
);
$config = array_filter($config);
$this->addExtraClass(Convert::raw2json($config));
- return parent::FieldHolder();
+ return parent::FieldHolder($properties);
}
function Field($properties = array()) {
2  forms/FieldGroup.php
View
@@ -131,7 +131,7 @@ function setZebra($zebra) {
return $this;
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
$Title = $this->XML_val('Title');
$Message = $this->XML_val('Message');
$MessageType = $this->XML_val('MessageType');
4 forms/FormAction.php
View
@@ -70,8 +70,8 @@ function Field($properties = array()) {
return $this->customise($properties)->renderWith($this->getTemplate());
}
- function FieldHolder() {
- return $this->Field();
+ function FieldHolder($properties = array()) {
+ return $this->Field($properties);
}
public function Type() {
4 forms/HasManyComplexTableField.php
View
@@ -64,8 +64,8 @@ function __construct($controller, $name, $sourceClass, $fieldList = null, $detai
}
- function FieldHolder() {
- $ret = parent::FieldHolder();
+ function FieldHolder($properties = array()) {
+ $ret = parent::FieldHolder($properties);
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/HasManyFileField.js");
4 forms/HiddenField.php
View
@@ -8,8 +8,8 @@ class HiddenField extends FormField {
protected $template = 'HiddenField';
- function FieldHolder() {
- return $this->Field();
+ function FieldHolder($properties = array()) {
+ return $this->Field($properties);
}
function performReadonlyTransformation() {
13 forms/LiteralField.php
View
@@ -27,12 +27,19 @@ function __construct($name, $content) {
parent::__construct($name);
}
- function FieldHolder() {
- return is_object($this->content) ? $this->content->forTemplate() : $this->content;
+ function FieldHolder($properties = array()) {
+ if(is_object($this->content)) {
+ $obj = $this->content;
+ if($properties)
+ $obj = $obj->customise($properties);
+ return $obj->forTemplate();
+ } else {
+ return $this->content;
+ }
}
function Field($properties = array()) {
- return $this->FieldHolder();
+ return $this->FieldHolder($properties);
}
/**
2  forms/PrintableTransformation.php
View
@@ -25,7 +25,7 @@ function __construct($tabs) {
CompositeField::__construct($tabs);
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
// This gives us support for sub-tabs.
$tag = ($this->tabSet) ? "h2>" : "h1>";
6 forms/SelectionGroup.php
View
@@ -85,12 +85,14 @@ function hasData() {
return true;
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/SelectionGroup.js');
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
+
+ $obj = $properties ? $this->customise($properties) : $this;
- return $this->renderWith($this->template);
+ return $obj->renderWith($this->template);
}
}
5 forms/TabSet.php
View
@@ -69,7 +69,7 @@ public function id() {
* Returns a tab-strip and the associated tabs.
* The HTML is a standardised format, containing a <ul;
*/
- public function FieldHolder() {
+ public function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-cookie/jquery.cookie.js');
@@ -80,7 +80,8 @@ public function FieldHolder() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');
- return $this->renderWith($this->template);
+ $obj = $properties ? $this->customise($properties) : $this;
+ return $obj->renderWith($this->template);
}
/**
5 forms/TableField.php
View
@@ -463,7 +463,7 @@ function getExtraData() {
/**
* Sets the template to be rendered with
*/
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
@@ -472,7 +472,8 @@ function FieldHolder() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableField.js');
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
- return $this->renderWith($this->template);
+ $obj = $properties ? $this->customise($properties) : $this;
+ return $obj->renderWith($this->template);
}
function setTransformationConditions($conditions) {
6 forms/TableListField.php
View
@@ -278,7 +278,7 @@ function handleItem($request) {
return new TableListField_ItemRequest($this, $request->param('ID'));
}
- function FieldHolder() {
+ function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
@@ -299,7 +299,9 @@ function FieldHolder() {
});
JS
);}
- return $this->renderWith($this->template);
+
+ $obj = $properties ? $this->customise($properties) : $this;
+ return $obj->renderWith($this->template);
}
function Headings() {
5 forms/ToggleCompositeField.php
View
@@ -22,12 +22,13 @@ function __construct($name, $title, $children) {
parent::__construct($children);
}
- public function FieldHolder() {
+ public function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleCompositeField.js");
- return $this->renderWith($this->template);
+ $obj = $properties ? $this->customise($properties) : $this;
+ return $obj->renderWith($this->template);
}
/**
4 forms/gridfield/GridField.php
View
@@ -289,7 +289,7 @@ public function getState($getData=true) {
*
* @return string
*/
- public function FieldHolder() {
+ public function FieldHolder($properties = array()) {
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_DIR . '/css/GridField.css');
@@ -449,7 +449,7 @@ public function FieldHolder() {
}
public function Field($properties = array()) {
- return $this->FieldHolder();
+ return $this->FieldHolder($properties);
}
public function getAttributes() {
Please sign in to comment.
Something went wrong with that request. Please try again.