mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Moving Requirements for AssetTableField, CommentTableField and MemberTableField from __construct() into FieldHolder() and renderWith(), which means inclusion closer to render time, and less side-effects by a previous Requirements::clear(), e.g. in a CTF popup. See r74919
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@74920 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
44fcc58c35
commit
119f821b94
@ -18,8 +18,6 @@ class AssetTableField extends ComplexTableField {
|
|||||||
);
|
);
|
||||||
function __construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") {
|
function __construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") {
|
||||||
parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin);
|
parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin);
|
||||||
|
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/AssetTableField.js');
|
|
||||||
|
|
||||||
$SNG_file = singleton('File');
|
$SNG_file = singleton('File');
|
||||||
|
|
||||||
@ -38,9 +36,12 @@ class AssetTableField extends ComplexTableField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function FieldHolder() {
|
function FieldHolder() {
|
||||||
|
$ret = parent::FieldHolder();
|
||||||
|
|
||||||
|
Requirements::javascript(CMS_DIR . '/javascript/AssetTableField.js');
|
||||||
Requirements::javascript('cms/javascript/ImageEditor/Activator.js');
|
Requirements::javascript('cms/javascript/ImageEditor/Activator.js');
|
||||||
|
|
||||||
return parent::FieldHolder();
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFolder($folder) {
|
function setFolder($folder) {
|
||||||
|
@ -23,8 +23,14 @@ class CommentTableField extends ComplexTableField {
|
|||||||
if(!empty($_REQUEST['CommentSearch'])) {
|
if(!empty($_REQUEST['CommentSearch'])) {
|
||||||
$this->sourceFilter[] = "( `Name` LIKE '%$search%' OR `Comment` LIKE '%$search%')";
|
$this->sourceFilter[] = "( `Name` LIKE '%$search%' OR `Comment` LIKE '%$search%')";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function FieldHolder() {
|
||||||
|
$ret = parent::FieldHolder();
|
||||||
|
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/CommentTableField.js');
|
Requirements::javascript(CMS_DIR . '/javascript/CommentTableField.js');
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Items() {
|
function Items() {
|
||||||
|
@ -109,9 +109,6 @@ class MemberTableField extends ComplexTableField {
|
|||||||
$this->hidePassword = $hidePassword;
|
$this->hidePassword = $hidePassword;
|
||||||
|
|
||||||
parent::__construct($controller, $name, $sourceClass, $fieldList);
|
parent::__construct($controller, $name, $sourceClass, $fieldList);
|
||||||
|
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
|
||||||
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
|
|
||||||
|
|
||||||
// search
|
// search
|
||||||
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
|
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
|
||||||
@ -133,6 +130,15 @@ class MemberTableField extends ComplexTableField {
|
|||||||
$this->setFieldListCsv($csvFieldList);
|
$this->setFieldListCsv($csvFieldList);
|
||||||
$this->setPageSize($this->stat('page_size'));
|
$this->setPageSize($this->stat('page_size'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function FieldHolder() {
|
||||||
|
$ret = parent::FieldHolder();
|
||||||
|
|
||||||
|
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
||||||
|
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
function sourceID() {
|
function sourceID() {
|
||||||
return ($this->group) ? $this->group->ID : 0;
|
return ($this->group) ? $this->group->ID : 0;
|
||||||
@ -376,11 +382,13 @@ class MemberTableField extends ComplexTableField {
|
|||||||
*/
|
*/
|
||||||
class MemberTableField_Popup extends ComplexTableField_Popup {
|
class MemberTableField_Popup extends ComplexTableField_Popup {
|
||||||
|
|
||||||
function __construct($controller, $name, $fields, $sourceClass, $readonly=false, $validator = null) {
|
function forTemplate() {
|
||||||
parent::__construct($controller, $name, $fields, $sourceClass, $readonly, $validator);
|
$ret = parent::forTemplate();
|
||||||
|
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField_popup.js');
|
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField_popup.js');
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user