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
|
2021-12-21 14:44:50 +00:00
|
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
|
|
* @gitea Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
2018-05-18 06:28:27 +00:00
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2021-01-03 16:49:35 +00:00
|
|
|
* @copyright Copyright (C) 2015 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');
|
|
|
|
|
2021-03-07 21:40:55 +00:00
|
|
|
use Joomla\CMS\Filesystem\File;
|
|
|
|
use Joomla\CMS\Filesystem\Folder;
|
2022-03-09 23:46:45 +00:00
|
|
|
use VDM\Joomla\Utilities\StringHelper;
|
|
|
|
use VDM\Joomla\Utilities\ArrayHelper;
|
|
|
|
use VDM\Joomla\Utilities\ObjectHelper;
|
2022-04-04 15:35:08 +00:00
|
|
|
use VDM\Joomla\Utilities\FileHelper;
|
2022-08-30 15:28:41 +00:00
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
2021-03-07 21:40:55 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
/**
|
2020-12-03 05:24:20 +00:00
|
|
|
* Infusion class
|
2016-02-26 00:20:09 +00:00
|
|
|
*/
|
|
|
|
class Infusion extends Interpretation
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
|
2017-02-13 23:24:38 +00:00
|
|
|
public $langFiles = array();
|
2022-12-11 15:06:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Switch to remove site folder
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Config')->remove_site_folder;
|
|
|
|
*/
|
2017-01-20 00:16:50 +00:00
|
|
|
public $removeSiteFolder = false;
|
2022-12-11 15:06:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Switch to remove site edit folder
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
* @deprecated 3.3 Use CFactory::_('Config')->remove_site_edit_folder;
|
|
|
|
*/
|
2018-08-07 12:25:26 +00:00
|
|
|
public $removeSiteEditFolder = true;
|
2016-05-04 04:53:33 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2022-08-30 15:28:41 +00:00
|
|
|
public function __construct()
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
// first we run the perent constructor
|
2022-08-30 15:28:41 +00:00
|
|
|
if (parent::__construct())
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
|
|
|
// 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
|
|
|
}
|
2020-03-28 13:34:14 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
return false;
|
|
|
|
}
|
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
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
*
|
|
|
|
* @return boolean on success
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2016-03-01 18:44:13 +00:00
|
|
|
*/
|
2016-02-26 00:20:09 +00:00
|
|
|
protected function buildFileContent()
|
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($this->componentData->admin_views)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->componentData->admin_views
|
|
|
|
))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildFilesContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildFilesContent',
|
|
|
|
array(&$this->componentContext, &$this->componentData,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentStatic, &$fileContentDynamic,
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPONENT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set('COMPONENT', CFactory::_('Placeholder')->get('COMPONENT'));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// Component
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set('Component', CFactory::_('Placeholder')->get('Component'));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// component
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set('component', CFactory::_('Placeholder')->get('component'));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPANYNAME
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('COMPANYNAME', trim(
|
2020-03-28 13:34:14 +00:00
|
|
|
JFilterOutput::cleanText($this->componentData->companyname)
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CREATIONDATE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('CREATIONDATE',
|
|
|
|
JFactory::getDate($this->componentData->created)->format(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jS F, Y'
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->set('GLOBALCREATIONDATE',
|
|
|
|
CFactory::_('Content')->get('CREATIONDATE'));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BUILDDATE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('BUILDDATE', JFactory::getDate()->format('jS F, Y'));
|
|
|
|
CFactory::_('Content')->set('GLOBALBUILDDATE',
|
|
|
|
CFactory::_('Content')->get('BUILDDATE'));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOR
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('AUTHOR', trim(
|
2020-03-28 13:34:14 +00:00
|
|
|
JFilterOutput::cleanText($this->componentData->author)
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOREMAIL
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('AUTHOREMAIL', trim($this->componentData->email));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHORWEBSITE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('AUTHORWEBSITE', trim($this->componentData->website));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COPYRIGHT
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('COPYRIGHT', trim($this->componentData->copyright));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LICENSE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('LICENSE', trim($this->componentData->license));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VERSION
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('VERSION', trim($this->componentData->component_version));
|
2017-11-06 14:04:23 +00:00
|
|
|
// set the actual global version
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ACTUALVERSION', CFactory::_('Content')->get('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
|
2022-12-04 09:23:43 +00:00
|
|
|
if (strpos(CFactory::_('Content')->get('VERSION'), '.') !== false)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$versionArray = explode(
|
2022-12-04 09:23:43 +00:00
|
|
|
'.', CFactory::_('Content')->get('VERSION')
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2017-11-06 14:04:23 +00:00
|
|
|
// load only first two values
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($versionArray)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$versionArray
|
2022-12-04 09:23:43 +00:00
|
|
|
) && $this->componentData->mvc_versiondate == 2)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('VERSION', $versionArray[0] . '.' . $versionArray[1] . '.x');
|
2017-11-06 14:04:23 +00:00
|
|
|
}
|
|
|
|
// load only the first value
|
2020-03-28 13:34:14 +00:00
|
|
|
elseif (isset($versionArray)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$versionArray
|
2022-12-04 09:23:43 +00:00
|
|
|
) && $this->componentData->mvc_versiondate == 3)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('GLOBALVERSION', CFactory::_('Content')->get('VERSION'));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the joomla target xml version
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('XMLVERSION', $this->joomlaVersions[CFactory::_('Config')->joomla_version]['xml_version']);
|
2021-12-21 14:44:50 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// Component_name
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('Component_name', JFilterOutput::cleanText($this->componentData->name));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SHORT_DISCRIPTION
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SHORT_DESCRIPTION', trim(
|
2020-03-28 13:34:14 +00:00
|
|
|
JFilterOutput::cleanText(
|
|
|
|
$this->componentData->short_description
|
|
|
|
)
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DESCRIPTION
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('DESCRIPTION', trim($this->componentData->description));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMP_IMAGE_TYPE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('COMP_IMAGE_TYPE', $this->setComponentImageType($this->componentData->image));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ACCESS_SECTIONS', $this->setAccessSections());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
2022-08-30 15:28:41 +00:00
|
|
|
$keepLang = CFactory::_('Config')->lang_target;
|
|
|
|
CFactory::_('Config')->lang_target = 'admin';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2017-03-06 12:06:51 +00:00
|
|
|
// start loading the category tree scripts
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('CATEGORY_CLASS_TREES', '');
|
2016-02-26 00:20:09 +00:00
|
|
|
// run the field sets for first time
|
|
|
|
$this->setConfigFieldsets(1);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_target = $keepLang;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMINJS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMINJS',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_js']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITEJS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITEJS',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_js']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMINCSS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMINCSS',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_css_admin']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITECSS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITECSS',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_css_site']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_HELPER_SCRIPT
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('CUSTOM_HELPER_SCRIPT',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BOTH_CUSTOM_HELPER_SCRIPT
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('BOTH_CUSTOM_HELPER_SCRIPT',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('ADMIN_GLOBAL_EVENT'))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMIN_GLOBAL_EVENT', '');
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('ADMIN_GLOBAL_EVENT_HELPER'))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMIN_GLOBAL_EVENT_HELPER', '');
|
2021-12-21 14:44:50 +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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT', PHP_EOL . PHP_EOL . '// Trigger the Global Admin Event');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT',
|
|
|
|
PHP_EOL . CFactory::_('Content')->get('Component')
|
|
|
|
. 'Helper::globalEvent($document);');
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . PHP_EOL . Indent::_(1) . '/**');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER',
|
|
|
|
PHP_EOL . Indent::_(1)
|
|
|
|
. '* The Global Admin Event Method.');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '**/');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER',
|
|
|
|
PHP_EOL . Indent::_(1)
|
|
|
|
. 'public static function globalEvent($document)');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '{');
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER',
|
2022-12-11 15:06:13 +00:00
|
|
|
PHP_EOL . CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add('ADMIN_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(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)
|
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('EXSTRA_ADMIN_FILES',
|
|
|
|
PHP_EOL . Indent::_(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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('HELPER_CREATEUSER',
|
|
|
|
$this->setCreateUserHelperMethod(
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->componentData->creatuserhelper
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELP
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('HELP', $this->noHelp());
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELP_SITE
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('HELP_SITE', $this->noHelp());
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// build route parse switch
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ROUTER_PARSE_SWITCH', '');
|
2016-02-26 00:20:09 +00:00
|
|
|
// build route views
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('HELPER_EMAIL', $this->addEmailHelper());
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2019-02-15 22:03:21 +00:00
|
|
|
// load the global placeholders
|
2022-09-14 15:40:02 +00:00
|
|
|
foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder =>
|
|
|
|
$gloabalValue
|
|
|
|
)
|
2019-02-15 22:03:21 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set($globalPlaceholder, $gloabalValue);
|
2019-02-15 22:03:21 +00:00
|
|
|
}
|
2022-09-14 15:40:02 +00:00
|
|
|
|
2016-09-11 15:27:04 +00:00
|
|
|
// reset view array
|
2020-03-28 13:34:14 +00:00
|
|
|
$viewarray = array();
|
2017-12-14 23:10:47 +00:00
|
|
|
$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
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = 'admin';
|
|
|
|
CFactory::_('Config')->lang_target = 'admin';
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2020-11-17 04:06:34 +00:00
|
|
|
// set local names
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode = $view['settings']->name_single_code;
|
|
|
|
$nameListCode = $view['settings']->name_list_code;
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
// set the view placeholders
|
|
|
|
$this->setViewPlaceholders($view['settings']);
|
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// set site edit view array
|
2020-03-28 13:34:14 +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
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$site_edit_view_array[] = Indent::_(4) . "'"
|
2020-11-26 17:33:39 +00:00
|
|
|
. $nameSingleCode . "'";
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_target = 'both';
|
2018-08-07 12:25:26 +00:00
|
|
|
// insure site view does not get removed
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Config')->remove_site_edit_folder = false;
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
// check if help is being loaded
|
2020-11-26 17:33:39 +00:00
|
|
|
$this->checkHelp($nameSingleCode);
|
2017-12-14 23:10:47 +00:00
|
|
|
// set custom admin view list links
|
2020-11-17 04:06:34 +00:00
|
|
|
$this->setCustomAdminViewListLink(
|
2020-11-26 17:33:39 +00:00
|
|
|
$view, $nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set view array
|
2022-08-30 15:28:41 +00:00
|
|
|
$viewarray[] = Indent::_(4) . "'"
|
2020-11-26 17:33:39 +00:00
|
|
|
. $nameSingleCode . "' => '"
|
|
|
|
. $nameListCode . "'";
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the view names
|
2020-03-28 13:34:14 +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
|
2020-11-17 04:06:34 +00:00
|
|
|
$this->setLockLicensePer(
|
2022-08-30 15:28:41 +00:00
|
|
|
$nameSingleCode, CFactory::_('Config')->build_target
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
|
|
|
$this->setLockLicensePer(
|
2022-08-30 15:28:41 +00:00
|
|
|
$nameListCode, CFactory::_('Config')->build_target
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildAdminEditViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$nameSingleCode,
|
|
|
|
&$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$nameSingleCode],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FIELDSETS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'FIELDSETS', $this->setFieldSet(
|
2022-08-30 15:28:41 +00:00
|
|
|
$view, CFactory::_('Config')->component_code_name,
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESSCONTROL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ACCESSCONTROL', $this->setFieldSetAccessControl(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWITEMS', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADDTOOLBAR <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ADDTOOLBAR', $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
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'VIEW_SCRIPT', $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, 'fileScript'
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODYSCRIPT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'EDITBODYSCRIPT', $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, 'footerScript'
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AJAXTOKE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'AJAXTOKE', $this->setAjaxToke(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DOCUMENT_CUSTOM_PHP <<<DYNAMIC>>>
|
2022-08-31 11:49:01 +00:00
|
|
|
if ($phpDocument = CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'php_document', $nameSingleCode,
|
2020-11-17 04:06:34 +00:00
|
|
|
PHP_EOL, null, true,
|
2020-03-28 13:34:14 +00:00
|
|
|
false
|
|
|
|
))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'DOCUMENT_CUSTOM_PHP', str_replace(
|
2020-03-28 13:34:14 +00:00
|
|
|
'$document->', '$this->document->', $phpDocument
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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
|
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'DOCUMENT_CUSTOM_PHP', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWTABLESCRIPTS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWTABLESCRIPTS', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VALIDATEFIX <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'VALIDATIONFIX', $this->setValidationFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->get('Component')
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'EDITBODY', $this->setEditBody($view));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 03:43:24 +00:00
|
|
|
// EDITBODYFADEIN <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'EDITBODYFADEIN', $this->setFadeInEfect($view));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLECONSTRUCTOR <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JTABLECONSTRUCTOR', $this->setJtableConstructor(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLEALIASCATEGORY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JTABLEALIASCATEGORY', $this->setJtableAliasCategory(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'METHOD_GET_ITEM', $this->setMethodGetItem(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWGLOBAL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWGLOBAL', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWMETHODS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'LINKEDVIEWMETHODS', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_BEFORE_DELETE', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-17 04:06:34 +00:00
|
|
|
'php_before_delete',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, PHP_EOL
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_AFTER_DELETE', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'php_after_delete', $nameSingleCode,
|
2020-11-17 04:06:34 +00:00
|
|
|
PHP_EOL . PHP_EOL
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_BEFORE_PUBLISH', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-17 04:06:34 +00:00
|
|
|
'php_before_publish',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, PHP_EOL
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_AFTER_PUBLISH', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-17 04:06:34 +00:00
|
|
|
'php_after_publish',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, PHP_EOL . PHP_EOL
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKBOX_SAVE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'CHECKBOX_SAVE', $this->setCheckboxSave(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_ITEM_SAVE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'METHOD_ITEM_SAVE', $this->setMethodItemSave(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTSAVEHOOK <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'POSTSAVEHOOK', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'php_postsavehook', $nameSingleCode,
|
2020-11-17 04:06:34 +00:00
|
|
|
PHP_EOL, null,
|
2022-08-30 15:28:41 +00:00
|
|
|
true, PHP_EOL . Indent::_(2) . "return;",
|
|
|
|
PHP_EOL . PHP_EOL . Indent::_(2) . "return;"
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWCSS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'VIEWCSS', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'css_view', $nameSingleCode, '',
|
2020-11-17 04:06:34 +00:00
|
|
|
null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// add css to front end
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($view['edit_create_site_view'])
|
2022-12-11 15:06:13 +00:00
|
|
|
&& is_numeric($view['edit_create_site_view'])
|
2020-03-28 13:34:14 +00:00
|
|
|
&& $view['edit_create_site_view'] > 0)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_VIEWCSS', CFactory::_('Content')->get_($nameSingleCode,'VIEWCSS'));
|
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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_MENU_XML', $this->setAdminViewMenu(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, $view
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-04-09 21:54:54 +00:00
|
|
|
}
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_ADMIN_VIEW_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'site.admin.view.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'site.admin.view.model',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'site.admin.view.html',
|
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'SITE_ADMIN_VIEW_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.admin.view',
|
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'TABLAYOUTFIELDSARRAY', $this->getTabLayoutFieldsArray(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-07-01 16:10:28 +00:00
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEW_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'admin.view.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
// ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader(
|
2020-11-26 17:33:39 +00:00
|
|
|
'admin.view.model', $nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'admin.view.html', $nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'ADMIN_VIEW_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'admin.view', $nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildAdminEditViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$nameSingleCode,
|
|
|
|
&$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$nameSingleCode],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
// set the views names
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($view['settings']->name_list)
|
|
|
|
&& $view['settings']->name_list != 'null')
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_target = 'admin';
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ICOMOON <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ICOMOON', $view['icomoon']);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildAdminListViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$nameSingleCode,
|
|
|
|
&$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$nameListCode],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the export/import option
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($view['port']) && $view['port']
|
|
|
|
|| 1 == $view['settings']->add_custom_import)
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2020-11-26 17:33:39 +00:00
|
|
|
$this->eximportView[$nameListCode]
|
2020-11-17 04:06:34 +00:00
|
|
|
= true;
|
2017-12-14 23:10:47 +00:00
|
|
|
if (1 == $view['settings']->add_custom_import)
|
|
|
|
{
|
|
|
|
// this view has custom import scripting
|
2020-11-26 17:33:39 +00:00
|
|
|
$this->importCustomScripts[$nameListCode]
|
2020-11-17 04:06:34 +00:00
|
|
|
= true;
|
2020-04-19 00:48:23 +00:00
|
|
|
// set all custom scripts
|
2020-11-17 04:06:34 +00:00
|
|
|
$this->setImportCustomScripts(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-26 17:33:39 +00:00
|
|
|
$this->eximportView[$nameListCode]
|
2020-11-17 04:06:34 +00:00
|
|
|
= false;
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2020-04-19 00:48:23 +00:00
|
|
|
// set Auto check in function
|
2017-12-14 23:10:47 +00:00
|
|
|
if (isset($view['checkin']) && $view['checkin'] == 1)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTOCHECKIN <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'AUTOCHECKIN', $this->setAutoCheckin(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->component_code_name
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'CHECKINCALL', $this->setCheckinCall());
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTOCHECKIN <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'AUTOCHECKIN', '');
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'CHECKINCALL', '');
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2019-03-06 20:32:16 +00:00
|
|
|
// admin list file contnet
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_JAVASCRIPT_FILE', $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode, 'list_fileScript'
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_CUSTOM_BUTTONS_LIST
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_CUSTOM_BUTTONS_LIST', $this->setCustomButtons($view, 3, Indent::_(1)));
|
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST', $this->setFunctionOnlyButtons(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_ITEMS_METHOD_STRING_FIX <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'GET_ITEMS_METHOD_STRING_FIX', $this->setGetItemsMethodStringFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->get('Component')
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_ITEMS_METHOD_AFTER_ALL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'GET_ITEMS_METHOD_AFTER_ALL', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-17 04:06:34 +00:00
|
|
|
'php_getitems_after_all',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, PHP_EOL
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIX <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'SELECTIONTRANSLATIONFIX', $this->setSelectionTranslationFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->get('Component')
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIXFUNC <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'SELECTIONTRANSLATIONFIXFUNC', $this->setSelectionTranslationFixFunc(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->get('Component')
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTER_FIELDS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'FILTER_FIELDS', $this->setFilterFieldsArray(
|
2020-12-03 00:13:49 +00:00
|
|
|
$nameSingleCode,
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// STOREDID <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'STOREDID', $this->setStoredId(
|
2020-12-03 00:13:49 +00:00
|
|
|
$nameSingleCode, $nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POPULATESTATE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'POPULATESTATE', $this->setPopulateState(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, $nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SORTFIELDS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'SORTFIELDS', $this->setSortFields(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CATEGORY_VIEWS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ROUTER_CATEGORY_VIEWS',
|
|
|
|
$this->setRouterCategoryViews(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
// FILTERFIELDDISPLAYHELPER <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'FILTERFIELDDISPLAYHELPER', $this->setFilterFieldSidebarDisplayHelper(
|
2020-11-29 00:00:20 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
|
|
|
|
// BATCHDISPLAYHELPER <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'BATCHDISPLAYHELPER', $this->setBatchDisplayHelper(
|
2020-11-29 00:00:20 +00:00
|
|
|
$nameSingleCode,
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTERFUNCTIONS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'FILTERFUNCTIONS', $this->setFilterFieldHelper(
|
2020-11-29 00:00:20 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
|
|
|
|
// FIELDFILTERSETS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('filter_' . $nameListCode,'FIELDFILTERSETS',
|
|
|
|
$this->setFieldFilterSet(
|
2020-11-29 00:00:20 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
|
|
|
|
// FIELDLISTSETS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('filter_' . $nameListCode, 'FIELDLISTSETS',
|
|
|
|
$this->setFieldFilterListSet(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTQUERY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'LISTQUERY', $this->setListQuery(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXPORTMETHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'MODELEXPORTMETHOD', $this->setGetItemsModelMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXIMPORTMETHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'CONTROLLEREXIMPORTMETHOD', $this->setControllerEximportMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EXPORTBUTTON <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'EXPORTBUTTON', $this->setExportButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// IMPORTBUTTON <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'IMPORTBUTTON', $this->setImportButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 03:43:24 +00:00
|
|
|
// VIEWS_DEFAULT_BODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'VIEWS_DEFAULT_BODY', $this->setDefaultViewsBody(
|
2020-11-29 03:43:24 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 03:43:24 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTHEAD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'LISTHEAD', $this->setListHead(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTBODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'LISTBODY', $this->setListBody(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTCOLNR <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'LISTCOLNR', $this->setListColnr(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JVIEWLISTCANDO <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'JVIEWLISTCANDO', $this->setJviewListCanDo(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWSCSS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'VIEWSCSS', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'css_views', $nameSingleCode, '',
|
2020-11-17 04:06:34 +00:00
|
|
|
null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2020-05-22 00:32:58 +00:00
|
|
|
// ADMIN_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_DIPLAY_METHOD', $this->setAdminViewDisplayMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-05-22 00:32:58 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWS_FOOTER_SCRIPT <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$scriptNote = PHP_EOL . '//' . Line::_(__Line__, __Class__)
|
2020-11-26 17:33:39 +00:00
|
|
|
. ' ' . $nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
. ' footer script';
|
2022-08-31 11:49:01 +00:00
|
|
|
if (($footerScript = CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'views_footer', $nameSingleCode, '',
|
|
|
|
$scriptNote, true,
|
|
|
|
false, PHP_EOL
|
2020-11-29 03:43:24 +00:00
|
|
|
)) !== false
|
2022-03-09 23:46:45 +00:00
|
|
|
&& StringHelper::check($footerScript))
|
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
|
2022-08-30 15:28:41 +00:00
|
|
|
if (CFactory::_('Config')->get('minify', 0)
|
2020-03-28 13:34:14 +00:00
|
|
|
&& strpos($footerScript, '<?php') === false)
|
2018-04-18 19:11:14 +00:00
|
|
|
{
|
|
|
|
// minfy the script
|
|
|
|
$minifier = new JS;
|
|
|
|
$minifier->add($footerScript);
|
|
|
|
$footerScript = $minifier->minify();
|
|
|
|
// clear some memory
|
|
|
|
unset($minifier);
|
|
|
|
}
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, '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
|
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'VIEWS_FOOTER_SCRIPT', '');
|
2018-04-18 12:03:07 +00:00
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEWS_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'admin.views.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
// ADMIN_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_MODEL_HEADER', $this->setFileHeader(
|
2020-11-26 17:33:39 +00:00
|
|
|
'admin.views.model', $nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'admin.views.html', $nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'ADMIN_VIEWS_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'admin.views', $nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminListViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildAdminListViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$nameSingleCode,
|
|
|
|
&$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$nameListCode],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set u fields used in batch
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'UNIQUEFIELDS', $this->setUniqueFields(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// TITLEALIASFIX <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'TITLEALIASFIX', $this->setAliasTitleFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWTITLE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'GENERATENEWTITLE', $this->setGenerateNewTitle(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-05-02 23:12:06 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWALIAS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'GENERATENEWALIAS', $this->setGenerateNewAlias(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_COPY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'MODEL_BATCH_COPY', $this->setBatchCopy($nameSingleCode));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_MOVE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'MODEL_BATCH_MOVE', $this->setBatchMove($nameSingleCode));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BATCH_ONCLICK_CANCEL_SCRIPT <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'BATCH_ONCLICK_CANCEL_SCRIPT', ''); // TODO <-- must still be build
|
2019-06-12 20:06:19 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JCONTROLLERFORM_ALLOWADD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_ALLOWADD', $this->setJcontrollerAllowAdd(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-12 20:06:19 +00:00
|
|
|
// JCONTROLLERFORM_BEFORECANCEL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_BEFORECANCEL', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'php_before_cancel', $nameSingleCode,
|
2022-08-31 11:49:01 +00:00
|
|
|
PHP_EOL, null, false,
|
2020-03-28 13:34:14 +00:00
|
|
|
''
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-06-12 20:06:19 +00:00
|
|
|
|
2019-06-12 20:36:05 +00:00
|
|
|
// JCONTROLLERFORM_AFTERCANCEL <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_AFTERCANCEL', CFactory::_('Customcode.Dispenser')->get(
|
2020-11-26 17:33:39 +00:00
|
|
|
'php_after_cancel', $nameSingleCode,
|
2022-08-31 11:49:01 +00:00
|
|
|
PHP_EOL, null, false,
|
2020-03-28 13:34:14 +00:00
|
|
|
''
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-06-12 20:36:05 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JCONTROLLERFORM_ALLOWEDIT <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JCONTROLLERFORM_ALLOWEDIT', $this->setJcontrollerAllowEdit(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_GETFORM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_GETFORM', $this->setJmodelAdminGetForm(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_ALLOWEDIT <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_ALLOWEDIT', $this->setJmodelAdminAllowEdit(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANDELETE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_CANDELETE', $this->setJmodelAdminCanDelete(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANEDITSTATE <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'JMODELADMIN_CANEDITSTATE', $this->setJmodelAdminCanEditState(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'CUSTOM_ADMIN_DYNAMIC_BUTTONS', $this->setCustomAdminDynamicButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER', $this->setCustomAdminDynamicButtonController(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set helper router
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ROUTEHELPER',
|
|
|
|
$this->setRouterHelp(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-03-28 13:34:14 +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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ROUTER_PARSE_SWITCH',
|
|
|
|
$this->routerParseSwitch(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, null, false
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add('ROUTER_BUILD_VIEWS',
|
|
|
|
$this->routerBuildViews(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ACCESS_SECTIONS',
|
|
|
|
$this->setAccessSectionsCategory(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2018-08-23 01:37:42 +00:00
|
|
|
// set the Joomla Fields ACCESS section if needed
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($view['joomla_fields'])
|
|
|
|
&& $view['joomla_fields'] == 1)
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ACCESS_SECTIONS', $this->setAccessSectionsJoomlaFields());
|
2018-08-23 01:37:42 +00:00
|
|
|
}
|
2020-04-19 00:48:23 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildAdminViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildAdminViewContent',
|
2020-11-17 04:06:34 +00:00
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$nameSingleCode,
|
|
|
|
&$nameListCode,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic, &$placeholders,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 15:40:02 +00:00
|
|
|
// all fields stored in database
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ARRAY_ALL_SEARCH_FIELDS', CFactory::_('Registry')->varExport('all_search_fields', 1));
|
2022-09-14 15:40:02 +00:00
|
|
|
|
2020-06-25 19:22:30 +00:00
|
|
|
// setup the layouts
|
|
|
|
$this->setCustomViewLayouts();
|
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// setup custom_admin_views and all needed stuff for the site
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($this->componentData->custom_admin_views)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->componentData->custom_admin_views
|
|
|
|
))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = 'custom_admin';
|
|
|
|
CFactory::_('Config')->lang_target = 'admin';
|
2017-12-14 23:10:47 +00:00
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->custom_admin_views as $view)
|
|
|
|
{
|
|
|
|
// for single views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SView', $view['settings']->Code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'sview', $view['settings']->code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SVIEW', $view['settings']->CODE);
|
2017-12-14 23:10:47 +00:00
|
|
|
// for list views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SViews', $view['settings']->Code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'sviews', $view['settings']->code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SVIEWS', $view['settings']->CODE);
|
2017-12-14 23:10:47 +00:00
|
|
|
// add to lang array
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target,
|
|
|
|
CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE,
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->name
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
|
|
|
CFactory::_('Config')->lang_target,
|
|
|
|
CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE
|
2020-03-28 13:34:14 +00:00
|
|
|
. '_DESC', $view['settings']->description
|
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// ICOMOON <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'ICOMOON', $view['icomoon']);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set placeholders
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->set('SView', $view['settings']->Code);
|
|
|
|
CFactory::_('Placeholder')->set('sview', $view['settings']->code);
|
|
|
|
CFactory::_('Placeholder')->set('SVIEW', $view['settings']->CODE);
|
|
|
|
|
|
|
|
CFactory::_('Placeholder')->set('SViews', $view['settings']->Code);
|
|
|
|
CFactory::_('Placeholder')->set('sviews', $view['settings']->code);
|
|
|
|
CFactory::_('Placeholder')->set('SVIEWS', $view['settings']->CODE);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildCustomAdminViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$view['settings']->code,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$view['settings']->code],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
// set license per view if needed
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->setLockLicensePer(
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, CFactory::_('Config')->build_target
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-04-23 21:15:07 +00:00
|
|
|
// check if this custom admin view is the default view
|
|
|
|
if ($this->dynamicDashboardType === 'custom_admin_views'
|
|
|
|
&& $this->dynamicDashboard === $view['settings']->code)
|
|
|
|
{
|
|
|
|
// HIDEMAINMENU <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'HIDEMAINMENU', '');
|
2020-04-23 21:15:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// HIDEMAINMENU <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'HIDEMAINMENU', PHP_EOL . Indent::_(2) . '//' . Line::_(
|
2022-08-30 15:28:41 +00:00
|
|
|
__LINE__,__CLASS__
|
2020-04-23 21:15:07 +00:00
|
|
|
) . " hide the main menu"
|
2022-08-30 15:28:41 +00:00
|
|
|
. PHP_EOL . Indent::_(2)
|
2022-12-11 15:06:13 +00:00
|
|
|
. "\$this->app->input->set('hidemainmenu', true);");
|
2020-04-23 21:15:07 +00:00
|
|
|
}
|
|
|
|
|
2017-12-14 23:10:47 +00:00
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BEFORE_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BEFORE_GET_ITEM', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_before_getitem',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, '', null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_ITEM', $this->setCustomViewGetItem(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get,
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, Indent::_(2)
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_AFTER_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_AFTER_GET_ITEM', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_after_getitem',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, '', null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_LIST_QUERY', $this->setCustomViewListQuery(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_getlistquery',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, PHP_EOL, null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BEFORE_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_before_getitems',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, PHP_EOL, null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_GET_ITEMS', $this->setCustomViewGetItems(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_AFTER_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_after_getitems',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, PHP_EOL, null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_METHODS', $this->setCustomViewCustomItemMethods(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add_($view['settings']->code, 'CUSTOM_ADMIN_CUSTOM_METHODS',
|
|
|
|
$this->setCustomViewCustomMethods(
|
|
|
|
$view, $view['settings']->code
|
|
|
|
)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_DIPLAY_METHOD', $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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS', $this->setCustomViewExtraDisplayMethods($view));
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CODE_BODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_CODE_BODY', $this->setCustomViewCodeBody($view));
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BODY', $this->setCustomViewBody($view));
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT', $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
|
|
|
|
2020-02-04 23:18:34 +00:00
|
|
|
// set the site form if needed
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_TOP_FORM', $this->setCustomViewForm(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 1
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_BOTTOM_FORM', $this->setCustomViewForm(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 2
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-02-04 23:18:34 +00:00
|
|
|
|
2020-10-21 03:10:19 +00:00
|
|
|
// set headers based on the main get type
|
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'custom.admin.view.controller',
|
|
|
|
$view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_MODEL_HEADER', $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'custom.admin.view.model', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'custom.admin.view.html', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEW_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'custom.admin.view', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
elseif ($view['settings']->main_get->gettype == 2)
|
|
|
|
{
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the controller
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'custom.admin.views.controller',
|
|
|
|
$view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_MODEL_HEADER', $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'custom.admin.views.model', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'custom.admin.views.html', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'CUSTOM_ADMIN_VIEWS_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'custom.admin.views', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildCustomAdminViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$view['settings']->code,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$view['settings']->code],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
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
|
|
|
|
2020-12-26 20:28:36 +00:00
|
|
|
// ADMIN_HELPER_CLASS_HEADER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMIN_HELPER_CLASS_HEADER',
|
|
|
|
$this->setFileHeader(
|
2020-12-26 20:28:36 +00:00
|
|
|
'admin.helper', 'admin'
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-12-26 20:28:36 +00:00
|
|
|
|
|
|
|
// ADMIN_COMPONENT_HEADER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMIN_COMPONENT_HEADER',
|
|
|
|
$this->setFileHeader(
|
2020-12-26 20:28:36 +00:00
|
|
|
'admin.component', 'admin'
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-12-26 20:28:36 +00:00
|
|
|
|
|
|
|
// SITE_HELPER_CLASS_HEADER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_HELPER_CLASS_HEADER',
|
|
|
|
$this->setFileHeader(
|
2020-12-26 20:28:36 +00:00
|
|
|
'site.helper', 'site'
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-12-26 20:28:36 +00:00
|
|
|
|
|
|
|
// SITE_COMPONENT_HEADER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_COMPONENT_HEADER',
|
|
|
|
$this->setFileHeader(
|
2020-12-26 20:28:36 +00:00
|
|
|
'site.component', 'site'
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-12-26 20:28:36 +00:00
|
|
|
|
|
|
|
// HELPER_EXEL
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('HELPER_EXEL', $this->setHelperExelMethods());
|
2020-12-26 20:28:36 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWARRAY
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('VIEWARRAY', 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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_EDIT_VIEW_ARRAY', 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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('MAINMENUS', $this->setMainMenus());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SUBMENU
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SUBMENU', $this->setSubMenus());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_CRYPT_KEY
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('GET_CRYPT_KEY', $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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('CONTRIBUTORS', $this->theContributors);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// INSTALL
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('INSTALL', $this->setInstall());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALL
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('UNINSTALL', $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
|
2022-03-09 23:46:45 +00:00
|
|
|
if (!StringHelper::check($this->dynamicDashboard))
|
2018-03-09 03:26:44 +00:00
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDVIEW
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('DASHBOARDVIEW', CFactory::_('Config')->component_code_name);
|
2018-03-18 04:52:07 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASHBOARDICONS', $this->setDashboardIcons());
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONACCESS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASHBOARDICONACCESS', $this->setDashboardIconAccess());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_MODEL_METHODS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_MODEL_METHODS', $this->setDashboardModelMethods());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_GET_CUSTOM_DATA
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_GET_CUSTOM_DATA', $this->setDashboardGetCustomData());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_DISPLAY_DATA
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_DISPLAY_DATA', $this->setDashboardDisplayData());
|
2021-12-21 14:44:50 +00:00
|
|
|
|
|
|
|
// DASH_VIEW_HEADER
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_VIEW_HEADER', $this->setFileHeader('dashboard.view', 'dashboard'));
|
2021-12-21 14:44:50 +00:00
|
|
|
// DASH_VIEW_HTML_HEADER
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_VIEW_HTML_HEADER', $this->setFileHeader('dashboard.view.html', 'dashboard'));
|
2021-12-21 14:44:50 +00:00
|
|
|
// DASH_MODEL_HEADER
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_MODEL_HEADER', $this->setFileHeader('dashboard.model', 'dashboard'));
|
2021-12-21 14:44:50 +00:00
|
|
|
// DASH_CONTROLLER_HEADER
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_(CFactory::_('Config')->component_code_name, 'DASH_CONTROLLER_HEADER', $this->setFileHeader('dashboard.controller', 'dashboard'));
|
2018-03-09 03:26:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDVIEW
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('DASHBOARDVIEW', $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');
|
2020-04-19 00:48:23 +00:00
|
|
|
// IMPORT_EXT_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('import', 'IMPORT_EXT_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_(
|
|
|
|
ComponentbuilderHelper::getDynamicScripts('ext')
|
|
|
|
));
|
2020-04-19 00:48:23 +00:00
|
|
|
// IMPORT_SETDATA_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('import', 'IMPORT_SETDATA_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_(
|
|
|
|
ComponentbuilderHelper::getDynamicScripts('setdata')
|
|
|
|
));
|
2020-04-19 00:48:23 +00:00
|
|
|
// IMPORT_SAVE_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('import', 'IMPORT_SAVE_METHOD', PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update_(
|
|
|
|
ComponentbuilderHelper::getDynamicScripts('save')
|
|
|
|
));
|
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
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'REGISTER_AJAX_TASK', $this->setRegisterAjaxTask('admin'));
|
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_INPUT_RETURN', $this->setAjaxInputReturn('admin'));
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the model header
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_ADMIN_MODEL_HEADER', $this->setFileHeader('ajax.admin.model', 'ajax'));
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_MODEL_METHODS', $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
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'REGISTER_SITE_AJAX_TASK', $this->setRegisterAjaxTask('site'));
|
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_SITE_INPUT_RETURN', $this->setAjaxInputReturn('site'));
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the model header
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_SITE_MODEL_HEADER', $this->setFileHeader('ajax.site.model', 'ajax'));
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('ajax', 'AJAX_SITE_MODEL_METHODS', $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
|
2022-09-10 08:16:44 +00:00
|
|
|
if (($validationRules = CFactory::_('Registry')->_('validation.rules')) !== null)
|
2018-03-27 09:57:16 +00:00
|
|
|
{
|
2022-09-10 08:16:44 +00:00
|
|
|
foreach ($validationRules as $rule => $_php)
|
2018-03-27 09:57:16 +00:00
|
|
|
{
|
|
|
|
// setup rule file
|
|
|
|
$target = array('admin' => 'a_rule_zi');
|
|
|
|
$this->buildDynamique($target, 'rule', $rule);
|
|
|
|
// set the JFormRule Name
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('a_rule_zi_' . $rule, 'Name', ucfirst($rule));
|
2018-03-27 09:57:16 +00:00
|
|
|
// set the JFormRule PHP
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_('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
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($this->secondRunAdmin)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check($this->secondRunAdmin))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->secondRunAdmin as $function => $arrays)
|
|
|
|
{
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($arrays)
|
|
|
|
&& StringHelper::check($function))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
|
|
|
foreach ($arrays as $array)
|
|
|
|
{
|
|
|
|
$this->{$function}($array);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
2022-08-30 15:28:41 +00:00
|
|
|
$keepLang = CFactory::_('Config')->lang_target;
|
|
|
|
CFactory::_('Config')->lang_target = 'admin';
|
2017-12-14 23:10:47 +00:00
|
|
|
// run field sets for second time
|
|
|
|
$this->setConfigFieldsets(2);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_target = $keepLang;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// setup front-views and all needed stuff for the site
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($this->componentData->site_views)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->componentData->site_views
|
|
|
|
))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = 'site';
|
2016-02-26 00:20:09 +00:00
|
|
|
// start dynamic build
|
|
|
|
foreach ($this->componentData->site_views as $view)
|
|
|
|
{
|
|
|
|
// for list views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SViews', $view['settings']->Code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'sviews', $view['settings']->code);
|
2016-02-26 00:20:09 +00:00
|
|
|
// for single views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SView', $view['settings']->Code);
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'sview', $view['settings']->code);
|
|
|
|
|
|
|
|
// set placeholders
|
|
|
|
CFactory::_('Placeholder')->set('SView', $view['settings']->Code);
|
|
|
|
CFactory::_('Placeholder')->set('sview', $view['settings']->code);
|
|
|
|
CFactory::_('Placeholder')->set('SVIEW', $view['settings']->CODE);
|
|
|
|
|
|
|
|
CFactory::_('Placeholder')->set('SViews', $view['settings']->Code);
|
|
|
|
CFactory::_('Placeholder')->set('sviews', $view['settings']->code);
|
|
|
|
CFactory::_('Placeholder')->set('SVIEWS', $view['settings']->CODE);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildSiteViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildSiteViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$view['settings']->code,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$view['settings']->code],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// set license per view if needed
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->setLockLicensePer(
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, CFactory::_('Config')->build_target
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
// set the site default view
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($view['default_view'])
|
|
|
|
&& $view['default_view'] == 1)
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_DEFAULT_VIEW', $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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_MENU_XML', $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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ROUTEHELPER',
|
|
|
|
$this->setRouterHelp(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, $view['settings']->code, true
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2020-11-17 04:06:34 +00:00
|
|
|
// build route details
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('ROUTER_PARSE_SWITCH',
|
|
|
|
$this->routerParseSwitch(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, $view
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add('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)
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// set user permission access check USER_PERMISSION_CHECK_ACCESS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'USER_PERMISSION_CHECK_ACCESS', $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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_BEFORE_GET_ITEM', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_before_getitem',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, '', null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_ITEM', $this->setCustomViewGetItem(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get,
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, Indent::_(2)
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEM <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_AFTER_GET_ITEM', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_after_getitem',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, '', null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'USER_PERMISSION_CHECK_ACCESS', $this->setUserPermissionCheckAccess($view, 2));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_LIST_QUERY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_LIST_QUERY', $this->setCustomViewListQuery(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_BEFORE_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_before_getitems',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, PHP_EOL, null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_GET_ITEMS', $this->setCustomViewGetItems(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_AFTER_GET_ITEMS', CFactory::_('Customcode.Dispenser')->get(
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target . '_php_after_getitems',
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code, PHP_EOL, null, true
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
// add to lang array
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
2020-03-28 13:34:14 +00:00
|
|
|
'site',
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE,
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->name
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Language')->set(
|
2020-03-28 13:34:14 +00:00
|
|
|
'site',
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->lang_prefix . '_' . $view['settings']->CODE
|
2020-03-28 13:34:14 +00:00
|
|
|
. '_DESC', $view['settings']->description
|
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_CUSTOM_METHODS <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_CUSTOM_METHODS', $this->setCustomViewCustomItemMethods(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->main_get, $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add_($view['settings']->code, 'SITE_CUSTOM_METHODS',
|
|
|
|
$this->setCustomViewCustomMethods(
|
|
|
|
$view, $view['settings']->code
|
|
|
|
)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_DIPLAY_METHOD', $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>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_EXTRA_DIPLAY_METHODS', $this->setCustomViewExtraDisplayMethods($view));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_CODE_BODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_CODE_BODY', $this->setCustomViewCodeBody($view));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BODY <<<DYNAMIC>>>
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_BODY', $this->setCustomViewBody($view));
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// setup the templates
|
|
|
|
$this->setCustomViewTemplateBody($view);
|
2020-03-28 13:34:14 +00:00
|
|
|
|
2018-09-11 20:08:58 +00:00
|
|
|
// set the site form if needed
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_TOP_FORM', $this->setCustomViewForm(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 1
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_BOTTOM_FORM', $this->setCustomViewForm(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 2
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2020-10-21 03:10:19 +00:00
|
|
|
// set headers based on the main get type
|
|
|
|
if ($view['settings']->main_get->gettype == 1)
|
|
|
|
{
|
2020-10-26 20:30:51 +00:00
|
|
|
// insure the controller headers are added
|
2022-03-09 23:46:45 +00:00
|
|
|
if (StringHelper::check(
|
2020-10-26 20:30:51 +00:00
|
|
|
$view['settings']->php_controller
|
|
|
|
)
|
|
|
|
&& $view['settings']->php_controller != '//')
|
|
|
|
{
|
|
|
|
// SITE_VIEW_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-10-26 20:30:51 +00:00
|
|
|
'site.view.controller', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-26 20:30:51 +00:00
|
|
|
}
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_MODEL_HEADER', $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'site.view.model', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'site.view.html', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.view', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
elseif ($view['settings']->main_get->gettype == 2)
|
|
|
|
{
|
2020-10-26 20:30:51 +00:00
|
|
|
// insure the controller headers are added
|
2022-03-09 23:46:45 +00:00
|
|
|
if (StringHelper::check(
|
2020-10-26 20:30:51 +00:00
|
|
|
$view['settings']->php_controller
|
|
|
|
)
|
|
|
|
&& $view['settings']->php_controller != '//')
|
|
|
|
{
|
|
|
|
// SITE_VIEW_CONTROLLER_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEW_CONTROLLER_HEADER', $this->setFileHeader(
|
2020-10-26 20:30:51 +00:00
|
|
|
'site.views.controller', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-26 20:30:51 +00:00
|
|
|
}
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_MODEL_HEADER', $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'site.views.model', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_HTML_HEADER', $this->setFileHeader(
|
2021-03-08 22:36:30 +00:00
|
|
|
'site.views.html', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($view['settings']->code, 'SITE_VIEWS_HEADER', $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.views', $view['settings']->code
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-06-22 10:43:26 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildSiteViewContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildSiteViewContent',
|
|
|
|
array(&$this->componentContext, &$view,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$view['settings']->code,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$fileContentDynamic[$view['settings']->code],
|
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2020-06-25 19:22:30 +00:00
|
|
|
|
2018-08-07 12:25:26 +00:00
|
|
|
// setup the layouts
|
|
|
|
$this->setCustomViewLayouts();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// clear all site folder since none is needed
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Config')->remove_site_folder = true;
|
2018-08-07 12:25:26 +00:00
|
|
|
}
|
|
|
|
// load the site statics
|
2022-12-11 15:06:13 +00:00
|
|
|
if (!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder)
|
2018-08-07 12:25:26 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = 'site';
|
2017-08-20 17:52:35 +00:00
|
|
|
// if no default site view was set, the redirect to root
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('SITE_DEFAULT_VIEW'))
|
2017-08-20 17:52:35 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_DEFAULT_VIEW', '');
|
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
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_CUSTOM_HELPER_SCRIPT',
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('SITE_GLOBAL_EVENT'))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_GLOBAL_EVENT', '');
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('SITE_GLOBAL_EVENT_HELPER'))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('SITE_GLOBAL_EVENT_HELPER', '');
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
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)
|
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT', PHP_EOL . PHP_EOL . '// Trigger the Global Site Event');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT',
|
|
|
|
PHP_EOL . CFactory::_('Content')->get('Component')
|
|
|
|
. 'Helper::globalEvent($document);');
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . PHP_EOL . Indent::_(1) . '/**');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER',
|
|
|
|
PHP_EOL . Indent::_(1)
|
|
|
|
. '* The Global Site Event Method.');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '**/');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER',
|
|
|
|
PHP_EOL . Indent::_(1)
|
|
|
|
. 'public static function globalEvent($document)');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(1) . '{');
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER',
|
2022-12-11 15:06:13 +00:00
|
|
|
PHP_EOL . CFactory::_('Placeholder')->update_(
|
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_site_event']
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
|
|
|
CFactory::_('Content')->add('SITE_GLOBAL_EVENT_HELPER', PHP_EOL . Indent::_(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
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->add('PREINSTALLSCRIPT',
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->get(
|
2020-03-28 13:34:14 +00:00
|
|
|
'php_preflight', 'install', PHP_EOL, null, true
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// PREUPDATESCRIPT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->add('PREUPDATESCRIPT',
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->get(
|
2020-03-28 13:34:14 +00:00
|
|
|
'php_preflight', 'update', PHP_EOL, null, true
|
2022-12-04 09:23:43 +00:00
|
|
|
));
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTINSTALLSCRIPT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->add('POSTINSTALLSCRIPT', $this->setPostInstallScript());
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTUPDATESCRIPT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->add('POSTUPDATESCRIPT', $this->setPostUpdateScript());
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALLSCRIPT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->add('UNINSTALLSCRIPT', $this->setUninstallScript());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSSCRIPT
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('MOVEFOLDERSSCRIPT', $this->setMoveFolderScript());
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSMETHOD
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('MOVEFOLDERSMETHOD', $this->setMoveFolderMethod());
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELPER_UIKIT
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('HELPER_UIKIT', $this->setUikitHelperMethods());
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CONFIG_FIELDSETS
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('CONFIG_FIELDSETS', 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
|
2022-12-04 09:23:43 +00:00
|
|
|
if (!CFactory::_('Content')->exist('ROUTER_BUILD_VIEWS')
|
2022-03-09 23:46:45 +00:00
|
|
|
|| !StringHelper::check(
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->get('ROUTER_BUILD_VIEWS')
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ROUTER_BUILD_VIEWS', 0);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ROUTER_BUILD_VIEWS', '(' . CFactory::_('Content')->get('ROUTER_BUILD_VIEWS') . ')');
|
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)
|
|
|
|
{
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('README', $this->componentData->readme);
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
2021-12-21 14:44:50 +00:00
|
|
|
// remove all the power placeholders
|
2022-12-04 09:23:43 +00:00
|
|
|
CFactory::_('Content')->set('ADMIN_POWER_HELPER', '');
|
|
|
|
CFactory::_('Content')->set('SITE_POWER_HELPER', '');
|
|
|
|
CFactory::_('Content')->set('CUSTOM_POWER_AUTOLOADER', '');
|
2022-12-11 15:06:13 +00:00
|
|
|
|
2021-12-21 14:44:50 +00:00
|
|
|
// infuse powers data if set
|
2022-08-30 15:28:41 +00:00
|
|
|
if (ArrayHelper::check(CFactory::_('Power')->active))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
|
|
|
// start the autoloader
|
|
|
|
$autoloader = array();
|
2022-08-30 15:28:41 +00:00
|
|
|
foreach (CFactory::_('Power')->active as $power)
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ObjectHelper::check($power))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
|
|
|
// Trigger Event: jcb_ce_onBeforeInfusePowerData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2021-12-21 14:44:50 +00:00
|
|
|
'jcb_ce_onBeforeInfusePowerData',
|
|
|
|
array(&$this->componentContext, &$power, &$this)
|
|
|
|
);
|
|
|
|
// POWERCODE
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($power->key, 'POWERCODE', $this->getPowerCode($power));
|
2021-12-21 14:44:50 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterInfusePowerData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2021-12-21 14:44:50 +00:00
|
|
|
'jcb_ce_onAfterInfusePowerData',
|
|
|
|
array(&$this->componentContext, &$power, &$this)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// now set the power autoloader
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Power.Autoloader')->set((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder));
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
2019-12-06 05:31:32 +00:00
|
|
|
// tweak system to set stuff to the module domain
|
2022-08-30 15:28:41 +00:00
|
|
|
$_backup_target = CFactory::_('Config')->build_target;
|
|
|
|
$_backup_lang = CFactory::_('Config')->lang_target;
|
|
|
|
$_backup_langPrefix = CFactory::_('Config')->lang_prefix;
|
2019-12-06 05:31:32 +00:00
|
|
|
// infuse module data if set
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($this->joomlaModules))
|
2019-12-06 05:31:32 +00:00
|
|
|
{
|
|
|
|
foreach ($this->joomlaModules as $module)
|
|
|
|
{
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ObjectHelper::check($module))
|
2019-12-06 05:31:32 +00:00
|
|
|
{
|
2020-04-03 18:45:48 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeInfuseModuleData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-04-03 18:45:48 +00:00
|
|
|
'jcb_ce_onBeforeInfuseModuleData',
|
2020-07-13 02:52:06 +00:00
|
|
|
array(&$this->componentContext, &$module, &$this)
|
2020-04-03 18:45:48 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = $module->key;
|
|
|
|
CFactory::_('Config')->lang_target = $module->key;
|
2019-12-06 05:31:32 +00:00
|
|
|
$this->langPrefix = $module->lang_prefix;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->set('lang_prefix', $module->lang_prefix);
|
2019-12-06 05:31:32 +00:00
|
|
|
// MODCODE
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'MODCODE', $this->getModCode($module));
|
2019-12-06 05:31:32 +00:00
|
|
|
// DYNAMICGET
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'DYNAMICGETS', $this->setCustomViewCustomMethods(
|
2020-03-28 13:34:14 +00:00
|
|
|
$module, $module->key
|
2022-12-11 15:06:13 +00:00
|
|
|
));
|
2019-12-06 05:31:32 +00:00
|
|
|
// HELPERCODE
|
|
|
|
if ($module->add_class_helper >= 1)
|
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'HELPERCODE', $this->getModHelperCode($module));
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
// MODDEFAULT
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'MODDEFAULT', $this->getModDefault($module, $module->key));
|
2019-12-06 05:31:32 +00:00
|
|
|
// only add install script if needed
|
|
|
|
if ($module->add_install_script)
|
|
|
|
{
|
|
|
|
// INSTALLCLASS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'INSTALLCLASS', CFactory::_('Extension.InstallScript')->get($module));
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
// FIELDSET
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($module->form_files)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$module->form_files
|
|
|
|
))
|
2019-12-06 05:31:32 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
foreach ($module->form_files as $file => $files)
|
2019-12-06 05:31:32 +00:00
|
|
|
{
|
|
|
|
foreach ($files as $field_name => $fieldsets)
|
|
|
|
{
|
|
|
|
foreach ($fieldsets as $fieldset => $fields)
|
|
|
|
{
|
|
|
|
// FIELDSET_ . $file.$field_name.$fieldset
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key,
|
|
|
|
'FIELDSET_' . $file . $field_name . $fieldset,
|
|
|
|
$this->getExtensionFieldsetXML(
|
|
|
|
$module, $fields
|
|
|
|
)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MAINXML
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($module->key, 'MAINXML', $this->getModuleMainXML($module));
|
2020-04-03 18:45:48 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterInfuseModuleData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-04-03 18:45:48 +00:00
|
|
|
'jcb_ce_onAfterInfuseModuleData',
|
2020-07-13 02:52:06 +00:00
|
|
|
array(&$this->componentContext, &$module, &$this)
|
2020-04-03 18:45:48 +00:00
|
|
|
);
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// infuse plugin data if set
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($this->joomlaPlugins))
|
2019-08-04 22:38:53 +00:00
|
|
|
{
|
2019-08-22 01:54:47 +00:00
|
|
|
foreach ($this->joomlaPlugins as $plugin)
|
2019-08-04 22:38:53 +00:00
|
|
|
{
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ObjectHelper::check($plugin))
|
2019-08-04 22:38:53 +00:00
|
|
|
{
|
2020-04-03 18:45:48 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeInfusePluginData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-04-03 18:45:48 +00:00
|
|
|
'jcb_ce_onBeforeInfusePluginData',
|
2020-07-13 02:52:06 +00:00
|
|
|
array(&$this->componentContext, &$plugin, &$this)
|
2020-04-03 18:45:48 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = $plugin->key;
|
|
|
|
CFactory::_('Config')->lang_target = $plugin->key;
|
2019-08-22 01:54:47 +00:00
|
|
|
$this->langPrefix = $plugin->lang_prefix;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->set('lang_prefix', $plugin->lang_prefix);
|
2019-08-04 22:38:53 +00:00
|
|
|
// MAINCLASS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($plugin->key, 'MAINCLASS', $this->getPluginMainClass($plugin));
|
2019-08-04 22:38:53 +00:00
|
|
|
// only add install script if needed
|
|
|
|
if ($plugin->add_install_script)
|
|
|
|
{
|
|
|
|
// INSTALLCLASS
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($plugin->key, 'INSTALLCLASS', CFactory::_('Extension.InstallScript')->get($plugin));
|
2019-08-04 22:38:53 +00:00
|
|
|
}
|
2019-08-22 01:54:47 +00:00
|
|
|
// FIELDSET
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($plugin->form_files)
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check(
|
2020-03-28 13:34:14 +00:00
|
|
|
$plugin->form_files
|
|
|
|
))
|
2019-08-22 01:54:47 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
foreach ($plugin->form_files as $file => $files)
|
2019-08-22 01:54:47 +00:00
|
|
|
{
|
|
|
|
foreach ($files as $field_name => $fieldsets)
|
|
|
|
{
|
|
|
|
foreach ($fieldsets as $fieldset => $fields)
|
|
|
|
{
|
|
|
|
// FIELDSET_ . $file.$field_name.$fieldset
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($plugin->key,
|
|
|
|
'FIELDSET_' . $file . $field_name . $fieldset,
|
|
|
|
$this->getExtensionFieldsetXML(
|
|
|
|
$plugin, $fields
|
|
|
|
)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2019-08-22 01:54:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-04 22:38:53 +00:00
|
|
|
// MAINXML
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($plugin->key, 'MAINXML', $this->getPluginMainXML($plugin));
|
2020-04-03 18:45:48 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterInfusePluginData
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-04-03 18:45:48 +00:00
|
|
|
'jcb_ce_onAfterInfusePluginData',
|
2020-07-13 02:52:06 +00:00
|
|
|
array(&$this->componentContext, &$plugin, &$this)
|
2020-04-03 18:45:48 +00:00
|
|
|
);
|
2019-08-04 22:38:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-06 05:31:32 +00:00
|
|
|
// rest globals
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->build_target = $_backup_target;
|
|
|
|
CFactory::_('Config')->lang_target = $_backup_lang;
|
2019-12-06 05:31:32 +00:00
|
|
|
$this->langPrefix = $_backup_langPrefix;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix);
|
|
|
|
// for plugin event TODO change event api signatures
|
2022-12-11 15:06:13 +00:00
|
|
|
$placeholders = CFactory::_('Placeholder')->active;
|
2022-12-04 09:23:43 +00:00
|
|
|
$fileContentStatic = CFactory::_('Content')->active;
|
2022-12-11 15:06:13 +00:00
|
|
|
$fileContentDynamic = CFactory::_('Content')->_active;
|
2019-08-08 15:35:58 +00:00
|
|
|
// Trigger Event: jcb_ce_onAfterBuildFilesContent
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onAfterBuildFilesContent',
|
|
|
|
array(&$this->componentContext, &$this->componentData,
|
2022-12-04 09:23:43 +00:00
|
|
|
&$fileContentStatic, &$this->fileContentDynamic,
|
2022-12-11 15:06:13 +00:00
|
|
|
&$placeholders, &$this->hhh)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-12-04 09:23:43 +00:00
|
|
|
unset($fileContentStatic);
|
2022-12-11 15:06:13 +00:00
|
|
|
unset($fileContentDynamic);
|
|
|
|
unset($placeholders);
|
2019-08-08 15:35:58 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-03-28 13:34:14 +00:00
|
|
|
|
2016-02-26 00:20:09 +00:00
|
|
|
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
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2018-01-19 10:27:47 +00:00
|
|
|
* @param object $view The view settings
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2018-01-19 10:27:47 +00:00
|
|
|
* @ return void
|
|
|
|
*/
|
|
|
|
protected function setViewPlaceholders(&$view)
|
|
|
|
{
|
|
|
|
// just to be safe, lets clear previous view placeholders
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->clearType('view');
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->clearType('views');
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEW <<<DYNAMIC>>>
|
2020-11-17 04:06:34 +00:00
|
|
|
if (isset($view->name_single) && $view->name_single != 'null')
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
|
|
|
// set main keys
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode = $view->name_single_code;
|
2022-03-09 23:46:45 +00:00
|
|
|
$name_single_uppercase = StringHelper::safe(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view->name_single, 'U'
|
|
|
|
);
|
2022-03-09 23:46:45 +00:00
|
|
|
$name_single_first_uppercase = StringHelper::safe(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view->name_single, 'F'
|
|
|
|
);
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
// set some place holder for the views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->set('view', $nameSingleCode);
|
|
|
|
CFactory::_('Placeholder')->set('View', $name_single_first_uppercase);
|
|
|
|
CFactory::_('Placeholder')->set('VIEW', $name_single_uppercase);
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWS <<<DYNAMIC>>>
|
2020-11-17 04:06:34 +00:00
|
|
|
if (isset($view->name_list) && $view->name_list != 'null')
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode = $view->name_list_code;
|
2022-03-09 23:46:45 +00:00
|
|
|
$name_list_uppercase = StringHelper::safe(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view->name_list, 'U'
|
|
|
|
);
|
2022-03-09 23:46:45 +00:00
|
|
|
$name_list_first_uppercase = StringHelper::safe(
|
2020-03-28 13:34:14 +00:00
|
|
|
$view->name_list, 'F'
|
|
|
|
);
|
2018-01-19 10:27:47 +00:00
|
|
|
|
|
|
|
// set some place holder for the views
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Placeholder')->set('views', $nameListCode);
|
|
|
|
CFactory::_('Placeholder')->set('Views', $name_list_first_uppercase);
|
|
|
|
CFactory::_('Placeholder')->set('VIEWS', $name_list_uppercase);
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// view <<<DYNAMIC>>>
|
2020-11-26 17:33:39 +00:00
|
|
|
if (isset($nameSingleCode))
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'view', $nameSingleCode);
|
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'VIEW', $name_single_uppercase);
|
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'View', $name_single_first_uppercase);
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2020-11-26 17:33:39 +00:00
|
|
|
if (isset($nameListCode))
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'view', $nameSingleCode);
|
|
|
|
CFactory::_('Content')->set_($nameListCode, 'VIEW', $name_single_uppercase);
|
|
|
|
CFactory::_('Content')->set_($nameListCode, 'View', $name_single_first_uppercase);
|
2018-01-19 10:27:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// views <<<DYNAMIC>>>
|
2020-11-26 17:33:39 +00:00
|
|
|
if (isset($nameListCode))
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameListCode, 'views', $nameListCode);
|
|
|
|
CFactory::_('Content')->set_($nameListCode, 'VIEWS', $name_list_uppercase);
|
|
|
|
CFactory::_('Content')->set_($nameListCode, 'Views', $name_list_first_uppercase);
|
2018-01-19 10:27:47 +00:00
|
|
|
|
2020-11-26 17:33:39 +00:00
|
|
|
if (isset($nameSingleCode))
|
2018-01-19 10:27:47 +00:00
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'views', $nameListCode);
|
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'VIEWS', $name_list_uppercase);
|
|
|
|
CFactory::_('Content')->set_($nameSingleCode, 'Views', $name_list_first_uppercase);
|
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
|
2020-03-28 13:34:14 +00:00
|
|
|
*
|
2017-02-13 23:24:38 +00:00
|
|
|
*/
|
|
|
|
public function setLangFileData()
|
|
|
|
{
|
2019-09-04 11:52:31 +00:00
|
|
|
// reset values
|
2020-03-28 13:34:14 +00:00
|
|
|
$values = array();
|
2017-04-05 13:21:10 +00:00
|
|
|
$mainLangLoader = array();
|
|
|
|
// check the admin lang is set
|
|
|
|
if ($this->setLangAdmin())
|
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$values[] = array_values(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['admin']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
|
|
|
$mainLangLoader['admin'] = count(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['admin']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the admin system lang is set
|
|
|
|
if ($this->setLangAdminSys())
|
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$values[] = array_values(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['adminsys']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
|
|
|
$mainLangLoader['adminsys'] = count(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['adminsys']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the site lang is set
|
2022-12-11 15:06:13 +00:00
|
|
|
if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder)
|
2020-03-28 13:34:14 +00:00
|
|
|
&& $this->setLangSite())
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$values[] = array_values(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['site']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
|
|
|
$mainLangLoader['site'] = count(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['site']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// check the site system lang is set
|
2022-12-11 15:06:13 +00:00
|
|
|
if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder)
|
2020-03-28 13:34:14 +00:00
|
|
|
&& $this->setLangSiteSys())
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$values[] = array_values(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['sitesys']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
|
|
|
$mainLangLoader['sitesys'] = count(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')]['sitesys']
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
2022-03-09 23:46:45 +00:00
|
|
|
$values = array_unique(ArrayHelper::merge($values));
|
2017-04-05 13:21:10 +00:00
|
|
|
// get the other lang strings if there is any
|
|
|
|
$this->multiLangString = $this->getMultiLangStrings($values);
|
|
|
|
// update insert the current lang in to DB
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->setLangPlaceholders($values, CFactory::_('Config')->component_id);
|
2017-04-07 20:33:35 +00:00
|
|
|
// remove old unused language strings
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->purgeLanuageStrings($values, CFactory::_('Config')->component_id);
|
2017-04-05 13:21:10 +00:00
|
|
|
// path to INI file
|
|
|
|
$getPAth = $this->templatePath . '/en-GB.com_admin.ini';
|
2020-03-24 01:11:43 +00:00
|
|
|
// Trigger Event: jcb_ce_onBeforeBuildAllLangFiles
|
2022-09-10 08:16:44 +00:00
|
|
|
CFactory::_('Event')->trigger(
|
2020-03-28 13:34:14 +00:00
|
|
|
'jcb_ce_onBeforeBuildAllLangFiles',
|
2020-04-23 21:15:07 +00:00
|
|
|
array(&$this->componentContext, &$this->languages['components'],
|
2021-12-21 14:44:50 +00:00
|
|
|
&$this->langTag)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
|
|
|
CFactory::_('Config')->lang_tag = $this->langTag;
|
2017-02-13 23:24:38 +00:00
|
|
|
// now we insert the values into the files
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($this->languages['components']))
|
2017-02-13 23:24:38 +00:00
|
|
|
{
|
2019-06-22 10:43:26 +00:00
|
|
|
// rest xml array
|
2017-04-05 13:21:10 +00:00
|
|
|
$langXML = array();
|
2020-03-28 13:34:14 +00:00
|
|
|
foreach ($this->languages['components'] as $tag => $areas)
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
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)
|
|
|
|
{
|
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)
|
|
|
|
{
|
2022-12-11 15:06:13 +00:00
|
|
|
if (CFactory::_('Config')->remove_site_folder
|
|
|
|
&& CFactory::_('Config')->remove_site_edit_folder)
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$p = 'site';
|
|
|
|
}
|
|
|
|
if (strpos($area, 'sys') !== false)
|
|
|
|
{
|
|
|
|
$t = '.sys';
|
|
|
|
}
|
|
|
|
// build the file name
|
2022-08-30 15:28:41 +00:00
|
|
|
$file_name = $tag . '.com_' . CFactory::_('Config')->component_code_name . $t
|
2020-03-28 13:34:14 +00:00
|
|
|
. '.ini';
|
2020-04-03 18:45:48 +00:00
|
|
|
// check if language should be added
|
|
|
|
if ($this->shouldLanguageBeAdded(
|
|
|
|
$tag, $languageStrings, $mainLangLoader[$area],
|
|
|
|
$file_name
|
|
|
|
))
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2020-04-03 18:45:48 +00:00
|
|
|
// build the path to place the lang file
|
|
|
|
$path = $this->componentPath . '/' . $p . '/language/'
|
|
|
|
. $tag . '/';
|
2021-03-07 21:40:55 +00:00
|
|
|
if (!Folder::exists($path))
|
2020-04-03 18:45:48 +00:00
|
|
|
{
|
2021-03-07 21:40:55 +00:00
|
|
|
Folder::create($path);
|
2020-04-03 18:45:48 +00:00
|
|
|
// count the folder created
|
|
|
|
$this->folderCount++;
|
|
|
|
}
|
|
|
|
// move the file to its place
|
2021-03-07 21:40:55 +00:00
|
|
|
File::copy($getPAth, $path . $file_name);
|
2020-04-03 18:45:48 +00:00
|
|
|
// count the file created
|
|
|
|
$this->fileCount++;
|
|
|
|
// add content to it
|
|
|
|
$lang = array_map(
|
|
|
|
function ($langstring, $placeholder) {
|
|
|
|
return $placeholder . '="' . $langstring . '"';
|
|
|
|
}, array_values($languageStrings),
|
|
|
|
array_keys($languageStrings)
|
|
|
|
);
|
|
|
|
// add to language file
|
|
|
|
$this->writeFile(
|
|
|
|
$path . $file_name, implode(PHP_EOL, $lang)
|
|
|
|
);
|
|
|
|
// set the line counter
|
|
|
|
$this->lineCount = $this->lineCount + count(
|
|
|
|
(array) $lang
|
|
|
|
);
|
|
|
|
unset($lang);
|
|
|
|
// build xml strings
|
|
|
|
if (!isset($langXML[$p]))
|
|
|
|
{
|
|
|
|
$langXML[$p] = array();
|
|
|
|
}
|
|
|
|
$langXML[$p][] = '<language tag="' . $tag
|
|
|
|
. '">language/'
|
|
|
|
. $tag . '/' . $file_name . '</language>';
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-22 10:43:26 +00:00
|
|
|
// load the lang xml
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($langXML))
|
2017-02-13 23:24:38 +00:00
|
|
|
{
|
2017-04-05 13:21:10 +00:00
|
|
|
$replace = array();
|
2020-03-28 13:34:14 +00:00
|
|
|
if (isset($langXML['admin'])
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check($langXML['admin']))
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$replace[Placefix::_h('ADMIN_LANGUAGES')]
|
|
|
|
= implode(PHP_EOL . Indent::_(3), $langXML['admin']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
2022-12-11 15:06:13 +00:00
|
|
|
if ((!CFactory::_('Config')->remove_site_folder || !CFactory::_('Config')->remove_site_edit_folder)
|
2020-03-28 13:34:14 +00:00
|
|
|
&& isset($langXML['site'])
|
2022-03-09 23:46:45 +00:00
|
|
|
&& ArrayHelper::check($langXML['site']))
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$replace[Placefix::_h('SITE_LANGUAGES')]
|
|
|
|
= implode(PHP_EOL . Indent::_(2), $langXML['site']);
|
2017-04-05 13:21:10 +00:00
|
|
|
}
|
|
|
|
// build xml path
|
2022-08-30 15:28:41 +00:00
|
|
|
$xmlPath = $this->componentPath . '/' . CFactory::_('Config')->component_code_name
|
2020-03-28 13:34:14 +00:00
|
|
|
. '.xml';
|
2017-04-05 13:21:10 +00:00
|
|
|
// get the content in xml
|
2022-04-04 15:35:08 +00:00
|
|
|
$componentXML = FileHelper::getContent(
|
2020-03-28 13:34:14 +00:00
|
|
|
$xmlPath
|
|
|
|
);
|
2017-04-05 13:21:10 +00:00
|
|
|
// update the xml content
|
2022-08-30 15:28:41 +00:00
|
|
|
$componentXML = CFactory::_('Placeholder')->update($componentXML, $replace);
|
2017-04-05 13:21:10 +00:00
|
|
|
// 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
|
|
|
}
|