2016-02-26 00:20:09 +00:00
|
|
|
<?php
|
2018-05-18 06:28:27 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
|
|
|
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2019-03-04 12:47:28 +00:00
|
|
|
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
2018-05-18 06:28:27 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
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;
|
2018-08-07 12:25:26 +00:00
|
|
|
public $removeSiteEditFolder = true;
|
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))
|
|
|
|
{
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildFilesContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPONENT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// Component
|
|
|
|
$this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] = $this->placeholders[$this->hhh . 'Component' . $this->hhh];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// component
|
|
|
|
$this->fileContentStatic[$this->hhh . 'component' . $this->hhh] = $this->placeholders[$this->hhh . 'component' . $this->hhh];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPANYNAME
|
|
|
|
$this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->companyname));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CREATIONDATE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = JFactory::getDate($this->componentData->created)->format('jS F, Y');
|
|
|
|
$this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BUILDDATE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = JFactory::getDate()->format('jS F, Y');
|
|
|
|
$this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOR
|
|
|
|
$this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->author));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOREMAIL
|
|
|
|
$this->fileContentStatic[$this->hhh . 'AUTHOREMAIL' . $this->hhh] = trim($this->componentData->email);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHORWEBSITE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] = trim($this->componentData->website);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COPYRIGHT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'COPYRIGHT' . $this->hhh] = trim($this->componentData->copyright);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LICENSE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'LICENSE' . $this->hhh] = trim($this->componentData->license);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VERSION
|
|
|
|
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = trim($this->componentData->component_version);
|
2017-11-06 14:04:23 +00:00
|
|
|
// set the actual global version
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh];
|
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
|
2018-05-22 19:01:36 +00:00
|
|
|
if (strpos($this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh], '.') !== false)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$versionArray = explode('.', $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]);
|
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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $versionArray[0] . '.' . $versionArray[1] . '.x';
|
2017-11-06 14:04:23 +00:00
|
|
|
}
|
|
|
|
// load only the first value
|
|
|
|
elseif (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 3)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// Component_name
|
|
|
|
$this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] = JFilterOutput::cleanText($this->componentData->name);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SHORT_DISCRIPTION
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->short_description));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DESCRIPTION
|
|
|
|
$this->fileContentStatic[$this->hhh . 'DESCRIPTION' . $this->hhh] = trim($this->componentData->description);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMP_IMAGE_TYPE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'COMP_IMAGE_TYPE' . $this->hhh] = $this->setComponentImageType($this->componentData->image);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = $this->setAccessSections();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
2016-02-26 00:20:09 +00:00
|
|
|
$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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' . $this->hhh] = '';
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMINJS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMINJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders);
|
|
|
|
// SITEJS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITEJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMINCSS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMINCSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_admin'], $this->placeholders);
|
|
|
|
// SITECSS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITECSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_site'], $this->placeholders);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_HELPER_SCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BOTH_CUSTOM_HELPER_SCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'BOTH_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = '';
|
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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);';
|
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Admin Event Method.';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{';
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}';
|
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)
|
|
|
|
{
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] .= PHP_EOL . $this->_t(3) . "<filename>README.txt</filename>";
|
2016-10-23 22:48:26 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELPER_CREATEUSER
|
|
|
|
$this->fileContentStatic[$this->hhh . 'HELPER_CREATEUSER' . $this->hhh] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELP
|
|
|
|
$this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] = $this->noHelp();
|
|
|
|
// HELP_SITE
|
|
|
|
$this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] = $this->noHelp();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// build route parse switch
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] = '';
|
2016-02-26 00:20:09 +00:00
|
|
|
// build route views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-04-22 12:03:43 +00:00
|
|
|
// add the helper emailer if set
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'HELPER_EMAIL' . $this->hhh] = $this->addEmailHelper();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2019-02-15 22:03:21 +00:00
|
|
|
// load the global placeholders
|
|
|
|
if (ComponentbuilderHelper::checkArray($this->globalPlaceholders))
|
|
|
|
{
|
|
|
|
foreach ($this->globalPlaceholders as $globalPlaceholder => $gloabalValue)
|
|
|
|
{
|
|
|
|
$this->fileContentStatic[$globalPlaceholder] = $gloabalValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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';
|
2019-06-22 10:43:26 +00:00
|
|
|
// reset
|
|
|
|
$viewName_single = '';
|
|
|
|
$viewName_list = '';
|
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
|
2019-04-09 21:54:54 +00:00
|
|
|
if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-26 10:03:08 +00:00
|
|
|
$site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'";
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->lang = 'both';
|
2018-08-07 12:25:26 +00:00
|
|
|
// insure site view does not get removed
|
|
|
|
$this->removeSiteEditFolder = false;
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
// check if help is being loaded
|
|
|
|
$this->checkHelp($viewName_single);
|
|
|
|
// set custom admin view list links
|
|
|
|
$this->setCustomAdminViewListLink($view, $viewName_list);
|
|
|
|
|
|
|
|
// set view array
|
2018-05-26 10:03:08 +00:00
|
|
|
$viewarray[] = $this->_t(4) . "'" . $viewName_single . "' => '" . $viewName_list . "'";
|
2017-12-14 23:10:47 +00:00
|
|
|
// 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);
|
|
|
|
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FIELDSETS <<<DYNAMIC>>>
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->componentCodeName, $viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESSCONTROL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'ACCESSCONTROL' . $this->hhh] = $this->setFieldSetAccessControl($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWITEMS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADDTOOLBAR <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'ADDTOOLBAR' . $this->hhh] = $this->setAddToolBar($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set the script for this view
|
|
|
|
$this->buildTheViewScript($view);
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEW_SCRIPT
|
2019-03-06 20:32:16 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW_SCRIPT' . $this->hhh] = $this->setViewScript($viewName_single, 'fileScript');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODYSCRIPT
|
2019-03-06 20:32:16 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYSCRIPT' . $this->hhh] = $this->setViewScript($viewName_single, 'footerScript');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AJAXTOKE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'AJAXTOKE' . $this->hhh] = $this->setAjaxToke($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DOCUMENT_CUSTOM_PHP <<<DYNAMIC>>>
|
2018-04-18 19:11:14 +00:00
|
|
|
if ($phpDocument = $this->getCustomScriptBuilder('php_document', $viewName_single, PHP_EOL, null, true, false))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = 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
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWTABLESCRIPTS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VALIDATEFIX <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VALIDATIONFIX' . $this->hhh] = $this->setValidationFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODY' . $this->hhh] = $this->setEditBody($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYFADEIN' . $this->hhh] = $this->setFadeInEfect($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLECONSTRUCTOR <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLECONSTRUCTOR' . $this->hhh] = $this->setJtableConstructor($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLEALIASCATEGORY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLEALIASCATEGORY' . $this->hhh] = $this->setJtableAliasCategory($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_GET_ITEM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_GET_ITEM' . $this->hhh] = $this->setMethodGetItem($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWGLOBAL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWMETHODS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWMETHODS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKBOX_SAVE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'CHECKBOX_SAVE' . $this->hhh] = $this->setCheckboxSave($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_ITEM_SAVE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_ITEM_SAVE' . $this->hhh] = $this->setMethodItemSave($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTSAVEHOOK <<<DYNAMIC>>>
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'POSTSAVEHOOK' . $this->hhh] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . $this->_t(2) . "return;", PHP_EOL . PHP_EOL . $this->_t(2) . "return;");
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWCSS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// add css to front end
|
2019-04-09 21:54:54 +00:00
|
|
|
if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_VIEWCSS' . $this->hhh] = $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh];
|
2019-04-09 21:54:54 +00:00
|
|
|
// check if we should add a create menu
|
|
|
|
if ($view['edit_create_site_view'] == 2)
|
|
|
|
{
|
|
|
|
// SITE_MENU_XML <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setAdminViewMenu($viewName_single, $view);
|
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2019-07-01 16:10:28 +00:00
|
|
|
// TABLAYOUTFIELDSARRAY <<<DYNAMIC>>> add the tab layout fields array to the model
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'TABLAYOUTFIELDSARRAY' . $this->hhh] = $this->getTabLayoutFieldsArray($viewName_single);
|
|
|
|
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh));
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
// 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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ICOMOON <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildAdminListViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// 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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTOCHECKIN <<<DYNAMIC>>>
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin($viewName_single, $this->componentCodeName);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = $this->setCheckinCall();
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTOCHECKIN <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = '';
|
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2019-03-06 20:32:16 +00:00
|
|
|
// admin list file contnet
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_JAVASCRIPT_FILE' . $this->hhh] = $this->setViewScript($viewName_list, 'list_fileScript');
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_CUSTOM_BUTTONS_LIST
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] = $this->setCustomButtons($view, 3, $this->_t(1));
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] = $this->setFunctionOnlyButtons($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_ITEMS_METHOD_STRING_FIX <<<DYNAMIC>>>
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] = $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_ITEMS_METHOD_AFTER_ALL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIX <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIX' . $this->hhh] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIXFUNC <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIXFUNC' . $this->hhh] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTER_FIELDS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTER_FIELDS' . $this->hhh] = $this->setFilterFields($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// STOREDID <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'STOREDID' . $this->hhh] = $this->setStoredId($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POPULATESTATE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'POPULATESTATE' . $this->hhh] = $this->setPopulateState($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SORTFIELDS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'SORTFIELDS' . $this->hhh] = $this->setSortFields($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CATEGORYFILTER <<<DYNAMIC>>>
|
2019-06-07 14:59:27 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CATEGORYFILTER' . $this->hhh] = $this->setCategoryFilter($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CATEGORY_VIEWS
|
|
|
|
if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh]))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] .= $this->setRouterCategoryViews($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// OTHERFILTERS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'OTHERFILTERS' . $this->hhh] = $this->setOtherFilter($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTERFUNCTIONS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTERFUNCTIONS' . $this->hhh] = $this->setFilterFunctions($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTQUERY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTQUERY' . $this->hhh] = $this->setListQuery($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXPORTMETHOD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'MODELEXPORTMETHOD' . $this->hhh] = $this->setModelExportMethod($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXIMPORTMETHOD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] = $this->setControllerEximportMethod($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EXPORTBUTTON <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'EXPORTBUTTON' . $this->hhh] = $this->setExportButton($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// IMPORTBUTTON <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'IMPORTBUTTON' . $this->hhh] = $this->setImportButton($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTHEAD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTHEAD' . $this->hhh] = $this->setListHead($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTBODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTBODY' . $this->hhh] = $this->setListBody($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTCOLNR <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTCOLNR' . $this->hhh] = $this->setListColnr($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JVIEWLISTCANDO <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'JVIEWLISTCANDO' . $this->hhh] = $this->setJviewListCanDo($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWSCSS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWSCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_views', $viewName_single, '', null, true);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2018-05-22 19:01:36 +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);
|
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = 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
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = '';
|
2018-04-18 12:03:07 +00:00
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
|
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminListViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildAdminListViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh));
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set u fields used in batch
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'UNIQUEFIELDS' . $this->hhh] = $this->setUniqueFields($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// TITLEALIASFIX <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'TITLEALIASFIX' . $this->hhh] = $this->setAliasTitleFix($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWTITLE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWTITLE' . $this->hhh] = $this->setGenerateNewTitle($viewName_single);
|
2018-05-02 23:12:06 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWALIAS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWALIAS' . $this->hhh] = $this->setGenerateNewAlias($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_COPY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_COPY' . $this->hhh] = $this->setBatchCopy($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_MOVE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_MOVE' . $this->hhh] = $this->setBatchMove($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BATCH_ONCLICK_CANCEL_SCRIPT <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'BATCH_ONCLICK_CANCEL_SCRIPT' . $this->hhh] = ''; // TODO <-- must still be build
|
2019-06-12 20:06:19 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JCONTROLLERFORM_ALLOWADD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWADD' . $this->hhh] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-12 20:06:19 +00:00
|
|
|
// JCONTROLLERFORM_BEFORECANCEL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_BEFORECANCEL' . $this->hhh] = $this->getCustomScriptBuilder('php_before_cancel', $viewName_single, PHP_EOL, null, null, '');
|
|
|
|
|
2019-06-12 20:36:05 +00:00
|
|
|
// JCONTROLLERFORM_AFTERCANCEL <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_AFTERCANCEL' . $this->hhh] = $this->getCustomScriptBuilder('php_after_cancel', $viewName_single, PHP_EOL, null, null, '');
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JCONTROLLERFORM_ALLOWEDIT <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWEDIT' . $this->hhh] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_GETFORM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_GETFORM' . $this->hhh] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_ALLOWEDIT <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_ALLOWEDIT' . $this->hhh] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANDELETE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANDELETE' . $this->hhh] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANEDITSTATE <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANEDITSTATE' . $this->hhh] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set custom admin view Toolbare buttons
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_DYNAMIC_BUTTONS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS' . $this->hhh] = $this->setCustomAdminDynamicButton($viewName_list);
|
|
|
|
// CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER' . $this->hhh] = $this->setCustomAdminDynamicButtonController($viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set helper router
|
2018-05-22 19:01:36 +00:00
|
|
|
if (!isset($this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh]))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($viewName_single, $viewName_list);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-04-09 21:54:54 +00:00
|
|
|
if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
// add needed router stuff for front edit views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($viewName_single, null, false);
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $this->routerBuildViews($viewName_single);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
|
|
|
if (!isset($this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh]))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list);
|
2018-08-23 01:37:42 +00:00
|
|
|
// set the Joomla Fields ACCESS section if needed
|
|
|
|
if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1)
|
|
|
|
{
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] .= $this->setAccessSectionsJoomlaFields();
|
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELPER_EXEL
|
|
|
|
$this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods();
|
2019-06-22 10:43:26 +00:00
|
|
|
|
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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';
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->custom_admin_views as $view)
|
|
|
|
{
|
|
|
|
// for single views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
// for list views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
// 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;
|
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
// ICOMOON <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set placeholders
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// set license per view if needed
|
|
|
|
$this->setLockLicensePer($view['settings']->code, $this->target);
|
|
|
|
|
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BEFORE_GET_ITEM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEM <<<DYNAMIC>>>
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_AFTER_GET_ITEM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] = $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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_LIST_QUERY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEMS' . $this->hhh] = $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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CUSTOM_METHODS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
|
|
|
|
// CUSTOM_ADMIN_DIPLAY_METHOD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
// set document details
|
|
|
|
$this->setPrepareDocument($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view);
|
|
|
|
// CUSTOM_ADMIN_CODE_BODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view);
|
|
|
|
// CUSTOM_ADMIN_BODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BODY' . $this->hhh] = $this->setCustomViewBody($view);
|
|
|
|
// CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] = $this->setCustomViewSubmitButtonScript($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// setup the templates
|
|
|
|
$this->setCustomViewTemplateBody($view);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
|
|
|
// Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWARRAY
|
|
|
|
$this->fileContentStatic[$this->hhh . 'VIEWARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $viewarray);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_EDIT_VIEW_ARRAY
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_EDIT_VIEW_ARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MAINMENUS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'MAINMENUS' . $this->hhh] = $this->setMainMenus();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SUBMENU
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SUBMENU' . $this->hhh] = $this->setSubMenus();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_CRYPT_KEY
|
|
|
|
$this->fileContentStatic[$this->hhh . 'GET_CRYPT_KEY' . $this->hhh] = $this->setGetCryptKey();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set the license locker
|
|
|
|
$this->setLockLicense();
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONTRIBUTORS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'CONTRIBUTORS' . $this->hhh] = $this->theContributors;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// INSTALL
|
|
|
|
$this->fileContentStatic[$this->hhh . 'INSTALL' . $this->hhh] = $this->setInstall();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALL
|
|
|
|
$this->fileContentStatic[$this->hhh . 'UNINSTALL' . $this->hhh] = $this->setUninstall();
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UPDATE_VERSION_MYSQL
|
2017-06-16 12:38:06 +00:00
|
|
|
$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))
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDVIEW
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->componentCodeName;
|
2018-03-18 04:52:07 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONS
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons();
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONACCESS
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_MODEL_METHODS
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_GET_CUSTOM_DATA
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_DISPLAY_DATA
|
2019-06-13 21:12:16 +00:00
|
|
|
$this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData();
|
2018-03-09 03:26:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDVIEW
|
|
|
|
$this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->dynamicDashboard;
|
2018-03-09 03:26:44 +00:00
|
|
|
}
|
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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['import'][$this->hhh . 'BLABLABLA' . $this->hhh] = '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('admin');
|
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('admin');
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('admin');
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_SITE_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('site');
|
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('site');
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('site');
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
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-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'Name' . $this->hhh] = ucfirst($rule);
|
2018-03-27 09:57:16 +00:00
|
|
|
// set the JFormRule PHP
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'VALIDATION_RULE_METHODS' . $this->hhh] = 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
2017-12-14 23:10:47 +00:00
|
|
|
$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';
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->site_views as $view)
|
|
|
|
{
|
|
|
|
// for list views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code;
|
2016-02-26 00:20:09 +00:00
|
|
|
// for single views
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code;
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// set placeholder
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE;
|
|
|
|
$this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code;
|
|
|
|
$this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code;
|
|
|
|
$this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildSiteViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +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
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = $view['settings']->code;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
// 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
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_MENU_XML <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setCustomViewMenu($view);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// insure the needed route helper is loaded
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
// build route details
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($view['settings']->code, $view);
|
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// set user permission access check USER_PERMISSION_CHECK_ACCESS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 1);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BEFORE_GET_ITEM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEM <<<DYNAMIC>>>
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEM <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEM' . $this->hhh] = $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
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// set user permission access check USER_PERMISSION_CHECK_ACCESS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 2);
|
|
|
|
// SITE_GET_LIST_QUERY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEMS' . $this->hhh] = $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
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_CUSTOM_METHODS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code);
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code);
|
|
|
|
// SITE_DIPLAY_METHOD <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view);
|
2016-02-26 00:20:09 +00:00
|
|
|
// set document details
|
|
|
|
$this->setPrepareDocument($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_EXTRA_DIPLAY_METHODS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view);
|
|
|
|
// SITE_CODE_BODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view);
|
|
|
|
// SITE_BODY <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BODY' . $this->hhh] = $this->setCustomViewBody($view);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// setup the templates
|
|
|
|
$this->setCustomViewTemplateBody($view);
|
2018-09-11 20:08:58 +00:00
|
|
|
|
|
|
|
// 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);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
|
|
|
// Trigger Event: jcb_ce_onAfterBuildSiteViewContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh));
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2018-08-07 12:25:26 +00:00
|
|
|
// setup the layouts
|
|
|
|
$this->setCustomViewLayouts();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// clear all site folder since none is needed
|
|
|
|
$this->removeSiteFolder = true;
|
|
|
|
}
|
|
|
|
// load the site statics
|
|
|
|
if (!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
|
|
|
{
|
|
|
|
$this->target = 'site';
|
2017-08-20 17:52:35 +00:00
|
|
|
// if no default site view was set, the redirect to root
|
2018-05-22 19:01:36 +00:00
|
|
|
if (!isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh]))
|
2017-08-20 17:52:35 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = '';
|
2017-08-20 17:52:35 +00:00
|
|
|
}
|
2016-02-26 00:20:09 +00:00
|
|
|
// set site custom script to helper class
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_CUSTOM_HELPER_SCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
|
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = '';
|
|
|
|
// SITE_GLOBAL_EVENT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = '';
|
2016-02-26 00:20:09 +00:00
|
|
|
// now load the data for the global event if needed
|
|
|
|
if ($this->componentData->add_site_event == 1)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);';
|
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Site Event Method.';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)';
|
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{';
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
|
2018-05-26 10:03:08 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}';
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-01-20 00:16:50 +00:00
|
|
|
}
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// PREINSTALLSCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'PREINSTALLSCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// PREUPDATESCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'PREUPDATESCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTINSTALLSCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'POSTINSTALLSCRIPT' . $this->hhh] = $this->setPostInstallScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTUPDATESCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'POSTUPDATESCRIPT' . $this->hhh] = $this->setPostUpdateScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALLSCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'UNINSTALLSCRIPT' . $this->hhh] = $this->setUninstallScript();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSSCRIPT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'MOVEFOLDERSSCRIPT' . $this->hhh] = $this->setMoveFolderScript();
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSMETHOD
|
|
|
|
$this->fileContentStatic[$this->hhh . 'MOVEFOLDERSMETHOD' . $this->hhh] = $this->setMoveFolderMethod();
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELPER_UIKIT
|
|
|
|
$this->fileContentStatic[$this->hhh . 'HELPER_UIKIT' . $this->hhh] = $this->setUikitHelperMethods();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
|
|
|
$this->fileContentStatic[$this->hhh . 'CONFIG_FIELDSETS' . $this->hhh] = implode(PHP_EOL, $this->configFieldSets);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// check if this has been set
|
2018-05-22 19:01:36 +00:00
|
|
|
if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh]) || !ComponentbuilderHelper::checkString($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh]))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = 0;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = '(' . $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] . ')';
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// README
|
2016-02-26 00:20:09 +00:00
|
|
|
if ($this->componentData->addreadme)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentStatic[$this->hhh . 'README' . $this->hhh] = $this->componentData->readme;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
|
|
|
|
// Trigger Event: jcb_ce_onAfterBuildFilesContent
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
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');
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEW <<<DYNAMIC>>>
|
2018-01-19 10:27:47 +00:00
|
|
|
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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->placeholders[$this->hhh . 'view' . $this->hhh] = $viewName_single;
|
|
|
|
$this->placeholders[$this->hhh . 'View' . $this->hhh] = $viewName_f;
|
|
|
|
$this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = $viewName_u;
|
|
|
|
$this->placeholders[$this->bbb . 'view' . $this->ddd] = $viewName_single;
|
|
|
|
$this->placeholders[$this->bbb . 'View' . $this->ddd] = $viewName_f;
|
|
|
|
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $viewName_u;
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWS <<<DYNAMIC>>>
|
2018-01-19 10:27:47 +00:00
|
|
|
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
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->placeholders[$this->hhh . 'views' . $this->hhh] = $viewName_list;
|
|
|
|
$this->placeholders[$this->hhh . 'Views' . $this->hhh] = $viewsName_f;
|
|
|
|
$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u;
|
|
|
|
$this->placeholders[$this->bbb . 'views' . $this->ddd] = $viewName_list;
|
|
|
|
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $viewsName_f;
|
|
|
|
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $viewsName_u;
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// view <<<DYNAMIC>>>
|
2018-01-19 10:27:47 +00:00
|
|
|
if (isset($viewName_single))
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'view' . $this->hhh] = $viewName_single;
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'View' . $this->hhh] = $viewName_f;
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
if (isset($viewName_list))
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'view' . $this->hhh] = $viewName_single;
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'View' . $this->hhh] = $viewName_f;
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// views <<<DYNAMIC>>>
|
2018-01-19 10:27:47 +00:00
|
|
|
if (isset($viewName_list))
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'views' . $this->hhh] = $viewName_list;
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_list][$this->hhh . 'Views' . $this->hhh] = $viewsName_f;
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
if (isset($viewName_single))
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'views' . $this->hhh] = $viewName_list;
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u;
|
|
|
|
$this->fileContentDynamic[$viewName_single][$this->hhh . 'Views' . $this->hhh] = $viewsName_f;
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
2018-08-07 12:25:26 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSite())
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
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
|
2018-08-07 12:25:26 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSiteSys())
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
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
|
|
|
{
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAllLangFiles
|
2019-07-01 16:10:28 +00:00
|
|
|
$this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag));
|
2019-06-22 10:43:26 +00:00
|
|
|
// rest xml array
|
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-08-30 21:22:48 +00:00
|
|
|
$langStringSum = ComponentbuilderHelper::bcmath('mul', $langStringNr, 100);
|
|
|
|
$percentage = ComponentbuilderHelper::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)
|
|
|
|
{
|
2018-08-07 12:25:26 +00:00
|
|
|
if ($this->removeSiteFolder && $this->removeSiteEditFolder)
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
// load the lang xml
|
2017-04-05 13:21:10 +00:00
|
|
|
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']))
|
|
|
|
{
|
2018-05-26 10:03:08 +00:00
|
|
|
$replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(3), $langXML['admin']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
2018-08-07 12:25:26 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2018-05-26 10:03:08 +00:00
|
|
|
$replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(2), $langXML['site']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// build xml path
|
2019-06-13 21:12:16 +00:00
|
|
|
$xmlPath = $this->componentPath . '/' . $this->componentCodeName . '.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
|
|
|
}
|