From 102ed837c2bb576f8ec6a2cd32b4ac65f65870f7 Mon Sep 17 00:00:00 2001 From: Michael Richey Date: Sun, 3 Dec 2017 19:43:45 -0600 Subject: [PATCH] automatic context based on available vars --- admin/helpers/compiler/e_Interpretation.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index d954cdeb3..ce5b4e68b 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1653,6 +1653,13 @@ class Interpretation extends Fields public function setCustomViewFieldUikitChecker(&$get, $checker, $string, $code, $tab = '') { $fieldUikit = ''; + $runplugins = false; + $context = array(); + foreach(array('###component###','###view###') as $key) { + if(array_key_exists($key,$this->fileContentStatic)) { + $context[] = $this->fileContentStatic[$key]; + } + } foreach ($checker as $field => $array) { if (strpos($get['selection']['select'], $field) !== false) @@ -1663,7 +1670,7 @@ class Interpretation extends Fields $runplugins .= PHP_EOL."\t".$tab."\t".'$dispatcher = JEventDispatcher::getInstance();'; } $fieldUikit .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Make sure the content prepare plugins fire on ".$field; - $fieldUikit .= PHP_EOL."\t".$tab."\t".'$dispatcher->trigger("onContentPrepare",array("com_'.$this->fileContentStatic['###component###'].'.'.$this->fileContentStatic['###view###'].'",&'.$string.'->'.$field.',$item->params));'; + $fieldUikit .= PHP_EOL."\t".$tab."\t".'$dispatcher->trigger("onContentPrepare",array("com_'.implode('.',$context).'",&'.$string.'->'.$field.',$item->params));'; // only load for uikit version 2 (TODO) we may need to add another check here if (2 == $this->uikit || 1 == $this->uikit) {