summaryrefslogtreecommitdiff
path: root/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php')
-rw-r--r--fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
index 44b28d4..a495973 100644
--- a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
+++ b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
@@ -104,6 +104,24 @@ class BakeExtraHelper extends Helper
return $coll->take($takeFields)->toArray();
}
+
+ public function filterFieldsOther($fields, $controllerName) {
+
+ $takeFields = Hash::get($this->_config, "taskParams.$controllerName.index-columns");
+ if ( $takeFields === NULL )
+ $takeFields = Hash::get($this->_config, "taskParams.default.index-columns");
+ //$filterTypes = ['binary']; // TODO
+ $rejectFields = ['id'];
+
+ $coll = collection($fields);
+ $coll = $coll->reject(function ($field, $key) use ($rejectFields) {
+ return in_array($field, $rejectFields);
+ });
+
+ return $coll->take($takeFields)->toArray();
+ }
+
+
public function getTitleOpts($controllerName) {
if ( ! is_string($controllerName) ) return FALSE;
return Hash::get($this->_config, "templateExtra.$controllerName.title");