diff --git a/code/AssetTableField.php b/code/AssetTableField.php index cb9a874d..e46e24e6 100755 --- a/code/AssetTableField.php +++ b/code/AssetTableField.php @@ -18,8 +18,6 @@ class AssetTableField extends ComplexTableField { ); function __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'); @@ -38,9 +36,12 @@ class AssetTableField extends ComplexTableField { } function FieldHolder() { + $ret = parent::FieldHolder(); + + Requirements::javascript(CMS_DIR . '/javascript/AssetTableField.js'); Requirements::javascript('cms/javascript/ImageEditor/Activator.js'); - return parent::FieldHolder(); + return $ret; } function setFolder($folder) { diff --git a/code/CommentTableField.php b/code/CommentTableField.php index e7e6fa22..945c50e9 100644 --- a/code/CommentTableField.php +++ b/code/CommentTableField.php @@ -23,8 +23,14 @@ class CommentTableField extends ComplexTableField { if(!empty($_REQUEST['CommentSearch'])) { $this->sourceFilter[] = "( `Name` LIKE '%$search%' OR `Comment` LIKE '%$search%')"; } + } + + function FieldHolder() { + $ret = parent::FieldHolder(); Requirements::javascript(CMS_DIR . '/javascript/CommentTableField.js'); + + return $ret; } function Items() { diff --git a/code/MemberTableField.php b/code/MemberTableField.php index 67b1816b..547809b5 100755 --- a/code/MemberTableField.php +++ b/code/MemberTableField.php @@ -109,9 +109,6 @@ class MemberTableField extends ComplexTableField { $this->hidePassword = $hidePassword; parent::__construct($controller, $name, $sourceClass, $fieldList); - - Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js'); - Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js"); // search $SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null; @@ -133,6 +130,15 @@ class MemberTableField extends ComplexTableField { $this->setFieldListCsv($csvFieldList); $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() { return ($this->group) ? $this->group->ID : 0; @@ -376,11 +382,13 @@ class MemberTableField extends ComplexTableField { */ class MemberTableField_Popup extends ComplexTableField_Popup { - function __construct($controller, $name, $fields, $sourceClass, $readonly=false, $validator = null) { - parent::__construct($controller, $name, $fields, $sourceClass, $readonly, $validator); - + function forTemplate() { + $ret = parent::forTemplate(); + Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js'); Requirements::javascript(CMS_DIR . '/javascript/MemberTableField_popup.js'); + + return $ret; } }