Adds new Content class. Adds the intial Package Classes. Removed phpseclib.

This commit is contained in:
Llewellyn van der Merwe 2022-12-04 11:23:43 +02:00
parent 6c42b5af61
commit 4217b22f67
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
174 changed files with 2091 additions and 38444 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.12) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.13) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -140,14 +140,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th November, 2022
+ *Version*: 3.1.12
+ *Last Build*: 4th December, 2022
+ *Version*: 3.1.13
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **335381**
+ *Field count*: **2004**
+ *File count*: **2192**
+ *Folder count*: **383**
+ *Line count*: **336766**
+ *Field count*: **2009**
+ *File count*: **2204**
+ *Folder count*: **387**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.12) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.13) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -140,14 +140,14 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th November, 2022
+ *Version*: 3.1.12
+ *Last Build*: 4th December, 2022
+ *Version*: 3.1.13
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **335381**
+ *Field count*: **2004**
+ *File count*: **2192**
+ *Folder count*: **383**
+ *Line count*: **336766**
+ *Field count*: **2009**
+ *File count*: **2204**
+ *Folder count*: **387**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -105,7 +105,7 @@ class Compiler extends Infusion
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/'
. $this->fileContentStatic[Placefix::_h('component')] . '.xml';
. CFactory::_('Content')->get('component') . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents(
$xmlPath
);
@ -632,7 +632,7 @@ class Compiler extends Infusion
array(&$this->componentContext, &$name, &$path, &$bom, &$view)
);
// set the file name
$this->fileContentStatic[Placefix::_h('FILENAME')] = $name;
CFactory::_('Content')->set('FILENAME', $name);
// check if the file should get PHP opening
$php = '';
if (ComponentbuilderHelper::checkFileType($name, 'php'))
@ -656,7 +656,7 @@ class Compiler extends Infusion
$string = $php . $bom . $code;
}
// set the answer
$answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic, 3);
$answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active, 3);
// set the dynamic answer
if ($view)
{
@ -805,21 +805,15 @@ class Compiler extends Infusion
$value = '@update number ' . $value . ' of this MVC';
}
}
$this->fileContentStatic[$key] = $value;
CFactory::_('Content')->set($key, $value);
}
return true;
}
// else insure to reset to global
$this->fileContentStatic[Placefix::_h('CREATIONDATE')]
= $this->fileContentStatic[Placefix::_h('CREATIONDATE')
. 'GLOBAL'];
$this->fileContentStatic[Placefix::_h('BUILDDATE')]
= $this->fileContentStatic[Placefix::_h('BUILDDATE')
. 'GLOBAL'];
$this->fileContentStatic[Placefix::_h('VERSION')]
= $this->fileContentStatic[Placefix::_h('VERSION')
. 'GLOBAL'];
CFactory::_('Content')->set('CREATIONDATE', CFactory::_('Content')->get('GLOBALCREATIONDATE'));
CFactory::_('Content')->set('BUILDDATE', CFactory::_('Content')->get('GLOBALBUILDDATE'));
CFactory::_('Content')->set('VERSION', CFactory::_('Content')->get('GLOBALVERSION'));
}
// set all global numbers
@ -883,10 +877,8 @@ class Compiler extends Infusion
private function setReadMe($path)
{
// set readme data if not set already
if (!isset(
$this->fileContentStatic[Placefix::_h('LINE_COUNT')]
)
|| $this->fileContentStatic[Placefix::_h('LINE_COUNT')]
if (!CFactory::_('Content')->exist('LINE_COUNT')
|| CFactory::_('Content')->get('LINE_COUNT')
!= $this->lineCount)
{
$this->buildReadMeData();
@ -894,7 +886,7 @@ class Compiler extends Infusion
// get the file
$string = ComponentbuilderHelper::getFileContents($path);
// update the file
$answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic);
$answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active);
// add to zip array
$this->writeFile($path, $answer);
}
@ -902,72 +894,39 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// set some defaults
$this->fileContentStatic[Placefix::_h('LINE_COUNT')]
= $this->lineCount;
$this->fileContentStatic[Placefix::_h('FIELD_COUNT')]
= $this->fieldCount;
$this->fileContentStatic[Placefix::_h('FILE_COUNT')]
= $this->fileCount;
$this->fileContentStatic[Placefix::_h('FOLDER_COUNT')]
= $this->folderCount;
$this->fileContentStatic[Placefix::_h('PAGE_COUNT')]
= $this->pageCount;
$this->fileContentStatic[Placefix::_h('folders')]
= $this->folderSeconds;
$this->fileContentStatic[Placefix::_h('foldersSeconds')]
= $this->folderSeconds;
$this->fileContentStatic[Placefix::_h('files')]
= $this->fileSeconds;
$this->fileContentStatic[Placefix::_h('filesSeconds')]
= $this->fileSeconds;
$this->fileContentStatic[Placefix::_h('lines')]
= $this->lineSeconds;
$this->fileContentStatic[Placefix::_h('linesSeconds')]
= $this->lineSeconds;
$this->fileContentStatic[Placefix::_h('seconds')]
= $this->actualSeconds;
$this->fileContentStatic[Placefix::_h('actualSeconds')]
= $this->actualSeconds;
$this->fileContentStatic[Placefix::_h('totalHours')]
= $this->totalHours;
$this->fileContentStatic[Placefix::_h('totalDays')]
= $this->totalDays;
$this->fileContentStatic[Placefix::_h('debugging')]
= $this->secondsDebugging;
$this->fileContentStatic[Placefix::_h('secondsDebugging')]
= $this->secondsDebugging;
$this->fileContentStatic[Placefix::_h('planning')]
= $this->secondsPlanning;
$this->fileContentStatic[Placefix::_h('secondsPlanning')]
= $this->secondsPlanning;
$this->fileContentStatic[Placefix::_h('mapping')]
= $this->secondsMapping;
$this->fileContentStatic[Placefix::_h('secondsMapping')]
= $this->secondsMapping;
$this->fileContentStatic[Placefix::_h('office')]
= $this->secondsOffice;
$this->fileContentStatic[Placefix::_h('secondsOffice')]
= $this->secondsOffice;
$this->fileContentStatic[Placefix::_h('actualTotalHours')]
= $this->actualTotalHours;
$this->fileContentStatic[Placefix::_h('actualTotalDays')]
= $this->actualTotalDays;
$this->fileContentStatic[Placefix::_h('debuggingHours')]
= $this->debuggingHours;
$this->fileContentStatic[Placefix::_h('planningHours')]
= $this->planningHours;
$this->fileContentStatic[Placefix::_h('mappingHours')]
= $this->mappingHours;
$this->fileContentStatic[Placefix::_h('officeHours')]
= $this->officeHours;
$this->fileContentStatic[Placefix::_h('actualHoursSpent')]
= $this->actualHoursSpent;
$this->fileContentStatic[Placefix::_h('actualDaysSpent')]
= $this->actualDaysSpent;
$this->fileContentStatic[Placefix::_h('projectWeekTime')]
= $this->projectWeekTime;
$this->fileContentStatic[Placefix::_h('projectMonthTime')]
= $this->projectMonthTime;
CFactory::_('Content')->set('LINE_COUNT', $this->lineCount);
CFactory::_('Content')->set('FIELD_COUNT', $this->fieldCount);
CFactory::_('Content')->set('FILE_COUNT', $this->fileCount);
CFactory::_('Content')->set('FOLDER_COUNT', $this->folderCount);
CFactory::_('Content')->set('PAGE_COUNT', $this->pageCount);
CFactory::_('Content')->set('folders', $this->folderSeconds);
CFactory::_('Content')->set('foldersSeconds', $this->folderSeconds);
CFactory::_('Content')->set('files', $this->fileSeconds);
CFactory::_('Content')->set('filesSeconds', $this->fileSeconds);
CFactory::_('Content')->set('lines', $this->lineSeconds);
CFactory::_('Content')->set('linesSeconds', $this->lineSeconds);
CFactory::_('Content')->set('seconds', $this->actualSeconds);
CFactory::_('Content')->set('actualSeconds', $this->actualSeconds);
CFactory::_('Content')->set('totalHours', $this->totalHours);
CFactory::_('Content')->set('totalDays', $this->totalDays);
CFactory::_('Content')->set('debugging', $this->secondsDebugging);
CFactory::_('Content')->set('secondsDebugging', $this->secondsDebugging);
CFactory::_('Content')->set('planning', $this->secondsPlanning);
CFactory::_('Content')->set('secondsPlanning', $this->secondsPlanning);
CFactory::_('Content')->set('mapping', $this->secondsMapping);
CFactory::_('Content')->set('secondsMapping', $this->secondsMapping);
CFactory::_('Content')->set('office', $this->secondsOffice);
CFactory::_('Content')->set('secondsOffice', $this->secondsOffice);
CFactory::_('Content')->set('actualTotalHours', $this->actualTotalHours);
CFactory::_('Content')->set('actualTotalDays', $this->actualTotalDays);
CFactory::_('Content')->set('debuggingHours', $this->debuggingHours);
CFactory::_('Content')->set('planningHours', $this->planningHours);
CFactory::_('Content')->set('mappingHours', $this->mappingHours);
CFactory::_('Content')->set('officeHours', $this->officeHours);
CFactory::_('Content')->set('actualHoursSpent', $this->actualHoursSpent);
CFactory::_('Content')->set('actualDaysSpent', $this->actualDaysSpent);
CFactory::_('Content')->set('projectWeekTime', $this->projectWeekTime);
CFactory::_('Content')->set('projectMonthTime', $this->projectMonthTime);
}
private function setLocalRepos()

View File

