Added context to all compiler events. Added layout fields override options for dynamic field generation.

This commit is contained in:
2019-07-01 18:10:28 +02:00
parent 663f8405e5
commit b9c758b800
291 changed files with 4951 additions and 370 deletions

View File

@ -254,7 +254,7 @@ class Compiler extends Infusion
protected function setFileContent(&$name, &$path, &$bom, $view = null)
{
// Trigger Event: jcb_ce_onBeforeSetFileContent
$this->triggerEvent('jcb_ce_onBeforeSetFileContent', array(&$name, &$path, &$bom, &$view));
$this->triggerEvent('jcb_ce_onBeforeSetFileContent', array(&$this->componentContext, &$name, &$path, &$bom, &$view));
// set the file name
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name;
// check if the file should get PHP opening
@ -266,7 +266,7 @@ class Compiler extends Infusion
// get content of the file
$string = ComponentbuilderHelper::getFileContents($path);
// Trigger Event: jcb_ce_onGetFileContents
$this->triggerEvent('jcb_ce_onGetFileContents', array(&$string, &$name, &$path, &$bom, &$view));
$this->triggerEvent('jcb_ce_onGetFileContents', array(&$this->componentContext, &$string, &$name, &$path, &$bom, &$view));
// see if we should add a BOM
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
@ -286,7 +286,7 @@ class Compiler extends Infusion
$answer = $this->setDynamicValues($answer);
}
// Trigger Event: jcb_ce_onBeforeSetFileContent
$this->triggerEvent('jcb_ce_onBeforeWriteFileContent', array(&$answer, &$name, &$path, &$bom, &$view));
$this->triggerEvent('jcb_ce_onBeforeWriteFileContent', array(&$this->componentContext, &$answer, &$name, &$path, &$bom, &$view));
// add answer back to file
$this->writeFile($path, $answer);
// count the file lines