Added many events to the compiler as the first step to allow 3rd party integration with the compiler via plugins. gh-429

This commit is contained in:
2019-06-22 12:43:26 +02:00
parent e84105c3bd
commit 75656d940a
14 changed files with 227 additions and 21 deletions

View File

@ -736,6 +736,13 @@ class Get
*/
public $mysqlTableSetting = array();
/**
* event plugin trigger switch
*
* @var boolean
*/
protected $active_plugins = false;
/**
* Constructor
*/
@ -748,6 +755,21 @@ class Get
$this->app = JFactory::getApplication();
// Set the params
$this->params = JComponentHelper::getParams('com_componentbuilder');
// get active plugins
if (($plugins = $this->params->get('compiler_plugin', false)) !== false)
{
foreach ($plugins as $plugin)
{
// get posible plugins
if (\JPluginHelper::isEnabled('extension', $plugin))
{
// Import the appropriate plugin group.
\JPluginHelper::importPlugin('extension', $plugin);
// activate events
$this->active_plugins = true;
}
}
}
// set the minfy switch of the JavaScript
$this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0);
// set the global language
@ -866,6 +888,40 @@ class Get
return '';
}
/**
* Trigger events
*
* @param string $event The event to trigger
* @param mix $data The values to pass to the event/plugin
*
* @return string
*
*/
public function triggerEvent($event, $data)
{
// only exicute if plugins were loaded (active)
if ($this->active_plugins)
{
// Get the dispatcher.
$dispatcher = \JEventDispatcher::getInstance();
// Trigger the form preparation event.
$results = $dispatcher->trigger($event, $data);
// Check for errors encountered while trigger the event
if (count($results) && in_array(false, $results, true))
{
// Get the last error.
$error = $dispatcher->getError();
if (!($error instanceof \Exception))
{
throw new \Exception($error);
}
}
}
}
/**
* get all System Placeholders
*
@ -963,12 +1019,18 @@ class Get
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_component_placeholders', 'k') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('k.joomla_component') . ')');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $this->componentID);
// Trigger Event: jcb_ce_onBeforeQueryComponentData
$this->triggerEvent('jcb_ce_onBeforeQueryComponentData', array(&$this->componentID, &$query, &$this->db));
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
// Load the results as a list of stdClass objects
$component = $this->db->loadObject();
// Trigger Event: jcb_ce_onBeforeModelComponentData
$this->triggerEvent('jcb_ce_onBeforeModelComponentData', array(&$component));
// set upater
$updater = array(
'unique' => array(
@ -1510,6 +1572,9 @@ class Get
$component->toignore = array('.git');
}
// Trigger Event: jcb_ce_onAfterModelComponentData
$this->triggerEvent('jcb_ce_onAfterModelComponentData', array(&$component));
// return the found component data
return $component;
}
@ -1556,6 +1621,9 @@ class Get
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_custom_tabs', 't') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('t.admin_view') . ')');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Trigger Event: jcb_ce_onBeforeQueryViewData
$this->triggerEvent('jcb_ce_onBeforeQueryViewData', array(&$id, &$query, &$this->db));
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
@ -1611,6 +1679,10 @@ class Get
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// Trigger Event: jcb_ce_onBeforeModelViewData
$this->triggerEvent('jcb_ce_onBeforeModelViewData', array(&$view, &$this->placeholders));
// add the tables
$view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null;
if (ComponentbuilderHelper::checkArray($view->addtables))
@ -2205,6 +2277,10 @@ class Get
// remove the table values since we moved to another object
unset($view->{'mysql_table_' . $_mysqlTableKey});
}
// Trigger Event: jcb_ce_onAfterModelViewData
$this->triggerEvent('jcb_ce_onAfterModelViewData', array(&$view, &$this->placeholders));
// clear placeholders
unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
@ -2244,11 +2320,18 @@ class Get
$query->from('#__componentbuilder_' . $table . ' AS a');
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Trigger Event: jcb_ce_onBeforeQueryCustomViewData
$this->triggerEvent('jcb_ce_onBeforeQueryCustomViewData', array(&$id, &$table, &$query, &$this->db));
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$view = $this->db->loadObject();
// Trigger Event: jcb_ce_onBeforeModelCustomViewData
$this->triggerEvent('jcb_ce_onBeforeModelCustomViewData', array(&$view, &$id, &$table));
if ($table === 'site_view')
{
$this->lang = 'site';
@ -2485,6 +2568,10 @@ class Get
}
unset($view->custom_button);
}
// Trigger Event: jcb_ce_onAfterModelCustomViewData
$this->triggerEvent('jcb_ce_onAfterModelCustomViewData', array(&$view));
// return the found view data
return $view;
}
@ -2513,6 +2600,9 @@ class Get
$query->join('LEFT', $this->db->quoteName('#__componentbuilder_fieldtype', 'c') . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' . $this->db->quoteName('c.id') . ')');
$query->where($this->db->quoteName('a.id') . ' = ' . $this->db->quote($id));
// Trigger Event: jcb_ce_onBeforeQueryFieldData
$this->triggerEvent('jcb_ce_onBeforeQueryFieldData', array(&$id, &$query, &$this->db));
// Reset the query using our newly populated query object.
$this->db->setQuery($query);
$this->db->execute();
@ -2521,6 +2611,9 @@ class Get
// Load the results as a list of stdClass objects (see later for more options on retrieving data).
$field = $this->db->loadObject();
// Trigger Event: jcb_ce_onBeforeModelFieldData
$this->triggerEvent('jcb_ce_onBeforeModelFieldData', array(&$field));
// adding a fix for the changed name of type to fieldtype
$field->type = $field->fieldtype;
@ -2596,6 +2689,9 @@ class Get
// get the last used version
$field->history = $this->getHistoryWatch('field', $id);
// Trigger Event: jcb_ce_onAfterModelFieldData
$this->triggerEvent('jcb_ce_onAfterModelFieldData', array(&$field));
$this->_fieldData[$id] = $field;
}
else

View File

@ -367,6 +367,8 @@ class Structure extends Get
$this->setLibaries();
// set the Joomla Version Data
$this->joomlaVersionData = $this->setJoomlaVersionData();
// Trigger Event: jcb_ce_onAfterSetJoomlaVersionData
$this->triggerEvent('jcb_ce_onAfterSetJoomlaVersionData', array(&$this->joomlaVersionData));
// set the dashboard
$this->setDynamicDashboard();
// set the new folders
@ -416,6 +418,8 @@ class Structure extends Get
{
if (ComponentbuilderHelper::checkArray($this->libraries))
{
// Trigger Event: jcb_ce_onBeforeSetLibaries
$this->triggerEvent('jcb_ce_onBeforeSetLibaries', array(&$this->libraries));
// creat the main component folder
if (!JFolder::exists($this->componentPath))
{

View File

@ -456,11 +456,15 @@ class Fields extends Structure
$dynamicFields = '';
// set the custom table key
$dbkey = 'g';
// Trigger Event: jcb_ce_onBeforeBuildFields
$this->triggerEvent('jcb_ce_onBeforeBuildFields', array(&$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews));
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamicFields .= $this->setDynamicField($field, $view, $view['settings']->type, $langView, $view_name_single, $view_name_list, $this->placeholders, $dbkey, true);
}
// Trigger Event: jcb_ce_onAfterBuildFields
$this->triggerEvent('jcb_ce_onAfterBuildFields', array(&$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews));
// set the default fields
$fieldSet = array();
$fieldSet[] = '<fieldset name="details">';
@ -724,11 +728,15 @@ class Fields extends Structure
$dynamicFieldsXML = array();
// set the custom table key
$dbkey = 'g';
// Trigger Event: jcb_ce_onBeforeBuildFields
$this->triggerEvent('jcb_ce_onBeforeBuildFields', array(&$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews));
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamicFieldsXML[] = $this->setDynamicField($field, $view, $view['settings']->type, $langView, $view_name_single, $view_name_list, $this->placeholders, $dbkey, true);
}
// Trigger Event: jcb_ce_onAfterBuildFields
$this->triggerEvent('jcb_ce_onAfterBuildFields', array(&$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews));
// set the default fields
$XML = new simpleXMLElement('<a/>');
$fieldSetXML = $XML->addChild('fieldset');

View File

@ -3353,11 +3353,13 @@ class Interpretation extends Fields
if ($view['settings']->main_get->gettype == 1 && ComponentbuilderHelper::checkArray($view['settings']->main_get->plugin_events))
{
$method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Process the content plugins.";
$method .= PHP_EOL . $this->_t(2) . "JPluginHelper::importPlugin('content');";
$method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Setup Event Object.";
$method .= PHP_EOL . $this->_t(2) . "\$this->item->event = new stdClass;";
$method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check if item has params, or pass global params";
$method .= PHP_EOL . $this->_t(2) . "\$params = (isset(\$this->item->params) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;";
$method .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$this->item))";
$method .= PHP_EOL . $this->_t(2) . "{";
$method .= PHP_EOL . $this->_t(3) . "JPluginHelper::importPlugin('content');";
$method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Setup Event Object.";
$method .= PHP_EOL . $this->_t(3) . "\$this->item->event = new stdClass;";
$method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check if item has params, or pass global params";
$method .= PHP_EOL . $this->_t(3) . "\$params = (isset(\$this->item->params) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;";
// load the defaults
foreach ($view['settings']->main_get->plugin_events as $plugin_event)
{
@ -3370,11 +3372,12 @@ class Interpretation extends Fields
}
else
{
$method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " " . $plugin_event . " Event Trigger.";
$method .= PHP_EOL . $this->_t(2) . "\$results = \$dispatcher->trigger('" . $plugin_event . "', array('com_" . $this->componentCodeName . "." . $view['settings']->context . "', &\$this->item, &\$params, 0));";
$method .= PHP_EOL . $this->_t(2) . '$this->item->event->' . $plugin_event . ' = trim(implode("\n", $results));';
$method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $plugin_event . " Event Trigger.";
$method .= PHP_EOL . $this->_t(3) . "\$results = \$dispatcher->trigger('" . $plugin_event . "', array('com_" . $this->componentCodeName . "." . $view['settings']->context . "', &\$this->item, &\$params, 0));";
$method .= PHP_EOL . $this->_t(3) . '$this->item->event->' . $plugin_event . ' = trim(implode("\n", $results));';
}
}
$method .= PHP_EOL . $this->_t(2) . "}";
}
$method .= PHP_EOL . PHP_EOL . $this->_t(2) . "parent::display(\$tpl);";
}
@ -6535,6 +6538,9 @@ class Interpretation extends Fields
{
// add final list of needed lang strings
$componentName = JFilterOutput::cleanText($this->componentData->name);
// Trigger Event: jcb_ce_onBeforeBuildAdminLang
$this->triggerEvent('jcb_ce_onBeforeBuildAdminLang', array(&$this->langContent['admin'], &$this->langPrefix, &$componentName));
// start loding the defaults
$this->langContent['adminsys'][$this->langPrefix] = $componentName;
$this->langContent['adminsys'][$this->langPrefix . '_CONFIGURATION'] = $componentName . ' Configuration';
$this->langContent['admin'][$this->langPrefix] = $componentName;
@ -6624,6 +6630,9 @@ class Interpretation extends Fields
}
if (isset($this->langContent['admin']) && ComponentbuilderHelper::checkArray($this->langContent['admin']))
{
// Trigger Event: jcb_ce_onAfterBuildAdminLang
$this->triggerEvent('jcb_ce_onAfterBuildAdminLang', array(&$this->langContent['admin'], &$this->langPrefix, &$componentName));
// sort the strings
ksort($this->langContent['admin']);
// load to global languages
$this->languages[$this->langTag]['admin'] = $this->langContent['admin'];
@ -6638,7 +6647,11 @@ class Interpretation extends Fields
public function setLangSite()
{
// add final list of needed lang strings
$this->langContent['site'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name, 'W');
$componentName = JFilterOutput::cleanText($this->componentData->name);
// Trigger Event: jcb_ce_onBeforeBuildSiteLang
$this->triggerEvent('jcb_ce_onBeforeBuildSiteLang', array(&$this->langContent['site'], &$this->langPrefix, &$componentName));
// add final list of needed lang strings
$this->langContent['site'][$this->langPrefix] = $componentName;
// some more defaults
$this->langContent['site']['JTOOLBAR_APPLY'] = "Save";
$this->langContent['site']['JTOOLBAR_SAVE_AS_COPY'] = "Save as Copy";
@ -6677,6 +6690,9 @@ class Interpretation extends Fields
}
if (isset($this->langContent['site']) && ComponentbuilderHelper::checkArray($this->langContent['site']))
{
// Trigger Event: jcb_ce_onAfterBuildSiteLang
$this->triggerEvent('jcb_ce_onAfterBuildSiteLang', array(&$this->langContent['site'], &$this->langPrefix, &$componentName));
// sort the strings
ksort($this->langContent['site']);
// load to global languages
$this->languages[$this->langTag]['site'] = $this->langContent['site'];
@ -6691,7 +6707,11 @@ class Interpretation extends Fields
public function setLangSiteSys()
{
// add final list of needed lang strings
$this->langContent['sitesys'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name, 'W');
$componentName = JFilterOutput::cleanText($this->componentData->name);
// Trigger Event: jcb_ce_onBeforeBuildSiteSysLang
$this->triggerEvent('jcb_ce_onBeforeBuildSiteSysLang', array(&$this->langContent['sitesys'], &$this->langPrefix, &$componentName));
// add final list of needed lang strings
$this->langContent['sitesys'][$this->langPrefix] = $componentName;
$this->langContent['sitesys'][$this->langPrefix . '_NO_ACCESS_GRANTED'] = "No Access Granted!";
$this->langContent['sitesys'][$this->langPrefix . '_NOT_FOUND_OR_ACCESS_DENIED'] = "Not found or access denied!";
@ -6705,6 +6725,9 @@ class Interpretation extends Fields
}
if (isset($this->langContent['sitesys']) && ComponentbuilderHelper::checkArray($this->langContent['sitesys']))
{
// Trigger Event: jcb_ce_onAfterBuildSiteSysLang
$this->triggerEvent('jcb_ce_onAfterBuildSiteSysLang', array(&$this->langContent['sitesys'], &$this->langPrefix, &$componentName));
// sort strings
ksort($this->langContent['sitesys']);
// load to global languages
$this->languages[$this->langTag]['sitesys'] = $this->langContent['sitesys'];
@ -6718,6 +6741,10 @@ class Interpretation extends Fields
public function setLangAdminSys()
{
// add final list of needed lang strings
$componentName = JFilterOutput::cleanText($this->componentData->name);
// Trigger Event: jcb_ce_onBeforeBuildAdminSysLang
$this->triggerEvent('jcb_ce_onBeforeBuildAdminSysLang', array(&$this->langContent['adminsys'], &$this->langPrefix, &$componentName));
// check if the both admin array is set
if (isset($this->langContent['bothadmin']) && ComponentbuilderHelper::checkArray($this->langContent['bothadmin']))
{
@ -6728,6 +6755,9 @@ class Interpretation extends Fields
}
if (isset($this->langContent['adminsys']) && ComponentbuilderHelper::checkArray($this->langContent['adminsys']))
{
// Trigger Event: jcb_ce_onAfterBuildAdminSysLang
$this->triggerEvent('jcb_ce_onAfterBuildAdminSysLang', array(&$this->langContent['adminsys'], &$this->langPrefix, &$componentName));
// sort strings
ksort($this->langContent['adminsys']);
// load to global languages
$this->languages[$this->langTag]['adminsys'] = $this->langContent['adminsys'];
@ -13963,6 +13993,7 @@ class Interpretation extends Fields
// set the custom fields
if (isset($this->componentData->config) && ComponentbuilderHelper::checkArray($this->componentData->config))
{
// set component code name
$component = $this->componentCodeName;
$viewName = 'config';
$listViewName = 'configs';
@ -13990,6 +14021,9 @@ class Interpretation extends Fields
$viewType = 0;
// set the custom table key
$dbkey = 'g';
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
$this->triggerEvent('jcb_ce_onBeforeSetConfigFieldsets', array(&$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->componentData->config, &$this->extensionsParams, &$placeholders));
// build the config fields
foreach ($this->componentData->config as $field)
{
// check the field builder type
@ -14043,6 +14077,8 @@ class Interpretation extends Fields
}
elseif (2 == $timer) // this is after the admin views are build
{
// Trigger Event: jcb_ce_onBeforeSetConfigFieldsets
$this->triggerEvent('jcb_ce_onBeforeSetConfigFieldsets', array(&$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->componentData->config, &$this->extensionsParams, &$this->placeholders));
// these field sets can only be added after admin view is build
$this->setGroupControlConfigFieldsets($lang);
// these can be added anytime really (but looks best after groups
@ -14053,7 +14089,8 @@ class Interpretation extends Fields
// these are the coustom settings
$this->setCustomControlConfigFieldsets($lang);
}
// we can add more event (timers as we need)
// Trigger Event: jcb_ce_onAfterSetConfigFieldsets
$this->triggerEvent('jcb_ce_onAfterSetConfigFieldsets', array(&$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->extensionsParams, &$this->frontEndParams, &$this->placeholders));
}
public function setSiteControlConfigFieldsets($lang)

View File

@ -68,6 +68,9 @@ class Infusion extends Interpretation
{
if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views))
{
// Trigger Event: jcb_ce_onBeforeBuildFilesContent
$this->triggerEvent('jcb_ce_onBeforeBuildFilesContent', array(&$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
// COMPONENT
$this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
@ -231,6 +234,9 @@ class Infusion extends Interpretation
// set the target
$this->target = 'admin';
$this->lang = 'admin';
// reset
$viewName_single = '';
$viewName_list = '';
// set single view
if (isset($view['settings']->name_single))
@ -269,6 +275,9 @@ class Infusion extends Interpretation
$this->setLockLicensePer($viewName_single, $this->target);
$this->setLockLicensePer($viewName_list, $this->target);
// Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent
$this->triggerEvent('jcb_ce_onBeforeBuildAdminEditViewContent', array(&$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh));
// FIELDSETS <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->componentCodeName, $viewName_single, $viewName_list);
@ -367,6 +376,9 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setAdminViewMenu($viewName_single, $view);
}
}
// Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent
$this->triggerEvent('jcb_ce_onAfterBuildAdminEditViewContent', array(&$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh));
}
// set the views names
if (isset($view['settings']->name_list) && $view['settings']->name_list != 'null')
@ -376,6 +388,9 @@ class Infusion extends Interpretation
// ICOMOON <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon'];
// Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent
$this->triggerEvent('jcb_ce_onBeforeBuildAdminListViewContent', array(&$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh));
// set the export/import option
if (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import)
{
@ -505,6 +520,9 @@ class Infusion extends Interpretation
{
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = '';
}
// Trigger Event: jcb_ce_onAfterBuildAdminListViewContent
$this->triggerEvent('jcb_ce_onAfterBuildAdminListViewContent', array(&$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh));
}
// set u fields used in batch
@ -585,6 +603,9 @@ class Infusion extends Interpretation
}
// HELPER_EXEL
$this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods();
// Trigger Event: jcb_ce_onAfterBuildAdminViewContent
$this->triggerEvent('jcb_ce_onAfterBuildAdminViewContent', array(&$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
}
// setup custom_admin_views and all needed stuff for the site
@ -592,7 +613,6 @@ class Infusion extends Interpretation
{
$this->target = 'custom_admin';
$this->lang = 'admin';
// var_dump($this->componentData->custom_admin_views);exit;
// start dynamic build
foreach ($this->componentData->custom_admin_views as $view)
{
@ -630,6 +650,9 @@ class Infusion extends Interpretation
$this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code;
$this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE;
// Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent
$this->triggerEvent('jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
// set license per view if needed
$this->setLockLicensePer($view['settings']->code, $this->target);
@ -680,6 +703,9 @@ class Infusion extends Interpretation
// setup the templates
$this->setCustomViewTemplateBody($view);
// Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent
$this->triggerEvent('jcb_ce_onAfterBuildCustomAdminViewContent', array(&$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
}
// setup the layouts
@ -846,6 +872,9 @@ class Infusion extends Interpretation
$this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code;
$this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE;
// Trigger Event: jcb_ce_onBeforeBuildSiteViewContent
$this->triggerEvent('jcb_ce_onBeforeBuildSiteViewContent', array(&$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
// set license per view if needed
$this->setLockLicensePer($view['settings']->code, $this->target);
@ -926,6 +955,9 @@ class Infusion extends Interpretation
// set the site form if needed
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_TOP_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, 1);
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BOTTOM_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, 2);
// Trigger Event: jcb_ce_onAfterBuildSiteViewContent
$this->triggerEvent('jcb_ce_onAfterBuildSiteViewContent', array(&$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
}
// setup the layouts
$this->setCustomViewLayouts();
@ -1009,6 +1041,10 @@ class Infusion extends Interpretation
{
$this->fileContentStatic[$this->hhh . 'README' . $this->hhh] = $this->componentData->readme;
}
// Trigger Event: jcb_ce_onAfterBuildFilesContent
$this->triggerEvent('jcb_ce_onAfterBuildFilesContent', array(&$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
return true;
}
return false;
@ -1136,6 +1172,9 @@ class Infusion extends Interpretation
// now we insert the values into the files
if (ComponentbuilderHelper::checkArray($this->languages))
{
// Trigger Event: jcb_ce_onBeforeBuildAllLangFiles
$this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->languages, &$this->langTag));
// rest xml array
$langXML = array();
foreach ($this->languages as $tag => $areas)
{
@ -1210,7 +1249,7 @@ class Infusion extends Interpretation
$langXML[$p][] = '<language tag="' . $tag . '">language/' . $tag . '/' . $fileName . '</language>';
}
}
// load the lang xml
// load the lang xml
if (ComponentbuilderHelper::checkArray($langXML))
{
$replace = array();