@ -240,6 +240,7 @@ class Structure extends Get
* Static File Content
*
* @var array
* @deprecated 3.3 Use CFactory::_('Content')->active
*/
public $fileContentStatic = array();
@ -277,6 +278,7 @@ class Structure extends Get
* Dynamic File Content
*
* @var array
* @deprecated 3.3 Use CFactory::_('Content')->_active
*/
public $fileContentDynamic = array();
@ -382,23 +384,17 @@ class Structure extends Get
// set the standard admin file
$this->stdRootFiles[] = $this->componentData->name_code . '.php';
// set incase no extra admin folder are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FOLDERS')]
= '';
CFactory::_('Content')->set('EXSTRA_ADMIN_FOLDERS', '');
// set incase no extra site folder are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FOLDERS')]
= '';
CFactory::_('Content')->set('EXSTRA_SITE_FOLDERS', '');
// set incase no extra media folder are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')]
= '';
CFactory::_('Content')->set('EXSTRA_MEDIA_FOLDERS', '');
// set incase no extra admin files are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')]
= '';
CFactory::_('Content')->set('EXSTRA_ADMIN_FILES', '');
// set incase no extra site files are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FILES')]
= '';
CFactory::_('Content')->set('EXSTRA_SITE_FILES', '');
// set incase no extra media files are loaded
$this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FILES')]
= '';
CFactory::_('Content')->set('EXSTRA_MEDIA_FILES', '');
// run global updater
ComponentbuilderHelper::runGlobalUpdater();
// set the template path
@ -1701,9 +1697,9 @@ class Structure extends Get
if ($addLocalFolder)
{
// add folder to xml of media folders
$this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')]
.= PHP_EOL . Indent::_(2) . "<folder>"
. $libFolder . "</folder>";
CFactory::_('Content')->add('EXSTRA_MEDIA_FOLDERS',
PHP_EOL . Indent::_(2) . "<folder>"
. $libFolder . "</folder>");
}
}
// if config fields are found load into component config (avoiding duplicates)
@ -2283,12 +2279,13 @@ class Structure extends Get
$eTab = Indent::_(3);
}
// set the xml file
$this->fileContentStatic[Placefix::_h('EXSTRA_'
. StringHelper::safe(
$checker[0], 'U'
) . '_' . $eNAME)]
.= PHP_EOL . $eTab . "<" . $ename . ">"
. $checker[1] . "</" . $ename . ">";
$key_ = 'EXSTRA_'
. StringHelper::safe(
$checker[0], 'U'
) . '_' . $eNAME;
CFactory::_('Content')->add($key_,
PHP_EOL . $eTab . "<" . $ename . ">"
. $checker[1] . "</" . $ename . ">");
}
}
}

View File

