summaryrefslogtreecommitdiff
path: root/fai_gestion/plugins/CustomTheme/src
diff options
context:
space:
mode:
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src')
-rw-r--r--fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
index c70be2e..eb4b1df 100644
--- a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
+++ b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php
@@ -61,6 +61,8 @@ class BakeExtraHelper extends Helper
return $extraModels;
}
public function stringifySearchManagerConfig($filterConfig) {
+ $indent = 2;
+ $tab = ' ';
// Do not output Model & Template specific options here
unset($filterConfig['mode']);
unset($filterConfig['colspan']);
@@ -68,7 +70,16 @@ class BakeExtraHelper extends Helper
//Bake::stringifyList() has bugs with nested array + option quotes in Cake 3.6.7
$s = var_export($filterConfig, true);
$s = str_replace([ 'array (', ')'], ['[', ']'], $s);
- return trim($s, '[]') . ' ';
+ $s = preg_replace_callback(
+ // for each text line, replace ' ' idents by $tab, adding a $indent offset
+ '/^([ ]+)/m',
+ function($ms) use ($indent, $tab) {
+ return str_repeat($tab, $indent+floor(strlen($ms[1])/2));
+ },
+ $s
+ );
+ $s = trim($s, '[]');
+ return $s . str_repeat($tab, $indent);
}
public function hasAction($action, $controllerName) {