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();
|
2017-01-20 00:16:50 +00:00
|
|
|
public $removeSiteFolder = false;
|
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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$this->fileContentStatic, &$this->fileContentDynamic,
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->placeholders;
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPONENT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('COMPONENT')]
|
|
|
|
= CFactory::_('Placeholder')->active[Placefix::_h('COMPONENT')];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// Component
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component')]
|
|
|
|
= CFactory::_('Placeholder')->active[Placefix::_h('Component')];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// component
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('component')]
|
|
|
|
= CFactory::_('Placeholder')->active[Placefix::_h('component')];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMPANYNAME
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('COMPANYNAME')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim(
|
|
|
|
JFilterOutput::cleanText($this->componentData->companyname)
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CREATIONDATE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('CREATIONDATE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= JFactory::getDate($this->componentData->created)->format(
|
|
|
|
'jS F, Y'
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('CREATIONDATE')
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'GLOBAL']
|
2022-08-30 15:28:41 +00:00
|
|
|
= $this->fileContentStatic[Placefix::_h('CREATIONDATE')];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BUILDDATE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('BUILDDATE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= JFactory::getDate()->format('jS F, Y');
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('BUILDDATE')
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'GLOBAL']
|
2022-08-30 15:28:41 +00:00
|
|
|
= $this->fileContentStatic[Placefix::_h('BUILDDATE')];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOR
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('AUTHOR')] = trim(
|
2020-03-28 13:34:14 +00:00
|
|
|
JFilterOutput::cleanText($this->componentData->author)
|
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHOREMAIL
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('AUTHOREMAIL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->email);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTHORWEBSITE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->website);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COPYRIGHT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('COPYRIGHT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->copyright);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LICENSE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('LICENSE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->license);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VERSION
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VERSION')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->component_version);
|
2017-11-06 14:04:23 +00:00
|
|
|
// set the actual global version
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACTUALVERSION')]
|
|
|
|
= $this->fileContentStatic[Placefix::_h('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
|
2020-03-28 13:34:14 +00:00
|
|
|
if (strpos(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VERSION')], '.'
|
2020-03-28 13:34:14 +00:00
|
|
|
) !== false)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$versionArray = explode(
|
2022-08-30 15:28:41 +00:00
|
|
|
'.', $this->fileContentStatic[Placefix::_h('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
|
|
|
|
)
|
|
|
|
&& $this->componentData->mvc_versiondate == 2)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VERSION')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
|
|
|
)
|
|
|
|
&& $this->componentData->mvc_versiondate == 3)
|
2017-11-06 14:04:23 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VERSION')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VERSION')
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'GLOBAL']
|
2022-08-30 15:28:41 +00:00
|
|
|
= $this->fileContentStatic[Placefix::_h('VERSION')];
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the joomla target xml version
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component_name')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= JFilterOutput::cleanText($this->componentData->name);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SHORT_DISCRIPTION
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim(
|
|
|
|
JFilterOutput::cleanText(
|
|
|
|
$this->componentData->short_description
|
|
|
|
)
|
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DESCRIPTION
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('DESCRIPTION')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= trim($this->componentData->description);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// COMP_IMAGE_TYPE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('COMP_IMAGE_TYPE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setComponentImageType($this->componentData->image);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMINJS')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITEJS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITEJS')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_js'], CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMINCSS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMINCSS')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_css_admin'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITECSS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITECSS')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_css_site'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_HELPER_SCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('CUSTOM_HELPER_SCRIPT')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_admin'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// BOTH_CUSTOM_HELPER_SCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('BOTH_CUSTOM_HELPER_SCRIPT')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_both'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
2022-08-30 15:28:41 +00:00
|
|
|
if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')]))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')] = '';
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
if (!isset($this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')]
|
2021-12-21 14:44:50 +00:00
|
|
|
.= PHP_EOL . PHP_EOL . '// Trigger the Global Admin Event';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT')]
|
|
|
|
.= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'Helper::globalEvent($document);';
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_GLOBAL_EVENT_HELPER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . PHP_EOL . Indent::_(1) . '/**';
|
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1)
|
2020-03-28 13:34:14 +00:00
|
|
|
. '* The Global Admin Event Method.';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1) . '**/';
|
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1)
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'public static function globalEvent($document)';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1) . '{';
|
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_admin_event'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')]
|
|
|
|
.= PHP_EOL . Indent::_(3)
|
2020-03-28 13:34:14 +00:00
|
|
|
. "<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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELPER_CREATEUSER')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCreateUserHelperMethod(
|
|
|
|
$this->componentData->creatuserhelper
|
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELP
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELP')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->noHelp();
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELP_SITE
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELP_SITE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->noHelp();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// build route parse switch
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2016-02-26 00:20:09 +00:00
|
|
|
// build route views
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2016-04-22 12:03:43 +00:00
|
|
|
// add the helper emailer if set
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELPER_EMAIL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->addEmailHelper();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2019-02-15 22:03:21 +00:00
|
|
|
// load the global placeholders
|
2022-03-09 23:46:45 +00:00
|
|
|
if (ArrayHelper::check($this->globalPlaceholders))
|
2019-02-15 22:03:21 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
foreach (
|
|
|
|
$this->globalPlaceholders as $globalPlaceholder =>
|
|
|
|
$gloabalValue
|
|
|
|
)
|
2019-02-15 22:03:21 +00:00
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
$this->fileContentStatic[$globalPlaceholder]
|
|
|
|
= $gloabalValue;
|
2019-02-15 22:03:21 +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
|
|
|
|
$this->removeSiteEditFolder = 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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$nameSingleCode],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->placeholders;
|
2019-06-22 10:43:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FIELDSETS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('FIELDSETS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESSCONTROL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ACCESSCONTROL')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setFieldSetAccessControl(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADDTOOLBAR <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADDTOOLBAR')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW_SCRIPT')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, 'fileScript'
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODYSCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYSCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, 'footerScript'
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// AJAXTOKE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('AJAXTOKE')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setAjaxToke(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= str_replace(
|
|
|
|
'$document->', '$this->document->', $phpDocument
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
// clear some memory
|
2018-04-18 19:11:14 +00:00
|
|
|
unset($phpDocument);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('DOCUMENT_CUSTOM_PHP')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWTABLESCRIPTS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VALIDATEFIX <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('VALIDATIONFIX')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setValidationFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EDITBODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setEditBody($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 03:43:24 +00:00
|
|
|
// EDITBODYFADEIN <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('EDITBODYFADEIN')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setFadeInEfect($view);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLECONSTRUCTOR <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLECONSTRUCTOR')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setJtableConstructor(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JTABLEALIASCATEGORY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JTABLEALIASCATEGORY')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setJtableAliasCategory(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_GET_ITEM <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_GET_ITEM')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setMethodGetItem(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWGLOBAL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LINKEDVIEWMETHODS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_DELETE')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_DELETE')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_BEFORE_DELETE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_BEFORE_PUBLISH')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_AFTER_DELETE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_AFTER_PUBLISH')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKBOX_SAVE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('CHECKBOX_SAVE')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setCheckboxSave(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// METHOD_ITEM_SAVE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('METHOD_ITEM_SAVE')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setMethodItemSave(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTSAVEHOOK <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('POSTSAVEHOOK')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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;"
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWCSS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWCSS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +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'])
|
|
|
|
&& 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
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_VIEWCSS')]
|
|
|
|
= $this->fileContentDynamic[$nameSingleCode][Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_MENU_XML')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setAdminViewMenu(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, $view
|
2020-03-28 13:34:14 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'site.admin.view.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-10-26 20:30:51 +00:00
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'site.admin.view.model',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-10-21 03:10:19 +00:00
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'site.admin.view.html',
|
|
|
|
$nameSingleCode
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('SITE_ADMIN_VIEW_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.admin.view',
|
|
|
|
$nameSingleCode
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('TABLAYOUTFIELDSARRAY')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->getTabLayoutFieldsArray(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'admin.view.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-10-26 20:30:51 +00:00
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
// ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-26 17:33:39 +00:00
|
|
|
'admin.view.model', $nameSingleCode
|
2020-10-21 03:10:19 +00:00
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'admin.view.html', $nameSingleCode
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('ADMIN_VIEW_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'admin.view', $nameSingleCode
|
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$nameSingleCode],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ICOMOON')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$nameListCode],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setAutoCheckin(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Config')->component_code_name
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCheckinCall();
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// AUTOCHECKIN <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('AUTOCHECKIN')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2018-05-22 19:01:36 +00:00
|
|
|
// CHECKINCALL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('CHECKINCALL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2019-03-06 20:32:16 +00:00
|
|
|
// admin list file contnet
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_JAVASCRIPT_FILE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setViewScript(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode, 'list_fileScript'
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// ADMIN_CUSTOM_BUTTONS_LIST
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_BUTTONS_LIST')]
|
|
|
|
= $this->setCustomButtons($view, 3, Indent::_(1));
|
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setFunctionOnlyButtons(
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_ITEMS_METHOD_STRING_FIX <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_STRING_FIX')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setGetItemsMethodStringFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('GET_ITEMS_METHOD_AFTER_ALL')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIX <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIX')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setSelectionTranslationFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SELECTIONTRANSLATIONFIXFUNC <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('SELECTIONTRANSLATIONFIXFUNC')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setSelectionTranslationFixFunc(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode,
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTER_FIELDS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('FILTER_FIELDS')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setFilterFieldsArray(
|
2020-12-03 00:13:49 +00:00
|
|
|
$nameSingleCode,
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// STOREDID <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('STOREDID')]
|
2020-12-03 00:13:49 +00:00
|
|
|
= $this->setStoredId(
|
|
|
|
$nameSingleCode, $nameListCode
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POPULATESTATE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('POPULATESTATE')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setPopulateState(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, $nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SORTFIELDS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('SORTFIELDS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setSortFields(
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CATEGORY_VIEWS
|
2020-03-28 13:34:14 +00:00
|
|
|
if (!isset(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->setRouterCategoryViews(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
// FILTERFIELDDISPLAYHELPER <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFIELDDISPLAYHELPER')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setFilterFieldSidebarDisplayHelper(
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
|
|
|
);
|
|
|
|
|
|
|
|
// BATCHDISPLAYHELPER <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('BATCHDISPLAYHELPER')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setBatchDisplayHelper(
|
|
|
|
$nameSingleCode,
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// FILTERFUNCTIONS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('FILTERFUNCTIONS')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setFilterFieldHelper(
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
|
|
|
);
|
|
|
|
|
|
|
|
// FIELDFILTERSETS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic['filter_'
|
2022-08-30 15:28:41 +00:00
|
|
|
. $nameListCode][Placefix::_h('FIELDFILTERSETS')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setFieldFilterSet(
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
|
|
|
);
|
|
|
|
|
|
|
|
// FIELDLISTSETS <<<DYNAMIC>>>
|
|
|
|
$this->fileContentDynamic['filter_'
|
2022-08-30 15:28:41 +00:00
|
|
|
. $nameListCode][Placefix::_h('FIELDLISTSETS')]
|
2020-11-29 00:00:20 +00:00
|
|
|
= $this->setFieldFilterListSet(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTQUERY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('LISTQUERY')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setListQuery(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXPORTMETHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('MODELEXPORTMETHOD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setGetItemsModelMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODELEXIMPORTMETHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('CONTROLLEREXIMPORTMETHOD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setControllerEximportMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// EXPORTBUTTON <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('EXPORTBUTTON')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setExportButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// IMPORTBUTTON <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('IMPORTBUTTON')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setImportButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2020-11-29 03:43:24 +00:00
|
|
|
// VIEWS_DEFAULT_BODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_DEFAULT_BODY')]
|
2020-11-29 03:43:24 +00:00
|
|
|
= $this->setDefaultViewsBody(
|
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
|
|
|
);
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTHEAD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('LISTHEAD')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setListHead(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTBODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('LISTBODY')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setListBody(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// LISTCOLNR <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('LISTCOLNR')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setListColnr(
|
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
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JVIEWLISTCANDO <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('JVIEWLISTCANDO')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJviewListCanDo(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWSCSS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWSCSS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-04-18 19:11:14 +00:00
|
|
|
|
2020-05-22 00:32:58 +00:00
|
|
|
// ADMIN_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_DIPLAY_METHOD')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setAdminViewDisplayMethod(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS_FOOTER_SCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'admin.views.controller',
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2020-10-26 20:30:51 +00:00
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
// ADMIN_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-26 17:33:39 +00:00
|
|
|
'admin.views.model', $nameListCode
|
2020-10-21 03:10:19 +00:00
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the views
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'admin.views.html', $nameListCode
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the views
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('ADMIN_VIEWS_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'admin.views', $nameListCode
|
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$nameListCode],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->placeholders;
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// set u fields used in batch
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('UNIQUEFIELDS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setUniqueFields(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// TITLEALIASFIX <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('TITLEALIASFIX')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setAliasTitleFix(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWTITLE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWTITLE')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setGenerateNewTitle(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2018-05-02 23:12:06 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GENERATENEWALIAS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('GENERATENEWALIAS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setGenerateNewAlias(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_COPY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_COPY')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $this->setBatchCopy($nameSingleCode);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MODEL_BATCH_MOVE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('MODEL_BATCH_MOVE')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('BATCH_ONCLICK_CANCEL_SCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= ''; // 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWADD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJcontrollerAllowAdd(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2019-06-12 20:06:19 +00:00
|
|
|
// JCONTROLLERFORM_BEFORECANCEL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_BEFORECANCEL')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
''
|
|
|
|
);
|
2019-06-12 20:06:19 +00:00
|
|
|
|
2019-06-12 20:36:05 +00:00
|
|
|
// JCONTROLLERFORM_AFTERCANCEL <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_AFTERCANCEL')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
''
|
|
|
|
);
|
2019-06-12 20:36:05 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JCONTROLLERFORM_ALLOWEDIT <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JCONTROLLERFORM_ALLOWEDIT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJcontrollerAllowEdit(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_GETFORM <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_GETFORM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJmodelAdminGetForm(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_ALLOWEDIT <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_ALLOWEDIT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJmodelAdminAllowEdit(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANDELETE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANDELETE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJmodelAdminCanDelete(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// JMODELADMIN_CANEDITSTATE <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('JMODELADMIN_CANEDITSTATE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setJmodelAdminCanEditState(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $this->setCustomAdminDynamicButton(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomAdminDynamicButtonController(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set helper router
|
2020-03-28 13:34:14 +00:00
|
|
|
if (!isset(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTEHELPER')]
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTEHELPER')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTEHELPER')]
|
2020-11-17 04:06:34 +00:00
|
|
|
.= $this->setRouterHelp(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-11-17 04:06:34 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->routerParseSwitch(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode, null, false
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
.= $this->routerBuildViews(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode
|
2020-11-17 04:06:34 +00:00
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// ACCESS_SECTIONS
|
2020-03-28 13:34:14 +00:00
|
|
|
if (!isset(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2017-12-14 23:10:47 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
2017-12-14 23:10:47 +00:00
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->setAccessSectionsCategory(
|
2020-11-26 17:33:39 +00:00
|
|
|
$nameSingleCode,
|
|
|
|
$nameListCode
|
2020-03-28 13:34:14 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ACCESS_SECTIONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic, &$this->placeholders,
|
|
|
|
&$this->hhh)
|
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::_('Placeholder')->active = $this->placeholders;
|
2017-12-14 23:10:47 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2017-12-14 23:10:47 +00:00
|
|
|
// for list views
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SVIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('ICOMOON')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['icomoon'];
|
2017-12-14 23:10:47 +00:00
|
|
|
|
|
|
|
// set placeholders
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$view['settings']->code],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')]
|
2020-10-21 03:10:19 +00:00
|
|
|
= '';
|
2020-04-23 21:15:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// HIDEMAINMENU <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('HIDEMAINMENU')]
|
|
|
|
= PHP_EOL . Indent::_(2) . '//' . Line::_(
|
|
|
|
__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)
|
2020-04-23 21:15:07 +00:00
|
|
|
. "\$this->app->input->set('hidemainmenu', true);";
|
|
|
|
}
|
|
|
|
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEM')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEM <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewGetItem(
|
|
|
|
$view['settings']->main_get,
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, Indent::_(2)
|
2020-03-28 13:34:14 +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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEM')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_LIST_QUERY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewListQuery(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BEFORE_GET_ITEMS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_GET_ITEMS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewGetItems(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_AFTER_GET_ITEMS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewCustomItemMethods(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CUSTOM_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->setCustomViewCustomMethods(
|
|
|
|
$view, $view['settings']->code
|
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_DIPLAY_METHOD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewExtraDisplayMethods($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_CODE_BODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_CODE_BODY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewCodeBody($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_BODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BODY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewBody($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_TOP_FORM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewForm(
|
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 1
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_BOTTOM_FORM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewForm(
|
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 2
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'custom.admin.view.controller',
|
|
|
|
$view['settings']->code
|
2020-10-26 20:30:51 +00:00
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'custom.admin.view.model', $view['settings']->code
|
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'custom.admin.view.html', $view['settings']->code
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEW_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'custom.admin.view', $view['settings']->code
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-17 04:06:34 +00:00
|
|
|
'custom.admin.views.controller',
|
|
|
|
$view['settings']->code
|
2020-10-26 20:30:51 +00:00
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'custom.admin.views.model', $view['settings']->code
|
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'custom.admin.views.html', $view['settings']->code
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// CUSTOM_ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('CUSTOM_ADMIN_VIEWS_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'custom.admin.views', $view['settings']->code
|
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$view['settings']->code],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_HELPER_CLASS_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'admin.helper', 'admin'
|
|
|
|
);
|
|
|
|
|
|
|
|
// ADMIN_COMPONENT_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_COMPONENT_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'admin.component', 'admin'
|
|
|
|
);
|
|
|
|
|
|
|
|
// SITE_HELPER_CLASS_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_HELPER_CLASS_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'site.helper', 'site'
|
|
|
|
);
|
|
|
|
|
|
|
|
// SITE_COMPONENT_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_COMPONENT_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'site.component', 'site'
|
|
|
|
);
|
|
|
|
|
|
|
|
// HELPER_EXEL
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELPER_EXEL')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setHelperExelMethods();
|
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// VIEWARRAY
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('VIEWARRAY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_EDIT_VIEW_ARRAY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('MAINMENUS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setMainMenus();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SUBMENU
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SUBMENU')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setSubMenus();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// GET_CRYPT_KEY
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('GET_CRYPT_KEY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('CONTRIBUTORS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->theContributors;
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// INSTALL
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('INSTALL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setInstall();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALL
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('UNINSTALL')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')]
|
|
|
|
= CFactory::_('Config')->component_code_name;
|
2018-03-18 04:52:07 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setDashboardIcons();
|
2016-09-11 15:27:04 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDICONACCESS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASHBOARDICONACCESS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setDashboardIconAccess();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_MODEL_METHODS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setDashboardModelMethods();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_GET_CUSTOM_DATA
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_GET_CUSTOM_DATA')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setDashboardGetCustomData();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASH_DISPLAY_DATA
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_DISPLAY_DATA')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setDashboardDisplayData();
|
2021-12-21 14:44:50 +00:00
|
|
|
|
|
|
|
// DASH_VIEW_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('dashboard.view', 'dashboard');
|
|
|
|
// DASH_VIEW_HTML_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_VIEW_HTML_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('dashboard.view.html', 'dashboard');
|
|
|
|
// DASH_MODEL_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_MODEL_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('dashboard.model', 'dashboard');
|
|
|
|
// DASH_CONTROLLER_HEADER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[CFactory::_('Config')->component_code_name][Placefix::_h('DASH_CONTROLLER_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('dashboard.controller', 'dashboard');
|
2018-03-09 03:26:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-22 19:01:36 +00:00
|
|
|
// DASHBOARDVIEW
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('DASHBOARDVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['import'][Placefix::_h('IMPORT_EXT_METHOD')]
|
|
|
|
= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
|
2020-04-23 21:15:07 +00:00
|
|
|
ComponentbuilderHelper::getDynamicScripts('ext'),
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-04-19 00:48:23 +00:00
|
|
|
);
|
|
|
|
// IMPORT_SETDATA_METHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['import'][Placefix::_h('IMPORT_SETDATA_METHOD')]
|
|
|
|
= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
|
2020-04-23 21:15:07 +00:00
|
|
|
ComponentbuilderHelper::getDynamicScripts('setdata'),
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-04-19 00:48:23 +00:00
|
|
|
);
|
|
|
|
// IMPORT_SAVE_METHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['import'][Placefix::_h('IMPORT_SAVE_METHOD')]
|
|
|
|
= PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
|
2020-04-23 21:15:07 +00:00
|
|
|
ComponentbuilderHelper::getDynamicScripts('save'),
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-04-19 00:48:23 +00:00
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_AJAX_TASK')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setRegisterAjaxTask('admin');
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_INPUT_RETURN')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setAjaxInputReturn('admin');
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the model header
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_ADMIN_MODEL_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('ajax.admin.model', 'ajax');
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_MODEL_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('REGISTER_SITE_AJAX_TASK')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setRegisterAjaxTask('site');
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_INPUT_RETURN')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setAjaxInputReturn('site');
|
2021-12-21 14:44:50 +00:00
|
|
|
// set the model header
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_HEADER')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->setFileHeader('ajax.site.model', 'ajax');
|
2017-12-14 23:10:47 +00:00
|
|
|
// set the module
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['ajax'][Placefix::_h('AJAX_SITE_MODEL_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('Name')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= ucfirst($rule);
|
2018-03-27 09:57:16 +00:00
|
|
|
// set the JFormRule PHP
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic['a_rule_zi_' . $rule][Placefix::_h('VALIDATION_RULE_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2016-02-26 00:20:09 +00:00
|
|
|
// for single views
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2016-02-26 00:20:09 +00:00
|
|
|
|
|
|
|
// set placeholder
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SView')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('sview')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SVIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('SVIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->CODE;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SViews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->Code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('sviews')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $view['settings']->code;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('SVIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$view['settings']->code],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_MENU_XML')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTEHELPER')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->setRouterHelp(
|
|
|
|
$view['settings']->code, $view['settings']->code, true
|
|
|
|
);
|
2020-11-17 04:06:34 +00:00
|
|
|
// build route details
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_PARSE_SWITCH')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->routerParseSwitch(
|
|
|
|
$view['settings']->code, $view
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEM')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEM <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewGetItem(
|
|
|
|
$view['settings']->main_get,
|
2022-08-30 15:28:41 +00:00
|
|
|
$view['settings']->code, Indent::_(2)
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEM <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEM')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('USER_PERMISSION_CHECK_ACCESS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setUserPermissionCheckAccess($view, 2);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_LIST_QUERY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_LIST_QUERY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewListQuery(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BEFORE_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BEFORE_GET_ITEMS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_GET_ITEMS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewGetItems(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_AFTER_GET_ITEMS <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_AFTER_GET_ITEMS')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= 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
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewCustomItemMethods(
|
|
|
|
$view['settings']->main_get, $view['settings']->code
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CUSTOM_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
.= $this->setCustomViewCustomMethods(
|
|
|
|
$view, $view['settings']->code
|
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_DIPLAY_METHOD <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_DIPLAY_METHOD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_EXTRA_DIPLAY_METHODS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewExtraDisplayMethods($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_CODE_BODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_CODE_BODY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewCodeBody($view);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_BODY <<<DYNAMIC>>>
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BODY')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_TOP_FORM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewForm(
|
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 1
|
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_BOTTOM_FORM')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewForm(
|
|
|
|
$view['settings']->code,
|
|
|
|
$view['settings']->main_get->gettype, 2
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-26 20:30:51 +00:00
|
|
|
'site.view.controller', $view['settings']->code
|
|
|
|
);
|
|
|
|
}
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_VIEW_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'site.view.model', $view['settings']->code
|
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'site.view.html', $view['settings']->code
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.view', $view['settings']->code
|
|
|
|
);
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEW_CONTROLLER_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-26 20:30:51 +00:00
|
|
|
'site.views.controller', $view['settings']->code
|
|
|
|
);
|
|
|
|
}
|
2020-10-21 03:10:19 +00:00
|
|
|
// SITE_VIEWS_MODEL_HEADER <<<DYNAMIC>>> add the header details for the model
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_MODEL_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-10-21 03:10:19 +00:00
|
|
|
'site.views.model', $view['settings']->code
|
|
|
|
);
|
2021-03-08 22:36:30 +00:00
|
|
|
// SITE_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HTML_HEADER')]
|
2021-03-08 22:36:30 +00:00
|
|
|
= $this->setFileHeader(
|
|
|
|
'site.views.html', $view['settings']->code
|
|
|
|
);
|
2020-11-29 00:00:20 +00:00
|
|
|
// SITE_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_VIEWS_HEADER')]
|
2020-12-26 20:28:36 +00:00
|
|
|
= $this->setFileHeader(
|
2020-11-29 00:00:20 +00:00
|
|
|
'site.views', $view['settings']->code
|
|
|
|
);
|
2020-10-21 03:10:19 +00:00
|
|
|
}
|
|
|
|
|
2022-08-30 15:28:41 +00:00
|
|
|
// for plugin event TODO change event api signatures
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
|
|
|
&$this->fileContentStatic,
|
|
|
|
&$this->fileContentDynamic[$view['settings']->code],
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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
|
|
|
|
$this->removeSiteFolder = true;
|
|
|
|
}
|
|
|
|
// load the site statics
|
|
|
|
if (!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
|
|
|
{
|
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
|
2020-03-28 13:34:14 +00:00
|
|
|
if (!isset(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2017-08-20 17:52:35 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= '';
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_CUSTOM_HELPER_SCRIPT')]
|
|
|
|
= CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_helper_site'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
2022-08-30 15:28:41 +00:00
|
|
|
if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')]))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')] = '';
|
2021-12-21 14:44:50 +00:00
|
|
|
}
|
2022-08-30 15:28:41 +00:00
|
|
|
if (!isset($this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]))
|
2021-12-21 14:44:50 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')]
|
2021-12-21 14:44:50 +00:00
|
|
|
.= PHP_EOL . PHP_EOL . '// Trigger the Global Site Event';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT')]
|
|
|
|
.= PHP_EOL . $this->fileContentStatic[Placefix::_h('Component')]
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'Helper::globalEvent($document);';
|
2018-05-22 19:01:36 +00:00
|
|
|
// SITE_GLOBAL_EVENT_HELPER
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . PHP_EOL . Indent::_(1) . '/**';
|
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1)
|
2020-03-28 13:34:14 +00:00
|
|
|
. '* The Global Site Event Method.';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1) . '**/';
|
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1)
|
2020-03-28 13:34:14 +00:00
|
|
|
. 'public static function globalEvent($document)';
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . Indent::_(1) . '{';
|
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_GLOBAL_EVENT_HELPER')]
|
|
|
|
.= PHP_EOL . CFactory::_('Placeholder')->update(
|
2022-08-31 11:49:01 +00:00
|
|
|
CFactory::_('Customcode.Dispenser')->hub['component_php_site_event'],
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active
|
2020-03-28 13:34:14 +00:00
|
|
|
);
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('PREINSTALLSCRIPT')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= CFactory::_('Customcode.Dispenser')->get(
|
2020-03-28 13:34:14 +00:00
|
|
|
'php_preflight', 'install', PHP_EOL, null, true
|
|
|
|
);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// PREUPDATESCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('PREUPDATESCRIPT')]
|
2022-08-31 11:49:01 +00:00
|
|
|
= CFactory::_('Customcode.Dispenser')->get(
|
2020-03-28 13:34:14 +00:00
|
|
|
'php_preflight', 'update', PHP_EOL, null, true
|
|
|
|
);
|
2016-10-23 22:48:26 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTINSTALLSCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('POSTINSTALLSCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setPostInstallScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// POSTUPDATESCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('POSTUPDATESCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setPostUpdateScript();
|
2016-02-26 00:20:09 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// UNINSTALLSCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('UNINSTALLSCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setUninstallScript();
|
2017-12-14 23:10:47 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSSCRIPT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('MOVEFOLDERSSCRIPT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setMoveFolderScript();
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// MOVEFOLDERSMETHOD
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('MOVEFOLDERSMETHOD')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setMoveFolderMethod();
|
2018-02-28 02:27:03 +00:00
|
|
|
|
2018-05-22 19:01:36 +00:00
|
|
|
// HELPER_UIKIT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('HELPER_UIKIT')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setUikitHelperMethods();
|
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
|
|
|
$this->fileContentStatic[Placefix::_h('CONFIG_FIELDSETS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 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
|
2020-03-28 13:34:14 +00:00
|
|
|
if (!isset(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
)
|
2022-03-09 23:46:45 +00:00
|
|
|
|| !StringHelper::check(
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
))
|
2016-02-26 00:20:09 +00:00
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= 0;
|
2016-02-26 00:20:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
|
|
|
|
= '(' . $this->fileContentStatic[Placefix::_h('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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('README')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] = '';
|
|
|
|
$this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] = '';
|
|
|
|
$this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] = '';
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$power->key][Placefix::_h('POWERCODE')]
|
2021-12-21 14:44:50 +00:00
|
|
|
= $this->getPowerCode($power);
|
|
|
|
// build the autoloader
|
|
|
|
$autoloader[implode('.', $power->_namespace_prefix)] = $power->_namespace_prefix;
|
|
|
|
// 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
|
|
|
|
$this->setPowersAutoloader($autoloader, (!$this->removeSiteFolder || !$this->removeSiteEditFolder));
|
|
|
|
}
|
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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('MODCODE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->getModCode($module);
|
2019-12-06 05:31:32 +00:00
|
|
|
// DYNAMICGET
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('DYNAMICGETS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->setCustomViewCustomMethods(
|
|
|
|
$module, $module->key
|
|
|
|
);
|
2019-12-06 05:31:32 +00:00
|
|
|
// HELPERCODE
|
|
|
|
if ($module->add_class_helper >= 1)
|
|
|
|
{
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('HELPERCODE')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->getModHelperCode($module);
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
// MODDEFAULT
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('MODDEFAULT')]
|
2020-11-06 05:06:38 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('INSTALLCLASS')]
|
2022-09-10 08:16:44 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('FIELDSET_'
|
|
|
|
. $file . $field_name . $fieldset)]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->getExtensionFieldsetXML(
|
|
|
|
$module, $fields
|
|
|
|
);
|
2019-12-06 05:31:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MAINXML
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$module->key][Placefix::_h('MAINXML')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$plugin->key][Placefix::_h('MAINCLASS')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->getPluginMainClass($plugin);
|
2019-08-04 22:38:53 +00:00
|
|
|
// only add install script if needed
|
|
|
|
if ($plugin->add_install_script)
|
|
|
|
{
|
|
|
|
// INSTALLCLASS
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$plugin->key][Placefix::_h('INSTALLCLASS')]
|
2022-09-10 08:16:44 +00:00
|
|
|
= 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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$plugin->key][Placefix::_h(
|
|
|
|
'FIELDSET_' . $file . $field_name . $fieldset)]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $this->getExtensionFieldsetXML(
|
|
|
|
$plugin, $fields
|
|
|
|
);
|
2019-08-22 01:54:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-04 22:38:53 +00:00
|
|
|
// MAINXML
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$plugin->key][Placefix::_h('MAINXML')]
|
2020-03-28 13:34:14 +00:00
|
|
|
= $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
|
|
|
|
$this->placeholders = CFactory::_('Placeholder')->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,
|
2021-12-21 14:44:50 +00:00
|
|
|
&$this->fileContentStatic, &$this->fileContentDynamic,
|
|
|
|
&$this->placeholders, &$this->hhh)
|
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::_('Placeholder')->active = $this->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');
|
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-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('view')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameSingleCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('View')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_single_first_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_single_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('view')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameSingleCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('View')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_single_first_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('VIEW')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('views')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameListCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('Views')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_list_first_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_list_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('views')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameListCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('Views')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_list_first_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('view')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameSingleCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEW')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_single_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('View')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('view')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameSingleCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEW')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_single_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('View')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('views')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameListCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('VIEWS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_list_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameListCode][Placefix::_h('Views')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('views')]
|
2020-11-26 17:33:39 +00:00
|
|
|
= $nameListCode;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('VIEWS')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $name_list_uppercase;
|
2022-08-30 15:28:41 +00:00
|
|
|
$this->fileContentDynamic[$nameSingleCode][Placefix::_h('Views')]
|
2020-11-17 04:06:34 +00:00
|
|
|
= $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
|
2020-03-28 13:34:14 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
|
|
|
&& $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
|
2020-03-28 13:34:14 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
|
|
|
&& $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)
|
|
|
|
{
|
2020-03-28 13:34:14 +00:00
|
|
|
if ($this->removeSiteFolder
|
|
|
|
&& $this->removeSiteEditFolder)
|
2017-04-05 13:21:10 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$p = 'site';
|
|
|
|
}
|
|
|
|
if (strpos($area, 'sys') !== false)
|
|
|
|
{
|
|
|
|
$t = '.sys';
|
|
|
|
}
|
|
|
|
// build the 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
|
|
|
}
|
2020-03-28 13:34:14 +00:00
|
|
|
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
|
|
|
&& 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
|
|
|
}
|