@ -29,7 +29,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
class Fields extends Structure
{
/**
* Metadate Switch
*
@ -5386,7 +5385,7 @@ class Fields extends Structure
) : 'com_' . CFactory::_('Config')->component_code_name,
// set the generic values
Placefix::_('component') => CFactory::_('Config')->component_code_name,
Placefix::_('Component') => $this->fileContentStatic[Placefix::_h('Component')],
Placefix::_('Component') => CFactory::_('Content')->get('Component'),
Placefix::_('view') => (isset($data['custom']['view'])
&& StringHelper::check(
$data['custom']['view']

View File

@ -271,7 +271,7 @@ class Interpretation extends Fields
{
// set email helper in place with component name
$component = CFactory::_('Config')->component_code_name;
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
$target = array('admin' => 'emailer');
$done = $this->buildDynamique($target, 'emailer', $component);
if ($done)
@ -297,36 +297,27 @@ class Interpretation extends Fields
if ($this->componentData->add_license
&& $this->componentData->license_type == 3)
{
if (!isset(
$this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
))
if (!CFactory::_('Content')->exist('HELPER_SITE_LICENSE_LOCK'))
{
$_WHMCS = '_' . StringHelper::safe(
$this->uniquekey(10), 'U'
);
// add it to the system
$this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
= $this->setHelperLicenseLock($_WHMCS, 'site');
$this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')]
= $this->setHelperLicenseLock($_WHMCS, 'admin');
$this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')]
= $this->setInitLicenseLock($_WHMCS);
$this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')]
= PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS
. '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));';
CFactory::_('Content')->set('HELPER_SITE_LICENSE_LOCK', $this->setHelperLicenseLock($_WHMCS, 'site'));
CFactory::_('Content')->set('HELPER_LICENSE_LOCK', $this->setHelperLicenseLock($_WHMCS, 'admin'));
CFactory::_('Content')->set('LICENSE_LOCKED_INT', $this->setInitLicenseLock($_WHMCS));
CFactory::_('Content')->set('LICENSE_LOCKED_DEFINED',
PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS
. '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));');
}
}
else
{
// don't add it to the system
$this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
= '';
$this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')]
= '';
$this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')]
= '';
$this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')]
= '';
CFactory::_('Content')->set('HELPER_SITE_LICENSE_LOCK', '');
CFactory::_('Content')->set('HELPER_LICENSE_LOCK', '');
CFactory::_('Content')->set('LICENSE_LOCKED_INT', '');
CFactory::_('Content')->set('LICENSE_LOCKED_DEFINED', '');
}
}
@ -496,7 +487,7 @@ class Interpretation extends Fields
$init[] = PHP_EOL . "if (!defined('" . $_WHMCS . "'))";
$init[] = "{";
$init[] = Indent::_(1) . "\$allow = "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::isGenuine();";
$init[] = Indent::_(1) . "if (\$allow)";
$init[] = Indent::_(1) . "{";
@ -819,8 +810,7 @@ class Interpretation extends Fields
public function setGetCryptKey()
{
// WHMCS_ENCRYPT_FILE
$this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')]
= '';
CFactory::_('Content')->set('WHMCS_ENCRYPT_FILE', '');
// check if encryption is ative
if ((isset($this->basicFieldModeling)
&& ArrayHelper::check(
@ -847,8 +837,7 @@ class Interpretation extends Fields
$this->fileContentDynamic['whmcs'][Placefix::_h('WHMCS_ENCRYPTION_BODY')]
= $this->setWHMCSCryption();
// ENCRYPT_FILE
$this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')]
= PHP_EOL . Indent::_(3) . "<filename>whmcs.php</filename>";
CFactory::_('Content')->set('WHMCS_ENCRYPT_FILE', PHP_EOL . Indent::_(3) . "<filename>whmcs.php</filename>");
}
// get component name
$component = CFactory::_('Config')->component_code_name;
@ -1158,20 +1147,18 @@ class Interpretation extends Fields
$updateServer[] = Indent::_(2)
. '<server type="extension" enabled="1" element="com_'
. CFactory::_('Config')->component_code_name . '" name="'
. $this->fileContentStatic[Placefix::_h('Component_name')] . '">' . $this->componentData->update_server_url
. CFactory::_('Content')->get('Component_name') . '">' . $this->componentData->update_server_url
. '</server>';
$updateServer[] = Indent::_(1) . '</updateservers>';
// return the array to string
$updateServer = implode(PHP_EOL, $updateServer);
// add update server details to component XML file
$this->fileContentStatic[Placefix::_h('UPDATESERVER')]
= $updateServer;
CFactory::_('Content')->set('UPDATESERVER', $updateServer);
}
else
{
// add update server details to component XML file
$this->fileContentStatic[Placefix::_h('UPDATESERVER')]
= '';
CFactory::_('Content')->set('UPDATESERVER', '');
}
// ensure to update Component version data
if (ArrayHelper::check($this->updateSQLBuilder))
@ -1364,9 +1351,9 @@ class Interpretation extends Fields
// build update xml
$updateXML[] = Indent::_(1) . "<update>";
$updateXML[] = Indent::_(2) . "<name>"
. $this->fileContentStatic[Placefix::_h('Component_name')] . "</name>";
. CFactory::_('Content')->get('Component_name') . "</name>";
$updateXML[] = Indent::_(2) . "<description>"
. $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] . "</description>";
. CFactory::_('Content')->get('SHORT_DESCRIPTION') . "</description>";
$updateXML[] = Indent::_(2) . "<element>$u_element</element>";
$updateXML[] = Indent::_(2) . "<type>$u_server_type</type>";
// check if we should add the target client value
@ -1377,7 +1364,7 @@ class Interpretation extends Fields
$updateXML[] = Indent::_(2) . "<version>" . $update['version']
. "</version>";
$updateXML[] = Indent::_(2) . '<infourl title="'
. $this->fileContentStatic[Placefix::_h('Component_name')] . '!">' . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . '</infourl>';
. CFactory::_('Content')->get('Component_name') . '!">' . CFactory::_('Content')->get('AUTHORWEBSITE') . '</infourl>';
$updateXML[] = Indent::_(2) . "<downloads>";
if (!isset($update['url'])
|| !StringHelper::check(
@ -1394,10 +1381,10 @@ class Interpretation extends Fields
$updateXML[] = Indent::_(3) . "<tag>$u_state</tag>";
$updateXML[] = Indent::_(2) . "</tags>";
$updateXML[] = Indent::_(2) . "<maintainer>"
. $this->fileContentStatic[Placefix::_h('AUTHOR')]
. CFactory::_('Content')->get('AUTHOR')
. "</maintainer>";
$updateXML[] = Indent::_(2) . "<maintainerurl>"
. $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . "</maintainerurl>";
. CFactory::_('Content')->get('AUTHORWEBSITE') . "</maintainerurl>";
$updateXML[] = Indent::_(2)
. '<targetplatform name="joomla" version="' . $u_target_version . '"/>';
$updateXML[] = Indent::_(1) . "</update>";
@ -1437,11 +1424,9 @@ class Interpretation extends Fields
if ($admindone && $sitedone)
{
// HELP
$this->fileContentStatic[Placefix::_h('HELP')]
= $this->setHelp(1);
CFactory::_('Content')->set('HELP', $this->setHelp(1));
// HELP_SITE
$this->fileContentStatic[Placefix::_h('HELP_SITE')]
= $this->setHelp(2);
CFactory::_('Content')->set('HELP_SITE', $this->setHelp(2));
// to make sure the file is updated TODO
$this->fileContentDynamic['help'][Placefix::_h('BLABLA')]
= 'blabla';
@ -1557,7 +1542,7 @@ class Interpretation extends Fields
if ($this->addEximport)
{
// we use the company name set in the GUI
$company_name = $this->fileContentStatic[Placefix::_h('COMPANYNAME')];
$company_name = CFactory::_('Content')->get('COMPANYNAME');
// start building the xml function
$exel = array();
$exel[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
@ -2313,7 +2298,7 @@ class Interpretation extends Fields
$xml .= PHP_EOL . Indent::_(1) . '<fields name="params">';
$xml .= PHP_EOL . Indent::_(2)
. '<fieldset name="basic" label="COM_'
. $this->fileContentStatic[Placefix::_h('COMPONENT')] . '"';
. CFactory::_('Content')->get('COMPONENT') . '"';
$xml .= PHP_EOL . Indent::_(3)
. 'addrulepath="/administrator/components/com_'
. CFactory::_('Config')->component_code_name . '/models/rules"';
@ -2587,7 +2572,7 @@ class Interpretation extends Fields
$filter .= PHP_EOL . PHP_EOL . Indent::_(1)
. $tab . Indent::_(1) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(" . $string . "->"
. $field . "))";
$filter .= PHP_EOL . Indent::_(1) . $tab
@ -2640,7 +2625,7 @@ class Interpretation extends Fields
. $as . " based on repeatable value";
$filter .= PHP_EOL . Indent::_(1) . $tab
. Indent::_(1) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkString(" . $string . "->"
. $field . "))";
$filter .= PHP_EOL . Indent::_(1) . $tab
@ -2651,7 +2636,7 @@ class Interpretation extends Fields
. $string . "->" . $field . ",true);";
$filter .= PHP_EOL . Indent::_(2) . $tab
. Indent::_(1) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$array))";
$filter .= PHP_EOL . Indent::_(2) . $tab
. Indent::_(1) . "{";
@ -2769,7 +2754,7 @@ class Interpretation extends Fields
if ('json' === $decode)
{
$if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "if (" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson("
. "if (" . CFactory::_('Content')->get('Component') . "Helper::checkJson("
. $string . "->" . $field . "))" . PHP_EOL
. Indent::_(1) . $tab . Indent::_(1) . "{";
// json_decode
@ -2869,7 +2854,7 @@ class Interpretation extends Fields
$fieldPrepare = '';
$runplugins = false;
// set component
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
// set context
$context = (isset($get['context'])) ? $get['context'] : $code;
$context = 'com_' . CFactory::_('Config')->component_code_name . '.' . $context;
@ -2969,7 +2954,7 @@ class Interpretation extends Fields
. $field . " has uikit components that must be loaded.";
$fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$this->uikitComp = "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getUikitComp(" . $string . "->"
. CFactory::_('Content')->get('Component') . "Helper::getUikitComp(" . $string . "->"
. $field . ",\$this->uikitComp);";
}
}
@ -3148,7 +3133,7 @@ class Interpretation extends Fields
. "\$array = " . $ter['state_key'] . ";";
$string .= PHP_EOL . Indent::_(2) . $tab
. "if (isset(\$array) && "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$array))";
$string .= PHP_EOL . Indent::_(2) . $tab . "{";
$string .= PHP_EOL . Indent::_(2) . $tab
@ -3177,7 +3162,7 @@ class Interpretation extends Fields
. "\$checkValue = " . $ter['state_key'] . ";";
$string .= PHP_EOL . Indent::_(2) . $tab
. "if (isset(\$checkValue) && "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkString(\$checkValue))";
$string .= PHP_EOL . Indent::_(2) . $tab . "{";
$string .= PHP_EOL . Indent::_(2) . $tab
@ -3395,7 +3380,7 @@ class Interpretation extends Fields
|| $whe['operator'] === 'NOT IN')
{
$string = "if (isset(" . $whe['value_key'] . ") && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray("
. CFactory::_('Content')->get('Component') . "Helper::checkArray("
. $whe['value_key'] . "))";
$string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "{";
@ -3526,10 +3511,8 @@ class Interpretation extends Fields
break;
}
// check that the default and the redirect page is not the same
if (isset(
$this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
)
&& $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $view['settings']->code)
if (CFactory::_('Content')->exist('SITE_DEFAULT_VIEW')
&& CFactory::_('Content')->get('SITE_DEFAULT_VIEW') != $view['settings']->code)
{
$redirectMessage = Indent::_(3) . "//" . Line::_(
__LINE__,__CLASS__
@ -3537,7 +3520,7 @@ class Interpretation extends Fields
. " redirect away to the default view if no access allowed.";
$redirectString = "JRoute::_('index.php?option=com_"
. CFactory::_('Config')->component_code_name . "&view="
. $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')";
. CFactory::_('Content')->get('SITE_DEFAULT_VIEW') . "')";
}
else
{
@ -3711,14 +3694,12 @@ class Interpretation extends Fields
if ('site' === CFactory::_('Config')->build_target)
{
// check that the default and the redirect page is not the same
if (isset(
$this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
)
&& $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $code)
if (CFactory::_('Content')->exist('SITE_DEFAULT_VIEW')
&& CFactory::_('Content')->get('SITE_DEFAULT_VIEW') != $code)
{
$redirectString = "JRoute::_('index.php?option=com_"
. CFactory::_('Config')->component_code_name . "&view="
. $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')";
. CFactory::_('Content')->get('SITE_DEFAULT_VIEW') . "')";
}
else
{
@ -3819,7 +3800,7 @@ class Interpretation extends Fields
}
}
// set the scripts
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
$script = '';
foreach ($this->cryptionTypes as $cryptionType)
{
@ -4240,7 +4221,7 @@ class Interpretation extends Fields
$method .= PHP_EOL . Indent::_(1) . "{";
$method .= PHP_EOL . Indent::_(2)
. "if (isset(\$this->uikitComp) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$this->uikitComp))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$this->uikitComp))";
$method .= PHP_EOL . Indent::_(2) . "{";
$method .= PHP_EOL . Indent::_(3) . "return \$this->uikitComp;";
$method .= PHP_EOL . Indent::_(2) . "}";
@ -4337,7 +4318,7 @@ class Interpretation extends Fields
. $default['on_field']
. " is an array with values.";
$methods .= PHP_EOL . Indent::_(2) . "\$array = ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkJson(\$"
. $default['on_field']
. ", true)) ? json_decode(\$"
@ -4345,7 +4326,7 @@ class Interpretation extends Fields
. $default['on_field'] . ";";
$methods .= PHP_EOL . Indent::_(2)
. "if (isset(\$array) && "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$array, true))";
$methods .= PHP_EOL . Indent::_(2) . "{";
$methods .= PHP_EOL . Indent::_(3)
@ -4628,7 +4609,7 @@ class Interpretation extends Fields
$methods .= PHP_EOL . Indent::_(1) . "}";
// set the script if it was found
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
$script = '';
foreach ($this->cryptionTypes as $cryptionType)
{
@ -4840,7 +4821,7 @@ class Interpretation extends Fields
$this->siteDecrypt[$cryptionType][$code] = false;
}
// set the component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
// start load the get item
if (ObjectHelper::check($get))
{
@ -5188,7 +5169,7 @@ class Interpretation extends Fields
__LINE__,__CLASS__
) . " Process the content plugins.";
$method .= PHP_EOL . Indent::_(2) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$this->item))";
. CFactory::_('Content')->get('Component') . "Helper::checkObject(\$this->item))";
$method .= PHP_EOL . Indent::_(2) . "{";
$method .= PHP_EOL . Indent::_(3)
. "JPluginHelper::importPlugin('content');";
@ -5202,7 +5183,7 @@ class Interpretation extends Fields
) . " Check if item has params, or pass global params";
$method .= PHP_EOL . Indent::_(3)
. "\$params = (isset(\$this->item->params) && "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;";
// load the defaults
foreach (
@ -5355,7 +5336,7 @@ class Interpretation extends Fields
$addModule[] = Indent::_(3)
. "\$modules = JModuleHelper::getModules(\$position);";
$addModule[] = Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$modules, true))";
$addModule[] = Indent::_(3) . "{";
$addModule[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
@ -5374,13 +5355,13 @@ class Interpretation extends Fields
. " check if modules were found";
$addModule[] = Indent::_(2)
. "if (\$found && isset(\$this->setModules[\$position]) && "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$this->setModules[\$position]))";
$addModule[] = Indent::_(2) . "{";
$addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " set class";
$addModule[] = Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$class))";
. CFactory::_('Content')->get('Component') . "Helper::checkString(\$class))";
$addModule[] = Indent::_(3) . "{";
$addModule[] = Indent::_(4)
. "\$class = ' class=\"'.\$class.'\" ';";
@ -5544,7 +5525,7 @@ class Interpretation extends Fields
$buttons[] = $tab . Indent::_(2)
. "JToolBarHelper::custom('" . $viewCodeName . "."
. "dashboard', 'grid-2', '', 'COM_"
. $this->fileContentStatic[Placefix::_h('COMPONENT')]
. CFactory::_('Content')->get('COMPONENT')
. "_DASH', false);";
}
}
@ -6427,13 +6408,13 @@ class Interpretation extends Fields
{
case 'js':
return '$this->document->addScript(' . $JURI . '"' . $path
. '", (' . $this->fileContentStatic[Placefix::_h('Component')]
. '", (' . CFactory::_('Content')->get('Component')
. 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");';
break;
case 'css':
case 'less':
return '$this->document->addStyleSheet(' . $JURI . '"'
. $path . '", (' . $this->fileContentStatic[Placefix::_h('Component')]
. $path . '", (' . CFactory::_('Content')->get('Component')
. 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");';
break;
case 'php':
@ -6579,11 +6560,11 @@ class Interpretation extends Fields
. "\$uikitFieldComp = \$this->get('UikitComp');";
$setter .= PHP_EOL . $tabV . Indent::_(3)
. "if (isset(\$uikitFieldComp) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitFieldComp))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitFieldComp))";
$setter .= PHP_EOL . $tabV . Indent::_(3) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(4)
. "if (isset(\$uikitComp) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))";
$setter .= PHP_EOL . $tabV . Indent::_(4) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(5)
. "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);";
@ -6603,7 +6584,7 @@ class Interpretation extends Fields
. " Load the needed uikit components in this view.";
$setter .= PHP_EOL . $tabV . Indent::_(2)
. "if (\$uikit != 2 && isset(\$uikitComp) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))";
$setter .= PHP_EOL . $tabV . Indent::_(2) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_(
__LINE__,__CLASS__
@ -6617,7 +6598,7 @@ class Interpretation extends Fields
. "foreach (\$uikitComp as \$class)";
$setter .= PHP_EOL . $tabV . Indent::_(3) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)";
. CFactory::_('Content')->get('Component') . "Helper::\$uk_components[\$class] as \$name)";
$setter .= PHP_EOL . $tabV . Indent::_(4) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_(
__LINE__,__CLASS__
@ -6668,7 +6649,7 @@ class Interpretation extends Fields
. "\$uikitComp = \$this->get('UikitComp');";
$setter .= PHP_EOL . $tabV . Indent::_(2)
. "if (\$uikit != 2 && isset(\$uikitComp) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$uikitComp))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$uikitComp))";
$setter .= PHP_EOL . $tabV . Indent::_(2) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(3) . "//" . Line::_(
__LINE__,__CLASS__
@ -6677,7 +6658,7 @@ class Interpretation extends Fields
. "foreach (\$uikitComp as \$class)";
$setter .= PHP_EOL . $tabV . Indent::_(3) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(4) . "foreach ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::\$uk_components[\$class] as \$name)";
. CFactory::_('Content')->get('Component') . "Helper::\$uk_components[\$class] as \$name)";
$setter .= PHP_EOL . $tabV . Indent::_(4) . "{";
$setter .= PHP_EOL . $tabV . Indent::_(5) . "//" . Line::_(
__LINE__,__CLASS__
@ -7231,8 +7212,8 @@ class Interpretation extends Fields
{
$script = '';
// get the component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$component = $this->fileContentStatic[Placefix::_h('component')];
$Component = CFactory::_('Content')->get('Component');
$component = CFactory::_('Content')->get('component');
// go from base64 to string
if (isset($this->base64Builder[$view])
&& ArrayHelper::check($this->base64Builder[$view]))
@ -7439,7 +7420,7 @@ class Interpretation extends Fields
{
$script = '';
// get component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
$component = CFactory::_('Config')->component_code_name;
// check if there was script added before modeling of data
$script .= CFactory::_('Customcode.Dispenser')->get(
@ -7911,8 +7892,8 @@ class Interpretation extends Fields
{
$script .= PHP_EOL . Indent::_(3)
. 'echo \'<a target="_blank" href="'
. $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . '" title="'
. $this->fileContentStatic[Placefix::_h('Component_name')] . '">';
. CFactory::_('Content')->get('AUTHORWEBSITE') . '" title="'
. CFactory::_('Content')->get('Component_name') . '">';
$script .= PHP_EOL . Indent::_(4) . '<img src="components/com_'
. $component . '/assets/images/vdm-component.'
. $this->componentImageType . '"/>';
@ -7940,14 +7921,14 @@ class Interpretation extends Fields
{
$script .= PHP_EOL . Indent::_(3)
. 'echo \'<a target="_blank" href="'
. $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . '" title="'
. $this->fileContentStatic[Placefix::_h('Component_name')] . '">';
. CFactory::_('Content')->get('AUTHORWEBSITE') . '" title="'
. CFactory::_('Content')->get('Component_name') . '">';
$script .= PHP_EOL . Indent::_(4) . '<img src="components/com_'
. CFactory::_('Config')->component_code_name . '/assets/images/vdm-component.'
. $this->componentImageType . '"/>';
$script .= PHP_EOL . Indent::_(4) . '</a>';
$script .= PHP_EOL . Indent::_(4) . "<h3>Upgrade to Version "
. $this->fileContentStatic[Placefix::_h('ACTUALVERSION')]
. CFactory::_('Content')->get('ACTUALVERSION')
. " Was Successful! Let us know if anything is not working as expected.</h3>';";
}
@ -9068,11 +9049,9 @@ class Interpretation extends Fields
public function routerBuildViews(&$view)
{
if (isset(
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
)
if (CFactory::_('Content')->exist('ROUTER_BUILD_VIEWS')
&& StringHelper::check(
$this->fileContentStatic[Placefix::_h('ROUTER_BUILD_VIEWS')]
CFactory::_('Content')->get('ROUTER_BUILD_VIEWS')
))
{
return " || \$view === '" . $view . "'";
@ -9090,7 +9069,7 @@ class Interpretation extends Fields
$batchmove = array();
$VIEW = StringHelper::safe($nameSingleCode, 'U');
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// setup correct core target
$coreLoad = false;
if (isset($this->permissionCore[$nameSingleCode]))
@ -9337,7 +9316,7 @@ class Interpretation extends Fields
$batchcopy = array();
$VIEW = StringHelper::safe($nameSingleCode, 'U');
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// setup correct core target
$coreLoad = false;
if (isset($this->permissionCore[$nameSingleCode]))
@ -9860,7 +9839,7 @@ class Interpretation extends Fields
. "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))";
$fixUnique[] = Indent::_(4) . "{";
$fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_"
. $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');";
. CFactory::_('Content')->get('COMPONENT') . "_" . $VIEW . "_SAVE_WARNING');";
$fixUnique[] = Indent::_(4) . "}";
$fixUnique[] = PHP_EOL . Indent::_(4) . "list(" . implode(
'', $titleVars
@ -9879,7 +9858,7 @@ class Interpretation extends Fields
. "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))";
$fixUnique[] = Indent::_(4) . "{";
$fixUnique[] = Indent::_(5) . "\$msg = JText:" . ":_('COM_"
. $this->fileContentStatic[Placefix::_h('COMPONENT')] . "_" . $VIEW . "_SAVE_WARNING');";
. CFactory::_('Content')->get('COMPONENT') . "_" . $VIEW . "_SAVE_WARNING');";
$fixUnique[] = Indent::_(4) . "}";
$fixUnique[] = PHP_EOL . Indent::_(4) . "\$data['" . $alias
. "'] = \$this->_generateNewTitle(\$data['" . $alias
@ -9917,7 +9896,7 @@ class Interpretation extends Fields
$fixUnique[] = Indent::_(3)
. "\$uniqueFields = \$this->getUniqueFields();";
$fixUnique[] = Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$uniqueFields))";
$fixUnique[] = Indent::_(3) . "{";
$fixUnique[] = Indent::_(4)
@ -9940,7 +9919,7 @@ class Interpretation extends Fields
|| isset($this->customAliasBuilder[$nameSingleCode])))
{
// get component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
// rest the new function
$newFunction = array();
$newFunction[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
@ -11278,7 +11257,7 @@ class Interpretation extends Fields
if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null)
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// setup correct core target
$coreLoad = false;
$core = null;
@ -11767,14 +11746,14 @@ class Interpretation extends Fields
. $this->componentCodeName . '&view='
. $customLinkView['link'] . '&id=<?php echo $item->id; ?>'
. $ref . '" title="<?php echo JText:' . ':_(' . "'COM_"
. $this->fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME'] . "'"
. CFactory::_('Content')->get('COMPONENT') . '_' . $customLinkView['NAME'] . "'"
. '); ?>" ><span class="icon-' . $customLinkView['icon']
. '"></span></a>';
$customAdminViewButton .= PHP_EOL . Indent::_(3)
. "<?php else: ?>";
$customAdminViewButton .= PHP_EOL . Indent::_(4)
. '<a class="hasTooltip btn btn-mini disabled" href="#" title="<?php echo JText:'
. ':_(' . "'COM_" . $this->fileContentStatic[Placefix::_h('COMPONENT')] . '_' . $customLinkView['NAME']
. ':_(' . "'COM_" . CFactory::_('Content')->get('COMPONENT') . '_' . $customLinkView['NAME']
. "'" . '); ?>"><span class="icon-'
. $customLinkView['icon'] . '"></span></a>';
$customAdminViewButton .= PHP_EOL . Indent::_(3)
@ -13811,7 +13790,7 @@ class Interpretation extends Fields
$headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' check if return value was set';
$headerscript .= PHP_EOL . 'if ('
. $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::checkString($return))';
. CFactory::_('Content')->get('Component') . 'Helper::checkString($return))';
$headerscript .= PHP_EOL . '{';
$headerscript .= PHP_EOL . Indent::_(1) . '//' . Line::_(
__LINE__,__CLASS__
@ -13851,7 +13830,7 @@ class Interpretation extends Fields
$headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' load the action object';
$headerscript .= PHP_EOL . '$can = '
. $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::getActions(' . "'"
. CFactory::_('Content')->get('Component') . 'Helper::getActions(' . "'"
. $name_single_code . "'"
. ');';
}
@ -14061,7 +14040,7 @@ class Interpretation extends Fields
if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null)
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// make sure the custom links are only added once
$firstTimeBeingAdded = true;
// setup correct core target
@ -14251,7 +14230,7 @@ class Interpretation extends Fields
if (($items = CFactory::_('Registry')->get('builder.list.' . $nameListCode)) !== null)
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
$head = '';
// only add new button if set
if ($addNewButon > 0)
@ -14613,7 +14592,7 @@ class Interpretation extends Fields
if (!isset($this->fieldsNames[$nameSingleCode]['access']))
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// load the access filter query code
$query .= PHP_EOL . Indent::_(2) . "//" . Line::_(
__LINE__,__CLASS__
@ -14704,13 +14683,13 @@ class Interpretation extends Fields
// add the fixing strings method
$query .= $this->setGetItemsMethodStringFix(
$nameSingleCode, $nameListCode,
$this->fileContentStatic[Placefix::_h('Component')],
CFactory::_('Content')->get('Component'),
Indent::_(1)
);
// add translations
$query .= $this->setSelectionTranslationFix(
$nameListCode,
$this->fileContentStatic[Placefix::_h('Component')],
CFactory::_('Content')->get('Component'),
Indent::_(1)
);
// filter by child repetable field values
@ -14725,19 +14704,19 @@ class Interpretation extends Fields
__LINE__,__CLASS__
) . " Filter by " . $globalKey . " in this Repetable Field";
$query .= PHP_EOL . Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$this->"
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && isset(\$this->"
. $globalKey . "))";
$query .= PHP_EOL . Indent::_(3) . "{";
$query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
$query .= PHP_EOL . Indent::_(4) . "{";
$query .= PHP_EOL . Indent::_(5) . "if (isset(\$item->" . $field
. ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $field . "))";
. ") && " . CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $field . "))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6)
. "\$tmpArray = json_decode(\$item->" . $field . ",true);";
$query .= PHP_EOL . Indent::_(6) . "if (!isset(\$tmpArray['"
. $target . "']) || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$tmpArray['"
. $target . "']) || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$tmpArray['"
. $target . "']) || !in_array(\$this->" . $globalKey
. ", \$tmpArray['" . $target . "']))";
$query .= PHP_EOL . Indent::_(6) . "{";
@ -14770,7 +14749,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->"
. $globalKey . ";";
$query .= PHP_EOL . Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && \$" . $globalKey
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && \$" . $globalKey
. ")";
$query .= PHP_EOL . Indent::_(3) . "{";
$query .= PHP_EOL . Indent::_(4)
@ -14780,14 +14759,14 @@ class Interpretation extends Fields
if (StringHelper::check($target))
{
$query .= PHP_EOL . Indent::_(5) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $target
. CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $target
. "))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "\$item->" . $target
. " = json_decode(\$item->" . $target . ", true);";
$query .= PHP_EOL . Indent::_(5) . "}";
$query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->"
. $target . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->"
. $target . ") || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$item->"
. $target . "))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
@ -14799,13 +14778,13 @@ class Interpretation extends Fields
else
{
$query .= PHP_EOL . Indent::_(5) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $_key . "))";
. CFactory::_('Content')->get('Component') . "Helper::checkJson(\$item->" . $_key . "))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "\$item->" . $_key
. " = json_decode(\$item->" . $_key . ", true);";
$query .= PHP_EOL . Indent::_(5) . "}";
$query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->"
. $_key . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->"
. $_key . ") || !" . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$item->"
. $_key . "))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
@ -14839,8 +14818,8 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey
. " = json_decode(\$this->" . $globalKey . ",true);";
$query .= PHP_EOL . Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$"
. $globalKey . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$"
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && isset(\$"
. $globalKey . ") && " . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$"
. $globalKey . "))";
$query .= PHP_EOL . Indent::_(3) . "{";
$query .= PHP_EOL . Indent::_(4)
@ -14848,7 +14827,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(4) . "{";
$query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key
. " && isset(\$" . $globalKey . "['" . $target . "']) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['"
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "['"
. $target . "']))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key
@ -14883,8 +14862,8 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->"
. $globalKey . ";";
$query .= PHP_EOL . Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$items) && "
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "))";
$query .= PHP_EOL . Indent::_(3) . "{";
$query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
@ -14893,7 +14872,7 @@ class Interpretation extends Fields
if (StringHelper::check($target))
{
$query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key
. " && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['"
. " && " . CFactory::_('Content')->get('Component') . "Helper::checkArray(\$" . $globalKey . "['"
. $target . "']))";
$query .= PHP_EOL . Indent::_(5) . "{";
$query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->"
@ -14936,7 +14915,7 @@ class Interpretation extends Fields
// SELECTIONTRANSLATIONFIXFUNC<<<DYNAMIC>>>
$query .= $this->setSelectionTranslationFixFunc(
$nameListCode,
$this->fileContentStatic[Placefix::_h('Component')]
CFactory::_('Content')->get('Component')
);
// fixe mothod name clash
@ -15122,7 +15101,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " setup the query";
$query .= PHP_EOL . Indent::_(2) . "if ((\$pks_size = "
. $this->fileContentStatic[Placefix::_h('Component')]
. CFactory::_('Content')->get('Component')
. "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)";
$query .= PHP_EOL . Indent::_(2) . "{";
$query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
@ -15133,7 +15112,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the user object if not set.";
$query .= PHP_EOL . Indent::_(3) . "if (!isset(\$user) || !"
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))";
. CFactory::_('Content')->get('Component') . "Helper::checkObject(\$user))";
$query .= PHP_EOL . Indent::_(3) . "{";
$query .= PHP_EOL . Indent::_(4) . "\$user = JFactory::getUser();";
$query .= PHP_EOL . Indent::_(3) . "}";
@ -15288,7 +15267,7 @@ class Interpretation extends Fields
// set the string fixing code
$query .= $this->setGetItemsMethodStringFix(
$nameSingleCode, $nameListCode,
$this->fileContentStatic[Placefix::_h('Component')],
CFactory::_('Content')->get('Component'),
Indent::_(2), $isExport, true
);
// first check if we export of text only is avalable
@ -15296,7 +15275,7 @@ class Interpretation extends Fields
{
$query_translations = $this->setSelectionTranslationFix(
$nameListCode,
$this->fileContentStatic[Placefix::_h('Component')], Indent::_(3)
CFactory::_('Content')->get('Component'), Indent::_(3)
);
}
// add translations
@ -15396,12 +15375,12 @@ class Interpretation extends Fields
$method[] = Indent::_(3)
. "\$data = \$model->getExportData(\$pks);";
$method[] = Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$data))";
. CFactory::_('Content')->get('Component') . "Helper::checkArray(\$data))";
$method[] = Indent::_(3) . "{";
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " now set the data to the spreadsheet";
$method[] = Indent::_(4) . "\$date = JFactory::getDate();";
$method[] = Indent::_(4) . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::xls(\$data,'"
$method[] = Indent::_(4) . CFactory::_('Content')->get('Component') . "Helper::xls(\$data,'"
. StringHelper::safe($nameListCode, 'F')
. "_'.\$date->format('jS_F_Y'),'"
. StringHelper::safe($nameListCode, 'Ww')
@ -15448,7 +15427,7 @@ class Interpretation extends Fields
$method[] = Indent::_(3)
. "\$headers = \$model->getExImPortHeaders();";
$method[] = Indent::_(3) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$headers))";
. CFactory::_('Content')->get('Component') . "Helper::checkObject(\$headers))";
$method[] = Indent::_(3) . "{";
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load headers to session.";
@ -15711,7 +15690,7 @@ class Interpretation extends Fields
if (!isset($this->fieldsNames[$nameSingleCode]['access']))
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// load the access filter query code
$query .= PHP_EOL . Indent::_(2) . "//" . Line::_(
__LINE__,__CLASS__
@ -16051,7 +16030,7 @@ class Interpretation extends Fields
))
{
// component helper name
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
// start building the filter query
$filterQuery = "";
foreach ($this->filterBuilder[$nameListCode] as $filter)
@ -18384,7 +18363,7 @@ class Interpretation extends Fields
))
{
// get component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
// load the rest of the filters
foreach ($this->filterBuilder[$nameListCode] as $filter)
{
@ -18649,7 +18628,7 @@ class Interpretation extends Fields
$get_values = true;
}
// get component name
$Component = $this->fileContentStatic[Placefix::_h('Component')];
$Component = CFactory::_('Content')->get('Component');
// load the rest of the batch options
foreach ($this->filterBuilder[$nameListCode] as $filter)
{
@ -18946,15 +18925,12 @@ class Interpretation extends Fields
$includeHelper[] = Indent::_(2) . "include_once \$path;";
$includeHelper[] = Indent::_(1) . "}";
$includeHelper[] = "}";
$this->fileContentStatic[Placefix::_h('CATEGORY_CLASS_TREES')]
.= implode("\n", $includeHelper);
CFactory::_('Content')->add('CATEGORY_CLASS_TREES', implode("\n", $includeHelper));
}
// return category view string
if (isset(
$this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')]
)
if (CFactory::_('Content')->exist('ROUTER_CATEGORY_VIEWS')
&& StringHelper::check(
$this->fileContentStatic[Placefix::_h('ROUTER_CATEGORY_VIEWS')]
CFactory::_('Content')->get('ROUTER_CATEGORY_VIEWS')
))
{
return "," . PHP_EOL . Indent::_(3) . '"'
@ -20987,7 +20963,7 @@ class Interpretation extends Fields
$toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Built the actions for new and existing records.";
$toolBar .= PHP_EOL . Indent::_(2) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$this->referral))";
. CFactory::_('Content')->get('Component') . "Helper::checkString(\$this->referral))";
$toolBar .= PHP_EOL . Indent::_(2) . "{";
if ($coreLoad && isset($core['core.create'])
&& isset($this->permissionBuilder['global'][$core['core.create']])
@ -21226,10 +21202,10 @@ class Interpretation extends Fields
$toolBar .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set help url for this view if found";
$toolBar .= PHP_EOL . Indent::_(2) . "\$this->help_url = "
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getHelpUrl('" . $nameSingleCode
. CFactory::_('Content')->get('Component') . "Helper::getHelpUrl('" . $nameSingleCode
. "');";
$toolBar .= PHP_EOL . Indent::_(2) . "if ("
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$this->help_url))";
. CFactory::_('Content')->get('Component') . "Helper::checkString(\$this->help_url))";
$toolBar .= PHP_EOL . Indent::_(2) . "{";
$toolBar .= PHP_EOL . Indent::_(3) . "JToolbarHelper::help('"
. $this->langPrefix . "_HELP_MANAGER', false, \$this->help_url);";
@ -21635,7 +21611,7 @@ class Interpretation extends Fields
. "\$item->tags->getTagIds(";
$fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(4)
. "\$item->id, 'com_"
. $this->fileContentStatic[Placefix::_h('component')] . ".$nameSingleCode'";
. CFactory::_('Content')->get('component') . ".$nameSingleCode'";
$fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . ");";
$fix_access .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3)
. "if (\$item->tags->tags)";
@ -22069,7 +22045,7 @@ class Interpretation extends Fields
. " Get the user object if not set.";
$forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "if (!isset(\$user) || !"
. $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))";
. CFactory::_('Content')->get('Component') . "Helper::checkObject(\$user))";
$forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "{";
$forEachStart .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3)
@ -23105,7 +23081,7 @@ class Interpretation extends Fields
. "<?php echo JHtml::_('bootstrap.startAccordion', 'dashboard_right', array('active' => 'vdm')); ?>";
$display[] = $tab . Indent::_(2)
. "<?php echo JHtml::_('bootstrap.addSlide', 'dashboard_right', '"
. $this->fileContentStatic[Placefix::_h('COMPANYNAME')]
. CFactory::_('Content')->get('COMPANYNAME')
. "', 'vdm'); ?>";
$display[] = $tab . Indent::_(3)
. "<?php echo \$this->loadTemplate('vdm');?>";
@ -27940,8 +27916,8 @@ function vdm_dkim() {
public function getModCode(&$module)
{
// get component helper string
$Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$component = $this->fileContentStatic[Placefix::_h('component')];
$Helper = CFactory::_('Content')->get('Component') . 'Helper';
$component = CFactory::_('Content')->get('component');
$_helper = '';
// get libraries code
$libraries = array(Placefix::_('MOD_LIBRARIES') => $this->getModLibCode($module));
@ -27961,7 +27937,7 @@ function vdm_dkim() {
. "/helpers/" . $component . ".php');";
}
return CFactory::_('Placeholder')->update($_helper . PHP_EOL . $code . PHP_EOL, $this->fileContentStatic);
return CFactory::_('Placeholder')->update($_helper . PHP_EOL . $code . PHP_EOL, CFactory::_('Content')->active);
}
public function getModDefault(&$module, &$key)
@ -27983,7 +27959,7 @@ function vdm_dkim() {
);
// return the default content for the model default area
return CFactory::_('Placeholder')->update($default, $this->fileContentStatic);
return CFactory::_('Placeholder')->update($default, CFactory::_('Content')->active);
}
public function getModHelperCode(&$module)
@ -27993,7 +27969,7 @@ function vdm_dkim() {
$module->class_helper_type . $module->class_helper_name . PHP_EOL
. '{' . PHP_EOL .
$module->class_helper_code . PHP_EOL .
"}" . PHP_EOL, $this->fileContentStatic);
"}" . PHP_EOL, CFactory::_('Content')->active);
}
public function getModLibCode(&$module)
@ -28048,7 +28024,7 @@ function vdm_dkim() {
)
),
$this->placeholders
), $this->fileContentStatic);
), CFactory::_('Content')->active);
}
return '';
@ -28449,7 +28425,7 @@ function vdm_dkim() {
$plugin->class_name . ' extends ' .
$plugin->extends . PHP_EOL . '{' . PHP_EOL .
$plugin->main_class_code . PHP_EOL .
"}" . PHP_EOL, $this->fileContentStatic);
"}" . PHP_EOL, CFactory::_('Content')->active);
}
public function getPluginMainXML(&$plugin)
@ -28862,7 +28838,7 @@ function vdm_dkim() {
}
$code[] = '}' . PHP_EOL . PHP_EOL;
return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), $this->fileContentStatic);
return CFactory::_('Placeholder')->update(implode(PHP_EOL, $code), CFactory::_('Content')->active);
}
public function setPowersAutoloader($namespace, $loadSite)
@ -28870,7 +28846,7 @@ function vdm_dkim() {
if (($size = ArrayHelper::check($namespace)) > 0)
{
// check if we are using a plugin
$use_plugin = isset($this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')]);
$use_plugin = CFactory::_('Content')->exist('PLUGIN_POWER_AUTOLOADER');
// build the methods
$autoloadNotSiteMethod = array();
$autoloadMethod = array();
@ -28977,20 +28953,20 @@ function vdm_dkim() {
// check if we are using a plugin
if ($use_plugin)
{
$this->fileContentStatic[Placefix::_h('PLUGIN_POWER_AUTOLOADER')] = PHP_EOL . $autoloader;
CFactory::_('Content')->set('PLUGIN_POWER_AUTOLOADER', PHP_EOL . $autoloader);
}
else
{
// load to events placeholders
$this->fileContentStatic[Placefix::_h('ADMIN_POWER_HELPER')] .= $autoloader;
CFactory::_('Content')->add('ADMIN_POWER_HELPER', $autoloader);
// load to site if needed
if ($loadSite)
{
$this->fileContentStatic[Placefix::_h('SITE_POWER_HELPER')] .= $autoloader;
CFactory::_('Content')->add('SITE_POWER_HELPER', $autoloader);
}
}
// to add to custom files
$this->fileContentStatic[Placefix::_h('CUSTOM_POWER_AUTOLOADER')] .= PHP_EOL . implode(PHP_EOL, $autoloadMethod);
CFactory::_('Content')->add('CUSTOM_POWER_AUTOLOADER', PHP_EOL . implode(PHP_EOL, $autoloadMethod));
}
}

File diff suppressed because it is too large Load Diff

View File

@ -3799,7 +3799,7 @@ abstract class ComponentbuilderHelper
// make sure we have the composer classes loaded
self::composerAutoload('phpseclib');
// build class name
$CLASS = '\phpseclib\Crypt\\' . $type;
$CLASS = '\phpseclib3\Crypt\\' . $type;
// make sure we have the phpseclib classes
if (!class_exists($CLASS))
{
@ -3813,31 +3813,31 @@ abstract class ComponentbuilderHelper
switch ($mode)
{
case 'CTR':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CTR);
self::$CRYPT[$key] = new $CLASS('ctr');
break;
case 'ECB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_ECB);
self::$CRYPT[$key] = new $CLASS('ecb');
break;
case 'CBC':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC);
self::$CRYPT[$key] = new $CLASS('cbc');
break;
case 'CBC3':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC3);
self::$CRYPT[$key] = new $CLASS('cbc3');
break;
case 'CFB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB);
self::$CRYPT[$key] = new $CLASS('cfb');
break;
case 'CFB8':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB8);
self::$CRYPT[$key] = new $CLASS('cfb8');
break;
case 'OFB':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_OFB);
self::$CRYPT[$key] = new $CLASS('ofb');
break;
case 'GCM':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_GCM);
self::$CRYPT[$key] = new $CLASS('gcm');
break;
case 'STREAM':
self::$CRYPT[$key] = new $CLASS($CLASS::MODE_STREAM);
self::$CRYPT[$key] = new $CLASS('stream');
break;
default:
// No valid mode has been specified
@ -3848,7 +3848,7 @@ abstract class ComponentbuilderHelper
}
else
{
// set the
// set the default
self::$CRYPT[$key] = new $CLASS();
}
// return the object
@ -3958,7 +3958,7 @@ abstract class ComponentbuilderHelper
// make sure we have the composer classes loaded
self::composerAutoload('phpseclib');
// make sure we have the phpseclib classes
if (!class_exists('\phpseclib\Net\SFTP'))
if (!class_exists('\phpseclib3\Net\SFTP'))
{
// class not in place so send out error
JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error');
@ -3967,7 +3967,7 @@ abstract class ComponentbuilderHelper
// insure the port is set
$server->port = (isset($server->port) && is_numeric($server->port) && $server->port > 0) ? (int) $server->port : 22;
// open the connection
self::$sftp[$server->cache] = new phpseclib\Net\SFTP($server->host, $server->port);
self::$sftp[$server->cache] = new phpseclib3\Net\SFTP($server->host, $server->port);
// heads-up on protocol
self::$sftp[$server->cache]->jcb_protocol = 2; // SFTP <-- if called not knowing what type of protocol is being used
// now login based on authentication type

View File

@ -8011,13 +8011,29 @@ COM_COMPONENTBUILDER_POWERS_N_ITEMS_UNPUBLISHED_1="%s Power unpublished."
COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu"
COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power"
COM_COMPONENTBUILDER_POWER_ABSTRACT_CLASS="abstract class"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION="Library path to the autoload.php file"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT="custom_folder/vendor/autoload.php (must be in the .../public_html/library/ folder of Joomla)"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL="Access Point"
COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE="Error! Please add autoload full path here."
COM_COMPONENTBUILDER_POWER_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work."
COM_COMPONENTBUILDER_POWER_ADD_HEAD_LABEL="Add Custom Class Header"
COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION="The option to override the licensing template."
COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL="Add Licensing Template"
COM_COMPONENTBUILDER_POWER_AS_LABEL="as"
COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION="<p>Once you have manually pulled composer classes into your own custom folder in libraries area (via composer), you can link it here.</p>
<p>So this feature gives you the ability to add your own custom <b>composer</b> set of classes to your project. Yes, you will still have to manually pull them into your own custom and unique folder into the libraries area of Joomla (on this JCB development system). But you can link it here and JCB will take care of adding it to your component.</p>
<p>First and most importantly (due to obvious risk of collusion), avoid pulling classes into your custom set of composer classes that are already included in the Joomla vendor folder. Those classes that Joomla loads are already available to you. To use them, just add the <b>use Namespace;</b> of that class to the header of this power, and the PHP auto linker will take care of the rest.</p>
<p>So all composer projects =>(vendor folders) has an <code>autoload.php</code> file that is located in the root of the vendor folder. We call this the <b>access point</b> to that cluster of classes. This means you will have <b>one access point</b> for multiple namespaces.</p>
<p>Due the continued risk of collusion <b>we allow only one access point per/power</b>. But for even more peace of mind, it is best to have only one access point per/project. Which means you should try to consolidate your custom composer additional classes (outside of the Joomla vendor folder) into one vendor folder. This will result in <b>one access point</b>, that you will use multiple times for various powers.</p>"
COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL="When to use Autoloader Composer Powers?"
COM_COMPONENTBUILDER_POWER_CLASS="class"
COM_COMPONENTBUILDER_POWER_CODE="Code"
COM_COMPONENTBUILDER_POWER_COMPOSER="Composer"
COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL="Autoloader Composer Powers"
COM_COMPONENTBUILDER_POWER_CREATED_BY_DESC="The user that created this Power."
COM_COMPONENTBUILDER_POWER_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_POWER_CREATED_DATE_DESC="The date this Power was created."
@ -8135,7 +8151,9 @@ COM_COMPONENTBUILDER_POWER_TYPE_DESCRIPTION="The type of power being build"
COM_COMPONENTBUILDER_POWER_TYPE_LABEL="Type of Power"
COM_COMPONENTBUILDER_POWER_USE="Use"
COM_COMPONENTBUILDER_POWER_USE_GLOBAL="Use Global"
COM_COMPONENTBUILDER_POWER_USE_LABEL="use"
COM_COMPONENTBUILDER_POWER_USE_HINT="Name\Project\ClassName"
COM_COMPONENTBUILDER_POWER_USE_LABEL="Use"
COM_COMPONENTBUILDER_POWER_USE_MESSAGE="Error! Please add namespace here."
COM_COMPONENTBUILDER_POWER_USE_SELECTION_DESCRIPTION="Select namespace you want to use in your power."
COM_COMPONENTBUILDER_POWER_USE_SELECTION_LABEL="Use Selection"
COM_COMPONENTBUILDER_POWER_VERSION_DESC="A count of the number of times this Power has been revised."

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm();
// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model method
// this name combination of tab and layout in the method name is the only work around
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'autoload_composer_note',
'composer'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
</div>
<?php endif; ?>

View File

@ -175,7 +175,7 @@ class ComponentbuilderModelAjax extends ListModel
// we first use the new encryption
// load phpseclib <https://phpseclib.com/docs/symmetric>
$opened = false;
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// load the system password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');

View File

@ -186,22 +186,6 @@
</field>
<!-- Load_powers_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="load_powers_note" label="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_LOAD_POWERS_NOTE_DESCRIPTION" heading="h4" class="alert alert-info load_powers_note" />
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Description Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -227,6 +211,63 @@
validate="code"
showon="add_licensing_template:2"
/>
<!-- Composer Field. Type: Subform. (joomla) -->
<field
type="subform"
name="composer"
label="COM_COMPONENTBUILDER_POWER_COMPOSER_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="1"
min="0">
<form hidden="true" name="list_composer_modal" repeat="true">
<!-- Access_point Field. Type: Text. (joomla) -->
<field
type="text"
name="access_point"
label="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_LABEL"
size="70"
maxlength="300"
description="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_DESCRIPTION"
class="text_area"
required="true"
filter="PATH"
message="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_ACCESS_POINT_HINT"
/>
<!-- Namespace Field. Type: Subform. (joomla) -->
<field
type="subform"
name="namespace"
label="COM_COMPONENTBUILDER_POWER_NAMESPACE_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
icon="list"
max="30"
min="1"
nested_depth="1">
<form hidden="true" name="list_namespace_modal" repeat="true">
<!-- Use Field. Type: Text. (joomla) -->
<field
type="text"
name="use"
label="COM_COMPONENTBUILDER_POWER_USE_LABEL"
size="70"
maxlength="300"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_POWER_USE_MESSAGE"
hint="COM_COMPONENTBUILDER_POWER_USE_HINT"
autocomplete="on"
/>
</form>
</field>
</form>
</field>
<!-- Property_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -372,21 +413,8 @@
required="false"
validate="code"
/>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Autoload_composer_note Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="autoload_composer_note" label="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_LABEL" description="COM_COMPONENTBUILDER_POWER_AUTOLOAD_COMPOSER_NOTE_DESCRIPTION" heading="h4" class="alert alert-info autoload_composer_note" />
<!-- Use_selection Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -425,6 +453,37 @@
/>
</form>
</field>
<!-- Add_licensing_template Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_licensing_template"
label="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_LABEL"
description="COM_COMPONENTBUILDER_POWER_ADD_LICENSING_TEMPLATE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_POWER_USE_GLOBAL</option>
<option value="2">
COM_COMPONENTBUILDER_POWER_OVERRIDE</option>
</field>
<!-- Main_class_code Field. Type: Editor. (joomla) -->
<field
type="editor"
name="main_class_code"
label="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_LABEL"
description="COM_COMPONENTBUILDER_POWER_MAIN_CLASS_CODE_DESCRIPTION"
width="100%"
height="800px"
cols="40"
rows="300"
buttons="no"
syntax="php"
editor="codemirror|none"
filter="raw"
validate="code"
/>
<!-- Guid Field. Type: Text. (joomla) -->
<field
type="text"

View File

@ -1096,7 +1096,7 @@ class ComponentbuilderModelImport_joomla_components extends BaseDatabaseModel
// check if we should use the phpseclib decryption
$phpseclip = (isset($this->packageInfo['phpseclib']) && $this->packageInfo['phpseclib']) ? true : $force;
// load phpseclib <https://phpseclib.com/docs/symmetric>
if($phpseclip && ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if($phpseclip && ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// load the system password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($password, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');

View File

@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
/**
* Joomla_components List Model
@ -1259,7 +1260,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
// $locker = new FOFEncryptAes($this->key, 128);
// $data = $locker->encryptString($data);
// load phpseclib <https://phpseclib.com/docs/symmetric>
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// set the password
ComponentbuilderHelper::crypt('AES', 'CBC')->setPassword($this->key, 'pbkdf2', 'sha256', 'VastDevelopmentMethod/salt');
@ -1313,7 +1314,7 @@ class ComponentbuilderModelJoomla_components extends ListModel
return false;
}
// set info data
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib\Crypt\Rijndael)
if(ComponentbuilderHelper::crypt('AES', 'CBC') instanceof \phpseclib3\Crypt\Rijndael)
{
// set system password
$db = 'COM_COMPONENTBUILDER_SZDEQZDMVSMHBTRWFIFTYTSQFLVVXJTMTHREEJTWOIXM';

View File

@ -64,6 +64,12 @@ class ComponentbuilderModelPower extends AdminModel
'add_licensing_template',
'licensing_template'
)
),
'composer' => array(
'fullwidth' => array(
'autoload_composer_note',
'composer'
)
)
);
@ -178,12 +184,6 @@ class ComponentbuilderModelPower extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->licensing_template))
{
// base64 Decode licensing_template.
@ -196,6 +196,12 @@ class ComponentbuilderModelPower extends AdminModel
$item->head = base64_decode($item->head);
}
if (!empty($item->main_class_code))
{
// base64 Decode main_class_code.
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->load_selection))
{
// Convert the load_selection field to an array.
@ -204,6 +210,14 @@ class ComponentbuilderModelPower extends AdminModel
$item->load_selection = $load_selection->toArray();
}
if (!empty($item->composer))
{
// Convert the composer field to an array.
$composer = new Registry;
$composer->loadString($item->composer);
$item->composer = $composer->toArray();
}
if (!empty($item->property_selection))
{
// Convert the property_selection field to an array.
@ -1050,6 +1064,19 @@ class ComponentbuilderModelPower extends AdminModel
$data['load_selection'] = '';
}
// Set the composer items to data.
if (isset($data['composer']) && is_array($data['composer']))
{
$composer = new JRegistry;
$composer->loadArray($data['composer']);
$data['composer'] = (string) $composer;
}
elseif (!isset($data['composer']))
{
// Set the empty composer to data
$data['composer'] = '';
}
// Set the property_selection items to data.
if (isset($data['property_selection']) && is_array($data['property_selection']))
{
@ -1102,12 +1129,6 @@ class ComponentbuilderModelPower extends AdminModel
$data['use_selection'] = '';
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the licensing_template string to base64 string.
if (isset($data['licensing_template']))
{
@ -1119,6 +1140,12 @@ class ComponentbuilderModelPower extends AdminModel
{
$data['head'] = base64_encode($data['head']);
}
// Set the main_class_code string to base64 string.
if (isset($data['main_class_code']))
{
$data['main_class_code'] = base64_encode($data['main_class_code']);
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))

View File

@ -314,6 +314,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_power` (
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`add_head` TINYINT(1) NOT NULL DEFAULT 0,
`add_licensing_template` TINYINT(1) NOT NULL DEFAULT 1,
`composer` TEXT NOT NULL,
`description` TEXT NOT NULL,
`extends` VARCHAR(36) NOT NULL DEFAULT '',
`extends_custom` VARCHAR(64) NOT NULL DEFAULT '',

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_power` ADD `composer` TEXT NOT NULL AFTER `add_licensing_template`;

View File

@ -64,6 +64,16 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'composer', JText::_('COM_COMPONENTBUILDER_POWER_COMPOSER', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('power.composer_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'licensing', JText::_('COM_COMPONENTBUILDER_POWER_LICENSING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>27th November, 2022</creationDate>
<creationDate>4th December, 2022</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.1.12</version>
<version>3.1.13</version>
<description><![CDATA[
<h1>Component Builder (v.3.1.12)</h1>
<h1>Component Builder (v.3.1.13)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -1109,4 +1109,21 @@
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>3.1.13</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -0,0 +1,183 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
/**
* Compiler Content
*
* @since 3.2.0
*/
class Content
{
/**
* The Content
*
* @var array
* @since 3.2.0
**/
public array $active = [];
/**
* The Dynamic Content
*
* @var array
* @since 3.2.0
**/
public array $_active = [];
/**
* Set content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function set(string $key, $value)
{
$this->active[Placefix::_h($key)] = $value;
}
/**
* Get content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return mixed
* @since 3.2.0
*/
public function get(string $key)
{
return $this->active[Placefix::_h($key)] ?? null;
}
/**
* Does key exist
*
* @param string $key The main string key
*
* @return bool
* @since 3.2.0
*/
public function exist(string $key): bool
{
if (isset($this->active[Placefix::_h($key)]))
{
return true;
}
return false;
}
/**
* Add content
*
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function add(string $key, $value)
{
if (isset($this->active[Placefix::_h($key)]))
{
$this->active[Placefix::_h($key)] .= $value;
}
else
{
$this->active[Placefix::_h($key)] = $value;
}
}
/**
* Set dynamic content
*
* @param string $view The view key
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function set_(string $view, string $key, $value)
{
$this->_active[$view][Placefix::_h($key)] = $value;
}
/**
* Get dynamic content
*
* @param string $view The view key
* @param string $key The main string key
*
* @return mixed
* @since 3.2.0
*/
public function get_(string $view, string $key = null)
{
if (!is_null($key))
{
return $this->_active[$view][Placefix::_h($key)] ?? null;
}
return $this->_active[$view] ?? null;
}
/**
* Does view key exist
*
* @param string $view The view key
* @param string $key The main string key
*
* @return bool
* @since 3.2.0
*/
public function exist_(string $view, string $key): bool
{
if (isset($this->_active[$view]) &&
isset($this->_active[$view][Placefix::_h($key)]))
{
return true;
}
return false;
}
/**
* Add dynamic content
*
* @param string $view The view key
* @param string $key The main string key
* @param mixed $value The values to set
*
* @return void
* @since 3.2.0
*/
public function add_(string $view, string $key, $value)
{
if (isset($this->_active[$view]) &&
isset($this->_active[$view][Placefix::_h($key)]))
{
$this->_active[$view][Placefix::_h($key)] .= $value;
}
else
{
$this->_active[$view][Placefix::_h($key)] = $value;
}
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -216,7 +216,7 @@ class Power implements PowerInterface
$tmp_lang_target = $this->config->lang_target;
$this->config->lang_target = 'both';
// we set the fix usr if needed
// we set the fix url if needed
$this->fixUrl
= '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id='
. $this->active[$guid]->id . '" target="_blank"';
@ -313,6 +313,13 @@ class Power implements PowerInterface
$guiMapper
) . PHP_EOL;
}
else
{
$this->active[$guid]->head = '';
}
// set composer
$this->setComposer($guid);
// now set the description
$this->active[$guid]->description = (StringHelper::check($this->active[$guid]->description)) ? $this->placeholder->update(
@ -400,7 +407,7 @@ class Power implements PowerInterface
$path_array = (array) explode('\\', $this->active[$guid]->namespace);
// make sure all sub folders in src dir is set and remove all characters that will not work in folders naming
$this->active[$guid]->namespace = NamespaceHelper::safe(str_replace('.', '\\', $this->active[$guid]->namespace));
$this->active[$guid]->namespace = $this->getCleanNamespace(str_replace('.', '\\', $this->active[$guid]->namespace));
// make sure it has two or more
if (ArrayHelper::check($path_array) <= 1)
@ -463,10 +470,10 @@ class Power implements PowerInterface
// make sure the arrays are namespace safe
$path_array = array_map(function ($val) {
return NamespaceHelper::safe($val);
return $this->getCleanNamespace($val);
}, $path_array);
$namespace_array = array_map(function ($val) {
return NamespaceHelper::safe($val);
return $this->getCleanNamespace($val);
}, $namespace_array);
// set the actual class namespace
$this->active[$guid]->_namespace = implode('\\', $namespace_array);
@ -481,7 +488,7 @@ class Power implements PowerInterface
{
// make sure the arrays are namespace safe
$sub_folder = '/' . implode('/', array_map(function ($val) {
return NamespaceHelper::safe($val);
return $this->getCleanNamespace($val);
}, $src_array));
}
@ -555,6 +562,69 @@ class Power implements PowerInterface
}
}
/**
* Set Composer Linked Use and Access Point
*
* @param string $guid The global unique id of the power
* @param array $use The use array
*
* @return void
* @since 3.2.0
*/
protected function setComposer(string $guid)
{
// does this have composer powers
$_composer = (isset($this->active[$guid]->composer)
&& JsonHelper::check(
$this->active[$guid]->composer
)) ? json_decode($this->active[$guid]->composer, true) : null;
if (ArrayHelper::check($_composer))
{
$this->active[$guid]->composer = [];
foreach ($_composer as $composer)
{
if (isset($composer['access_point']) && StringHelper::check($composer['access_point']))
{
if (isset($composer['namespace']) && ArrayHelper::check($composer['namespace']))
{
foreach ($composer['namespace'] as $_namespace)
{
// make sure we have a valid namespace
if (isset($_namespace['use']) && StringHelper::check($_namespace['use']) &&
strpos($_namespace['use'], '\\') !== false)
{
// trim possible use or ; added to the namespace
$namespace = $this->getCleanNamespace($_namespace['use']);
// check if still valid
if (!StringHelper::check($namespace))
{
continue;
}
// add to the header of the class
$this->addToHeader($guid, $this->getUseNamespace($namespace));
// add the namespace to this access point
if (strpos($namespace, ' as ') !== false)
{
$namespace = $this->getCleanNamespace(explode(' as ', $namespace)[0]);
}
$this->active[$guid]->composer[$namespace] = $composer['access_point'];
}
}
}
}
}
}
else
{
$this->active[$guid]->composer = null;
}
}
/**
* Set Implements Interface classes
*
@ -663,27 +733,75 @@ class Power implements PowerInterface
if ($this->set($u))
{
// get the namespace
$add_use = $this->get($u, 1)->namespace;
$namespace = $this->get($u, 1)->namespace;
// check if it has an AS option
if (isset($as[$u]) && StringHelper::check($as[$u]) && $as[$u] !== 'default')
if (isset($as[$u]) && StringHelper::check($as[$u]))
{
$add_use = 'use ' . $add_use . ' as ' . $as[$u] . ';';
// add to the header of the class
$this->addToHeader($guid, $this->getUseNamespace($namespace, $as[$u]));
}
else
{
$add_use = 'use ' . $add_use . ';';
}
// check if it is already added manually
if (strpos($this->active[$guid]->head, $add_use) === false)
{
$this->active[$guid]->head .= $add_use . PHP_EOL;
// add to the header of the class
$this->addToHeader($guid, $this->getUseNamespace($namespace));
}
}
}
}
}
/**
* Get Clean Namespace without use or ; as part of the name space
*
* @param string $namespace The actual name space
*
* @return string
* @since 3.2.0
*/
protected function getCleanNamespace(string $namespace): string
{
// trim possible (use) or (;) or (starting or ending \) added to the namespace
return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace));
}
/**
* Get [use Namespace\Class;]
*
* @param string $namespace The actual name space
* @param string $as The use as name (default is none)
*
* @return string
* @since 3.2.0
*/
protected function getUseNamespace(string $namespace, string $as = 'default'): string
{
// check if it has an AS option
if ($as !== 'default')
{
return 'use ' . $namespace . ' as ' . $as . ';';
}
return 'use ' . $namespace . ';';
}
/**
* Add to class header
*
* @param string $guid The global unique id of the power
* @param string $string The string to add to header
*
* @return void
* @since 3.2.0
*/
protected function addToHeader(string $guid, string $string)
{
// check if it is already added manually
if (isset($this->active[$guid]->head) &&
strpos($this->active[$guid]->head, $string) === false)
{
$this->active[$guid]->head .= $string . PHP_EOL;
}
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
@ -16,6 +16,7 @@ use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Registry;
use VDM\Joomla\Componentbuilder\Compiler\Content;
/**
@ -40,6 +41,9 @@ class Compiler implements ServiceProviderInterface
$container->alias(Registry::class, 'Registry')
->share('Registry', [$this, 'getRegistry'], true);
$container->alias(Content::class, 'Content')
->share('Content', [$this, 'getContent'], true);
}
/**
@ -67,6 +71,19 @@ class Compiler implements ServiceProviderInterface
{
return new Registry();
}
/**
* Get the Compiler Content
*
* @param Container $container The DI container.
*
* @return Content
* @since 3.2.0
*/
public function getContent(Container $container): Content
{
return new Content();
}
}

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -1,13 +1,13 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Interfaces;

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -1,13 +1,13 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Interfaces;

