Implement the Plugin sql updates

I checked the JCB codes and tried to implement the plugin sql updates section that did not work according to the JCB structure
This commit is contained in:
2021-12-26 14:13:18 +03:30
parent 9373b29bff
commit c37dfc0b21
6 changed files with 152 additions and 11 deletions

View File

@ -580,7 +580,7 @@ class Compiler extends Infusion
{
$this->setFileContent(
$plugin_file['name'], $plugin_file['path'],
$bom, $plugin->key
$bom, ['plugin_key' => $plugin->key, 'view' => $plugin_file['view']]
);
}
}
@ -633,6 +633,12 @@ class Compiler extends Infusion
*/
protected function setFileContent(&$name, &$path, &$bom, $view = null)
{
$main_view= null;
if (is_array($view))
{
$main_view= $view['view'];
$view= $view['plugin_key'];
}
// Trigger Event: jcb_ce_onBeforeSetFileContent
$this->triggerEvent(
'jcb_ce_onBeforeSetFileContent',
@ -667,9 +673,20 @@ class Compiler extends Infusion
// set the dynamic answer
if ($view)
{
$answer = $this->setPlaceholders(
$answer, $this->fileContentDynamic[$view], 3
);
if ($main_view)
{
$answer = $this->setPlaceholders(
$answer, $this->fileContentDynamic[$view][$main_view], 3
);
}
else
{
$answer = $this->setPlaceholders(
$answer, $this->fileContentDynamic[$view], 3
);
}
}
// check if this file needs extra care :)
if (isset($this->updateFileContent[$path]))