2016-02-26 00:20:09 +00:00
|
|
|
<?php
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
|
|
__ __ _ _____ _ _ __ __ _ _ _
|
|
|
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
|
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
|
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
|
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
|
|
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
|
|
| |
|
|
|
|
|_|
|
|
|
|
/-------------------------------------------------------------------------------------------------------------------------------/
|
|
|
|
|
2018-05-11 04:08:14 +00:00
|
|
|
@version 2.7.x
|
2017-12-14 23:10:47 +00:00
|
|
|
@created 30th April, 2015
|
|
|
|
@package Component Builder
|
|
|
|
@subpackage compiler.php
|
|
|
|
@author Llewellyn van der Merwe <http://www.vdm.io>
|
|
|
|
@my wife Roline van der Merwe <http://www.vdm.io/>
|
|
|
|
@copyright Copyright (C) 2015. All Rights Reserved
|
|
|
|
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
Builds Complex Joomla Components
|
|
|
|
|
|
|
|
/----------------------------------------------------------------------------------------------------------------------------- */
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interpretation class
|
|
|
|
*/
|
|
|
|
class Infusion extends Interpretation
|
|
|
|
{
|
2016-05-04 04:53:33 +00:00
|
|
|
|
|
|
|
public $eximportView = array();
|
|
|
|
public $importCustomScripts = array();
|
2017-02-13 23:24:38 +00:00
|
|
|
public $langFiles = array();
|
2017-01-20 00:16:50 +00:00
|
|
|
public $removeSiteFolder = false;
|
2017-10-26 16:43:51 +00:00
|
|
|
public $langNot = array();
|
|
|
|
public $langSet = array();
|
2016-05-04 04:53:33 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2017-12-14 23:10:47 +00:00
|
|
|
public function __construct($config = array())
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
// first we run the perent constructor
|
|
|
|
if (parent::__construct($config))
|
|
|
|
{
|
|
|
|
// infuse the data into the structure
|
2016-06-23 15:05:37 +00:00
|
|
|
return $this->buildFileContent();
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-09-03 21:44:47 +00:00
|
|
|
/**
|
|
|
|
* Set the line number in comments
|
|
|
|
*
|
|
|
|
* @param int $nr The line number
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private function setLine($nr)
|
|
|
|
{
|
2017-04-06 08:47:51 +00:00
|
|
|
if ($this->debugLinenr)
|
2016-09-03 21:44:47 +00:00
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
return ' [Infusion ' . $nr . ']';
|
2016-09-03 21:44:47 +00:00
|
|
|
}
|
|
|
|
return '';
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-03-04 00:01:43 +00:00
|
|
|
/**
|
2016-03-01 18:44:13 +00:00
|
|
|
* Build the content for the structure
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return boolean on success
|
|
|
|
*
|
|
|
|
*/
|
2016-02-26 00:20:09 +00:00
|
|
|
protected function buildFileContent()
|
|
|
|
{
|
|
|
|
if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views))
|
|
|
|
{
|
|
|
|
// ###COMPONENT###
|
2017-03-06 12:06:51 +00:00
|
|
|
$this->fileContentStatic['###COMPONENT###'] = $this->placeholders['###COMPONENT###'];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###Component###
|
2017-03-06 12:06:51 +00:00
|
|
|
$this->fileContentStatic['###Component###'] = $this->placeholders['###Component###'];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###component###
|
2017-03-06 12:06:51 +00:00
|
|
|
$this->fileContentStatic['###component###'] = $this->placeholders['###component###'];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###COMPANYNAME###
|
2016-04-22 12:03:43 +00:00
|
|
|
$this->fileContentStatic['###COMPANYNAME###'] = trim(JFilterOutput::cleanText($this->componentData->companyname));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###CREATIONDATE###
|
|
|
|
$this->fileContentStatic['###CREATIONDATE###'] = JFactory::getDate($this->componentData->created)->format('jS F, Y');
|
2017-02-01 13:17:04 +00:00
|
|
|
$this->fileContentStatic['###CREATIONDATE###GLOBAL'] = $this->fileContentStatic['###CREATIONDATE###'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###BUILDDATE###
|
|
|
|
$this->fileContentStatic['###BUILDDATE###'] = JFactory::getDate()->format('jS F, Y');
|
2017-02-01 13:17:04 +00:00
|
|
|
$this->fileContentStatic['###BUILDDATE###GLOBAL'] = $this->fileContentStatic['###BUILDDATE###'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###AUTHOR###
|
2016-04-22 12:03:43 +00:00
|
|
|
$this->fileContentStatic['###AUTHOR###'] = trim(JFilterOutput::cleanText($this->componentData->author));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###AUTHOREMAIL###
|
|
|
|
$this->fileContentStatic['###AUTHOREMAIL###'] = trim($this->componentData->email);
|
|
|
|
|
|
|
|
// ###AUTHORWEBSITE###
|
|
|
|
$this->fileContentStatic['###AUTHORWEBSITE###'] = trim($this->componentData->website);
|
|
|
|
|
|
|
|
// ###COPYRIGHT###
|
|
|
|
$this->fileContentStatic['###COPYRIGHT###'] = trim($this->componentData->copyright);
|
|
|
|
|
|
|
|
// ###LICENSE###
|
|
|
|
$this->fileContentStatic['###LICENSE###'] = trim($this->componentData->license);
|
|
|
|
|
|
|
|
// ###VERSION###
|
|
|
|
$this->fileContentStatic['###VERSION###'] = trim($this->componentData->component_version);
|
2017-11-06 14:04:23 +00:00
|
|
|
// set the actual global version
|
|
|
|
$this->fileContentStatic['###ACTUALVERSION###'] = $this->fileContentStatic['###VERSION###'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-11-06 14:04:23 +00:00
|
|
|
// do some Tweaks to the version based on selected options
|
|
|
|
if (strpos($this->fileContentStatic['###VERSION###'], '.') !== false)
|
|
|
|
{
|
|
|
|
$versionArray = explode('.', $this->fileContentStatic['###VERSION###']);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2017-11-06 14:04:23 +00:00
|
|
|
// load only first two values
|
|
|
|
if (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 2)
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###VERSION###'] = $versionArray[0] . '.' . $versionArray[1] . '.x';
|
|
|
|
}
|
|
|
|
// load only the first value
|
|
|
|
elseif (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 3)
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###VERSION###'] = $versionArray[0] . '.x.x';
|
2017-11-06 14:04:23 +00:00
|
|
|
}
|
|
|
|
unset($versionArray);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-11-06 14:04:23 +00:00
|
|
|
// set the global version in case
|
2017-02-01 13:17:04 +00:00
|
|
|
$this->fileContentStatic['###VERSION###GLOBAL'] = $this->fileContentStatic['###VERSION###'];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###Component_name###
|
2017-02-01 13:17:04 +00:00
|
|
|
$this->fileContentStatic['###Component_name###'] = JFilterOutput::cleanText($this->componentData->name);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###SHORT_DISCRIPTION###
|
2016-04-22 12:03:43 +00:00
|
|
|
$this->fileContentStatic['###SHORT_DESCRIPTION###'] = trim(JFilterOutput::cleanText($this->componentData->short_description));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###DESCRIPTION###
|
|
|
|
$this->fileContentStatic['###DESCRIPTION###'] = trim($this->componentData->description);
|
|
|
|
|
|
|
|
// ###COMP_IMAGE_TYPE###
|
|
|
|
$this->fileContentStatic['###COMP_IMAGE_TYPE###'] = $this->setComponentImageType($this->componentData->image);
|
|
|
|
|
|
|
|
// ###ACCESS_SECTIONS###
|
|
|
|
$this->fileContentStatic['###ACCESS_SECTIONS###'] = $this->setAccessSections();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###CONFIG_FIELDSETS###
|
|
|
|
$keepLang = $this->lang;
|
|
|
|
$this->lang = 'admin';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-03-06 12:06:51 +00:00
|
|
|
// start loading the category tree scripts
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###CATEGORY_CLASS_TREES###'] = '';
|
2016-02-26 00:20:09 +00:00
|
|
|
// run the field sets for first time
|
|
|
|
$this->setConfigFieldsets(1);
|
|
|
|
$this->lang = $keepLang;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-10-06 14:53:22 +00:00
|
|
|
// ###ADMINJS###
|
|
|
|
$this->fileContentStatic['###ADMINJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders);
|
|
|
|
// ###SITEJS###
|
|
|
|
$this->fileContentStatic['###SITEJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###ADMINCSS###
|
2018-01-15 15:54:05 +00:00
|
|
|
$this->fileContentStatic['###ADMINCSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css_admin'], $this->placeholders);
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITECSS###
|
2018-01-15 15:54:05 +00:00
|
|
|
$this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css_site'], $this->placeholders);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###CUSTOM_HELPER_SCRIPT###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
|
|
|
|
|
2016-11-25 02:56:16 +00:00
|
|
|
// ###BOTH_CUSTOM_HELPER_SCRIPT###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
|
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###ADMIN_GLOBAL_EVENT_HELPER###
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###ADMIN_GLOBAL_EVENT###
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-10-23 22:48:26 +00:00
|
|
|
// set incase no extra admin files are loaded
|
|
|
|
$this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// now load the data for the global event if needed
|
|
|
|
if ($this->componentData->add_admin_event == 1)
|
|
|
|
{
|
|
|
|
// ###ADMIN_GLOBAL_EVENT###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);';
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###ADMIN_GLOBAL_EVENT_HELPER###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Admin Event Method.';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{';
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
|
|
|
|
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}';
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-10-23 22:48:26 +00:00
|
|
|
// now load the readme file if needed
|
|
|
|
if ($this->componentData->addreadme == 1)
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= PHP_EOL . "\t\t\t<filename>README.txt</filename>";
|
2016-10-23 22:48:26 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###HELPER_CREATEUSER###
|
|
|
|
$this->fileContentStatic['###HELPER_CREATEUSER###'] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper);
|
|
|
|
|
|
|
|
// ###HELP###
|
|
|
|
$this->fileContentStatic['###HELP###'] = $this->noHelp();
|
|
|
|
// ###HELP_SITE###
|
|
|
|
$this->fileContentStatic['###HELP_SITE###'] = $this->noHelp();
|
|
|
|
|
|
|
|
// build route parse switch
|
|
|
|
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] = '';
|
|
|
|
// build route views
|
|
|
|
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-04-22 12:03:43 +00:00
|
|
|
// add the helper emailer if set
|
|
|
|
$this->fileContentStatic['###HELPER_EMAIL###'] = $this->addEmailHelper();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2016-09-11 15:27:04 +00:00
|
|
|
// reset view array
|
2017-12-14 23:10:47 +00:00
|
|
|
$viewarray = array();
|
|
|
|
$site_edit_view_array = array();
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->admin_views as $view)
|
|
|
|
{
|
2017-03-06 12:06:51 +00:00
|
|
|
// set the target
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->target = 'admin';
|
|
|
|
$this->lang = 'admin';
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
// set single view
|
|
|
|
if (isset($view['settings']->name_single))
|
|
|
|
{
|
|
|
|
$viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set list view
|
|
|
|
if (isset($view['settings']->name_list))
|
|
|
|
{
|
|
|
|
$viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
// set the view placeholders
|
|
|
|
$this->setViewPlaceholders($view['settings']);
|
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// set site edit view array
|
|
|
|
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
|
|
|
{
|
|
|
|
$site_edit_view_array[] = "\t\t\t\t'" . $viewName_single . "'";
|
|
|
|
$this->lang = 'both';
|
|
|
|
}
|
|
|
|
// check if help is being loaded
|
|
|
|
$this->checkHelp($viewName_single);
|
|
|
|
// set custom admin view list links
|
|
|
|
$this->setCustomAdminViewListLink($view, $viewName_list);
|
|
|
|
|
|
|
|
// set view array
|
|
|
|
$viewarray[] = "\t\t\t\t'" . $viewName_single . "' => '" . $viewName_list . "'";
|
|
|
|
// set the view names
|
2018-01-19 10:27:47 +00:00
|
|
|
if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null')
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
// set license per view if needed
|
|
|
|
$this->setLockLicensePer($viewName_single, $this->target);
|
|
|
|
$this->setLockLicensePer($viewName_list, $this->target);
|
|
|
|
|
|
|
|
// ###FIELDSETS### <<<DYNAMIC>>>
|
2018-01-19 10:27:47 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###'], $viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// ###ACCESSCONTROL### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single);
|
|
|
|
|
|
|
|
// ###LINKEDVIEWITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] = '';
|
|
|
|
|
|
|
|
// ###ADDTOOLBAR### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###ADDTOOLBAR###'] = $this->setAddToolBar($view);
|
|
|
|
|
|
|
|
// set the script for this view
|
|
|
|
$this->buildTheViewScript($view);
|
|
|
|
|
|
|
|
// ###VIEW_SCRIPT###
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###VIEW_SCRIPT###'] = $this->setViewScript($viewName_single);
|
|
|
|
|
|
|
|
// ###EDITBODYSCRIPT###
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###EDITBODYSCRIPT###'] = $this->setEditBodyScript($viewName_single);
|
|
|
|
|
|
|
|
// ###AJAXTOKE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single);
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
|
|
|
|
if ($phpDocument = $this->getCustomScriptBuilder('php_document', $viewName_single, PHP_EOL, null, true, false))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-04-18 19:11:14 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = str_replace('$document->', '$this->document->', $phpDocument);
|
2017-12-14 23:10:47 +00:00
|
|
|
// clear some memory
|
2018-04-18 19:11:14 +00:00
|
|
|
unset($phpDocument);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###LINKEDVIEWTABLESCRIPTS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = '';
|
|
|
|
|
|
|
|
// ###VALIDATEFIX### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###'] = $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']);
|
|
|
|
|
|
|
|
// ###EDITBODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###EDITBODY###'] = $this->setEditBody($view);
|
|
|
|
|
|
|
|
// ###EDITBODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###EDITBODYFADEIN###'] = $this->setFadeInEfect($view);
|
|
|
|
|
|
|
|
// ###JTABLECONSTRUCTOR### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JTABLECONSTRUCTOR###'] = $this->setJtableConstructor($viewName_single);
|
|
|
|
|
|
|
|
// ###JTABLEALIASCATEGORY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JTABLEALIASCATEGORY###'] = $this->setJtableAliasCategory($viewName_single);
|
|
|
|
|
|
|
|
// ###METHOD_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###METHOD_GET_ITEM###'] = $this->setMethodGetItem($viewName_single);
|
|
|
|
|
|
|
|
// ###LINKEDVIEWGLOBAL### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] = '';
|
|
|
|
|
|
|
|
// ###LINKEDVIEWMETHODS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = '';
|
|
|
|
|
|
|
|
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL);
|
|
|
|
|
|
|
|
// ###CHECKBOX_SAVE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single);
|
|
|
|
|
|
|
|
// ###METHOD_ITEM_SAVE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single);
|
|
|
|
|
|
|
|
// ###POSTSAVEHOOK### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;");
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###VIEWCSS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true);
|
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// add css to front end
|
|
|
|
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###'] = $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// set the views names
|
2018-01-19 10:27:47 +00:00
|
|
|
if (isset($view['settings']->name_list) && $view['settings']->name_list != 'null')
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
$this->lang = 'admin';
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// ###ICOMOON### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###ICOMOON###'] = $view['icomoon'];
|
|
|
|
|
|
|
|
// set the export/import option
|
2018-01-19 10:27:47 +00:00
|
|
|
if (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
$this->eximportView[$viewName_list] = true;
|
|
|
|
if (1 == $view['settings']->add_custom_import)
|
|
|
|
{
|
|
|
|
// this view has custom import scripting
|
|
|
|
$this->importCustomScripts[$viewName_list] = true;
|
|
|
|
$this->setImportCustomScripts($viewName_list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$this->eximportView[$viewName_list] = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// set Autocheckin function
|
|
|
|
if (isset($view['checkin']) && $view['checkin'] == 1)
|
|
|
|
{
|
|
|
|
// ###AUTOCHECKIN### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = $this->setAutoCheckin($viewName_single, $this->fileContentStatic['###component###']);
|
|
|
|
// ###CHECKINCALL### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = $this->setCheckinCall();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// ###AUTOCHECKIN### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = '';
|
|
|
|
// ###CHECKINCALL### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = '';
|
|
|
|
}
|
2017-03-02 00:55:04 +00:00
|
|
|
// ###ADMIN_CUSTOM_BUTTONS_LIST###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] = $this->setCustomButtons($view, 3, "\t");
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST###'] = $this->setFunctionOnlyButtons($viewName_list);
|
|
|
|
|
|
|
|
// ###GET_ITEMS_METHOD_STRING_FIX### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###']);
|
|
|
|
|
|
|
|
// ###GET_ITEMS_METHOD_AFTER_ALL### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
|
|
|
|
|
|
|
|
// ###SELECTIONTRANSLATIONFIX### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic['###Component###']);
|
|
|
|
|
|
|
|
// ###SELECTIONTRANSLATIONFIXFUNC### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###'] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']);
|
|
|
|
|
|
|
|
// ###FILTER_FIELDS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###FILTER_FIELDS###'] = $this->setFilterFields($viewName_list);
|
|
|
|
|
|
|
|
// ###STOREDID### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###STOREDID###'] = $this->setStoredId($viewName_list);
|
|
|
|
|
|
|
|
// ###POPULATESTATE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###POPULATESTATE###'] = $this->setPopulateState($viewName_list);
|
|
|
|
|
|
|
|
// ###SORTFIELDS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###SORTFIELDS###'] = $this->setSortFields($viewName_list);
|
|
|
|
|
|
|
|
// ###CATEGORYFILTER### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CATEGORYFILTER###'] = $this->setCategoryFilter($viewName_list);
|
|
|
|
|
|
|
|
// ###CATEGORY_VIEWS###
|
|
|
|
if (!isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###']))
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] = '';
|
|
|
|
}
|
|
|
|
$this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] .= $this->setRouterCategoryViews($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###OTHERFILTERS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###OTHERFILTERS###'] = $this->setOtherFilter($viewName_list);
|
|
|
|
|
|
|
|
// ###FILTERFUNCTIONS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###'] = $this->setFilterFunctions($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###LISTQUERY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###LISTQUERY###'] = $this->setListQuery($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###MODELEXPORTMETHOD### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###'] = $this->setModelExportMethod($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###MODELEXIMPORTMETHOD### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###'] = $this->setControllerEximportMethod($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###EXPORTBUTTON### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###'] = $this->setExportButton($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###IMPORTBUTTON### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###'] = $this->setImportButton($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###LISTHEAD### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###LISTHEAD###'] = $this->setListHead($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###LISTBODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###LISTBODY###'] = $this->setListBody($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###LISTCOLNR### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###LISTCOLNR###'] = $this->setListColnr($viewName_list);
|
|
|
|
|
|
|
|
// ###JVIEWLISTCANDO### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] = $this->setJviewListCanDo($viewName_single, $viewName_list);
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###VIEWSCSS### <<<DYNAMIC>>>
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = $this->getCustomScriptBuilder('css_views', $viewName_single, '', null, true);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
|
|
|
// ###VIEWS_FOOTER_SCRIPT### <<<DYNAMIC>>>
|
2018-05-11 04:08:14 +00:00
|
|
|
$scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) . ' ' . $viewName_list . ' footer script';
|
2018-04-18 19:11:14 +00:00
|
|
|
if ($footerScript = $this->getCustomScriptBuilder('views_footer', $viewName_single, '', $scriptNote, true, false, PHP_EOL))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-04-18 19:11:14 +00:00
|
|
|
// only minfy if no php is added to the footer script
|
|
|
|
if ($this->minify && strpos($footerScript, '<?php') === false)
|
|
|
|
{
|
|
|
|
// minfy the script
|
|
|
|
$minifier = new JS;
|
|
|
|
$minifier->add($footerScript);
|
|
|
|
$footerScript = $minifier->minify();
|
|
|
|
// clear some memory
|
|
|
|
unset($minifier);
|
|
|
|
}
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = PHP_EOL . '<script type="text/javascript">' . $footerScript . "</script>";
|
2017-12-14 23:10:47 +00:00
|
|
|
// clear some memory
|
2018-04-18 19:11:14 +00:00
|
|
|
unset($footerScript);
|
2018-04-18 12:03:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = '';
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set u fields used in batch
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###UNIQUEFIELDS###'] = $this->setUniqueFields($viewName_single);
|
|
|
|
|
|
|
|
// ###TITLEALIASFIX### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###TITLEALIASFIX###'] = $this->setAliasTitleFix($viewName_single);
|
|
|
|
|
|
|
|
// ###GENERATENEWTITLE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###GENERATENEWTITLE###'] = $this->setGenerateNewTitle($viewName_single);
|
2018-05-02 23:12:06 +00:00
|
|
|
|
|
|
|
// ###GENERATENEWALIAS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###GENERATENEWALIAS###'] = $this->setGenerateNewAlias($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// ###MODEL_BATCH_COPY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_COPY###'] = $this->setBatchCopy($viewName_single);
|
|
|
|
|
|
|
|
// ###MODEL_BATCH_MOVE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_MOVE###'] = $this->setBatchMove($viewName_single);
|
|
|
|
|
|
|
|
// ###BATCH_ONCLICK_CANCEL_SCRIPT### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###BATCH_ONCLICK_CANCEL_SCRIPT###'] = ''; // TODO <-- must still be build
|
|
|
|
// ###JCONTROLLERFORM_ALLOWADD### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###'] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###JCONTROLLERFORM_ALLOWEDIT### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###'] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_GETFORM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###'] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_ALLOWEDIT### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###'] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_CANDELETE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###'] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###JMODELADMIN_CANEDITSTATE### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###'] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// set custom admin view Toolbare buttons
|
|
|
|
// ###CUSTOM_ADMIN_DYNAMIC_BUTTONS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###'] = $this->setCustomAdminDynamicButton($viewName_list);
|
|
|
|
// ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###'] = $this->setCustomAdminDynamicButtonController($viewName_list);
|
|
|
|
|
|
|
|
// set helper router
|
|
|
|
if (!isset($this->fileContentStatic['###ROUTEHELPER###']))
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###ROUTEHELPER###'] = '';
|
|
|
|
}
|
|
|
|
$this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
|
|
|
{
|
|
|
|
// add needed router stuff for front edit views
|
|
|
|
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false);
|
|
|
|
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($viewName_single);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###ACCESS_SECTIONS###
|
|
|
|
if (!isset($this->fileContentStatic['###ACCESS_SECTIONS###']))
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###ACCESS_SECTIONS###'] = '';
|
|
|
|
}
|
|
|
|
$this->fileContentStatic['###ACCESS_SECTIONS###'] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list);
|
|
|
|
|
|
|
|
// ###HELPER_EXEL###
|
|
|
|
$this->fileContentStatic['###HELPER_EXEL###'] = $this->setExelHelperMethods();
|
|
|
|
}
|
|
|
|
|
|
|
|
// setup custom_admin_views and all needed stuff for the site
|
|
|
|
if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views))
|
|
|
|
{
|
|
|
|
$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)
|
|
|
|
{
|
|
|
|
// for single views
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SVIEW###'] = $view['settings']->CODE;
|
|
|
|
// for list views
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SVIEWS###'] = $view['settings']->CODE;
|
|
|
|
// add to lang array
|
|
|
|
if (!isset($this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE]))
|
|
|
|
{
|
|
|
|
$this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE] = $view['settings']->name;
|
|
|
|
}
|
|
|
|
if (!isset($this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC']))
|
|
|
|
{
|
|
|
|
$this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description;
|
|
|
|
}
|
|
|
|
// ###ICOMOON### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###ICOMOON###'] = $view['icomoon'];
|
|
|
|
|
|
|
|
// set placeholders
|
|
|
|
$this->placeholders['###SView###'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['###sview###'] = $view['settings']->code;
|
|
|
|
$this->placeholders['###SVIEW###'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['[[[SView]]]'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['[[[sview]]]'] = $view['settings']->code;
|
|
|
|
$this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['###SViews###'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['###sviews###'] = $view['settings']->code;
|
|
|
|
$this->placeholders['###SVIEWS###'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['[[[SViews]]]'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['[[[sviews]]]'] = $view['settings']->code;
|
|
|
|
$this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE;
|
|
|
|
|
|
|
|
// set license per view if needed
|
|
|
|
$this->setLockLicensePer($view['settings']->code, $this->target);
|
|
|
|
|
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// ###CUSTOM_ADMIN_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t");
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
elseif ($view['settings']->main_get->gettype == 2)
|
|
|
|
{
|
|
|
|
// ###CUSTOM_ADMIN_GET_LIST_QUERY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// ###CUSTOM_ADMIN_GET_ITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// ###CUSTOM_ADMIN_CUSTOM_METHODS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
|
|
|
|
// ###CUSTOM_ADMIN_DIPLAY_METHOD### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view);
|
|
|
|
// set document details
|
|
|
|
$this->setPrepareDocument($view);
|
|
|
|
// ###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view);
|
|
|
|
// ###CUSTOM_ADMIN_CODE_BODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CODE_BODY###'] = $this->setCustomViewCodeBody($view);
|
|
|
|
// ###CUSTOM_ADMIN_BODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BODY###'] = $this->setCustomViewBody($view);
|
|
|
|
// ###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###'] = $this->setCustomViewSubmitButtonScript($view);
|
|
|
|
|
|
|
|
// setup the templates
|
|
|
|
$this->setCustomViewTemplateBody($view);
|
|
|
|
}
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// setup the layouts
|
|
|
|
$this->setCustomViewLayouts();
|
|
|
|
}
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// ###VIEWARRAY###
|
|
|
|
$this->fileContentStatic['###VIEWARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $viewarray);
|
|
|
|
|
|
|
|
// ###CUSTOM_ADMIN_EDIT_VIEW_ARRAY###
|
|
|
|
$this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array);
|
|
|
|
|
|
|
|
// ###MAINMENUS###
|
|
|
|
$this->fileContentStatic['###MAINMENUS###'] = $this->setMainMenus();
|
|
|
|
|
|
|
|
// ###SUBMENU###
|
|
|
|
$this->fileContentStatic['###SUBMENU###'] = $this->setSubMenus();
|
|
|
|
|
|
|
|
// ###GET_CRYPT_KEY###
|
|
|
|
$this->fileContentStatic['###GET_CRYPT_KEY###'] = $this->setGetCryptKey();
|
|
|
|
|
|
|
|
// set the license locker
|
|
|
|
$this->setLockLicense();
|
|
|
|
|
|
|
|
// ###CONTRIBUTORS###
|
|
|
|
$this->fileContentStatic['###CONTRIBUTORS###'] = $this->theContributors;
|
|
|
|
|
|
|
|
// ###INSTALL###
|
|
|
|
$this->fileContentStatic['###INSTALL###'] = $this->setInstall();
|
|
|
|
|
|
|
|
// ###UNINSTALL###
|
|
|
|
$this->fileContentStatic['###UNINSTALL###'] = $this->setUninstall();
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2017-06-16 12:38:06 +00:00
|
|
|
// ###UPDATE_VERSION_MYSQL###
|
|
|
|
$this->setVersionController();
|
2018-03-18 04:52:07 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// only set these if default dashboard it used
|
|
|
|
if (!ComponentbuilderHelper::checkString($this->dynamicDashboard))
|
|
|
|
{
|
|
|
|
// ###DASHBOARDVIEW###
|
|
|
|
$this->fileContentStatic['###DASHBOARDVIEW###'] = $this->fileContentStatic['###component###'];
|
2018-03-18 04:52:07 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// ###DASHBOARDICONS###
|
|
|
|
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONS###'] = $this->setDashboardIcons();
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// ###DASHBOARDICONACCESS###
|
|
|
|
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONACCESS###'] = $this->setDashboardIconAccess();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// ###DASH_MODEL_METHODS###
|
|
|
|
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_MODEL_METHODS###'] = $this->setDashboardModelMethods();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// ###DASH_GET_CUSTOM_DATA###
|
|
|
|
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_GET_CUSTOM_DATA###'] = $this->setDashboardGetCustomData();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-03-09 03:26:44 +00:00
|
|
|
// ###DASH_DISPLAY_DATA###
|
|
|
|
$this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_DISPLAY_DATA###'] = $this->setDashboardDisplayData();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// ###DASHBOARDVIEW###
|
|
|
|
$this->fileContentStatic['###DASHBOARDVIEW###'] = $this->dynamicDashboard;
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// add import
|
|
|
|
if (isset($this->addEximport) && $this->addEximport)
|
|
|
|
{
|
|
|
|
// setup import files
|
|
|
|
$target = array('admin' => 'import');
|
|
|
|
$this->buildDynamique($target, 'import');
|
|
|
|
// set the controller
|
|
|
|
$this->fileContentDynamic['import']['###BLABLABLA###'] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// ensure that the ajax model and controller is set if needed
|
|
|
|
if (isset($this->addAjax) && $this->addAjax)
|
|
|
|
{
|
|
|
|
// setup Ajax files
|
|
|
|
$target = array('admin' => 'ajax');
|
|
|
|
$this->buildDynamique($target, 'ajax');
|
|
|
|
// set the controller
|
|
|
|
$this->fileContentDynamic['ajax']['###REGISTER_AJAX_TASK###'] = $this->setRegisterAjaxTask('admin');
|
|
|
|
$this->fileContentDynamic['ajax']['###AJAX_INPUT_RETURN###'] = $this->setAjaxInputReturn('admin');
|
|
|
|
// set the module
|
|
|
|
$this->fileContentDynamic['ajax']['###AJAX_MODEL_METHODS###'] = $this->setAjaxModelMethods('admin');
|
|
|
|
}
|
|
|
|
|
|
|
|
// ensure that the site ajax model and controller is set if needed
|
|
|
|
if (isset($this->addSiteAjax) && $this->addSiteAjax)
|
|
|
|
{
|
|
|
|
// setup Ajax files
|
|
|
|
$target = array('site' => 'ajax');
|
|
|
|
$this->buildDynamique($target, 'ajax');
|
|
|
|
// set the controller
|
|
|
|
$this->fileContentDynamic['ajax']['###REGISTER_SITE_AJAX_TASK###'] = $this->setRegisterAjaxTask('site');
|
|
|
|
$this->fileContentDynamic['ajax']['###AJAX_SITE_INPUT_RETURN###'] = $this->setAjaxInputReturn('site');
|
|
|
|
// set the module
|
|
|
|
$this->fileContentDynamic['ajax']['###AJAX_SITE_MODEL_METHODS###'] = $this->setAjaxModelMethods('site');
|
|
|
|
}
|
2018-05-11 04:08:14 +00:00
|
|
|
|
2018-03-27 09:57:16 +00:00
|
|
|
// build the validation rules
|
|
|
|
if (isset($this->validationRules) && ComponentbuilderHelper::checkArray($this->validationRules))
|
|
|
|
{
|
|
|
|
foreach ($this->validationRules as $rule => $_php)
|
|
|
|
{
|
|
|
|
// setup rule file
|
|
|
|
$target = array('admin' => 'a_rule_zi');
|
|
|
|
$this->buildDynamique($target, 'rule', $rule);
|
|
|
|
// set the JFormRule Name
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule]['###Name###'] = ucfirst($rule);
|
2018-03-27 09:57:16 +00:00
|
|
|
// set the JFormRule PHP
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule]['###VALIDATION_RULE_METHODS###'] = PHP_EOL . $_php;
|
2018-03-27 09:57:16 +00:00
|
|
|
}
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// run the second run if needed
|
|
|
|
if (isset($this->secondRunAdmin) && ComponentbuilderHelper::checkArray($this->secondRunAdmin))
|
|
|
|
{
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->secondRunAdmin as $function => $arrays)
|
|
|
|
{
|
|
|
|
if (ComponentbuilderHelper::checkArray($arrays) && ComponentbuilderHelper::checkString($function))
|
|
|
|
{
|
|
|
|
foreach ($arrays as $array)
|
|
|
|
{
|
|
|
|
$this->{$function}($array);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###CONFIG_FIELDSETS###
|
|
|
|
$keepLang = $this->lang;
|
|
|
|
$this->lang = 'admin';
|
|
|
|
// run field sets for second time
|
|
|
|
$this->setConfigFieldsets(2);
|
|
|
|
$this->lang = $keepLang;
|
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// setup front-views and all needed stuff for the site
|
|
|
|
if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views))
|
|
|
|
{
|
|
|
|
$this->target = 'site';
|
|
|
|
// var_dump($this->componentData->site_views);exit;
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->site_views as $view)
|
|
|
|
{
|
|
|
|
// for list views
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code;
|
|
|
|
// for single views
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code;
|
|
|
|
|
|
|
|
// set placeholder
|
|
|
|
$this->placeholders['###SView###'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['###sview###'] = $view['settings']->code;
|
|
|
|
$this->placeholders['###SVIEW###'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['[[[SView]]]'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['[[[sview]]]'] = $view['settings']->code;
|
|
|
|
$this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['###SViews###'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['###sviews###'] = $view['settings']->code;
|
|
|
|
$this->placeholders['###SVIEWS###'] = $view['settings']->CODE;
|
|
|
|
$this->placeholders['[[[SViews]]]'] = $view['settings']->Code;
|
|
|
|
$this->placeholders['[[[sviews]]]'] = $view['settings']->code;
|
|
|
|
$this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// set license per view if needed
|
2016-12-22 21:32:13 +00:00
|
|
|
$this->setLockLicensePer($view['settings']->code, $this->target);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// set the site default view
|
2017-10-30 18:50:56 +00:00
|
|
|
if (isset($view['default_view']) && $view['default_view'] == 1)
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
$this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = $view['settings']->code;
|
|
|
|
}
|
|
|
|
// add site menu
|
2017-10-30 18:50:56 +00:00
|
|
|
if (isset($view['menu']) && $view['menu'] == 1)
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
// ###SITE_MENU_XML### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_MENU_XML###'] = $this->setCustomViewMenu($view);
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// insure the needed route helper is loaded
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
// build route details
|
2016-12-22 21:32:13 +00:00
|
|
|
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($view['settings']->code, $view);
|
2016-02-26 00:20:09 +00:00
|
|
|
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($view['settings']->code);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2016-12-30 10:47:19 +00:00
|
|
|
// set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 1);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
|
|
|
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###SITE_GET_ITEM### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t");
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
elseif ($view['settings']->main_get->gettype == 2)
|
2016-12-30 10:47:19 +00:00
|
|
|
{
|
|
|
|
// set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 2);
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_GET_LIST_QUERY### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_GET_ITEMS### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
|
|
|
|
2018-04-18 19:11:14 +00:00
|
|
|
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
// add to lang array
|
2017-12-14 23:10:47 +00:00
|
|
|
if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE]))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE] = $view['settings']->name;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC']))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
// ###SITE_CUSTOM_METHODS### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_DIPLAY_METHOD### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view);
|
2016-02-26 00:20:09 +00:00
|
|
|
// set document details
|
|
|
|
$this->setPrepareDocument($view);
|
|
|
|
// ###SITE_EXTRA_DIPLAY_METHODS### <<<DYNAMIC>>>
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view);
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_CODE_BODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_CODE_BODY###'] = $this->setCustomViewCodeBody($view);
|
|
|
|
// ###SITE_BODY### <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code]['###SITE_BODY###'] = $this->setCustomViewBody($view);
|
|
|
|
|
|
|
|
// setup the templates
|
|
|
|
$this->setCustomViewTemplateBody($view);
|
|
|
|
}
|
2017-08-20 17:52:35 +00:00
|
|
|
// if no default site view was set, the redirect to root
|
|
|
|
if (!isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']))
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = '';
|
|
|
|
}
|
2016-02-26 00:20:09 +00:00
|
|
|
// set site custom script to helper class
|
|
|
|
// ###SITE_CUSTOM_HELPER_SCRIPT###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_GLOBAL_EVENT_HELPER###
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = '';
|
|
|
|
// ###SITE_GLOBAL_EVENT###
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = '';
|
|
|
|
// now load the data for the global event if needed
|
|
|
|
if ($this->componentData->add_site_event == 1)
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);';
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###SITE_GLOBAL_EVENT_HELPER###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Site Event Method.';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{';
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
|
|
|
|
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}';
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
// setup the layouts
|
|
|
|
$this->setCustomViewLayouts();
|
|
|
|
}
|
2017-01-20 00:16:50 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// clear all site folder since none is needed
|
|
|
|
$this->removeSiteFolder = true;
|
|
|
|
}
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2016-10-23 22:48:26 +00:00
|
|
|
// ###PREINSTALLSCRIPT###
|
2017-02-09 16:11:10 +00:00
|
|
|
$this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
|
|
|
// ###PREUPDATESCRIPT###
|
2017-02-09 16:11:10 +00:00
|
|
|
$this->fileContentStatic['###PREUPDATESCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
|
|
|
// ###POSTINSTALLSCRIPT###
|
|
|
|
$this->fileContentStatic['###POSTINSTALLSCRIPT###'] = $this->setPostInstallScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2016-10-23 22:48:26 +00:00
|
|
|
// ###POSTUPDATESCRIPT###
|
|
|
|
$this->fileContentStatic['###POSTUPDATESCRIPT###'] = $this->setPostUpdateScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// ###UNINSTALLSCRIPT###
|
|
|
|
$this->fileContentStatic['###UNINSTALLSCRIPT###'] = $this->setUninstallScript();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-02-28 02:27:03 +00:00
|
|
|
// ###MOVEFOLDERSSCRIPT###
|
|
|
|
$this->fileContentStatic['###MOVEFOLDERSSCRIPT###'] = $this->setMoveFolderScript();
|
|
|
|
|
|
|
|
// ###MOVEFOLDERSMETHOD###
|
|
|
|
$this->fileContentStatic['###MOVEFOLDERSMETHOD###'] = $this->setMoveFolderMethod();
|
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###HELPER_UIKIT###
|
|
|
|
$this->fileContentStatic['###HELPER_UIKIT###'] = $this->setUikitHelperMethods();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###CONFIG_FIELDSETS###
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL, $this->configFieldSets);
|
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// check if this has been set
|
2017-12-14 23:10:47 +00:00
|
|
|
if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = '(' . $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] . ')';
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// ###README###
|
|
|
|
if ($this->componentData->addreadme)
|
|
|
|
{
|
|
|
|
$this->fileContentStatic['###README###'] = $this->componentData->readme;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-01-19 10:27:47 +00:00
|
|
|
/**
|
|
|
|
* Set the view place holders to global scope
|
|
|
|
*
|
|
|
|
* @param object $view The view settings
|
|
|
|
*
|
|
|
|
* @ return void
|
|
|
|
*/
|
|
|
|
protected function setViewPlaceholders(&$view)
|
|
|
|
{
|
|
|
|
// just to be safe, lets clear previous view placeholders
|
|
|
|
$this->clearFromPlaceHolders('view');
|
|
|
|
|
|
|
|
// ###VIEW### <<<DYNAMIC>>>
|
|
|
|
if (isset($view->name_single))
|
|
|
|
{
|
|
|
|
// set main keys
|
|
|
|
$viewName_single = ComponentbuilderHelper::safeString($view->name_single);
|
|
|
|
$viewName_u = ComponentbuilderHelper::safeString($view->name_single, 'U');
|
|
|
|
$viewName_f = ComponentbuilderHelper::safeString($view->name_single, 'F');
|
|
|
|
|
|
|
|
// set some place holder for the views
|
|
|
|
$this->placeholders['###view###'] = $viewName_single;
|
|
|
|
$this->placeholders['###View###'] = $viewName_f;
|
|
|
|
$this->placeholders['###VIEW###'] = $viewName_u;
|
|
|
|
$this->placeholders['[[[view]]]'] = $viewName_single;
|
|
|
|
$this->placeholders['[[[View]]]'] = $viewName_f;
|
|
|
|
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###VIEWS### <<<DYNAMIC>>>
|
|
|
|
if (isset($view->name_list))
|
|
|
|
{
|
|
|
|
$viewName_list = ComponentbuilderHelper::safeString($view->name_list);
|
|
|
|
$viewsName_u = ComponentbuilderHelper::safeString($view->name_list, 'U');
|
|
|
|
$viewsName_f = ComponentbuilderHelper::safeString($view->name_list, 'F');
|
|
|
|
|
|
|
|
// set some place holder for the views
|
|
|
|
$this->placeholders['###views###'] = $viewName_list;
|
|
|
|
$this->placeholders['###Views###'] = $viewsName_f;
|
|
|
|
$this->placeholders['###VIEWS###'] = $viewsName_u;
|
|
|
|
$this->placeholders['[[[views]]]'] = $viewName_list;
|
|
|
|
$this->placeholders['[[[Views]]]'] = $viewsName_f;
|
|
|
|
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###view### <<<DYNAMIC>>>
|
|
|
|
if (isset($viewName_single))
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single;
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f;
|
|
|
|
|
|
|
|
if (isset($viewName_list))
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single;
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ###views### <<<DYNAMIC>>>
|
|
|
|
if (isset($viewName_list))
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list;
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f;
|
|
|
|
|
|
|
|
if (isset($viewName_single))
|
|
|
|
{
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list;
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-13 23:24:38 +00:00
|
|
|
/**
|
2018-04-13 15:24:06 +00:00
|
|
|
* Build the language values and insert into file
|
2017-02-13 23:24:38 +00:00
|
|
|
*
|
|
|
|
* @return boolean on success
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function setLangFileData()
|
|
|
|
{
|
2017-04-05 13:21:10 +00:00
|
|
|
$values = array();
|
|
|
|
$mainLangLoader = array();
|
|
|
|
// check the admin lang is set
|
|
|
|
if ($this->setLangAdmin())
|
|
|
|
{
|
2018-04-19 23:36:21 +00:00
|
|
|
$values[] = array_values($this->languages[$this->langTag]['admin']);
|
|
|
|
$mainLangLoader['admin'] = count($this->languages[$this->langTag]['admin']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the admin system lang is set
|
|
|
|
if ($this->setLangAdminSys())
|
|
|
|
{
|
2018-04-19 23:36:21 +00:00
|
|
|
$values[] = array_values($this->languages[$this->langTag]['adminsys']);
|
|
|
|
$mainLangLoader['adminsys'] = count($this->languages[$this->langTag]['adminsys']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the site lang is set
|
|
|
|
if (!$this->removeSiteFolder && $this->setLangSite())
|
|
|
|
{
|
2018-04-19 23:36:21 +00:00
|
|
|
$values[] = array_values($this->languages[$this->langTag]['site']);
|
|
|
|
$mainLangLoader['site'] = count($this->languages[$this->langTag]['site']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the site system lang is set
|
|
|
|
if (!$this->removeSiteFolder && $this->setLangSiteSys())
|
|
|
|
{
|
2018-04-19 23:36:21 +00:00
|
|
|
$values[] = array_values($this->languages[$this->langTag]['sitesys']);
|
|
|
|
$mainLangLoader['sitesys'] = count($this->languages[$this->langTag]['sitesys']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
$values = array_unique(ComponentbuilderHelper::mergeArrays($values));
|
|
|
|
// get the other lang strings if there is any
|
|
|
|
$this->multiLangString = $this->getMultiLangStrings($values);
|
|
|
|
// update insert the current lang in to DB
|
|
|
|
$this->setLangPlaceholders($values);
|
2017-04-07 20:33:35 +00:00
|
|
|
// remove old unused language strings
|
|
|
|
$this->purgeLanuageStrings($values);
|
2017-04-05 13:21:10 +00:00
|
|
|
// path to INI file
|
|
|
|
$getPAth = $this->templatePath . '/en-GB.com_admin.ini';
|
2017-02-13 23:24:38 +00:00
|
|
|
// now we insert the values into the files
|
2017-04-05 13:21:10 +00:00
|
|
|
if (ComponentbuilderHelper::checkArray($this->languages))
|
2017-02-13 23:24:38 +00:00
|
|
|
{
|
2017-04-05 13:21:10 +00:00
|
|
|
$langXML = array();
|
|
|
|
foreach ($this->languages as $tag => $areas)
|
|
|
|
{
|
2018-04-13 15:24:06 +00:00
|
|
|
// trim the tag
|
|
|
|
$tag = trim($tag);
|
2017-04-05 13:21:10 +00:00
|
|
|
foreach ($areas as $area => $languageStrings)
|
|
|
|
{
|
2018-04-19 23:36:21 +00:00
|
|
|
// only log messages for none $this->langTag translations
|
|
|
|
if ($this->langTag !== $tag)
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2017-10-26 16:43:51 +00:00
|
|
|
$langStringNr = count($languageStrings);
|
2018-04-08 21:20:33 +00:00
|
|
|
$langStringSum = $this->bcmath('mul', $langStringNr, 100);
|
|
|
|
$percentage = $this->bcmath('div', $langStringSum, $mainLangLoader[$area]);
|
2017-10-26 16:43:51 +00:00
|
|
|
$stringNAme = ($langStringNr == 1) ? '(string ' . $tag . ' translated)' : '(strings ' . $tag . ' translated)';
|
|
|
|
// force load if debug lines are added
|
|
|
|
if (!$this->debugLinenr)
|
2017-04-06 08:47:51 +00:00
|
|
|
{
|
2017-10-26 16:43:51 +00:00
|
|
|
// check if we sould install this translation
|
|
|
|
if ($percentage < $this->percentageLanguageAdd)
|
|
|
|
{
|
|
|
|
// dont add
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->langNot[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total ' . $this->langTag . ' strings) only <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage;
|
2017-10-26 16:43:51 +00:00
|
|
|
continue;
|
|
|
|
}
|
2017-04-06 08:47:51 +00:00
|
|
|
}
|
2017-10-26 16:43:51 +00:00
|
|
|
// show if it was added as well
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->langSet[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total ' . $this->langTag . ' strings) and <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage;
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
2017-10-26 16:43:51 +00:00
|
|
|
// set naming convention
|
2017-04-05 13:21:10 +00:00
|
|
|
$p = 'admin';
|
|
|
|
$t = '';
|
|
|
|
if (strpos($area, 'site') !== false)
|
|
|
|
{
|
|
|
|
if ($this->removeSiteFolder)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$p = 'site';
|
|
|
|
}
|
|
|
|
if (strpos($area, 'sys') !== false)
|
|
|
|
{
|
|
|
|
$t = '.sys';
|
|
|
|
}
|
|
|
|
// build the path to to place the lang file
|
2017-12-14 23:10:47 +00:00
|
|
|
$path = $this->componentPath . '/' . $p . '/language/' . $tag;
|
2017-04-05 13:21:10 +00:00
|
|
|
if (!JFolder::exists($path))
|
|
|
|
{
|
|
|
|
JFolder::create($path);
|
|
|
|
// count the folder created
|
|
|
|
$this->folderCount++;
|
|
|
|
}
|
|
|
|
// build the file name
|
|
|
|
$fileName = $tag . '.com_' . $this->componentCodeName . $t . '.ini';
|
|
|
|
// move the file to its place
|
2017-12-14 23:10:47 +00:00
|
|
|
JFile::copy($getPAth, $path . '/' . $fileName);
|
2017-04-05 13:21:10 +00:00
|
|
|
// count the file created
|
|
|
|
$this->fileCount++;
|
|
|
|
// add content to it
|
2018-05-11 04:08:14 +00:00
|
|
|
$lang = array_map(function ($langstring, $placeholder)
|
|
|
|
{
|
2018-04-13 15:24:06 +00:00
|
|
|
return $placeholder . '="' . $langstring . '"';
|
|
|
|
}, $languageStrings, array_keys($languageStrings));
|
2017-04-05 13:21:10 +00:00
|
|
|
// add to language file
|
2018-04-13 15:24:06 +00:00
|
|
|
$this->writeFile($path . '/' . $fileName, implode(PHP_EOL, $lang));
|
2017-04-05 13:21:10 +00:00
|
|
|
// set the line counter
|
2018-05-11 04:08:14 +00:00
|
|
|
$this->lineCount = $this->lineCount + count((array) $lang);
|
2017-04-05 13:21:10 +00:00
|
|
|
// build xml strings
|
|
|
|
if (!isset($langXML[$p]))
|
|
|
|
{
|
|
|
|
$langXML[$p] = array();
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
$langXML[$p][] = '<language tag="' . $tag . '">language/' . $tag . '/' . $fileName . '</language>';
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// load the lang xml
|
|
|
|
if (ComponentbuilderHelper::checkArray($langXML))
|
2017-02-13 23:24:38 +00:00
|
|
|
{
|
2017-04-05 13:21:10 +00:00
|
|
|
$replace = array();
|
|
|
|
if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin']))
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL . "\t\t\t", $langXML['admin']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$replace['###SITE_LANGUAGES###'] = implode(PHP_EOL . "\t\t", $langXML['site']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// build xml path
|
2017-12-14 23:10:47 +00:00
|
|
|
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml';
|
2017-04-05 13:21:10 +00:00
|
|
|
// get the content in xml
|
2017-11-16 04:37:32 +00:00
|
|
|
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
|
2017-04-05 13:21:10 +00:00
|
|
|
// update the xml content
|
|
|
|
$componentXML = $this->setPlaceholders($componentXML, $replace);
|
|
|
|
// store the values back to xml
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->writeFile($xmlPath, $componentXML);
|
2017-02-13 23:24:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-05-11 04:08:14 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|