View File

@ -0,0 +1,187 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Package\Database;
use Joomla\CMS\Factory as JoomlaFactory;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Table;
use VDM\Joomla\Componentbuilder\Search\Model\Insert as Model;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Package Database Insert
*
* @since 3.2.0
*/
class Insert
{
/**
* Search Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Search Table
*
* @var Table
* @since 3.2.0
*/
protected Table $table;
/**
* Search Model
*
* @var Model
* @since 3.2.0
*/
protected Model $model;
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param Table|null $table The search table object.
* @param Model|null $model The search get model object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Table $table = null,
?Model $model = null, ?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Factory::_('Config');
$this->table = $table ?: Factory::_('Table');
$this->model = $model ?: Factory::_('Set.Model');
$this->db = $db ?: JoomlaFactory::getDbo();
}
/**
* Set values to a given table
* Example: $this->value(Value, 23, 'value_key', 'table_name');
*
* @param mixed $value The field value
* @param int $id The item ID
* @param string $field The field key
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function value($value, int $id, string $field, ?string $table = null): bool
{
// load the table
if (empty($table))
{
$table = $this->config->table_name;
}
// check if this is a valid field and table
if ($id > 0 && ($name = $this->table->get($table, $field, 'name')) !== null)
{
// build the object
$item = new \stdClass();
$item->id = $id;
$item->{$name} = $this->model->value($value, $name, $table);
// Update the column of this table using id as the primary key.
return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id');
}
return false;
}
/**
* Set values to a given table
* Example: $this->item(Object, 23, 'table_name');
*
* @param object $item The item to save
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): bool
{
// load the table
if (empty($table))
{
$table = $this->config->table_name;
}
// check if this is a valid table
if (($fields = $this->table->fields($table)) !== null)
{
// model the item values
foreach ($fields as $field)
{
if (isset($item->{$field}))
{
$item->{$field} = $this->model->value($item->{$field}, $field, $table);
}
}
// Update the column of this table using id as the primary key.
return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id');
}
return false;
}
/**
* Set values to a given table
* Example: $this->items(Array, 'table_name');
*
* @param array|null $items The items being saved
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function items(?array $items, string $table = null): bool
{
// load the table
if (empty($table))
{
$table = $this->config->table_name;
}
// check if this is a valid table
if (ArrayHelper::check($items))
{
$success = true;
foreach ($items as $item)
{
if ($this->item($item, $table) !== true)
{
$success = false;
break;
}
}
return $success;
}
return false;
}
}

View File

@ -0,0 +1,128 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Package\Database;
use VDM\Joomla\Componentbuilder\Package\Factory;
use VDM\Joomla\Componentbuilder\Table;
use VDM\Joomla\Componentbuilder\Database\Load as Database;
/**
* Package Database Load
*
* @since 3.2.0
*/
class Load
{
/**
* Search Table
*
* @var Table
* @since 3.2.0
*/
protected Table $table;
/**
* Database Load
*
* @var Database
* @since 3.2.0
*/
protected Database $load;
/**
* Constructor
*
* @param Table|null $table The core table object.
* @param Database|null $load The database object.
*
* @since 3.2.0
*/
public function __construct(?Table $table = null, ?Database $load = null)
{
$this->table = $table ?: Factory::_('Table');
$this->load = $load ?: Factory::_('Load');
}
/**
* Get a value from a given table
* Example: $this->value(23, 'value_key', 'table_name');
*
* @param int $id The item ID
* @param string $field The field key
* @param string $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value(int $id, string $field, string $table)
{
// check if this is a valid table
if ($id > 0 && $this->table->exist($table, $field))
{
return $this->load->value(
["a.${field}" => $field], ['a' => $table], ['a.id' => $id]
);
}
return null;
}
/**
* Get values from a given table
* Example: $this->item(23, 'table_name');
*
* @param int $id The item ID
* @param string $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(int $id, ?string $table): ?object
{
// check if this is a valid table
if ($id > 0 && $this->table->exist($table))
{
return $this->load->item(
['all' => 'a.*'], ['a' => $table], ['a.id' => $id]
);
}
return null;
}
/**
* Get values from a given table
* Example: $this->items($ids, 'table_name');
*
* @param array $ids The item ids
* @param string $table The table
*
* @return array|null
* @since 3.2.0
*/
public function items(array $ids, string $table): ?array
{
// check if this is a valid table
if ($this->table->exist($table))
{
return $this->load->items(
['all' => 'a.*'], ['a' => $table], ['a.id' => $ids]
);
}
return null;
}
}

