From b10b01949404aab8f0ace9334ae4e617cfe43031 Mon Sep 17 00:00:00 2001 From: Michael Richey Date: Sun, 3 Dec 2017 19:24:53 -0600 Subject: [PATCH] Implement onContentPrepare --- admin/helpers/compiler/e_Interpretation.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 9374bc27e..d954cdeb3 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1658,8 +1658,12 @@ class Interpretation extends Fields if (strpos($get['selection']['select'], $field) !== false) { // build decoder string - $fieldUikit .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Make sure the content prepare plugins fire on ".$field." (TODO)"; - $fieldUikit .= PHP_EOL."\t".$tab."\t".$string."->".$field." = JHtml::_('content.prepare',".$string."->".$field.");"; + if(!$runplugins) { + $runplugins = PHP_EOL."\t".$tab."\tJPluginHelper::importPlugin('content');\n"; + $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));'; // only load for uikit version 2 (TODO) we may need to add another check here if (2 == $this->uikit || 1 == $this->uikit) { @@ -1668,7 +1672,7 @@ class Interpretation extends Fields } } } - return $fieldUikit; + return ($runplugins?:'').$fieldUikit; } public function setCustomViewCustomJoin(&$gets,$string,$code,&$asBucket,$tab = '')