View File

@ -0,0 +1,81 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Package;
use Joomla\DI\Container;
use VDM\Joomla\Componentbuilder\Service\Crypt;
use VDM\Joomla\Componentbuilder\Package\Service\Database;
use VDM\Joomla\Componentbuilder\Interfaces\FactoryInterface;
/**
* Package Factory
*
* @since 3.2.0
*/
abstract class Factory implements FactoryInterface
{
/**
* Global Package Container
*
* @var Container
* @since 3.2.0
**/
protected static $container = null;
/**
* Get any class from the package container
*
* @param string $key The container class key
*
* @return Mixed
* @since 3.2.0
*/
public static function _($key)
{
return self::getContainer()->get($key);
}
/**
* Get the global package container
*
* @return Container
* @since 3.2.0
*/
public static function getContainer(): Container
{
if (!self::$container)
{
self::$container = self::createContainer();
}
return self::$container;
}
/**
* Create a container object
*
* @return Container
* @since 3.2.0
*/
protected static function createContainer(): Container
{
$container = (new Container())
->registerServiceProvider(new Database())
->registerServiceProvider(new Crypt());
return $container;
}
}

View File

@ -0,0 +1,112 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Package\Service;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use VDM\Joomla\Componentbuilder\Package\Database\Load as LoadDatabase;
use VDM\Joomla\Componentbuilder\Database\Load;
use VDM\Joomla\Componentbuilder\Package\Database\Insert as InsertDatabase;
use VDM\Joomla\Componentbuilder\Database\Insert;
/**
* Database Service Provider
*
* @since 3.2.0
*/
class Database implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since 3.2.0
*/
public function register(Container $container)
{
$container->alias(Load::class, 'Load')
->share('Load', [$this, 'getLoad'], true);
$container->alias(LoadDatabase::class, 'Load.Database')
->share('Load.Database', [$this, 'getDatabaseLoad'], true);
$container->alias(Insert::class, 'Insert')
->share('Insert', [$this, 'getInsert'], true);
$container->alias(InsertDatabase::class, 'Insert.Database')
->share('Insert.Database', [$this, 'getDatabaseInsert'], true);
}
/**
* Get the Core Load Database
*
* @param Container $container The DI container.
*
* @return Load
* @since 3.2.0
*/
public function getLoad(Container $container): Load
{
return new Load();
}
/**
* Get the Load Database
*
* @param Container $container The DI container.
*
* @return LoadDatabase
* @since 3.2.0
*/
public function getDatabaseLoad(Container $container): LoadDatabase
{
return new LoadDatabase(
$container->get('Table'),
$container->get('Load')
);
}
/**
* Get the Core Insert Database
*
* @param Container $container The DI container.
*
* @return Insert
* @since 3.2.0
*/
public function getInsert(Container $container): Insert
{
return new Insert();
}
/**
* Get the Insert Database
*
* @param Container $container The DI container.
*
* @return InsertDatabase
* @since 3.2.0
*/
public function getDatabaseInsert(Container $container): InsertDatabase
{
return new InsertDatabase(
$container->get('Table'),
$container->get('Insert')
);
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

View File

@ -2,7 +2,7 @@
/**
* @package Joomla.Component.Builder
*
* @created 3rd September, 2022
* @created 4th September, 2022
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.

Some files were not shown because too many files have changed in this diff Show More