diff --git a/README.md b/README.md
index 680ab3df8..84cd3b690 100644
--- a/README.md
+++ b/README.md
@@ -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*: 21st August, 2022
++ *Last Build*: 30th August, 2022
+ *Version*: 3.1.5
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **312270**
++ *Line count*: **319334**
+ *Field count*: **2002**
-+ *File count*: **2057**
-+ *Folder count*: **351**
++ *File count*: **2087**
++ *Folder count*: **359**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
diff --git a/admin/README.txt b/admin/README.txt
index 680ab3df8..84cd3b690 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -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*: 21st August, 2022
++ *Last Build*: 30th August, 2022
+ *Version*: 3.1.5
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **312270**
++ *Line count*: **319334**
+ *Field count*: **2002**
-+ *File count*: **2057**
-+ *Folder count*: **351**
++ *File count*: **2087**
++ *Folder count*: **359**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
diff --git a/admin/config.xml b/admin/config.xml
index 4535b441b..974a94e8f 100644
--- a/admin/config.xml
+++ b/admin/config.xml
@@ -930,11 +930,11 @@
min="1"
showon="development_method:2">
diff --git a/admin/controllers/compiler.php b/admin/controllers/compiler.php
index 0274d1e0e..e4411c370 100644
--- a/admin/controllers/compiler.php
+++ b/admin/controllers/compiler.php
@@ -14,6 +14,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
/**
* Compiler Admin Controller
@@ -89,20 +90,10 @@ class ComponentbuilderControllerCompiler extends AdminController
// currently only those with admin access can compile a component
if($user->authorise('core.manage', 'com_componentbuilder'))
{
- // get the post values
- $jinput = JFactory::getApplication()->input;
- $componentId = $jinput->post->get('component', 0, 'INT');
- $version = $jinput->post->get('version', 0, 'INT');
- $addBackup = $jinput->post->get('backup', 0, 'INT');
- $addRepo = $jinput->post->get('repository', 0, 'INT');
- $addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
- $addPowers = $jinput->post->get('powers', 2, 'INT');
- $debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT');
- $minify = $jinput->post->get('minify', 2, 'INT');
// include component compiler
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php';
$model = $this->getModel('compiler');
- if ($model->builder($version, $componentId, $addBackup, $addRepo, $addPlaceholders, $addPowers, $debugLinenr, $minify))
+ if ($model->builder())
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
@@ -123,7 +114,7 @@ class ComponentbuilderControllerCompiler extends AdminController
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
// get system messages
$message = $app->getUserState('com_componentbuilder.message');
- if (empty($redirect_url) && $componentId > 0)
+ if (empty($redirect_url) && CFactory::_('Config')->component_id > 0)
{
// start new message
$message = array();
diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php
index e4760daf5..9a37ffa38 100644
--- a/admin/helpers/compiler.php
+++ b/admin/helpers/compiler.php
@@ -20,7 +20,10 @@ use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\MathHelper;
-use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
// Use the component builder autoloader
ComponentbuilderHelper::autoLoader();
@@ -30,6 +33,8 @@ ComponentbuilderHelper::autoLoader();
*/
class Compiler extends Infusion
{
+
+
/**
* The Temp path
*
@@ -75,13 +80,13 @@ class Compiler extends Infusion
// to check the compiler speed
$this->time_start = microtime(true);
// first we run the perent constructors
- if (parent::__construct($config))
+ if (parent::__construct())
{
// set temp directory
$comConfig = JFactory::getConfig();
$this->tempPath = $comConfig->get('tmp_path');
// set some folder paths in relation to distribution
- if ($config['backup'])
+ if (CFactory::_('Config')->backup)
{
$this->backupPath = $this->params->get(
'backup_folder_path', $this->tempPath
@@ -89,7 +94,7 @@ class Compiler extends Infusion
$this->dynamicIntegration = true;
}
// set local repos switch
- if ($config['repository'])
+ if (CFactory::_('Config')->repository)
{
$this->repoPath = $this->params->get('git_folder_path', null);
}
@@ -100,8 +105,7 @@ class Compiler extends Infusion
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/'
- . $this->fileContentStatic[$this->hhh . 'component'
- . $this->hhh] . '.xml';
+ . $this->fileContentStatic[Placefix::_h('component')] . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents(
$xmlPath
);
@@ -119,7 +123,7 @@ class Compiler extends Infusion
$this->writeFile($xmlPath, $componentXML);
}
// Trigger Event: jcb_ce_onBeforeUpdateFiles
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeUpdateFiles',
array(&$this->componentContext, &$this)
);
@@ -129,15 +133,15 @@ class Compiler extends Infusion
return false;
}
// Trigger Event: jcb_ce_onBeforeGetCustomCode
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeGetCustomCode',
array(&$this->componentContext, &$this)
);
// now insert into the new files
- if ($this->getCustomCode())
+ if (CFactory::_('Customcode')->load())
{
// Trigger Event: jcb_ce_onBeforeAddCustomCode
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeAddCustomCode',
array(&$this->componentContext, &$this)
);
@@ -145,7 +149,7 @@ class Compiler extends Infusion
$this->addCustomCode();
}
// Trigger Event: jcb_ce_onBeforeSetLangFileData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeSetLangFileData',
array(&$this->componentContext, &$this)
);
@@ -184,7 +188,7 @@ class Compiler extends Infusion
'because more then %s% of the strings have been translated.',
$this->percentageLanguageAdd
);
- if (Config::get('debug_line_nr', false))
+ if (CFactory::_('Config')->get('debug_line_nr', false))
{
$whyAddedLang = JText::_(
'because the debugging mode is on. (debug line numbers)'
@@ -215,12 +219,12 @@ class Compiler extends Infusion
'The SQL fix updates the #__assets table\'s column size on installation of the component and reverses it back to the Joomla default on uninstall of the component.'
);
// set assets table rules column notice
- if (Config::get('add_assets_table_fix'))
+ if (CFactory::_('Config')->add_assets_table_fix)
{
$this->app->enqueueMessage(
JText::_('Assets Table Notice '), 'Notice'
);
- $asset_table_fix_type = (Config::get('add_assets_table_fix') == 2)
+ $asset_table_fix_type = (CFactory::_('Config')->add_assets_table_fix == 2)
? 'intelligent' : 'sql';
$this->app->enqueueMessage(
JText::sprintf(
@@ -245,7 +249,7 @@ class Compiler extends Infusion
);
}
// set assets table name column warning if not set
- if (!Config::get('add_assets_table_fix') && $this->addAssetsTableNameFix)
+ if (!CFactory::_('Config')->add_assets_table_fix && $this->addAssetsTableNameFix)
{
// only add if not already added
if ($this->accessSize < 30)
@@ -282,18 +286,18 @@ class Compiler extends Infusion
// if there are plugins zip them
$this->zipPlugins();
// do lang mismatch check
- if (ArrayHelper::check($this->langMismatch))
+ if (ArrayHelper::check(CFactory::_('Language.Extractor')->langMismatch))
{
- if (ArrayHelper::check($this->langMatch))
+ if (ArrayHelper::check(CFactory::_('Language.Extractor')->langMatch))
{
$mismatch = array_diff(
- array_unique($this->langMismatch),
- array_unique($this->langMatch)
+ array_unique(CFactory::_('Language.Extractor')->langMismatch),
+ array_unique(CFactory::_('Language.Extractor')->langMatch)
);
}
else
{
- $mismatch = array_unique($this->langMismatch);
+ $mismatch = array_unique(CFactory::_('Language.Extractor')->langMismatch);
}
// set a notice if we have a mismatch
if (isset($mismatch)
@@ -323,7 +327,7 @@ class Compiler extends Infusion
// add the mismatching issues
foreach ($mismatch as $string)
{
- $constant = Config::get('lang_prefix') . '_'
+ $constant = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe($string, 'U');
$this->app->enqueueMessage(
JText::sprintf(
@@ -365,24 +369,6 @@ class Compiler extends Infusion
return false;
}
- /**
- * Set the line number in comments
- *
- * @param int $nr The line number
- *
- * @return void
- *
- */
- private function setLine($nr)
- {
- if (Config::get('debug_line_nr', false))
- {
- return ' [Compiler ' . $nr . ']';
- }
-
- return '';
- }
-
/**
* Set the dynamic data to the created fils
*
@@ -598,9 +584,9 @@ class Compiler extends Infusion
}
}
// do powers if found
- if (ArrayHelper::check($this->powers))
+ if (ArrayHelper::check(CFactory::_('Power')->active))
{
- foreach ($this->powers as $power)
+ foreach (CFactory::_('Power')->active as $power)
{
if (ObjectHelper::check($power)
&& isset($this->newFiles[$power->key])
@@ -641,12 +627,12 @@ class Compiler extends Infusion
protected function setFileContent(&$name, &$path, &$bom, $view = null)
{
// Trigger Event: jcb_ce_onBeforeSetFileContent
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeSetFileContent',
array(&$this->componentContext, &$name, &$path, &$bom, &$view)
);
// set the file name
- $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name;
+ $this->fileContentStatic[Placefix::_h('FILENAME')] = $name;
// check if the file should get PHP opening
$php = '';
if (ComponentbuilderHelper::checkFileType($name, 'php'))
@@ -656,35 +642,35 @@ class Compiler extends Infusion
// get content of the file
$string = ComponentbuilderHelper::getFileContents($path);
// Trigger Event: jcb_ce_onGetFileContents
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onGetFileContents',
array(&$this->componentContext, &$string, &$name, &$path, &$bom,
&$view)
);
// see if we should add a BOM
- if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
+ if (strpos($string, Placefix::_h('BOM')) !== false)
{
list($wast, $code) = explode(
- $this->hhh . 'BOM' . $this->hhh, $string
+ Placefix::_h('BOM'), $string
);
$string = $php . $bom . $code;
}
// set the answer
- $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
+ $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic, 3);
// set the dynamic answer
if ($view)
{
- $answer = $this->setPlaceholders(
+ $answer = CFactory::_('Placeholder')->update(
$answer, $this->fileContentDynamic[$view], 3
);
}
// check if this file needs extra care :)
if (isset($this->updateFileContent[$path]))
{
- $answer = $this->setDynamicValues($answer);
+ $answer = CFactory::_('Customcode')->add($answer);
}
// Trigger Event: jcb_ce_onBeforeSetFileContent
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeWriteFileContent',
array(&$this->componentContext, &$answer, &$name, &$path, &$bom,
&$view)
@@ -805,7 +791,7 @@ class Compiler extends Infusion
{
foreach ($data['config'] as $key => $value)
{
- if ($this->hhh . 'VERSION' . $this->hhh === $key)
+ if (Placefix::_h('VERSION') === $key)
{
// hmm we sould in some way make it known that this version number
// is not in relation the the project but to the file only... any ideas?
@@ -825,14 +811,14 @@ class Compiler extends Infusion
return true;
}
// else insure to reset to global
- $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh]
- = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh
+ $this->fileContentStatic[Placefix::_h('CREATIONDATE')]
+ = $this->fileContentStatic[Placefix::_h('CREATIONDATE')
. 'GLOBAL'];
- $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh]
- = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh
+ $this->fileContentStatic[Placefix::_h('BUILDDATE')]
+ = $this->fileContentStatic[Placefix::_h('BUILDDATE')
. 'GLOBAL'];
- $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]
- = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh
+ $this->fileContentStatic[Placefix::_h('VERSION')]
+ = $this->fileContentStatic[Placefix::_h('VERSION')
. 'GLOBAL'];
}
@@ -898,9 +884,9 @@ class Compiler extends Infusion
{
// set readme data if not set already
if (!isset(
- $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LINE_COUNT')]
)
- || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]
+ || $this->fileContentStatic[Placefix::_h('LINE_COUNT')]
!= $this->lineCount)
{
$this->buildReadMeData();
@@ -908,7 +894,7 @@ class Compiler extends Infusion
// get the file
$string = ComponentbuilderHelper::getFileContents($path);
// update the file
- $answer = $this->setPlaceholders($string, $this->fileContentStatic);
+ $answer = CFactory::_('Placeholder')->update($string, $this->fileContentStatic);
// add to zip array
$this->writeFile($path, $answer);
}
@@ -916,71 +902,71 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// set some defaults
- $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LINE_COUNT')]
= $this->lineCount;
- $this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('FIELD_COUNT')]
= $this->fieldCount;
- $this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('FILE_COUNT')]
= $this->fileCount;
- $this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('FOLDER_COUNT')]
= $this->folderCount;
- $this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('PAGE_COUNT')]
= $this->pageCount;
- $this->fileContentStatic[$this->hhh . 'folders' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('folders')]
= $this->folderSeconds;
- $this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('foldersSeconds')]
= $this->folderSeconds;
- $this->fileContentStatic[$this->hhh . 'files' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('files')]
= $this->fileSeconds;
- $this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('filesSeconds')]
= $this->fileSeconds;
- $this->fileContentStatic[$this->hhh . 'lines' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('lines')]
= $this->lineSeconds;
- $this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('linesSeconds')]
= $this->lineSeconds;
- $this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('seconds')]
= $this->actualSeconds;
- $this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('actualSeconds')]
= $this->actualSeconds;
- $this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('totalHours')]
= $this->totalHours;
- $this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('totalDays')]
= $this->totalDays;
- $this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('debugging')]
= $this->secondsDebugging;
- $this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('secondsDebugging')]
= $this->secondsDebugging;
- $this->fileContentStatic[$this->hhh . 'planning' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('planning')]
= $this->secondsPlanning;
- $this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('secondsPlanning')]
= $this->secondsPlanning;
- $this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('mapping')]
= $this->secondsMapping;
- $this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('secondsMapping')]
= $this->secondsMapping;
- $this->fileContentStatic[$this->hhh . 'office' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('office')]
= $this->secondsOffice;
- $this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('secondsOffice')]
= $this->secondsOffice;
- $this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('actualTotalHours')]
= $this->actualTotalHours;
- $this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('actualTotalDays')]
= $this->actualTotalDays;
- $this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('debuggingHours')]
= $this->debuggingHours;
- $this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('planningHours')]
= $this->planningHours;
- $this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('mappingHours')]
= $this->mappingHours;
- $this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('officeHours')]
= $this->officeHours;
- $this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('actualHoursSpent')]
= $this->actualHoursSpent;
- $this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('actualDaysSpent')]
= $this->actualDaysSpent;
- $this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('projectWeekTime')]
= $this->projectWeekTime;
- $this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('projectMonthTime')]
= $this->projectMonthTime;
}
@@ -995,9 +981,9 @@ class Compiler extends Infusion
// set the repo path
$repoFullPath = $this->repoPath . '/com_'
. $this->componentData->sales_name . '__joomla_'
- . Config::get('version', 3);
+ . CFactory::_('Config')->get('version', 3);
// Trigger Event: jcb_ce_onBeforeUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeUpdateRepo',
array(&$this->componentContext, &$this->componentPath,
&$repoFullPath, &$this->componentData)
@@ -1007,7 +993,7 @@ class Compiler extends Infusion
// set the new data
Folder::copy($this->componentPath, $repoFullPath, '', true);
// Trigger Event: jcb_ce_onAfterUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
array(&$this->componentContext, &$this->componentPath,
&$repoFullPath, &$this->componentData)
@@ -1026,9 +1012,9 @@ class Compiler extends Infusion
// set the repo path
$repoFullPath = $this->repoPath . '/'
. $module->folder_name . '__joomla_'
- . Config::get('version', 3);
+ . CFactory::_('Config')->get('version', 3);
// Trigger Event: jcb_ce_onBeforeUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeUpdateRepo',
array(&$module_context, &$module->folder_path,
&$repoFullPath, &$module)
@@ -1042,7 +1028,7 @@ class Compiler extends Infusion
$module->folder_path, $repoFullPath, '', true
);
// Trigger Event: jcb_ce_onAfterUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
array(&$module_context, &$module->folder_path,
&$repoFullPath, &$module)
@@ -1063,9 +1049,9 @@ class Compiler extends Infusion
// set the repo path
$repoFullPath = $this->repoPath . '/'
. $plugin->folder_name . '__joomla_'
- . Config::get('version', 3);
+ . CFactory::_('Config')->get('version', 3);
// Trigger Event: jcb_ce_onBeforeUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeUpdateRepo',
array(&$plugin_context, &$plugin->folder_path,
&$repoFullPath, &$plugin)
@@ -1079,7 +1065,7 @@ class Compiler extends Infusion
$plugin->folder_path, $repoFullPath, '', true
);
// Trigger Event: jcb_ce_onAfterUpdateRepo
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterUpdateRepo',
array(&$plugin_context, &$plugin->folder_path,
&$repoFullPath, &$plugin)
@@ -1098,7 +1084,7 @@ class Compiler extends Infusion
$this->filepath['component'] = $this->tempPath . '/'
. $this->filepath['component-folder'] . '.zip';
// Trigger Event: jcb_ce_onBeforeZipComponent
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeZipComponent',
array(&$this->componentContext, &$this->componentPath,
&$this->filepath['component'], &$this->tempPath,
@@ -1113,7 +1099,7 @@ class Compiler extends Infusion
if ($this->backupPath && $this->dynamicIntegration)
{
// Trigger Event: jcb_ce_onBeforeBackupZip
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBackupZip', array(&$this->componentContext,
&$this->filepath['component'],
&$this->tempPath,
@@ -1135,7 +1121,7 @@ class Compiler extends Infusion
if (isset($this->componentData->sales_server))
{
// Trigger Event: jcb_ce_onBeforeMoveToServer
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeMoveToServer',
array(&$this->componentContext,
&$this->filepath['component'], &$this->tempPath,
@@ -1151,7 +1137,7 @@ class Compiler extends Infusion
}
}
// Trigger Event: jcb_ce_onAfterZipComponent
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterZipComponent',
array(&$this->componentContext, &$this->filepath['component'],
&$this->tempPath, &$this->componentFolderName,
@@ -1190,7 +1176,7 @@ class Compiler extends Infusion
$this->filepath['modules'][$module->id] = $this->tempPath
. '/' . $module->zip_name . '.zip';
// Trigger Event: jcb_ce_onBeforeZipModule
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeZipModule',
array(&$module_context, &$module->folder_path,
&$this->filepath['modules'][$module->id],
@@ -1207,7 +1193,7 @@ class Compiler extends Infusion
{
$__module_context = 'module.' . $module_context;
// Trigger Event: jcb_ce_onBeforeBackupZip
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBackupZip',
array(&$__module_context,
&$this->filepath['modules'][$module->id],
@@ -1229,7 +1215,7 @@ class Compiler extends Infusion
if (isset($module->sales_server))
{
// Trigger Event: jcb_ce_onBeforeMoveToServer
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeMoveToServer',
array(&$__module_context,
&$this->filepath['modules'][$module->id],
@@ -1246,7 +1232,7 @@ class Compiler extends Infusion
}
}
// Trigger Event: jcb_ce_onAfterZipModule
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterZipModule', array(&$module_context,
&$this->filepath['modules'][$module->id],
&$this->tempPath,
@@ -1284,7 +1270,7 @@ class Compiler extends Infusion
$this->filepath['plugins'][$plugin->id] = $this->tempPath
. '/' . $plugin->zip_name . '.zip';
// Trigger Event: jcb_ce_onBeforeZipPlugin
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeZipPlugin',
array(&$plugin_context, &$plugin->folder_path,
&$this->filepath['plugins'][$plugin->id],
@@ -1301,7 +1287,7 @@ class Compiler extends Infusion
{
$__plugin_context = 'plugin.' . $plugin_context;
// Trigger Event: jcb_ce_onBeforeBackupZip
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBackupZip',
array(&$__plugin_context,
&$this->filepath['plugins'][$plugin->id],
@@ -1323,7 +1309,7 @@ class Compiler extends Infusion
if (isset($plugin->sales_server))
{
// Trigger Event: jcb_ce_onBeforeMoveToServer
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeMoveToServer',
array(&$__plugin_context,
&$this->filepath['plugins'][$plugin->id],
@@ -1340,7 +1326,7 @@ class Compiler extends Infusion
}
}
// Trigger Event: jcb_ce_onAfterZipPlugin
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterZipPlugin', array(&$plugin_context,
&$this->filepath['plugins'][$plugin->id],
&$this->tempPath,
@@ -1358,9 +1344,9 @@ class Compiler extends Infusion
protected function addCustomCode()
{
// reset all these
- $this->clearFromPlaceHolders('view');
- $this->clearFromPlaceHolders('arg');
- foreach ($this->customCode as $nr => $target)
+ CFactory::_('Placeholder')->clearType('view');
+ CFactory::_('Placeholder')->clearType('arg');
+ foreach (CFactory::_('Customcode')->active as $nr => $target)
{
// reset each time per custom code
$fingerPrint = array();
@@ -1471,13 +1457,13 @@ class Compiler extends Infusion
}
if ($found)
{
- $placeholder = $this->getPlaceHolder(
+ $placeholder = CFactory::_('Placeholder')->keys(
(int) $target['comment_type'] . $target['type'],
$target['id']
);
$data = $placeholder['start'] . PHP_EOL
- . $this->setPlaceholders(
- $target['code'], $this->placeholders
+ . CFactory::_('Placeholder')->update(
+ $target['code'], CFactory::_('Placeholder')->active
) . $placeholder['end'] . PHP_EOL;
if ($target['type'] == 2)
{
@@ -1566,7 +1552,7 @@ class Compiler extends Infusion
$_commentType . PHP_EOL . $commentType, $code
) . $_commentType . PHP_EOL;
// get place holders
- $placeholder = $this->getPlaceHolder(
+ $placeholder = CFactory::_('Placeholder')->keys(
(int) $target['comment_type'] . $target['type'], $target['id']
);
// build the data
diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php
index fe7727f3d..5da9bf912 100644
--- a/admin/helpers/compiler/a_Get.php
+++ b/admin/helpers/compiler/a_Get.php
@@ -27,7 +27,10 @@ use VDM\Joomla\Utilities\String\TypeHelper;
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\String\PluginHelper;
-use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Get class as the main compilers class
@@ -39,7 +42,7 @@ class Get
* The Joomla Version
*
* @var string
- * @deprecated 4.0 Use Config::get('version');
+ * @deprecated 3.3 Use CFactory::_('Config')->joomla_version;
*/
public $joomlaVersion;
@@ -57,6 +60,7 @@ class Get
* The hash placeholder
*
* @var string
+ * @deprecated 3.3 Use Placefix::h();
*/
public $hhh = '#' . '#' . '#';
@@ -64,6 +68,7 @@ class Get
* The open bracket placeholder
*
* @var string
+ * @deprecated 3.3 Use Placefix::b();
*/
public $bbb = '[' . '[' . '[';
@@ -71,6 +76,7 @@ class Get
* The close bracket placeholder
*
* @var string
+ * @deprecated 3.3 Use Placefix::d();
*/
public $ddd = ']' . ']' . ']';
@@ -106,6 +112,7 @@ class Get
* The global placeholders
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Component.Placeholder')->get();
*/
public $globalPlaceholders = array();
@@ -113,6 +120,7 @@ class Get
* The placeholders
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Placeholder')->active[];
*/
public $placeholders = array();
@@ -120,7 +128,7 @@ class Get
* The Compiler Path
*
* @var object
- * @deprecated 4.0 Use Config::get('compiler_path');
+ * @deprecated 3.3 Use CFactory::_('Config')->compiler_path;
*/
public $compilerPath;
@@ -128,7 +136,7 @@ class Get
* The JCB Powers Path
*
* @var object
- * @deprecated 4.0 Use Config::get('jcb_powers_path');
+ * @deprecated 3.3 Use CFactory::_('Config')->jcb_powers_path;
*/
public $jcbPowersPath;
@@ -136,7 +144,7 @@ class Get
* Switch to add assets table fix
*
* @var int
- * @deprecated 4.0 Use Config::get('add_assets_table_fix');
+ * @deprecated 3.3 Use CFactory::_('Config')->add_assets_table_fix;
*/
public $addAssetsTableFix = 1;
@@ -158,7 +166,7 @@ class Get
* Switch to add custom code placeholders
*
* @var bool
- * @deprecated 4.0 Use Config::get('add_placeholders');
+ * @deprecated 3.3 Use CFactory::_('Config')->add_placeholders;
*/
public $addPlaceholders = false;
@@ -166,7 +174,7 @@ class Get
* Switch to remove line breaks from language strings
*
* @var bool
- * @deprecated 4.0 Use Config::get('remove_line_breaks');
+ * @deprecated 3.3 Use CFactory::_('Config')->remove_line_breaks;
*/
public $removeLineBreaks = false;
@@ -174,6 +182,7 @@ class Get
* The placeholders for custom code keys
*
* @var array
+ * @deprecated 3.3
*/
protected $customCodeKeyPlacholders
= array(
@@ -195,7 +204,7 @@ class Get
* The Switch to add Powers data
*
* @var boolean
- * @deprecated 4.0 Use Config::get('add_power');
+ * @deprecated 3.3 Use CFactory::_('Config')->add_power;
*/
public $addPower;
@@ -203,6 +212,7 @@ class Get
* The Powers data
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Power')->active;
*/
public $powers = array();
@@ -210,6 +220,7 @@ class Get
* The state of all Powers
*
* @var array
+ * @deprecated 3.3
*/
public $statePowers = array();
@@ -279,6 +290,7 @@ class Get
* The custom code to be added
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Customcode')->active
*/
public $customCode;
@@ -286,6 +298,7 @@ class Get
* The custom code to be added
*
* @var array
+ * @deprecated 3.3
*/
protected $customCodeData = array();
@@ -293,6 +306,7 @@ class Get
* The function name memory ids
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Customcode')->functionNameMemory
*/
public $functionNameMemory = array();
@@ -300,6 +314,7 @@ class Get
* The custom code for local memory
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Customcode')->memory
*/
public $customCodeMemory = array();
@@ -328,6 +343,7 @@ class Get
* The external code/string to be added
*
* @var array
+ * @deprecated 3.3
*/
protected $externalCodeString = array();
@@ -335,6 +351,7 @@ class Get
* The external code/string cutter
*
* @var array
+ * @deprecated 3.3
*/
protected $externalCodeCutter = array();
@@ -342,7 +359,7 @@ class Get
* The line numbers Switch
*
* @var boolean
- * @deprecated 4.0 Use Config::get('debug_line_nr');
+ * @deprecated 3.3 Use CFactory::_('Config')->debug_line_nr;
*/
public $debugLinenr = false;
@@ -357,7 +374,7 @@ class Get
* The Placholder Language prefix
*
* @var string
- * @deprecated 4.0 Use Config::get('lang_prefix');
+ * @deprecated 3.3 Use CFactory::_('Config')->lang_prefix;
*/
public $langPrefix;
@@ -365,6 +382,7 @@ class Get
* The Language content
*
* @var array
+ * @deprecated 3.3
*/
public $langContent = array();
@@ -381,7 +399,7 @@ class Get
* The Main Languages
*
* @var string
- * @deprecated 4.0 Use Config::get('lang_tag');
+ * @deprecated 3.3 Use CFactory::_('Config')->lang_tag;
*/
public $langTag = 'en-GB';
@@ -410,6 +428,7 @@ class Get
* The Language JS matching check
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langMismatch;
*/
public $langMismatch = array();
@@ -417,6 +436,7 @@ class Get
* The Language SC matching check
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langMatch;
*/
public $langMatch = array();
@@ -424,6 +444,7 @@ class Get
* The Language string targets
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Config')->lang_string_targets;
*/
public $langStringTargets
= array(
@@ -438,7 +459,7 @@ class Get
* The Component Code Name
*
* @var string
- * @deprecated 4.0 Use Config::get('component_code_name');
+ * @deprecated 3.3 Use CFactory::_('Config')->component_code_name;
*/
public $componentCodeName;
@@ -446,7 +467,7 @@ class Get
* The Component Context
*
* @var string
- * @deprecated 4.0 Use Config::get('component_context');
+ * @deprecated 3.3 Use CFactory::_('Config')->component_context;
*/
public $componentContext;
@@ -454,7 +475,7 @@ class Get
* The Component Code Name Length
*
* @var int
- * @deprecated 4.0 Use Config::get('component_code_name_length');
+ * @deprecated 3.3 Use CFactory::_('Config')->component_code_name_length;
*/
public $componentCodeNameLength;
@@ -462,7 +483,7 @@ class Get
* The Component ID
*
* @var int
- * @deprecated 4.0 Use Config::get('component_id');
+ * @deprecated 3.3 Use CFactory::_('Config')->component_id;
*/
public $componentID;
@@ -582,6 +603,7 @@ class Get
* The Language target
*
* @var string
+ * @deprecated 3.3 Use CFactory::_('Config')->lang_target;
*/
public $lang = 'admin';
@@ -589,6 +611,7 @@ class Get
* The lang keys for extentions
*
* @var array
+ * @deprecated 3.3 Use CFactory::_('Language.Extractor')->langKeys;
*/
public $langKeys = array();
@@ -596,6 +619,7 @@ class Get
* The Build target Switch
*
* @var string
+ * @deprecated 3.3 Use CFactory::_('Config')->build_target;
*/
public $target;
@@ -690,7 +714,7 @@ class Get
* 2 = SimpleXMLElement
*
* @var int
- * @deprecated 4.0 Use Config::get('field_builder_type');
+ * @deprecated 3.3 Use CFactory::_('Config')->field_builder_type;
*/
public $fieldBuilderType;
@@ -903,7 +927,7 @@ class Get
* Is minify Enabled
*
* @var int
- * @deprecated 4.0 Use Config::get('minify');
+ * @deprecated 3.3 Use CFactory::_('Config')->minify;
*/
public $minify = 0;
@@ -911,7 +935,7 @@ class Get
* Is Tidy Enabled
*
* @var bool
- * @deprecated 4.0 Use Config::get('tidy');
+ * @deprecated 3.3 Use CFactory::_('Config')->tidy;
*/
public $tidy = false;
@@ -942,18 +966,12 @@ class Get
*/
public $mysqlTableSetting = array();
- /**
- * event plugin trigger switch
- *
- * @var boolean
- */
- protected $active_plugins = false;
-
/**
* Constructor
*/
- public function __construct($config = array())
+ public function __construct()
{
+ echo '';
// we do not yet have this set as an option
$config['remove_line_breaks']
= 2; // 2 is global (use the components value)
@@ -961,42 +979,24 @@ class Get
$this->app = JFactory::getApplication();
// Set the params
$this->params = JComponentHelper::getParams('com_componentbuilder');
- // get active plugins
- if (($plugins = $this->params->get('compiler_plugin', false))
- !== false)
- {
- foreach ($plugins as $plugin)
- {
- // get possible plugins
- if (\JPluginHelper::isEnabled('extension', $plugin))
- {
- // Import the appropriate plugin group.
- \JPluginHelper::importPlugin('extension', $plugin);
- // activate events
- $this->active_plugins = true;
- }
- }
- }
// Trigger Event: jcb_ce_onBeforeGet
- $this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this));
- // load the global config
- Config::init($config);
+ CFactory::_J('Event')->trigger('jcb_ce_onBeforeGet', array(&$config, &$this));
// set the Joomla version @deprecated
- $this->joomlaVersion = Config::get('version', 3);
+ $this->joomlaVersion = CFactory::_('Config')->joomla_version;
// set the minfy switch of the JavaScript @deprecated
- $this->minify = Config::get('minify', 0);
+ $this->minify = CFactory::_('Config')->get('minify', 0);
// set the global language @deprecated @deprecated
- $this->langTag = Config::get('lang_tag', 'en-GB');
+ $this->langTag = CFactory::_('Config')->get('lang_tag', 'en-GB');
// also set the helper class langTag (for safeStrings)
- ComponentbuilderHelper::$langTag = Config::get('lang_tag', 'en-GB');
+ ComponentbuilderHelper::$langTag = CFactory::_('Config')->get('lang_tag', 'en-GB');
// setup the main language array
- $this->languages['components'][Config::get('lang_tag', 'en-GB')] = array();
+ $this->languages['components'][CFactory::_('Config')->get('lang_tag', 'en-GB')] = array();
// check if we have Tidy enabled @deprecated
- $this->tidy = Config::get('tidy', false);
+ $this->tidy = CFactory::_('Config')->get('tidy', false);
// set the field type builder @deprecated
- $this->fieldBuilderType = Config::get('field_builder_type', 2);
+ $this->fieldBuilderType = CFactory::_('Config')->get('field_builder_type', 2);
// check the field builder type logic
- if (!Config::get('tidy', false) && Config::get('field_builder_type', 2) == 2)
+ if (!CFactory::_('Config')->get('tidy', false) && CFactory::_('Config')->get('field_builder_type', 2) == 2)
{
// we do not have the tidy extension set fall back to StringManipulation
$this->fieldBuilderType = 1;
@@ -1010,37 +1010,37 @@ class Get
), 'Notice'
);
}
- Config::set('field_builder_type', $this->fieldBuilderType);
+ CFactory::_('Config')->set('field_builder_type', $this->fieldBuilderType);
// load the compiler path @deprecated
- $this->compilerPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler');
+ $this->compilerPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler');
// load the jcb powers path @deprecated
- $this->jcbPowersPath = Config::get('jcb_powers_path', 'libraries/jcb_powers');
+ $this->jcbPowersPath = CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers');
// set the component ID @deprecated
- $this->componentID = Config::get('component_id');
+ $this->componentID = CFactory::_('Config')->component_id;
// set lang prefix @deprecated
- $this->langPrefix = Config::get('lang_prefix');
+ $this->langPrefix = CFactory::_('Config')->lang_prefix;
// set component code name @deprecated
- $this->componentCodeName = Config::get('component_code_name');
+ $this->componentCodeName = CFactory::_('Config')->component_code_name;
// set component context @deprecated
- $this->componentContext = Config::get('component_context');
+ $this->componentContext = CFactory::_('Config')->component_context;
// set the component name length @deprecated
- $this->componentCodeNameLength = Config::get('component_code_name_length');
+ $this->componentCodeNameLength = CFactory::_('Config')->component_code_name_length;
// add assets table fix @deprecated
- $this->addAssetsTableFix = Config::get('add_assets_table_fix');
+ $this->addAssetsTableFix = CFactory::_('Config')->add_assets_table_fix;
// set if language strings line breaks should be removed @deprecated
- $this->removeLineBreaks = Config::get('remove_line_breaks');
+ $this->removeLineBreaks = CFactory::_('Config')->remove_line_breaks;
// set if placeholders should be added to customcode @deprecated
- $this->addPlaceholders = Config::get('add_placeholders', false);
+ $this->addPlaceholders = CFactory::_('Config')->get('add_placeholders', false);
// set if line numbers should be added to comments @deprecated
- $this->debugLinenr = Config::get('debug_line_nr', false);
+ $this->debugLinenr = CFactory::_('Config')->get('debug_line_nr', false);
// set if powers should be added to component (default is true) @deprecated
- $this->addPower = Config::get('add_power', true);
+ $this->addPower = CFactory::_('Config')->get('add_power', true);
// set the current user
$this->user = JFactory::getUser();
// Get a db connection.
$this->db = JFactory::getDbo();
- // get global placeholders
- $this->globalPlaceholders = $this->getGlobalPlaceholders();
+ // get global placeholders @deprecated
+ $this->globalPlaceholders = CFactory::_('Component.Placeholder')->get();
// check if this component is installed on the current website
if ($paths = $this->getLocalInstallPaths())
{
@@ -1050,14 +1050,14 @@ class Get
$this->customCodeFactory($paths, $today);
}
// Trigger Event: jcb_ce_onBeforeGetComponentData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeGetComponentData',
array(&$this->componentContext, &$this)
);
// get the component data
$this->componentData = $this->getComponentData();
// Trigger Event: jcb_ce_onAfterGetComponentData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterGetComponentData',
array(&$this->componentContext, &$this)
);
@@ -1092,14 +1092,14 @@ class Get
);
}
// get powers *+*+*+*+*+*+*+*PRO
- $this->getPowers($this->linkedPowers);
+ CFactory::_('Power')->load($this->linkedPowers);
// set the percentage when a language can be added
$this->percentageLanguageAdd = (int) $this->params->get(
'percentagelanguageadd', 50
);
// Trigger Event: jcb_ce_onBeforeGet
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterGet', array(&$this->componentContext, &$this)
);
@@ -1120,24 +1120,6 @@ class Get
return ComponentbuilderHelper::_t($nr);
}
- /**
- * Set the line number in comments
- *
- * @param int $nr The line number
- *
- * @return void
- *
- */
- private function setLine($nr)
- {
- if (Config::get('debug_line_nr', false))
- {
- return ' [Get ' . $nr . ']';
- }
-
- return '';
- }
-
/**
* Trigger events
*
@@ -1145,99 +1127,22 @@ class Get
* @param mix $data The values to pass to the event/plugin
*
* @return void
- *
+ * @deprecated 3.3 Use CFactory::_J('Event')->trigger($event, $data);
*/
public function triggerEvent($event, $data)
{
- // only exicute if plugins were loaded (active)
- if ($this->active_plugins)
- {
- // Get the dispatcher.
- $dispatcher = \JEventDispatcher::getInstance();
-
- // Trigger this compiler event.
- $results = $dispatcher->trigger($event, $data);
-
- // Check for errors encountered while trigger the event
- if (count((array) $results) && in_array(false, $results, true))
- {
- // Get the last error.
- $error = $dispatcher->getError();
-
- if (!($error instanceof \Exception))
- {
- throw new \Exception($error);
- }
- }
- }
+ return CFactory::_J('Event')->trigger($event, $data);
}
/**
* get all System Placeholders
*
* @return array The global placeholders
- *
+ * @deprecated 3.3 Use CFactory::_('Component.Placeholder')->get();
*/
public function getGlobalPlaceholders()
{
- // reset bucket
- $bucket = array();
- // Create a new query object.
- $query = $this->db->getQuery(true);
- $query->select($this->db->quoteName(array('a.target', 'a.value')));
- // from these tables
- $query->from('#__componentbuilder_placeholder AS a');
- // Reset the query using our newly populated query object.
- $this->db->setQuery($query);
- // Load the items
- $this->db->execute();
- if ($this->db->getNumRows())
- {
- $bucket = $this->db->loadAssocList('target', 'value');
- // open all the code
- foreach ($bucket as $key => &$code)
- {
- $code = base64_decode($code);
- }
- }
- // set component place holders
- $bucket[$this->hhh . 'component' . $this->hhh]
- = Config::get('component_code_name');
- $bucket[$this->hhh . 'Component' . $this->hhh]
- = StringHelper::safe(
- Config::get('component_code_name'), 'F'
- );
- $bucket[$this->hhh . 'COMPONENT' . $this->hhh]
- = StringHelper::safe(
- Config::get('component_code_name'), 'U'
- );
- $bucket[$this->bbb . 'component' . $this->ddd] = $bucket[$this->hhh
- . 'component' . $this->hhh];
- $bucket[$this->bbb . 'Component' . $this->ddd] = $bucket[$this->hhh
- . 'Component' . $this->hhh];
- $bucket[$this->bbb . 'COMPONENT' . $this->ddd] = $bucket[$this->hhh
- . 'COMPONENT' . $this->hhh];
- $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh] = Config::get('lang_prefix');
- $bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh
- . 'LANG_PREFIX' . $this->hhh];
- // get the current components overides
- if (($_placeholders = GetHelper::var(
- 'component_placeholders', Config::get('component_id'),
- 'joomla_component', 'addplaceholders'
- )) !== false
- && JsonHelper::check($_placeholders))
- {
- $_placeholders = json_decode($_placeholders, true);
- if (ArrayHelper::check($_placeholders))
- {
- foreach ($_placeholders as $row)
- {
- $bucket[$row['target']] = $row['value'];
- }
- }
- }
-
- return $bucket;
+ return CFactory::_('Component.Placeholder')->get();
}
/**
@@ -1307,11 +1212,11 @@ class Get
);
}
$query->where(
- $this->db->quoteName('a.id') . ' = ' . (int) Config::get('component_id')
+ $this->db->quoteName('a.id') . ' = ' . (int) CFactory::_('Config')->component_id
);
// Trigger Event: jcb_ce_onBeforeQueryComponentData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeQueryComponentData',
array(&$this->componentContext, &$this->componentID, &$query,
&$this->db)
@@ -1324,7 +1229,7 @@ class Get
$component = $this->db->loadObject();
// Trigger Event: jcb_ce_onBeforeModelComponentData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeModelComponentData',
array(&$this->componentContext, &$component)
);
@@ -1336,36 +1241,36 @@ class Get
'val' => (int) $component->addadmin_views_id,
'key' => 'id'),
'addconfig' => array('table' => 'component_config',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'addcustom_admin_views' => array('table' => 'component_custom_admin_views',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'addcustommenus' => array('table' => 'component_custom_admin_menus',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'addfiles' => array('table' => 'component_files_folders',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'addfolders' => array('table' => 'component_files_folders',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'addsite_views' => array('table' => 'component_site_views',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'dashboard_tab' => array('table' => 'component_dashboard',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'sql_tweak' => array('table' => 'component_mysql_tweaks',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component'),
'version_update' => array('table' => 'component_updates',
- 'val' => (int) Config::get('component_id'),
+ 'val' => (int) CFactory::_('Config')->component_id,
'key' => 'joomla_component')
),
'table' => 'joomla_component',
'key' => 'id',
- 'val' => (int) Config::get('component_id')
+ 'val' => (int) CFactory::_('Config')->component_id
);
// repeatable fields to update
$searchRepeatables = array(
@@ -1390,7 +1295,7 @@ class Get
// load the global placeholders
if (ArrayHelper::check($this->globalPlaceholders))
{
- $this->placeholders = $this->globalPlaceholders;
+ CFactory::_('Placeholder')->active = $this->globalPlaceholders;
}
// set component sales name
@@ -1542,8 +1447,8 @@ class Get
? json_decode($component->addadmin_views, true) : null;
if (ArrayHelper::check($component->addadmin_views))
{
- $this->lang = 'admin';
- $this->target = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
+ CFactory::_('Config')->build_target = 'admin';
// sort the views according to order
usort(
$component->addadmin_views, function ($a, $b) {
@@ -1586,7 +1491,7 @@ class Get
&& $array['edit_create_site_view'] > 0)
{
$this->siteEditView[$array['adminview']] = true;
- $this->lang = 'both';
+ CFactory::_('Config')->lang_target = 'both';
}
// set the import/export option for this view
if (isset($array['port']) && $array['port']
@@ -1636,8 +1541,8 @@ class Get
? json_decode($component->addsite_views, true) : null;
if (ArrayHelper::check($component->addsite_views))
{
- $this->lang = 'site';
- $this->target = 'site';
+ CFactory::_('Config')->lang_target = 'site';
+ CFactory::_('Config')->build_target = 'site';
// build the site_views settings
$component->site_views = array_map(
function ($array) {
@@ -1675,8 +1580,8 @@ class Get
$component->addcustom_admin_views
))
{
- $this->lang = 'admin';
- $this->target = 'custom_admin';
+ CFactory::_('Config')->lang_target = 'admin';
+ CFactory::_('Config')->build_target = 'custom_admin';
// build the custom_admin_views settings
$component->custom_admin_views = array_map(
function ($array) {
@@ -1764,7 +1669,7 @@ class Get
'component_admin_views', $component->addadmin_views_id
);
$old_component = $this->getHistoryWatch(
- 'joomla_component', Config::get('component_id')
+ 'joomla_component', CFactory::_('Config')->component_id
);
if ($old_component || $old_admin_views)
{
@@ -1805,7 +1710,7 @@ class Get
// set GUI mapper
$guiMapper = array('table' => 'joomla_component',
- 'id' => (int) Config::get('component_id'),
+ 'id' => (int) CFactory::_('Config')->component_id,
'field' => 'javascript', 'type' => 'js');
// add_javascript
@@ -1849,7 +1754,7 @@ class Get
unset($component->{'css_' . $area});
}
// set the lang target
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
// add PHP in ADMIN
$addScriptMethods = array('php_preflight', 'php_postflight',
'php_method');
@@ -1892,7 +1797,7 @@ class Get
$component->php_helper_admin
))
{
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
// update GUI mapper
$guiMapper['field'] = 'php_helper_admin';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1914,7 +1819,7 @@ class Get
if ($component->add_admin_event == 1
&& StringHelper::check($component->php_admin_event))
{
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
// update GUI mapper field
$guiMapper['field'] = 'php_admin_event';
$this->setCustomScriptBuilder(
@@ -1934,7 +1839,7 @@ class Get
if ($component->add_php_helper_both == 1
&& StringHelper::check($component->php_helper_both))
{
- $this->lang = 'both';
+ CFactory::_('Config')->lang_target = 'both';
// update GUI mapper field
$guiMapper['field'] = 'php_helper_both';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1955,7 +1860,7 @@ class Get
if ($component->add_php_helper_site == 1
&& StringHelper::check($component->php_helper_site))
{
- $this->lang = 'site';
+ CFactory::_('Config')->lang_target = 'site';
// update GUI mapper field
$guiMapper['field'] = 'php_helper_site';
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
@@ -1977,7 +1882,7 @@ class Get
if ($component->add_site_event == 1
&& StringHelper::check($component->php_site_event))
{
- $this->lang = 'site';
+ CFactory::_('Config')->lang_target = 'site';
// update GUI mapper field
$guiMapper['field'] = 'php_site_event';
$this->setCustomScriptBuilder(
@@ -2015,17 +1920,17 @@ class Get
// bom
if (StringHelper::check($component->bom))
{
- $this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom;
+ $this->bomPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' . $component->bom;
}
else
{
- $this->bomPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/default.txt';
+ $this->bomPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/default.txt';
}
unset($component->bom);
// README
if ($component->addreadme)
{
- $component->readme = $this->setDynamicValues(
+ $component->readme = CFactory::_('Customcode')->add(
base64_decode($component->readme)
);
}
@@ -2035,8 +1940,8 @@ class Get
}
// set lang now
- $nowLang = $this->lang;
- $this->lang = 'admin';
+ $nowLang = CFactory::_('Config')->lang_target;
+ CFactory::_('Config')->lang_target = 'admin';
// dashboard methods
$component->dashboard_tab = (isset($component->dashboard_tab)
&& JsonHelper::check($component->dashboard_tab))
@@ -2045,7 +1950,7 @@ class Get
{
$component->dashboard_tab = array_map(
function ($array) {
- $array['html'] = $this->setDynamicValues($array['html']);
+ $array['html'] = CFactory::_('Customcode')->add($array['html']);
return $array;
}, array_values($component->dashboard_tab)
@@ -2062,8 +1967,8 @@ class Get
))
{
// load the php for the dashboard model
- $component->php_dashboard_methods = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ $component->php_dashboard_methods = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($component->php_dashboard_methods)
),
array(
@@ -2078,7 +1983,7 @@ class Get
$component->php_dashboard_methods = '';
}
// reset back to nowlang
- $this->lang = $nowLang;
+ CFactory::_('Config')->lang_target = $nowLang;
// add the update/sales server FTP details if that is the expected protocol
$serverArray = array('update_server', 'sales_server');
@@ -2173,7 +2078,7 @@ class Get
unset($component->addjoomla_plugins);
// Trigger Event: jcb_ce_onAfterModelComponentData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterModelComponentData',
array(&$this->componentContext, &$component)
);
@@ -2191,26 +2096,14 @@ class Get
* @param boolean $addPrefix The switch to add langPrefix
*
* @return void
+ * @deprecated 3.3 Use CFactory::_('Language')->set($target, $language, $string, $addPrefix);
*
*/
public function setLangContent($target, $language, $string,
$addPrefix = false
)
{
- if ($addPrefix
- && !isset(
- $this->langContent[$target][Config::get('lang_prefix') . '_' . $language]
- ))
- {
- $this->langContent[$target][Config::get('lang_prefix') . '_' . $language]
- = $this->fixLangString($string);
- }
- elseif (!isset($this->langContent[$target][$language]))
- {
- $this->langContent[$target][$language] = $this->fixLangString(
- $string
- );
- }
+ CFactory::_('Language')->set($target, $language, $string, $addPrefix);
}
/**
@@ -2219,11 +2112,12 @@ class Get
* @param string $string The language string
*
* @return string
+ * @deprecated 3.3
*
*/
public function fixLangString(&$string)
{
- if (Config::get('remove_line_breaks'))
+ if (CFactory::_('Config')->remove_line_breaks)
{
return trim(str_replace(array(PHP_EOL, "\r", "\n"), '', $string));
}
@@ -2294,7 +2188,7 @@ class Get
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Trigger Event: jcb_ce_onBeforeQueryViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeQueryViewData',
array(&$this->componentContext, &$id, &$query, &$this->db)
);
@@ -2324,7 +2218,7 @@ class Get
}
// check the length of the view name (+5 for com_ and _)
- $name_length = Config::get('component_code_name_length') + strlen(
+ $name_length = CFactory::_('Config')->component_code_name_length + strlen(
$view->name_single_code
) + 5;
// when the name is larger then 49 we need to add the assets table name fix
@@ -2373,44 +2267,48 @@ class Get
= false;
$this->customScriptBuilder['token'][$view->name_list_code] = false;
// set some placeholders
- $this->placeholders[$this->hhh . 'view' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('view')]
= $view->name_single_code;
- $this->placeholders[$this->hhh . 'views' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('views')]
= $view->name_list_code;
- $this->placeholders[$this->hhh . 'View' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('View')]
= StringHelper::safe(
$view->name_single, 'F'
);
- $this->placeholders[$this->hhh . 'Views' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('Views')]
= StringHelper::safe(
$view->name_list, 'F'
);
- $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]
= StringHelper::safe(
$view->name_single, 'U'
);
- $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]
= StringHelper::safe(
$view->name_list, 'U'
);
- $this->placeholders[$this->bbb . 'view' . $this->ddd]
- = $this->placeholders[$this->hhh . 'view' . $this->hhh];
- $this->placeholders[$this->bbb . 'views' . $this->ddd]
- = $this->placeholders[$this->hhh . 'views' . $this->hhh];
- $this->placeholders[$this->bbb . 'View' . $this->ddd]
- = $this->placeholders[$this->hhh . 'View' . $this->hhh];
- $this->placeholders[$this->bbb . 'Views' . $this->ddd]
- = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
- $this->placeholders[$this->bbb . 'VIEW' . $this->ddd]
- = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
- $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]
- = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
+ CFactory::_('Placeholder')->active[Placefix::_('view')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('view')];
+ CFactory::_('Placeholder')->active[Placefix::_('views')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('views')];
+ CFactory::_('Placeholder')->active[Placefix::_('View')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('View')];
+ CFactory::_('Placeholder')->active[Placefix::_('Views')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('Views')];
+ CFactory::_('Placeholder')->active[Placefix::_('VIEW')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('VIEW')];
+ CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]
+ = CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')];
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onBeforeModelViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeModelViewData',
array(&$this->componentContext, &$view, &$this->placeholders)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// add the tables
$view->addtables = (isset($view->addtables)
@@ -2436,9 +2334,9 @@ class Get
// set the view name
$tab['view'] = $view->name_single_code;
// load the dynamic data
- $tab['html'] = $this->setPlaceholders(
- $this->setDynamicValues($tab['html']),
- $this->placeholders
+ $tab['html'] = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($tab['html']),
+ CFactory::_('Placeholder')->active
);
// set the tab name
$tab['name'] = (isset($tab['name'])
@@ -2446,13 +2344,13 @@ class Get
$tab['name']
)) ? $tab['name'] : 'Tab';
// set lang
- $tab['lang'] = Config::get('lang_prefix') . '_'
+ $tab['lang'] = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe(
$tab['view'], 'U'
) . '_' . StringHelper::safe(
$tab['name'], 'U'
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'both', $tab['lang'], $tab['name']
);
// set code name
@@ -2464,7 +2362,7 @@ class Get
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
- $_tab = $this->_t(1);
+ $_tab = Indent::_(1);
}
// check if the php of the tab is set, if not load it now
if (strpos($tab['html'], 'bootstrap.addTab') === false
@@ -2472,31 +2370,31 @@ class Get
=== false)
{
// add the tab
- $tmp = PHP_EOL . $_tab . $this->_t(1)
+ $tmp = PHP_EOL . $_tab . Indent::_(1)
. "";
- $tmp .= PHP_EOL . $_tab . $this->_t(2)
+ $tmp .= PHP_EOL . $_tab . Indent::_(2)
. '';
- $tmp .= PHP_EOL . $_tab . $this->_t(1)
+ $tmp .= PHP_EOL . $_tab . Indent::_(3) . '';
+ $tmp .= PHP_EOL . $_tab . Indent::_(2) . '';
+ $tmp .= PHP_EOL . $_tab . Indent::_(1)
. "";
// update html
$tab['html'] = $tmp;
}
else
{
- $tab['html'] = PHP_EOL . $_tab . $this->_t(1)
+ $tab['html'] = PHP_EOL . $_tab . Indent::_(1)
. implode(
- PHP_EOL . $_tab . $this->_t(1),
+ PHP_EOL . $_tab . Indent::_(1),
(array) explode(PHP_EOL, trim($tab['html']))
);
}
@@ -2504,12 +2402,12 @@ class Get
if (isset($tab['permission'])
&& $tab['permission'] == 1)
{
- $tmp = PHP_EOL . $this->_t(1)
+ $tmp = PHP_EOL . Indent::_(1)
. "canDo->get('"
. $tab['view'] . "." . $tab['code']
. ".viewtab')) : ?>";
$tmp .= $tab['html'];
- $tmp .= PHP_EOL . $this->_t(1) . "";
+ $tmp .= PHP_EOL . Indent::_(1) . "";
// update html
$tab['html'] = $tmp;
// set lang for permissions
@@ -2518,19 +2416,17 @@ class Get
$tab['lang_permission_desc'] = $tab['lang']
. '_TAB_PERMISSION_DESC';
$tab['lang_permission_title']
- = $this->placeholders[$this->hhh
- . 'Views' . $this->hhh] . ' View '
+ = CFactory::_('Placeholder')->active[Placefix::_h('Views')] . ' View '
. $tab['name'] . ' Tab';
- $this->setLangContent(
+ CFactory::_('Language')->set(
'both', $tab['lang_permission'],
$tab['lang_permission_title']
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'both', $tab['lang_permission_desc'],
'Allow the users in this group to view '
. $tab['name'] . ' Tab of '
- . $this->placeholders[$this->hhh . 'views'
- . $this->hhh]
+ . CFactory::_('Placeholder')->active[Placefix::_h('views')]
);
// set the sort key
$tab['sortKey']
@@ -2712,7 +2608,7 @@ class Get
$tmpfield['settings'] = new stdClass();
// convert the xml json string to normal string
$tmpfield['settings']->xml
- = $this->setDynamicValues(
+ = CFactory::_('Customcode')->add(
json_decode(
$field['settings']->history->xml
)
@@ -2944,7 +2840,7 @@ class Get
$relationsValue['set']
))
{
- $relationsValue['set'] = $this->setDynamicValues(
+ $relationsValue['set'] = CFactory::_('Customcode')->add(
$relationsValue['set']
);
}
@@ -2984,14 +2880,14 @@ class Get
// confirm it should really make the over ride
if ('default' !== $check_column_name)
{
- $column_name_lang = Config::get('lang_prefix') . '_'
+ $column_name_lang = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe(
$view->name_list_code, 'U'
) . '_'
. StringHelper::safe(
$relationsValue['column_name'], 'U'
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'admin', $column_name_lang,
$relationsValue['column_name']
);
@@ -3019,10 +2915,10 @@ class Get
}
unset($view->addlinked_views);
// set the lang target
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
if (isset($this->siteEditView[$id]))
{
- $this->lang = 'both';
+ CFactory::_('Config')->lang_target = 'both';
}
// set GUI mapper
$guiMapper = array('table' => 'admin_view', 'id' => (int) $id,
@@ -3147,8 +3043,8 @@ class Get
// set field
$guiMapper['field'] = $button_code_field;
$view->{$button_code_field}
- = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($view->{$button_code_field})
),
$guiMapper
@@ -3364,25 +3260,29 @@ class Get
unset($view->{'mysql_table_' . $_mysqlTableKey});
}
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onAfterModelViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterModelViewData',
array(&$this->componentContext, &$view, &$this->placeholders)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// clear placeholders
- unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
- unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
- unset($this->placeholders[$this->hhh . 'View' . $this->hhh]);
- unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]);
- unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]);
- unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]);
- unset($this->placeholders[$this->bbb . 'view' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'views' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'View' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('view')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('views')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('View')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('Views')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEW')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('view')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('views')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('View')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('Views')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('VIEW')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('VIEWS')]);
// store this view to class object
$this->_adminViewData[$id] = $view;
@@ -3411,7 +3311,7 @@ class Get
$query->where($this->db->quoteName('a.id') . ' = ' . (int) $id);
// Trigger Event: jcb_ce_onBeforeQueryCustomViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeQueryCustomViewData',
array(&$this->componentContext, &$id, &$table, &$query, &$this->db)
);
@@ -3428,14 +3328,14 @@ class Get
$view->Code = StringHelper::safe($view->code, 'F');
$view->CODE = StringHelper::safe($view->code, 'U');
// Trigger Event: jcb_ce_onBeforeModelCustomViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeModelCustomViewData',
array(&$this->componentContext, &$view, &$id, &$table)
);
if ($table === 'site_view')
{
- $this->lang = 'site';
+ CFactory::_('Config')->lang_target = 'site';
// repeatable fields to update
$searchRepeatables = array(
// repeatablefield => checker
@@ -3445,7 +3345,7 @@ class Get
}
else
{
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
// repeatable fields to update
$searchRepeatables = array(
// repeatablefield => checker
@@ -3468,8 +3368,8 @@ class Get
'field' => 'default', 'type' => 'html');
// set the default data
- $view->default = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(base64_decode($view->default)),
+ $view->default = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(base64_decode($view->default)),
$guiMapper
);
// load context if not set
@@ -3486,13 +3386,13 @@ class Get
$view->context = StringHelper::safe($view->context);
}
// load the library
- if (!isset($this->libManager[$this->target]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target]))
{
- $this->libManager[$this->target] = array();
+ $this->libManager[CFactory::_('Config')->build_target] = array();
}
- if (!isset($this->libManager[$this->target][$view->code]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target][$view->code]))
{
- $this->libManager[$this->target][$view->code] = array();
+ $this->libManager[CFactory::_('Config')->build_target][$view->code] = array();
}
// make sure json become array
if (JsonHelper::check($view->libraries))
@@ -3504,27 +3404,27 @@ class Get
{
foreach ($view->libraries as $library)
{
- if (!isset($this->libManager[$this->target][$view->code][$library]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target][$view->code][$library]))
{
if ($this->getMediaLibrary((int) $library))
{
- $this->libManager[$this->target][$view->code][(int) $library]
+ $this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $library]
= true;
}
}
}
}
elseif (is_numeric($view->libraries)
- && !isset($this->libManager[$this->target][$view->code][(int) $view->libraries]))
+ && !isset($this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $view->libraries]))
{
if ($this->getMediaLibrary((int) $view->libraries))
{
- $this->libManager[$this->target][$view->code][(int) $view->libraries]
+ $this->libManager[CFactory::_('Config')->build_target][$view->code][(int) $view->libraries]
= true;
}
}
// setup template array
- $this->templateData[$this->target][$view->code] = array();
+ $this->templateData[CFactory::_('Config')->build_target][$view->code] = array();
// setup template and layout data
$this->setTemplateAndLayoutData($view->default, $view->code);
// insure the uikit components are loaded
@@ -3540,13 +3440,13 @@ class Get
);
}
// check for footable
- if (!isset($this->footableScripts[$this->target][$view->code])
- || !$this->footableScripts[$this->target][$view->code])
+ if (!isset($this->footableScripts[CFactory::_('Config')->build_target][$view->code])
+ || !$this->footableScripts[CFactory::_('Config')->build_target][$view->code])
{
$foundFoo = $this->getFootableScripts($view->default);
if ($foundFoo)
{
- $this->footableScripts[$this->target][$view->code] = true;
+ $this->footableScripts[CFactory::_('Config')->build_target][$view->code] = true;
}
if ($foundFoo && !$this->footableScripts)
{
@@ -3554,13 +3454,13 @@ class Get
}
}
// check for get module
- if (!isset($this->getModule[$this->target][$view->code])
- || !$this->getModule[$this->target][$view->code])
+ if (!isset($this->getModule[CFactory::_('Config')->build_target][$view->code])
+ || !$this->getModule[CFactory::_('Config')->build_target][$view->code])
{
$found = $this->getGetModule($view->default);
if ($found)
{
- $this->getModule[$this->target][$view->code] = true;
+ $this->getModule[CFactory::_('Config')->build_target][$view->code] = true;
}
}
// set the main get data
@@ -3589,8 +3489,8 @@ class Get
{
// set field
$guiMapper['field'] = $scripter;
- $view->$scripter = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ $view->$scripter = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($view->$scripter)
),
$guiMapper
@@ -3598,7 +3498,7 @@ class Get
}
else
{
- $view->$scripter = $this->setDynamicValues(
+ $view->$scripter = CFactory::_('Customcode')->add(
base64_decode($view->$scripter)
);
}
@@ -3618,13 +3518,13 @@ class Get
$this->setTemplateAndLayoutData($view->$scripter, $view->code);
// check for footable
- if (!isset($this->footableScripts[$this->target][$view->code])
- || !$this->footableScripts[$this->target][$view->code])
+ if (!isset($this->footableScripts[CFactory::_('Config')->build_target][$view->code])
+ || !$this->footableScripts[CFactory::_('Config')->build_target][$view->code])
{
$foundFoo = $this->getFootableScripts($view->$scripter);
if ($foundFoo)
{
- $this->footableScripts[$this->target][$view->code]
+ $this->footableScripts[CFactory::_('Config')->build_target][$view->code]
= true;
}
if ($foundFoo && !$this->footable)
@@ -3633,13 +3533,13 @@ class Get
}
}
// check for google chart
- if (!isset($this->googleChart[$this->target][$view->code])
- || !$this->googleChart[$this->target][$view->code])
+ if (!isset($this->googleChart[CFactory::_('Config')->build_target][$view->code])
+ || !$this->googleChart[CFactory::_('Config')->build_target][$view->code])
{
$found = $this->getGoogleChart($view->$scripter);
if ($found)
{
- $this->googleChart[$this->target][$view->code] = true;
+ $this->googleChart[CFactory::_('Config')->build_target][$view->code] = true;
}
if ($found && !$this->googlechart)
{
@@ -3647,13 +3547,13 @@ class Get
}
}
// check for get module
- if (!isset($this->getModule[$this->target][$view->code])
- || !$this->getModule[$this->target][$view->code])
+ if (!isset($this->getModule[CFactory::_('Config')->build_target][$view->code])
+ || !$this->getModule[CFactory::_('Config')->build_target][$view->code])
{
$found = $this->getGetModule($view->$scripter);
if ($found)
{
- $this->getModule[$this->target][$view->code] = true;
+ $this->getModule[CFactory::_('Config')->build_target][$view->code] = true;
}
}
}
@@ -3662,7 +3562,7 @@ class Get
if (isset($view->add_php_ajax) && $view->add_php_ajax == 1)
{
// ajax target (since we only have two options really)
- if ('site' === $this->target)
+ if ('site' === CFactory::_('Config')->build_target)
{
$target = 'site';
}
@@ -3702,7 +3602,7 @@ class Get
if ($setAjax)
{
// turn on ajax area
- if ('site' === $this->target)
+ if ('site' === CFactory::_('Config')->build_target)
{
$this->addSiteAjax = true;
}
@@ -3729,8 +3629,8 @@ class Get
{
// set field
$guiMapper['field'] = $button_code_field;
- $view->{$button_code_field} = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ $view->{$button_code_field} = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($view->{$button_code_field})
),
$guiMapper
@@ -3749,7 +3649,7 @@ class Get
}
// Trigger Event: jcb_ce_onAfterModelCustomViewData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterModelCustomViewData',
array(&$this->componentContext, &$view)
);
@@ -3795,7 +3695,7 @@ class Get
);
// Trigger Event: jcb_ce_onBeforeQueryFieldData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeQueryFieldData',
array(&$this->componentContext, &$id, &$query, &$this->db)
);
@@ -3809,7 +3709,7 @@ class Get
$field = $this->db->loadObject();
// Trigger Event: jcb_ce_onBeforeModelFieldData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeModelFieldData',
array(&$this->componentContext, &$field)
);
@@ -3834,7 +3734,7 @@ class Get
);
// load the values form params
- $field->xml = $this->setDynamicValues(json_decode($field->xml));
+ $field->xml = CFactory::_('Customcode')->add(json_decode($field->xml));
// check if we have validate (validation rule set)
$validationRule = GetHelper::between(
@@ -3871,13 +3771,13 @@ class Get
{
// open and set the validation rule
$this->validationRules[$validationRule]
- = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$this->validationRules[$validationRule]
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
array(
'table' => 'validation_rule',
@@ -3951,12 +3851,12 @@ class Get
$field->initiator_on_save_model
);
$field->initiator_save = explode(
- PHP_EOL, $this->setPlaceholders(
- $this->setDynamicValues(
+ PHP_EOL, CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$field->initiator_on_save_model
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
)
);
}
@@ -3968,28 +3868,28 @@ class Get
$field->initiator_on_get_model
);
$field->initiator_get = explode(
- PHP_EOL, $this->setPlaceholders(
- $this->setDynamicValues(
+ PHP_EOL, CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$field->initiator_on_get_model
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
)
);
}
// set the field modeling
$field->model_field['save'] = explode(
- PHP_EOL, $this->setPlaceholders(
- $this->setDynamicValues(
+ PHP_EOL, CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($field->on_save_model_field)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
)
);
$field->model_field['get'] = explode(
- PHP_EOL, $this->setPlaceholders(
- $this->setDynamicValues(
+ PHP_EOL, CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($field->on_get_model_field)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
)
);
// remove the original values
@@ -4000,7 +3900,7 @@ class Get
$field->history = $this->getHistoryWatch('field', $id);
// Trigger Event: jcb_ce_onAfterModelFieldData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterModelFieldData',
array(&$this->componentContext, &$field)
);
@@ -4496,8 +4396,8 @@ class Get
|| strpos($requeSt_id, '_request_catid') !== false)
{
// keep it then, don't change
- $name = $this->setPlaceholders(
- $requeSt_id, $this->placeholders
+ $name = CFactory::_('Placeholder')->update(
+ $requeSt_id, CFactory::_('Placeholder')->active
);
}
else
@@ -4508,20 +4408,20 @@ class Get
if (StringHelper::check($listViewName))
{
// check if we should use another Text Name as this views name
- $otherName = $this->setPlaceholders(
+ $otherName = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'othername="', '"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
- $otherViews = $this->setPlaceholders(
+ $otherViews = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'views="', '"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
- $otherView = $this->setPlaceholders(
+ $otherView = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'view="', '"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
// This is to link other view category
if (StringHelper::check($otherName)
@@ -4561,10 +4461,10 @@ class Get
{
// get value from xml
$xml = FieldHelper::safe(
- $this->setPlaceholders(
+ CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'name="', '"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
)
);
// check if a value was found
@@ -4701,7 +4601,7 @@ class Get
foreach ($results as $_nr => &$result)
{
// Trigger Event: jcb_ce_onBeforeModelDynamicGetData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeModelDynamicGetData',
array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context)
);
@@ -4716,8 +4616,8 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'php_calculation';
$result->php_calculation
- = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($result->php_calculation)
),
$guiMapper
@@ -4734,8 +4634,8 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'php_router_parse';
$result->php_router_parse
- = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($result->php_router_parse)
),
$guiMapper
@@ -4770,7 +4670,7 @@ class Get
$guiMapper['prefix'] = PHP_EOL . PHP_EOL;
$this->setCustomScriptBuilder(
$result->{$script},
- $this->target . '_' . $script,
+ CFactory::_('Config')->build_target . '_' . $script,
$view_code,
false,
$guiMapper,
@@ -4790,8 +4690,8 @@ class Get
$guiMapper['prefix'] = PHP_EOL;
// only for custom gets
$result->{$script}
- = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($result->{$script})
),
$guiMapper
@@ -4859,8 +4759,8 @@ class Get
$guiMapper['field'] = 'php_custom_get';
// get the custom query
$customQueryString
- = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($result->php_custom_get)
),
$guiMapper
@@ -4989,12 +4889,12 @@ class Get
|| isset($_part_of_a[$join_field[0]])
|| isset($_part_of_a[$on_field[0]]))
{
- $this->siteMainGet[$this->target][$view_code][$option['as']]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$view_code][$option['as']]
= $option['as'];
}
else
{
- $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option['as']][$join_field[1]]
= $on_field[0];
}
}
@@ -5003,7 +4903,7 @@ class Get
$result->custom_get[] = $option;
if ($on_field[0] != 'a')
{
- $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option['as']][$join_field[1]]
= $on_field[0];
}
}
@@ -5089,12 +4989,12 @@ class Get
|| isset($_part_of_a[$join_field[0]])
|| isset($_part_of_a[$on_field[0]]))
{
- $this->siteMainGet[$this->target][$view_code][$option1['as']]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$view_code][$option1['as']]
= $option1['as'];
}
else
{
- $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option1['as']][$join_field[1]]
= $on_field[0];
}
}
@@ -5103,7 +5003,7 @@ class Get
$result->custom_get[] = $option1;
if ($on_field[0] != 'a')
{
- $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$view_code][$option1['as']][$join_field[1]]
= $on_field[0];
}
}
@@ -5127,10 +5027,10 @@ class Get
$option2['operator']
= $operatorArray[$option2['operator']];
$option2['state_key']
- = $this->setPlaceholders(
- $this->setDynamicValues(
+ = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
$option2['state_key']
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
$option2['key'] = $result->key;
}
@@ -5216,7 +5116,7 @@ class Get
$result->plugin_events = '';
}
// Trigger Event: jcb_ce_onAfterModelDynamicGetData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterModelDynamicGetData',
array(&$this->componentContext, &$result, &$result->id, &$view_code, &$context)
);
@@ -5294,7 +5194,7 @@ class Get
// prep the script string
if ($base64 && $dynamic)
{
- $script = $this->setDynamicValues(base64_decode($script));
+ $script = CFactory::_('Customcode')->add(base64_decode($script));
}
elseif ($base64)
{
@@ -5302,7 +5202,7 @@ class Get
}
elseif ($dynamic) // this does not happen (just incase)
{
- $script = $this->setDynamicValues($script);
+ $script = CFactory::_('Customcode')->add($script);
}
// check if we still have a string
if (StringHelper::check($script))
@@ -5310,7 +5210,7 @@ class Get
// now load the placeholder snippet if needed
if ($base64 || $dynamic)
{
- $script = $this->setGuiCodePlaceholder($script, $config);
+ $script = CFactory::_('Customcode.Gui')->set($script, $config);
}
// add Dynamic HASHING option of a file/string
$script = $this->setDynamicHASHING($script);
@@ -5395,8 +5295,8 @@ class Get
}
// load the actual script
$script .= $prefix . str_replace(
- array_keys($this->placeholders),
- array_values($this->placeholders),
+ array_keys(CFactory::_('Placeholder')->active),
+ array_values(CFactory::_('Placeholder')->active),
$this->customScriptBuilder[$first][$second]
) . $sufix;
// clear some memory
@@ -5814,7 +5714,7 @@ class Get
// remove watch
if (isset($version_note['component'])
&& ($key = array_search(
- Config::get('component_id'), $version_note['component']
+ CFactory::_('Config')->component_id, $version_note['component']
)) !== false)
{
// last version that was used to build/compile
@@ -5830,9 +5730,9 @@ class Get
break;
case 1:
// add watch
- if (!in_array(Config::get('component_id'), $version_note['component']))
+ if (!in_array(CFactory::_('Config')->component_id, $version_note['component']))
{
- $version_note['component'][] = Config::get('component_id');
+ $version_note['component'][] = CFactory::_('Config')->component_id;
}
else
{
@@ -5913,9 +5813,9 @@ class Get
{
foreach ($templates as $template)
{
- if (!isset($this->templateData[$this->target][$view])
+ if (!isset($this->templateData[CFactory::_('Config')->build_target][$view])
|| !array_key_exists(
- $template, $this->templateData[$this->target][$view]
+ $template, $this->templateData[CFactory::_('Config')->build_target][$view]
))
{
$data = $this->getDataWithAlias(
@@ -5924,7 +5824,7 @@ class Get
if (ArrayHelper::check($data))
{
// load it to the template data array
- $this->templateData[$this->target][$view][$template]
+ $this->templateData[CFactory::_('Config')->build_target][$view][$template]
= $data;
// call self to get child data
$again[] = array($data['html'], $view);
@@ -5933,7 +5833,7 @@ class Get
}
// check if we have the template set (and nothing yet found)
if (!$found
- && isset($this->templateData[$this->target][$view][$template]))
+ && isset($this->templateData[CFactory::_('Config')->build_target][$view][$template]))
{
// something was found
$found = true;
@@ -5972,27 +5872,27 @@ class Get
{
// get the other target if both
$_target = null;
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
- $_target = ($this->target === 'admin') ? 'site' : 'admin';
+ $_target = (CFactory::_('Config')->build_target === 'admin') ? 'site' : 'admin';
}
foreach ($layouts as $layout)
{
- if (!isset($this->layoutData[$this->target])
+ if (!isset($this->layoutData[CFactory::_('Config')->build_target])
|| !ArrayHelper::check(
- $this->layoutData[$this->target]
+ $this->layoutData[CFactory::_('Config')->build_target]
)
|| !array_key_exists(
- $layout, $this->layoutData[$this->target]
+ $layout, $this->layoutData[CFactory::_('Config')->build_target]
))
{
$data = $this->getDataWithAlias($layout, 'layout', $view);
if (ArrayHelper::check($data))
{
// load it to the layout data array
- $this->layoutData[$this->target][$layout] = $data;
+ $this->layoutData[CFactory::_('Config')->build_target][$layout] = $data;
// check if other target is set
- if ($this->lang === 'both' && $_target)
+ if (CFactory::_('Config')->lang_target === 'both' && $_target)
{
$this->layoutData[$_target][$layout] = $data;
}
@@ -6002,7 +5902,7 @@ class Get
}
}
// check if we have the layout set (and nothing yet found)
- if (!$found && isset($this->layoutData[$this->target][$layout]))
+ if (!$found && isset($this->layoutData[CFactory::_('Config')->build_target][$layout]))
{
// something was found
$found = true;
@@ -6060,8 +5960,8 @@ class Get
$this->db->quoteName('a.id') . ' = ' . (int) $ID
);
// get the other target if both
- $_targets = array($this->target);
- if ($this->lang === 'both')
+ $_targets = array(CFactory::_('Config')->build_target);
+ if (CFactory::_('Config')->lang_target === 'both')
{
$_targets = array('site', 'admin');
}
@@ -6073,8 +5973,8 @@ class Get
if ($row->add_php_view == 1
&& StringHelper::check($row->php_view))
{
- $php_view = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(base64_decode($row->php_view)),
+ $php_view = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(base64_decode($row->php_view)),
array(
'table' => $table,
'field' => 'php_view',
@@ -6082,8 +5982,8 @@ class Get
'type' => 'php')
);
}
- $contnent = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(base64_decode($row->{$table})),
+ $contnent = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(base64_decode($row->{$table})),
array(
'table' => $table,
'field' => $table,
@@ -6188,7 +6088,7 @@ class Get
return array(
'id' => $row->id,
- 'html' => $this->setGuiCodePlaceholder(
+ 'html' => CFactory::_('Customcode.Gui')->set(
$contnent,
array(
'table' => $table,
@@ -6197,7 +6097,7 @@ class Get
'type' => 'html'
)
),
- 'php_view' => $this->setGuiCodePlaceholder(
+ 'php_view' => CFactory::_('Customcode.Gui')->set(
$php_view,
array(
'table' => $table,
@@ -6460,8 +6360,8 @@ class Get
$library->php_setdocument
))
{
- $library->document = $this->setGuiCodePlaceholder(
- $this->setDynamicValues(
+ $library->document = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Customcode')->add(
base64_decode($library->php_setdocument)
),
array(
@@ -6515,156 +6415,11 @@ class Get
* @param string $content The content
*
* @return string The content with the updated Language place holder
- *
+ * @deprecated 3.3 Use CFactory::_('Language.Extractor')->engine($content)
*/
public function setLangStrings($content)
{
- // get targets to search for
- $langStringTargets = array_filter(
- $this->langStringTargets, function ($get) use ($content) {
- if (strpos($content, $get) !== false)
- {
- return true;
- }
-
- return false;
- }
- );
- // check if we should continue
- if (ArrayHelper::check($langStringTargets))
- {
- // insure string is not broken
- $content = $this->setPlaceholders($content, $this->placeholders);
- // reset some buckets
- $langHolders = array();
- $langCheck = array();
- $langOnly = array();
- $jsTEXT = array();
- $scTEXT = array();
- // first get the Joomla .JText._()
- if (in_array('Joomla' . '.JText._(', $langStringTargets))
- {
- $jsTEXT[] = GetHelper::allBetween(
- $content, "Joomla" . ".JText._('", "'"
- );
- $jsTEXT[] = GetHelper::allBetween(
- $content, 'Joomla' . '.JText._("', '"'
- );
- // combine into one array
- $jsTEXT = ArrayHelper::merge($jsTEXT);
- // we need to add a check to insure these JavaScript lang matchup
- if (ArrayHelper::check(
- $jsTEXT
- )) //<-- not really needed hmmm
- {
- // load the JS text to mismatch array
- $langCheck[] = $jsTEXT;
- $this->langMismatch = ArrayHelper::merge(
- array($jsTEXT, $this->langMismatch)
- );
- }
- }
- // now get the JText: :script()
- if (in_array('JText:' . ':script(', $langStringTargets))
- {
- $scTEXT[] = GetHelper::allBetween(
- $content, "JText:" . ":script('", "'"
- );
- $scTEXT[] = GetHelper::allBetween(
- $content, 'JText:' . ':script("', '"'
- );
- // combine into one array
- $scTEXT = ArrayHelper::merge($scTEXT);
- // we need to add a check to insure these JavaScript lang matchup
- if (ArrayHelper::check($scTEXT))
- {
- // load the Script text to match array
- $langCheck[] = $scTEXT;
- $this->langMatch = ArrayHelper::merge(
- array($scTEXT, $this->langMatch)
- );
- }
- }
- // now do the little trick for JustTEXT: :_('Just uppercase text');
- if (in_array('JustTEXT:' . ':_(', $langStringTargets))
- {
- $langOnly[] = GetHelper::allBetween(
- $content, "JustTEXT:" . ":_('", "')"
- );
- $langOnly[] = GetHelper::allBetween(
- $content, 'JustTEXT:' . ':_("', '")'
- );
- // merge lang only
- $langOnly = ArrayHelper::merge($langOnly);
- }
- // set language data
- foreach ($langStringTargets as $langStringTarget)
- {
- // need some special treatment here
- if ($langStringTarget === 'Joomla' . '.JText._('
- || $langStringTarget === 'JText:' . ':script('
- || $langStringTarget === 'JustTEXT:' . ':_(')
- {
- continue;
- }
- $langCheck[] = GetHelper::allBetween(
- $content, $langStringTarget . "'", "'"
- );
- $langCheck[] = GetHelper::allBetween(
- $content, $langStringTarget . '"', '"'
- );
- }
- // the normal loading of the language strings
- $langCheck = ArrayHelper::merge($langCheck);
- if (ArrayHelper::check(
- $langCheck
- )) //<-- not really needed hmmm
- {
- foreach ($langCheck as $string)
- {
- if ($keyLang = $this->setLang($string))
- {
- // load the language targets
- foreach ($langStringTargets as $langStringTarget)
- {
- // need some special treatment here
- if ($langStringTarget === 'JustTEXT:' . ':_(')
- {
- continue;
- }
- $langHolders[$langStringTarget . "'" . $string
- . "'"]
- = $langStringTarget . "'" . $keyLang . "'";
- $langHolders[$langStringTarget . '"' . $string
- . '"']
- = $langStringTarget . '"' . $keyLang . '"';
- }
- }
- }
- }
- // the uppercase loading only (for arrays and other tricks)
- if (ArrayHelper::check($langOnly))
- {
- foreach ($langOnly as $string)
- {
- if ($keyLang = $this->setLang($string))
- {
- // load the language targets
- $langHolders["JustTEXT:" . ":_('" . $string . "')"]
- = "'" . $keyLang . "'";
- $langHolders['JustTEXT:' . ':_("' . $string . '")']
- = '"' . $keyLang . '"';
- }
- }
- }
- // only continue if we have value to replace
- if (ArrayHelper::check($langHolders))
- {
- $content = $this->setPlaceholders($content, $langHolders);
- }
- }
-
- return $content;
+ return CFactory::_('Language.Extractor')->engine($content);
}
/**
@@ -6673,24 +6428,11 @@ class Get
* @param string $string The plan text string (English)
*
* @return string The key language string (all uppercase)
- *
+ * @deprecated 3.3 Use CFactory::_('Language')->key($string);
*/
public function setLang($string)
{
- // this is there to insure we dont break already added Language strings
- if (StringHelper::safe($string, 'U', '_', false, false)
- === $string)
- {
- return false;
- }
- // build lang key
- $keyLang = Config::get('lang_prefix') . '_' . StringHelper::safe(
- $string, 'U'
- );
- // set the language string
- $this->setLangContent($this->lang, $keyLang, $string);
-
- return $keyLang;
+ return CFactory::_('Language')->key($string);
}
/**
@@ -6722,7 +6464,7 @@ class Get
elseif ('view' === $type)
{
$view = $this->getViewTableName($asset);
- $table = '#__' . Config::get('component_code_name') . '_' . $view;
+ $table = '#__' . CFactory::_('Config')->component_code_name . '_' . $view;
$queryName = $view;
}
// just get all values from table if * is found
@@ -6836,9 +6578,9 @@ class Get
else
{
$querySelect = '$query->select($db->quoteName('
- . PHP_EOL . $this->_t(3) . 'array(' . implode(
+ . PHP_EOL . Indent::_(3) . 'array(' . implode(
',', $gets
- ) . '),' . PHP_EOL . $this->_t(3) . 'array('
+ ) . '),' . PHP_EOL . Indent::_(3) . 'array('
. implode(',', $keys) . ')));';
}
$queryFrom = '$db->quoteName(' . $this->db->quote($table)
@@ -7042,11 +6784,10 @@ class Get
// start building the MySql dump
$dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__"
- . $this->bbb . "component" . $this->ddd . "_" . $view
+ . Placefix::_( "component" ) . "_" . $view
. "`";
$dump .= PHP_EOL . "--";
- $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb
- . "component" . $this->ddd . "_" . $view . "` (";
+ $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . Placefix::_("component" ) . "_" . $view . "` (";
foreach ($data as $line)
{
$comaSet = 0;
@@ -7147,12 +6888,12 @@ class Get
*/
public function uniqueCode($code)
{
- if (!isset($this->uniquecodes[$this->target])
+ if (!isset($this->uniquecodes[CFactory::_('Config')->build_target])
|| !in_array(
- $code, $this->uniquecodes[$this->target]
+ $code, $this->uniquecodes[CFactory::_('Config')->build_target]
))
{
- $this->uniquecodes[$this->target][] = $code;
+ $this->uniquecodes[CFactory::_('Config')->build_target][] = $code;
return $code;
}
@@ -7262,25 +7003,11 @@ class Get
* dynamic build values if it gets broken
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Customcode')->add($string, $debug);
*/
public function setDynamicValues($string, $debug = 0)
{
- if (StringHelper::check($string))
- {
- $string = $this->setLangStrings(
- $this->setCustomCodeData(
- $this->setExternalCodeString($string, $debug), $debug
- )
- );
- }
- // if debug
- if ($debug)
- {
- jexit();
- }
-
- return $string;
+ return CFactory::_('Customcode')->add($string, $debug);
}
/**
@@ -7290,94 +7017,11 @@ class Get
* @param int $debug The switch to debug the update
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Customcode.External')->set($string, $debug);
*/
public function setExternalCodeString($string, $debug = 0)
{
- // check if content has custom code placeholder
- if (strpos($string, '[EXTERNA' . 'LCODE=') !== false)
- {
- // if debug
- if ($debug)
- {
- echo 'External Code String:';
- var_dump($string);
- }
- // target content
- $bucket = array();
- $found = GetHelper::allBetween(
- $string, '[EXTERNA' . 'LCODE=', ']'
- );
- if (ArrayHelper::check($found))
- {
- // build local bucket
- foreach ($found as $target)
- {
- // check for cutting sequence
- // example: >{3|4
- // will cut 3 rows at top and 4 rows at bottom
- // if the external code has 8 or more lines
- if (($pos = strpos($target, '>{')) !== false)
- {
- // the length
- $target_len = strlen($target);
- // where to cut
- $cutting = $target_len - $pos;
- // get the sequence
- $sequence = substr($target, "-$cutting");
- // remove from the URL
- $target_url = str_replace($sequence, '', $target);
- // set the cut key for this target if not set
- $this->externalCodeCutter[trim($target)] = str_replace('>{', '', $sequence);
- }
- else
- {
- $target_url = $target;
- }
- // check if the target is valid URL or path
- if ((!filter_var($target_url, FILTER_VALIDATE_URL) === false
- && ComponentbuilderHelper::urlExists($target_url))
- || (JPath::clean($target_url) === $target_url
- && File::exists($target_url)))
- {
- $this->getExternalCodeString($target, $bucket);
- }
- // give notice that target is not a valid url/path
- else
- {
- // set key
- $key = '[EXTERNA' . 'LCODE=' . $target . ']';
- // set the notice
- $this->app->enqueueMessage(
- JText::_(
- 'External Code Warning '
- ), 'Warning'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- 'The %s is not a valid url/path!',
- $key
- ), 'Warning'
- );
- // remove the placeholder
- $bucket[$key] = '';
- }
- }
- // now update local string if bucket has values
- if (ArrayHelper::check($bucket))
- {
- $string = $this->setPlaceholders($string, $bucket);
- }
- }
- // if debug
- if ($debug)
- {
- echo 'External Code String After Update:';
- var_dump($string);
- }
- }
-
- return $string;
+ return CFactory::_('Customcode.External')->set($string, $debug);
}
/**
@@ -7387,161 +7031,19 @@ class Get
* @param array $bucket The Placeholders bucket
*
* @return void
- *
+ * @deprecated 3.3
*/
protected function getExternalCodeString($target, &$bucket)
{
- // set URL key
- $target_key = trim($target);
- // set key
- $key = '[EXTERNA' . 'LCODE=' . $target . ']';
- // remove the cut sequence from the url
- if (isset($this->externalCodeCutter[$target_key]))
- {
- // remove from the URL
- $target_url = trim(str_replace('>{' . $this->externalCodeCutter[$target_key], '', $target));
- }
- else
- {
- $target_url = trim($target);
- }
- // check if we already fetched this
- if (!isset($this->externalCodeString[$target_key]))
- {
- // get the data string (code)
- $this->externalCodeString[$target_key]
- = FileHelper::getContent($target_url);
- // check if we must cut this
- if (isset($this->externalCodeCutter[$target_key]) &&
- $this->externalCodeCutter[$target_key])
- {
- $this->externalCodeString[$target_key] = $this->cutExternalCodeString(
- $this->externalCodeString[$target_key],
- $this->externalCodeCutter[$target_key],
- $key
- );
- }
- // did we get any value
- if (StringHelper::check(
- $this->externalCodeString[$target_key]
- ))
- {
- // check for changes
- $live_hash = md5($this->externalCodeString[$target_key]);
- // check if it exists local
- if ($hash = GetHelper::var(
- 'external_code', $target_key, 'target', 'hash'
- ))
- {
- // must be an admin make a change to use EXTERNAL code (we may add a custom access switch - use ADMIN for now)
- if ($hash !== $live_hash && $this->user->authorise(
- 'core.admin', 'com_componentbuilder'
- ))
- {
- // update the hash since it changed
- $object = new stdClass();
- $object->target = $target_key;
- $object->hash = $live_hash;
- // update local hash
- $this->db->updateObject(
- '#__componentbuilder_external_code', $object,
- 'target'
- );
- // give notice of the change
- $this->app->enqueueMessage(
- JText::_('External Code Warning '),
- 'Warning'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- 'The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once .',
- $key
- ), 'Warning'
- );
- }
- elseif ($hash !== $live_hash)
- {
- // set the notice
- $this->app->enqueueMessage(
- JText::_('External Code Error '),
- 'Error'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- '%s, we detected a change in EXTERNALCODE , but you do not have permission to allow this change so %s was removed from the compilation. Please contact your system administrator for more info!(admin access required) ',
- $this->user->get('name'), $key
- ), 'Error'
- );
- // remove the code/string
- $this->externalCodeString[$target_key] = '';
- }
- }
- // only an admin can add new EXTERNAL code (we may add a custom access switch - use ADMIN for now)
- elseif ($this->user->authorise(
- 'core.admin', 'com_componentbuilder'
- ))
- {
- // add the hash to track changes
- $object = new stdClass();
- $object->target = $target_key;
- $object->hash = $live_hash;
- // insert local hash
- $this->db->insertObject(
- '#__componentbuilder_external_code', $object
- );
- // give notice the first time this is added
- $this->app->enqueueMessage(
- JText::_('External Code Notice '),
- 'Warning'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- 'The code/string from %s has been added for the first time . Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once .',
- $key
- ), 'Warning'
- );
- }
- else
- {
- // set the notice
- $this->app->enqueueMessage(
- JText::_('External Code Error '),
- 'Error'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- '%s, we detected NEW EXTERNALCODE , but you do not have permission to allow this new code/string so %s was removed from the compilation. Please contact you system administrator for more info!(admin access required) ',
- $this->user->get('name'), $key
- ), 'Error'
- );
- // remove the code/string
- $this->externalCodeString[$target_key] = '';
- }
- }
- else
- {
- // set notice that we could not get a valid string from the target
- $this->app->enqueueMessage(
- JText::_('External Code Warning '), 'Error'
- );
- $this->app->enqueueMessage(
- JText::sprintf(
- 'The %s returned an invalid string!', $key
- ), 'Error'
- );
- }
- }
- // add to local bucket
- if (isset($this->externalCodeString[$target_key]))
- {
- // update the placeholder with the external code string
- $bucket[$key] = $this->externalCodeString[$target_key];
- }
- else
- {
- // remove the placeholder
- $bucket[$key] = '';
- }
+ // set notice that we could not get a valid string from the target
+ $this->app->enqueueMessage(
+ JText::_('External Code Warning '), 'Error'
+ );
+ $this->app->enqueueMessage(
+ JText::_(
+ 'Use of a deprecated method (getExternalCodeString)!'
+ ), 'Error'
+ );
}
/**
@@ -7552,41 +7054,17 @@ class Get
* @param string $key The content key
*
* @return string
- *
+ * @deprecated 3.3
*/
protected function cutExternalCodeString($string, $sequence, $key)
{
- // we first break the string up in rows
- $rows = (array) explode(PHP_EOL, $string);
- // get the cutting sequence
- $cutter = (array) explode('|', $sequence);
- // we only continue if we have more rows than we have to cut
- if (array_sum($cutter) < ArrayHelper::check($rows))
- {
- // remove the rows at the bottom if needed
- if (isset($cutter[1]) && $cutter[1] > 0)
- {
- array_splice($rows, "-$cutter[1]");
- }
- // remove the rows at the top if needed
- if ($cutter[0] > 0)
- {
- $rows = array_splice($rows, $cutter[0]);
- }
-
- // return the remaining rows
- return implode(PHP_EOL, $rows);
- }
-
- // we set an error message about too few lines to cut
+ // set notice that we could not get a valid string from the target
$this->app->enqueueMessage(
- JText::_('External Code Notice '),
- 'Error'
+ JText::_('External Code Warning '), 'Error'
);
$this->app->enqueueMessage(
- JText::sprintf(
- 'The %s cut sequence failed on the returned external code/string as more lines has to be cut then was found in the code/string. We have completely removed the code. Please check this code/string!',
- $key
+ JText::_(
+ 'Use of a deprecated method (cutExternalCodeString)!'
), 'Error'
);
@@ -7600,182 +7078,11 @@ class Get
* @param int $debug The switch to debug the update
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Customcode')->set($string, $debug, $not);
*/
public function setCustomCodeData($string, $debug = 0, $not = null)
{
- // insure the code is loaded
- $loaded = false;
- // check if content has custom code place holder
- if (strpos($string, '[CUSTO' . 'MCODE=') !== false)
- {
- // if debug
- if ($debug)
- {
- echo 'Custom Code String:';
- var_dump($string);
- }
- // the ids found in this content
- $bucket = array();
- $found = GetHelper::allBetween(
- $string, '[CUSTO' . 'MCODE=', ']'
- );
- if (ArrayHelper::check($found))
- {
- foreach ($found as $key)
- {
- // if debug
- if ($debug)
- {
- echo '$key before update:';
- var_dump($key);
- }
- // check if we have args
- if (is_numeric($key))
- {
- $id = (int) $key;
- }
- elseif (StringHelper::check($key)
- && strpos(
- $key, '+'
- ) === false)
- {
- $getFuncName = trim($key);
- if (!isset($this->functionNameMemory[$getFuncName]))
- {
- if (!$found_local = GetHelper::var(
- 'custom_code', $getFuncName, 'function_name',
- 'id'
- ))
- {
- continue;
- }
- $this->functionNameMemory[$getFuncName]
- = $found_local;
- }
- $id = (int) $this->functionNameMemory[$getFuncName];
- }
- elseif (StringHelper::check($key)
- && strpos(
- $key, '+'
- ) !== false)
- {
- $array = explode('+', $key);
- // set ID
- if (is_numeric($array[0]))
- {
- $id = (int) $array[0];
- }
- elseif (StringHelper::check($array[0]))
- {
- $getFuncName = trim($array[0]);
- if (!isset($this->functionNameMemory[$getFuncName]))
- {
- if (!$found_local
- = GetHelper::var(
- 'custom_code', $getFuncName,
- 'function_name', 'id'
- ))
- {
- continue;
- }
- $this->functionNameMemory[$getFuncName]
- = $found_local;
- }
- $id = (int) $this->functionNameMemory[$getFuncName];
- }
- else
- {
- continue;
- }
- // load args for this ID
- if (isset($array[1]))
- {
- if (!isset($this->customCodeData[$id]['args']))
- {
- $this->customCodeData[$id]['args'] = array();
- }
- // only load if not already loaded
- if (!isset($this->customCodeData[$id]['args'][$key]))
- {
- if (strpos($array[1], ',') !== false)
- {
- // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values)
- $this->customCodeData[$id]['args'][$key]
- = array_map(
- function ($_key) {
- return $this->setPlaceholders(
- $_key,
- $this->customCodeKeyPlacholders
- );
- }, (array) explode(',', $array[1])
- );
- }
- elseif (StringHelper::check(
- $array[1]
- ))
- {
- $this->customCodeData[$id]['args'][$key]
- = array();
- // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values)
- $this->customCodeData[$id]['args'][$key][]
- = $this->setPlaceholders(
- $array[1],
- $this->customCodeKeyPlacholders
- );
- }
- }
- }
- }
- else
- {
- continue;
- }
- // make sure to remove the not if set
- if ($not && is_numeric($not) && $not > 0 && $not == $id)
- {
- continue;
- }
- $bucket[$id] = $id;
- }
- }
- // if debug
- if ($debug)
- {
- echo 'Bucket:';
- var_dump($bucket);
- }
- // check if any custom code placeholders where found
- if (ArrayHelper::check($bucket))
- {
- $_tmpLang = $this->lang;
- // insure we add the langs to both site and admin
- $this->lang = 'both';
- // now load the code to memory
- $loaded = $this->getCustomCode($bucket, false, $debug);
- // revert lang to current setting
- $this->lang = $_tmpLang;
- }
- // if debug
- if ($debug)
- {
- echo 'Loaded:';
- var_dump($loaded);
- }
- // when the custom code is loaded
- if ($loaded === true)
- {
- $string = $this->insertCustomCode($bucket, $string, $debug);
- }
- // if debug
- if ($debug)
- {
- echo 'Custom Code String After Update:';
- var_dump($string);
- }
- }
-
- return $string;
+ return CFactory::_('Customcode')->set($string, $debug, $not);
}
/**
@@ -7785,29 +7092,21 @@ class Get
* @param int $debug The switch to debug the update
*
* @return string on success
- *
+ * @deprecated 3.3
*/
protected function insertCustomCode($ids, $string, $debug = 0)
{
- $code = array();
- // load the code
- foreach ($ids as $id)
- {
- $this->buildCustomCodePlaceholders(
- $this->customCodeMemory[$id], $code, $debug
- );
- }
- // if debug
- if ($debug)
- {
- echo 'Place holders to Update String:';
- var_dump($code);
- echo 'Custom Code String Before Update:';
- var_dump($string);
- }
+ // set notice that we could not get a valid string from the target
+ $this->app->enqueueMessage(
+ JText::_('External Code Warning '), 'Error'
+ );
+ $this->app->enqueueMessage(
+ JText::_(
+ 'Use of a deprecated method (insertCustomCode)!'
+ ), 'Error'
+ );
- // now update the string
- return $this->setPlaceholders($string, $code);
+ return '';
}
/**
@@ -7817,73 +7116,21 @@ class Get
* @param int $debug The switch to debug the update
*
* @return string on success
- *
+ * @deprecated 3.3
*/
protected function buildCustomCodePlaceholders($item, &$code, $debug = 0)
{
- // check if there is args for this code
- if (isset($this->customCodeData[$item['id']]['args'])
- && ArrayHelper::check(
- $this->customCodeData[$item['id']]['args']
- ))
- {
- // since we have args we cant update this code via IDE (TODO)
- $placeholder = $this->getPlaceHolder(3, null);
- // if debug
- if ($debug)
- {
- echo 'Custom Code Placeholders:';
- var_dump($placeholder);
- }
- // we have args and so need to load each
- foreach (
- $this->customCodeData[$item['id']]['args'] as $key => $args
- )
- {
- $this->setThesePlaceHolders('arg', $args);
- // if debug
- if ($debug)
- {
- echo 'Custom Code Global Placholders:';
- var_dump($this->placeholders);
- }
- $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start']
- . PHP_EOL . $this->setPlaceholders(
- $item['code'], $this->placeholders
- ) . $placeholder['end'];
- }
- // always clear the args
- $this->clearFromPlaceHolders('arg');
- }
- else
- {
- if (($keyPlaceholder = array_search(
- $item['id'], $this->functionNameMemory
- )) === false)
- {
- $keyPlaceholder = $item['id'];
- }
- // check what type of place holders we should load here
- $placeholderType = (int) $item['comment_type'] . '2';
- if (stripos($item['code'], $this->bbb . 'view') !== false
- || stripos($item['code'], $this->bbb . 'sview') !== false
- || stripos($item['code'], $this->bbb . 'arg') !== false)
- {
- // if view is being set dynamicly then we can't update this code via IDE (TODO)
- $placeholderType = 3;
- }
- // if now ars were found, clear it
- $this->clearFromPlaceHolders('arg');
- // load args for this code
- $placeholder = $this->getPlaceHolder(
- $placeholderType, $item['id']
- );
- $code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']']
- = $placeholder['start'] . PHP_EOL
- . $this->setPlaceholders(
- $item['code'], $this->placeholders
- ) . $placeholder['end'];
- }
+ // set notice that we could not get a valid string from the target
+ $this->app->enqueueMessage(
+ JText::_('External Code Warning '), 'Error'
+ );
+ $this->app->enqueueMessage(
+ JText::_(
+ 'Use of a deprecated method (buildCustomCodePlaceholders)!'
+ ), 'Error'
+ );
+
+ return '';
}
/**
@@ -7893,21 +7140,12 @@ class Get
* @param array $values The values to add
*
* @return void
+ * @deprecated 3.3 Use CFactory::_('Placeholder')->setType($key, $values);
*/
public function setThesePlaceHolders($key, $values)
{
- // aways fist reset these
- $this->clearFromPlaceHolders($key);
- if (ArrayHelper::check($values))
- {
- $number = 0;
- foreach ($values as $value)
- {
- $this->placeholders[$this->bbb . $key . $number . $this->ddd]
- = $value;
- $number++;
- }
- }
+ // use the new container class
+ CFactory::_('Placeholder')->setType($key, $values);
}
/**
@@ -7916,16 +7154,12 @@ class Get
* @param string $like The main string for placeholder key
*
* @return void
+ * @deprecated 3.3 Use CFactory::_('Placeholder')->clearType($key);
*/
public function clearFromPlaceHolders($like)
{
- foreach ($this->placeholders as $something => $value)
- {
- if (stripos($something, $like) !== false)
- {
- unset($this->placeholders[$something]);
- }
- }
+ // use the new container class
+ CFactory::_('Placeholder')->clearType($like);
}
/**
@@ -7998,7 +7232,7 @@ class Get
$counterUpdate = 0;
$today = JFactory::getDate()->toSql();
foreach (
- $this->languages[$target][Config::get('lang_tag', 'en-GB')] as $area => $placeholders
+ $this->languages[$target][CFactory::_('Config')->get('lang_tag', 'en-GB')] as $area => $placeholders
)
{
foreach ($placeholders as $placeholder => $string)
@@ -8455,130 +7689,40 @@ class Get
/**
* get the custom code from the system
*
- * @return void
+ * @param array|null $ids The custom code ides if known
+ * @param int|null $setLang The set lang switch
+ * @param int $debug The switch to debug the update
*
+ * @return void
+ * @deprecated 3.3 Use CFactory::_('Customcode')->load($ids, $setLang, $debug);
*/
- public function getCustomCode($ids = null, $setLang = true, $debug = 0)
+ public function getCustomCode(?array $ids = null, bool $setLang = true, int $debug = 0)
{
- // should the result be stored in memory
- $loadInMemory = false;
- // Create a new query object.
- $query = $this->db->getQuery(true);
- $query->from(
- $this->db->quoteName('#__componentbuilder_custom_code', 'a')
- );
+ CFactory::_('Customcode')->load($ids, $setLang, $debug);
+ }
+
+ /**
+ * check if we already have these ids in local memory
+ *
+ * @return void
+ * @deprecated 3.3
+ */
+ protected function checkCustomCodeMemory($ids)
+ {
+ // reset custom code
+ CFactory::_('Customcode')->active = array();
+ foreach ($ids as $pointer => $id)
+ {
+ if (isset(CFactory::_('Customcode')->memory[$id]))
+ {
+ CFactory::_('Customcode')->active[] = CFactory::_('Customcode')->memory[$id];
+ unset($ids[$pointer]);
+ }
+ }
+ // check if any ids left to fetch
if (ArrayHelper::check($ids))
{
- if ($idArray = $this->checkCustomCodeMemory($ids))
- {
- $query->select(
- $this->db->quoteName(
- array('a.id', 'a.code', 'a.comment_type')
- )
- );
- $query->where(
- $this->db->quoteName('a.id') . ' IN (' . implode(
- ',', $idArray
- ) . ')'
- );
- $query->where(
- $this->db->quoteName('a.target') . ' = 2'
- ); // <--- to load the correct target
- $loadInMemory = true;
- }
- else
- {
- // all values are already in memory continue
- return true;
- }
- }
- else
- {
- $query->select(
- $this->db->quoteName(
- array('a.id', 'a.code', 'a.comment_type', 'a.component',
- 'a.from_line', 'a.hashtarget', 'a.hashendtarget',
- 'a.path', 'a.to_line', 'a.type')
- )
- );
- $query->where(
- $this->db->quoteName('a.component') . ' = '
- . (int) $this->componentData->id
- );
- $query->where(
- $this->db->quoteName('a.target') . ' = 1'
- ); // <--- to load the correct target
- $query->order(
- $this->db->quoteName('a.from_line') . ' ASC'
- ); // <--- insure we always add code from top of file
- // reset custom code
- $this->customCode = array();
- }
- $query->where($this->db->quoteName('a.published') . ' >= 1');
- $this->db->setQuery($query);
- $this->db->execute();
- if ($this->db->getNumRows())
- {
- $bucket = $this->db->loadAssocList('id');
- // open the code
- foreach ($bucket as $nr => &$customCode)
- {
- $customCode['code'] = base64_decode($customCode['code']);
- // always insure that the external code is loaded
- $customCode['code'] = $this->setExternalCodeString(
- $customCode['code']
- );
- // set the lang only if needed
- if ($setLang)
- {
- $customCode['code'] = $this->setLangStrings(
- $customCode['code']
- );
- }
- // check for more custom code (since this is a custom code placeholder)
- else
- {
- $customCode['code'] = $this->setCustomCodeData(
- $customCode['code'], $debug, $nr
- );
- }
- // build the hash array
- if (isset($customCode['hashtarget']))
- {
- $customCode['hashtarget'] = explode(
- "__", $customCode['hashtarget']
- );
- // is this a replace code, set end has array
- if ($customCode['type'] == 1
- && strpos(
- $customCode['hashendtarget'], '__'
- ) !== false)
- {
- $customCode['hashendtarget'] = explode(
- "__", $customCode['hashendtarget']
- );
- // NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e)
- // I know this fix is not air-tight, but it should work as the value of an empty line when md5'ed is ^^^^
- // Then if the line number is only >>>one<<< it is almost always end of the page.
- // So I am using those two values to detect end of page replace ending, to avoid mismatching the ending target hash.
- if ($customCode['hashendtarget'][0] == 1
- && 'd41d8cd98f00b204e9800998ecf8427e'
- === $customCode['hashendtarget'][1])
- {
- // unset since this will force the replacement unto end of page.
- unset($customCode['hashendtarget']);
- }
- }
- }
- }
- // load this code into memory if needed
- if ($loadInMemory === true)
- {
- $this->customCodeMemory = $this->customCodeMemory + $bucket;
- }
- $this->customCode = array_merge($this->customCode, $bucket);
-
- return true;
+ return $ids;
}
return false;
@@ -8588,374 +7732,43 @@ class Get
* get all the powers linkd to this component
*
* @return void
- *
+ * @deprecated 3.3 Use CFactory::_('Power')->load($guids);
*/
protected function getPowers($guids)
{
- if (ArrayHelper::check($guids))
- {
- foreach ($guids as $guid => $build)
- {
- $this->getPower($guid, $build);
- }
- }
+ CFactory::_('Power')->load($guids);
}
/**
* get a power linkd to this component
*
* @return mixed
- *
+ * @deprecated 3.3 Use CFactory::_('Power')->get($guid, $build);
*/
public function getPower($guid, $build = 0)
{
- if ((Config::get('add_power', true) || $build == 1) && $this->setPower($guid))
- {
- return $this->powers[$guid];
- }
-
- return false;
+ CFactory::_('Power')->get($guid, $build);
}
/**
* set a power linkd to this component
*
* @return bool
- *
+ * @deprecated 3.3
*/
protected function setPower($guid)
{
- // check if we have been here before
- if (isset($this->statePowers[$guid]))
- {
- return $this->statePowers[$guid];
- }
- elseif (GuidHelper::valid($guid))
- {
- // Create a new query object.
- $query = $this->db->getQuery(true);
+ // set notice that we could not get a valid string from the target
+ $this->app->enqueueMessage(
+ JText::_('Power building error '), 'Error'
+ );
+ $this->app->enqueueMessage(
+ JText::_(
+ 'Use of a deprecated method (setPower)!'
+ ), 'Error'
+ );
- $query->select('a.*');
- // from these tables
- $query->from('#__componentbuilder_power AS a');
- $query->where($this->db->quoteName('a.guid') . ' = ' . $this->db->quote($guid));
- $this->db->setQuery($query);
- $this->db->execute();
- if ($this->db->getNumRows())
- {
- // make sure that in recursion we
- // don't try to load this power again
- $this->statePowers[$guid] = true;
- // get the power data
- $power = $this->db->loadObject();
- // we set the fix usr if needed
- $fix_url
- = '"index.php?option=com_componentbuilder&view=powers&task=power.edit&id='
- . $power->id . '" target="_blank"';
- // set some keys
- $power->target_type = 'P0m3R!';
- $power->key = $power->id . '_' . $power->target_type;
- // now set the name
- $power->name = $this->setPlaceholders(
- $this->setDynamicValues($power->name),
- $this->placeholders
- );
- // now set the code_name and class name
- $power->code_name = $power->class_name = ClassfunctionHelper::safe(
- $power->name
- );
- // set official name
- $power->official_name = StringHelper::safe(
- $power->name, 'W'
- );
- // set namespace
- $power->namespace = $this->setPlaceholders(
- $power->namespace, $this->placeholders
- );
- // validate namespace
- if (strpos($power->namespace, '\\') === false)
- {
- // we raise an error message
- $this->app->enqueueMessage(
- JText::sprintf('%s namespace error (%s) You must at-least have two sections in your namespace, you just have one. This is an unacceptable action, please see psr-4 for more info.
This %s was therefore removed, click here to fix this issue.
',
- ucfirst($power->type), $power->name, $power->namespace,
- '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $power->type,
- $fix_url),
- 'Error'
- );
- $this->statePowers[$guid] = false;
-
- // we break out here
- return false;
- }
- else
- {
- // setup the path array
- $path_array = (array) explode('\\', $power->namespace);
- // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming
- $power->namespace = NamespaceHelper::safe(str_replace('.', '\\', $power->namespace));
- // make sure it has two or more
- if (ArrayHelper::check($path_array) <= 1)
- {
- // we raise an error message
- $this->app->enqueueMessage(
- JText::sprintf('%s namespace error (%s) You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.
This %s was therefore removed, click here to fix this issue.
',
- ucfirst($power->type), $power->name, $power->namespace,
- '"https://www.php-fig.org/psr/psr-4/" target="_blank"', $power->type,
- $fix_url),
- 'Error'
- );
- $this->statePowers[$guid] = false;
-
- // we break out here
- return false;
- }
- // get the file and class name (the last value in array)
- $file_name = array_pop($path_array);
- // src array bucket
- $src_array = array();
- // do we have src folders
- if (strpos($file_name, '.') !== false)
- {
- // we have src folders in the namespace
- $src_array = (array) explode('.', $file_name);
- // get the file and class name (the last value in array)
- $power->file_name = array_pop($src_array);
- // namespace array
- $namespace_array = array_merge($path_array, $src_array);
- }
- else
- {
- // set the file name
- $power->file_name = $file_name;
- // namespace array
- $namespace_array = $path_array;
- }
- // the last value is the same as the class name
- if ($power->file_name !== $power->class_name)
- {
- // we raise an error message
- $this->app->enqueueMessage(
- JText::sprintf('%s naming mismatch error (%s)
The %s name is %s and the ending file name in the namespace is %s . This is bad convention, please see psr-4 for more info.
Click here to fix this issue.
',
- ucfirst($power->type), $power->name, $power->type, $power->class_name, $power->file_name,
- '"https://www.php-fig.org/psr/psr-4/" target="_blank"',
- $fix_url),
- 'Error'
- );
- $this->statePowers[$guid] = false;
-
- // we break out here
- return false;
- }
- // make sure the arrays are namespace safe
- $path_array = array_map(function ($val) {
- return NamespaceHelper::safe($val);
- }, $path_array);
- $namespace_array = array_map(function ($val) {
- return NamespaceHelper::safe($val);
- }, $namespace_array);
- // set the actual class namespace
- $power->_namespace = implode('\\', $namespace_array);
- // prefix values
- $power->_namespace_prefix = $path_array;
- // get the parent folder (the first value in array)
- $prefix_folder = implode('.', $path_array);
- // make sub folders if still found
- $sub_folder = '';
- if (ArrayHelper::check($src_array))
- {
- // make sure the arrays are namespace safe
- $sub_folder = '/' . implode('/', array_map(function ($val) {
- return NamespaceHelper::safe($val);
- }, $src_array));
- }
- // now we set the paths
- $power->path_jcb = Config::get('jcb_powers_path', 'libraries/jcb_powers');
- $power->path_parent = $power->path_jcb . '/' . $prefix_folder;
- $power->path = $power->path_parent . '/src' . $sub_folder;
- }
- // load use ids
- $use = array();
- $as = array();
- // check if we have use selection
- $power->use_selection = (isset($power->use_selection)
- && JsonHelper::check(
- $power->use_selection
- )) ? json_decode($power->use_selection, true) : null;
- if ($power->use_selection)
- {
- $use = array_values(array_map(function ($u) use(&$as) {
- // track the AS options
- if (empty($u['as']))
- {
- $as[$u['use']] = 'default';
- }
- else
- {
- $as[$u['use']] = (string) $u['as'];
- }
- // return the guid
- return $u['use'];
- }, $power->use_selection));
- }
- // check if we have load selection
- $power->load_selection = (isset($power->load_selection)
- && JsonHelper::check(
- $power->load_selection
- )) ? json_decode($power->load_selection, true) : null;
- if ($power->load_selection)
- {
- // load use ids
- array_map(function ($l) {
- // just load it directly and be done with it
- return $this->setPower($l['load']);
- }, $power->load_selection);
- }
- // see if we have implements
- $power->implement_names = array();
- // does this implement
- $power->implements = (isset($power->implements)
- && JsonHelper::check(
- $power->implements
- )) ? json_decode($power->implements, true) : null;
- if ($power->implements)
- {
- foreach ($power->implements as $implement)
- {
- if ($implement == -1
- && StringHelper::check($power->implements_custom))
- {
- $power->implement_names[] = $this->setPlaceholders(
- $this->setDynamicValues($power->implements_custom),
- $this->placeholders
- );
- // just add this once
- unset($power->implements_custom);
- }
- // does this extend existing
- elseif (GuidHelper::valid($implement))
- {
- // check if it was set
- if ($this->setPower($implement))
- {
- // get the name
- $power->implement_names[] = $this->getPower($implement, 1)->class_name;
- // add to use
- $use[] = $implement;
- }
- }
- }
- }
- // does this extend something
- $power->extends_name = null;
- // we first check for custom extending options
- if ($power->extends == -1
- && StringHelper::check($power->extends_custom))
- {
- $power->extends_name = $this->setPlaceholders(
- $this->setDynamicValues($power->extends_custom),
- $this->placeholders
- );
- // just add once
- unset($power->extends_custom);
- }
- // does this extend existing
- elseif (GuidHelper::valid($power->extends))
- {
- // check if it was set
- if ($this->setPower($power->extends))
- {
- // get the name
- $power->extends_name = $this->getPower($power->extends, 1)->class_name;
- // add to use
- $use[] = $power->extends;
- }
- }
- // set GUI mapper
- $guiMapper = array('table' => 'power', 'id' => (int) $power->id, 'type' => 'php');
- // add the header script
- if ($power->add_head == 1)
- {
- // set GUI mapper field
- $guiMapper['field'] = 'head';
- // base64 Decode code
- $power->head = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
- base64_decode(
- $power->head
- )
- ), $this->placeholders
- ),
- $guiMapper
- ) . PHP_EOL;
- }
- // now add all the extra use statements
- if (ArrayHelper::check($use))
- {
- foreach (array_unique($use) as $u)
- {
- if ($this->setPower($u))
- {
- $add_use = $this->getPower($u, 1)->namespace;
- // check if it is already added manually, you know how some people are
- if (strpos($power->head, $add_use) === false)
- {
- // check if it has an AS option
- if (isset($as[$u]) && StringHelper::check($as[$u]) && $as[$u] !== 'default')
- {
- $power->head .= 'use ' . $add_use . ' as ' . $as[$u] . ';' . PHP_EOL;
- }
- else
- {
- $power->head .= 'use ' . $add_use . ';' . PHP_EOL;
- }
- }
- }
- }
- }
- // now set the description
- $power->description = (StringHelper::check($power->description)) ? $this->setPlaceholders(
- $this->setDynamicValues($power->description),
- $this->placeholders
- ) : '';
- // add the main code if set
- if (StringHelper::check($power->main_class_code))
- {
- // set GUI mapper field
- $guiMapper['field'] = 'main_class_code';
- // base64 Decode code
- $power->main_class_code = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
- base64_decode(
- $power->main_class_code
- )
- ), $this->placeholders
- ),
- $guiMapper
- );
- }
- // store the power
- $this->powers[$guid] = $power;
-
- return true;
- }
- }
- // we failed to get the power,
- // so we raise an error message
- // only if guid is valid
- if (GuidHelper::valid($guid))
- {
- $this->app->enqueueMessage(
- JText::sprintf('Power guid:%s not found!
', $guid),
- 'Error'
- );
- }
- // let's not try again
- $this->statePowers[$guid] = false;
-
- return false;
+ return '';
}
/**
@@ -8993,8 +7806,8 @@ class Get
// get the module data
$module = $this->db->loadObject();
// update the name if it has dynamic values
- $module->name = $this->setPlaceholders(
- $this->setDynamicValues($module->name),
+ $module->name = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($module->name),
$this->globalPlaceholders
);
// set safe class function name
@@ -9005,7 +7818,7 @@ class Get
// set module folder name
$module->folder_name = 'mod_' . strtolower($module->code_name);
// set the lang key
- $this->langKeys[strtoupper($module->folder_name)] = $module->id
+ CFactory::_('Language.Extractor')->langKeys[strtoupper($module->folder_name)] = $module->id
. '_M0dU|3';
// return the path
if ($module->target == 2)
@@ -9034,7 +7847,7 @@ class Get
protected function getModuleIDs()
{
if (($addjoomla_modules = GetHelper::var(
- 'component_modules', Config::get('component_id'), 'joomla_component',
+ 'component_modules', CFactory::_('Config')->component_id, 'joomla_component',
'addjoomla_modules'
)) !== false)
{
@@ -9132,15 +7945,15 @@ class Get
// get the module data
$module = $this->db->loadObject();
// tweak system to set stuff to the module domain
- $_backup_target = $this->target;
- $_backup_lang = $this->lang;
- $_backup_langPrefix = Config::get('lang_prefix');
+ $_backup_target = CFactory::_('Config')->build_target;
+ $_backup_lang = CFactory::_('Config')->lang_target;
+ $_backup_langPrefix = CFactory::_('Config')->lang_prefix;
// set some keys
$module->target_type = 'M0dU|3';
$module->key = $module->id . '_' . $module->target_type;
// update to point to module
- $this->target = $module->key;
- $this->lang = $module->key;
+ CFactory::_('Config')->build_target = $module->key;
+ CFactory::_('Config')->lang_target = $module->key;
// set version if not set
if (empty($module->module_version))
{
@@ -9160,8 +7973,8 @@ class Get
$guiMapper = array('table' => 'joomla_module',
'id' => (int) $id, 'type' => 'php');
// update the name if it has dynamic values
- $module->name = $this->setPlaceholders(
- $this->setDynamicValues($module->name), $this->placeholders
+ $module->name = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($module->name), CFactory::_('Placeholder')->active
);
// set safe class function name
$module->code_name
@@ -9176,9 +7989,9 @@ class Get
);
// set langPrefix
$this->langPrefix = 'MOD_' . strtoupper($module->code_name);
- Config::set('lang_prefix', $this->langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $this->langPrefix);
// set lang prefix
- $module->lang_prefix = Config::get('lang_prefix');
+ $module->lang_prefix = CFactory::_('Config')->lang_prefix;
// set module class name
$module->class_helper_name = 'Mod' . ucfirst($module->code_name)
. 'Helper';
@@ -9193,29 +8006,29 @@ class Get
// set the zip name
$module->zip_name = $module->folder_name . '_v' . str_replace(
'.', '_', $module->module_version
- ) . '__J' . Config::get('version', 3);
+ ) . '__J' . CFactory::_('Config')->joomla_version;
// set module file name
$module->file_name = $module->folder_name;
// set module context
$module->context = $module->file_name . '.' . $module->id;
// set official_name lang strings
- $this->setLangContent(
- $module->key, Config::get('lang_prefix'), $module->official_name
+ CFactory::_('Language')->set(
+ $module->key, CFactory::_('Config')->lang_prefix, $module->official_name
);
// set some placeholder for this module
- $this->placeholders[$this->bbb . 'Module_name' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Module_name')]
= $module->official_name;
- $this->placeholders[$this->bbb . 'Module' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Module')]
= ucfirst(
$module->code_name
);
- $this->placeholders[$this->bbb . 'module' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('module')]
= strtolower(
$module->code_name
);
- $this->placeholders[$this->bbb . 'module.version' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('module.version')]
= $module->module_version;
- $this->placeholders[$this->bbb . 'module_version' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('module_version')]
= str_replace(
'.', '_', $module->module_version
);
@@ -9229,11 +8042,11 @@ class Get
}
else
{
- $module->description = $this->setPlaceholders(
- $this->setDynamicValues($module->description),
- $this->placeholders
+ $module->description = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($module->description),
+ CFactory::_('Placeholder')->active
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
$module->key, $module->lang_prefix . '_DESCRIPTION',
$module->description
);
@@ -9251,16 +8064,16 @@ class Get
. JFactory::getDate($module->created)->format("jS F, Y")
. "";
// set xml description
- $this->setLangContent(
+ CFactory::_('Language')->set(
$module->key, $module->lang_prefix . '_XML_DESCRIPTION',
$module->xml_description
);
// update the readme if set
if ($module->addreadme == 1 && !empty($module->readme))
{
- $module->readme = $this->setPlaceholders(
- $this->setDynamicValues(base64_decode($module->readme)),
- $this->placeholders
+ $module->readme = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(base64_decode($module->readme)),
+ CFactory::_('Placeholder')->active
);
}
else
@@ -9297,13 +8110,13 @@ class Get
$guiMapper['field'] = 'class_helper_header';
// base64 Decode code
$module->class_helper_header = PHP_EOL
- . $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ . CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$module->class_helper_header
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
) . PHP_EOL;
@@ -9316,11 +8129,11 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'class_helper_code';
// base64 Decode code
- $module->class_helper_code = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $module->class_helper_code = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($module->class_helper_code)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -9346,11 +8159,11 @@ class Get
{
// set GUI mapper field
$guiMapper['field'] = 'mod_code';
- $module->mod_code = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $module->mod_code = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($module->mod_code)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -9374,11 +8187,11 @@ class Get
{
// set GUI mapper field
$guiMapper['field'] = 'default_header';
- $module->default_header = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $module->default_header = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($module->default_header)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -9394,11 +8207,11 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'default';
$guiMapper['type'] = 'html';
- $module->default = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $module->default = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($module->default)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -9520,7 +8333,7 @@ class Get
))
{
$module->fieldsets_label[$unique]
- = $this->setLang($form['label']);
+ = CFactory::_('Language')->key($form['label']);
}
// build the fields
$form['fields'] = array_map(
@@ -9676,13 +8489,13 @@ class Get
unset($module->{'add' . $addTarget});
}
// load the library
- if (!isset($this->libManager[$this->target]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target]))
{
- $this->libManager[$this->target] = array();
+ $this->libManager[CFactory::_('Config')->build_target] = array();
}
- if (!isset($this->libManager[$this->target][$module->code_name]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name]))
{
- $this->libManager[$this->target][$module->code_name]
+ $this->libManager[CFactory::_('Config')->build_target][$module->code_name]
= array();
}
// make sure json become array
@@ -9695,22 +8508,22 @@ class Get
{
foreach ($module->libraries as $library)
{
- if (!isset($this->libManager[$this->target][$module->code_name][$library]))
+ if (!isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name][$library]))
{
if ($this->getMediaLibrary((int) $library))
{
- $this->libManager[$this->target][$module->code_name][(int) $library]
+ $this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $library]
= true;
}
}
}
}
elseif (is_numeric($module->libraries)
- && !isset($this->libManager[$this->target][$module->code_name][(int) $module->libraries]))
+ && !isset($this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $module->libraries]))
{
if ($this->getMediaLibrary((int) $module->libraries))
{
- $this->libManager[$this->target][$module->code_name][(int) $module->libraries]
+ $this->libManager[CFactory::_('Config')->build_target][$module->code_name][(int) $module->libraries]
= true;
}
}
@@ -9741,14 +8554,14 @@ class Get
$guiMapper['field'] = $scriptMethod . '_'
. $scriptType;
$module->{$scriptMethod . '_' . $scriptType}
- = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$module->{$scriptMethod . '_'
. $scriptType}
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -9767,9 +8580,9 @@ class Get
if ($module->add_sql == 1
&& StringHelper::check($module->sql))
{
- $module->sql = $this->setPlaceholders(
- $this->setDynamicValues(base64_decode($module->sql)),
- $this->placeholders
+ $module->sql = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(base64_decode($module->sql)),
+ CFactory::_('Placeholder')->active
);
}
else
@@ -9783,10 +8596,10 @@ class Get
$module->sql_uninstall
))
{
- $module->sql_uninstall = $this->setPlaceholders(
- $this->setDynamicValues(
+ $module->sql_uninstall = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($module->sql_uninstall)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
}
else
@@ -9800,9 +8613,9 @@ class Get
$module->update_server_url
))
{
- $module->update_server_url = $this->setPlaceholders(
- $this->setDynamicValues($module->update_server_url),
- $this->placeholders
+ $module->update_server_url = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($module->update_server_url),
+ CFactory::_('Placeholder')->active
);
}
// add the update/sales server FTP details if that is the expected protocol
@@ -9837,23 +8650,21 @@ class Get
// update_server_xml_file_name
// rest globals
- $this->target = $_backup_target;
- $this->lang = $_backup_lang;
+ CFactory::_('Config')->build_target = $_backup_target;
+ CFactory::_('Config')->lang_target = $_backup_lang;
$this->langPrefix = $_backup_langPrefix;
- Config::set('lang_prefix', $_backup_langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix);
unset(
- $this->placeholders[$this->bbb . 'Module_name' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Module_name')]
);
- unset($this->placeholders[$this->bbb . 'Module' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'module' . $this->ddd]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('Module')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('module')]);
unset(
- $this->placeholders[$this->bbb . 'module.version'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('module.version')]
);
unset(
- $this->placeholders[$this->bbb . 'module_version'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('module_version')]
);
$this->joomlaModules[$id] = $module;
@@ -9875,27 +8686,21 @@ class Get
{
$xml = '';
$xml .= PHP_EOL . '';
- $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix
+ $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix
. ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'BUILDDATE' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR'
- . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'AUTHOREMAIL' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'AUTHORWEBSITE' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'COPYRIGHT' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE'
- . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $module->module_version
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . $module->module_version
. ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix
+ $xml .= PHP_EOL . Indent::_(1) . '' . $module->lang_prefix
. '_XML_DESCRIPTION ';
- $xml .= $this->hhh . 'MAINXML' . $this->hhh;
+ $xml .= Placefix::_h('MAINXML');
$xml .= PHP_EOL . ' ';
return $xml;
@@ -9910,8 +8715,8 @@ class Get
public function getModAdminVvvvvvvdm($fieldScriptBucket)
{
$form_field_class = array();
- $form_field_class[] = $this->hhh . 'BOM' . $this->hhh . PHP_EOL;
- $form_field_class[] = "//" . $this->setLine(__LINE__)
+ $form_field_class[] = Placefix::_h('BOM') . PHP_EOL;
+ $form_field_class[] = "//" . Line::_(__Line__, __Class__)
. " No direct access to this file";
$form_field_class[] = "defined('_JEXEC') or die('Restricted access');";
$form_field_class[] = PHP_EOL . "use Joomla\CMS\Form\FormField;";
@@ -9919,23 +8724,23 @@ class Get
$form_field_class[] = PHP_EOL
. "class JFormFieldModadminvvvvvvvdm extends FormField";
$form_field_class[] = "{";
- $form_field_class[] = $this->_t(1)
+ $form_field_class[] = Indent::_(1)
. "protected \$type = 'modadminvvvvvvvdm';";
- $form_field_class[] = PHP_EOL . $this->_t(1)
+ $form_field_class[] = PHP_EOL . Indent::_(1)
. "protected function getLabel()";
- $form_field_class[] = $this->_t(1) . "{";
- $form_field_class[] = $this->_t(2) . "return;";
- $form_field_class[] = $this->_t(1) . "}";
- $form_field_class[] = PHP_EOL . $this->_t(1)
+ $form_field_class[] = Indent::_(1) . "{";
+ $form_field_class[] = Indent::_(2) . "return;";
+ $form_field_class[] = Indent::_(1) . "}";
+ $form_field_class[] = PHP_EOL . Indent::_(1)
. "protected function getInput()";
- $form_field_class[] = $this->_t(1) . "{";
- $form_field_class[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $form_field_class[] = Indent::_(1) . "{";
+ $form_field_class[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the document";
- $form_field_class[] = $this->_t(2)
+ $form_field_class[] = Indent::_(2)
. "\$document = Factory::getDocument();";
$form_field_class[] = implode(PHP_EOL, $fieldScriptBucket);
- $form_field_class[] = $this->_t(2) . "return; // noting for now :)";
- $form_field_class[] = $this->_t(1) . "}";
+ $form_field_class[] = Indent::_(2) . "return; // noting for now :)";
+ $form_field_class[] = Indent::_(1) . "}";
$form_field_class[] = "}";
return implode(PHP_EOL, $form_field_class);
@@ -9950,7 +8755,7 @@ class Get
protected function getPluginIDs()
{
if (($addjoomla_plugins = GetHelper::var(
- 'component_plugins', Config::get('component_id'), 'joomla_component',
+ 'component_plugins', CFactory::_('Config')->component_id, 'joomla_component',
'addjoomla_plugins'
)) !== false)
{
@@ -10027,8 +8832,8 @@ class Get
// get the plugin data
$plugin = $this->db->loadObject();
// update the name if it has dynamic values
- $plugin->name = $this->setPlaceholders(
- $this->setDynamicValues($plugin->name),
+ $plugin->name = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($plugin->name),
$this->globalPlaceholders
);
// update the name if it has dynamic values
@@ -10041,7 +8846,7 @@ class Get
// set plugin file name
$plugin->file_name = strtolower($plugin->code_name);
// set the lang key
- $this->langKeys['PLG_' . strtoupper(
+ CFactory::_('Language.Extractor')->langKeys['PLG_' . strtoupper(
$plugin->group . '_' . $plugin->file_name
)]
= $plugin->id . '_P|uG!n';
@@ -10138,15 +8943,15 @@ class Get
// get the plugin data
$plugin = $this->db->loadObject();
// tweak system to set stuff to the plugin domain
- $_backup_target = $this->target;
- $_backup_lang = $this->lang;
- $_backup_langPrefix = Config::get('lang_prefix');
+ $_backup_target = CFactory::_('Config')->build_target;
+ $_backup_lang = CFactory::_('Config')->lang_target;
+ $_backup_langPrefix = CFactory::_('Config')->lang_prefix;
// set some keys
$plugin->target_type = 'P|uG!n';
$plugin->key = $plugin->id . '_' . $plugin->target_type;
// update to point to plugin
- $this->target = $plugin->key;
- $this->lang = $plugin->key;
+ CFactory::_('Config')->build_target = $plugin->key;
+ CFactory::_('Config')->lang_target = $plugin->key;
// set version if not set
if (empty($plugin->plugin_version))
{
@@ -10156,8 +8961,8 @@ class Get
$guiMapper = array('table' => 'joomla_plugin',
'id' => (int) $id, 'type' => 'php');
// update the name if it has dynamic values
- $plugin->name = $this->setPlaceholders(
- $this->setDynamicValues($plugin->name), $this->placeholders
+ $plugin->name = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($plugin->name), CFactory::_('Placeholder')->active
);
// update the name if it has dynamic values
$plugin->code_name
@@ -10174,9 +8979,9 @@ class Get
$plugin->code_name,
$plugin->group
);
- Config::set('lang_prefix', $this->langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $this->langPrefix);
// set lang prefix
- $plugin->lang_prefix = Config::get('lang_prefix');
+ $plugin->lang_prefix = CFactory::_('Config')->lang_prefix;
// set plugin class name
$plugin->class_name
= PluginHelper::safeClassName(
@@ -10198,46 +9003,46 @@ class Get
// set the zip name
$plugin->zip_name = $plugin->folder_name . '_v' . str_replace(
'.', '_', $plugin->plugin_version
- ) . '__J' . Config::get('version', 3);
+ ) . '__J' . CFactory::_('Config')->joomla_version;
// set plugin file name
$plugin->file_name = strtolower($plugin->code_name);
// set plugin context
$plugin->context = $plugin->folder_name . '.' . $plugin->id;
// set official_name lang strings
- $this->setLangContent(
- $plugin->key, Config::get('lang_prefix'), $plugin->official_name
+ CFactory::_('Language')->set(
+ $plugin->key, CFactory::_('Config')->lang_prefix, $plugin->official_name
);
// set some placeholder for this plugin
- $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')]
= $plugin->official_name;
- $this->placeholders[$this->hhh . 'PLUGIN_NAME' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')]
= $plugin->official_name;
- $this->placeholders[$this->bbb . 'Plugin' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Plugin')]
= ucfirst(
$plugin->code_name
);
- $this->placeholders[$this->bbb . 'plugin' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin')]
= strtolower(
$plugin->code_name
);
- $this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')]
= ucfirst(
$plugin->group
);
- $this->placeholders[$this->bbb . 'plugin_group' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin_group')]
= strtolower(
$plugin->group
);
- $this->placeholders[$this->bbb . 'plugin.version' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin.version')]
= $plugin->plugin_version;
- $this->placeholders[$this->hhh . 'VERSION' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('VERSION')]
= $plugin->plugin_version;
- $this->placeholders[$this->bbb . 'plugin_version' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin_version')]
= str_replace(
'.', '_', $plugin->plugin_version
);
// set description
- $this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')]
= '';
if (!isset($plugin->description)
|| !StringHelper::check(
@@ -10248,16 +9053,16 @@ class Get
}
else
{
- $plugin->description = $this->setPlaceholders(
- $this->setDynamicValues($plugin->description),
- $this->placeholders
+ $plugin->description = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($plugin->description),
+ CFactory::_('Placeholder')->active
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
$plugin->key, $plugin->lang_prefix . '_DESCRIPTION',
$plugin->description
);
// set description
- $this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')]
= $plugin->description;
$plugin->description = '' . $plugin->description
. '
';
@@ -10273,16 +9078,16 @@ class Get
. JFactory::getDate($plugin->created)->format("jS F, Y")
. "";
// set xml discription
- $this->setLangContent(
+ CFactory::_('Language')->set(
$plugin->key, $plugin->lang_prefix . '_XML_DESCRIPTION',
$plugin->xml_description
);
// update the readme if set
if ($plugin->addreadme == 1 && !empty($plugin->readme))
{
- $plugin->readme = $this->setPlaceholders(
- $this->setDynamicValues(base64_decode($plugin->readme)),
- $this->placeholders
+ $plugin->readme = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(base64_decode($plugin->readme)),
+ CFactory::_('Placeholder')->active
);
}
else
@@ -10296,11 +9101,11 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'main_class_code';
// base64 Decode main_class_code.
- $plugin->main_class_code = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $plugin->main_class_code = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($plugin->main_class_code)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -10311,11 +9116,11 @@ class Get
// set GUI mapper field
$guiMapper['field'] = 'head';
// base64 Decode head.
- $plugin->head = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $plugin->head = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($plugin->head)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -10323,11 +9128,11 @@ class Get
elseif (!empty($plugin->class_head))
{
// base64 Decode head.
- $plugin->head = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $plugin->head = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($plugin->class_head)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
array(
'table' => 'class_extends',
@@ -10341,11 +9146,11 @@ class Get
if (!empty($plugin->comment))
{
// base64 Decode comment.
- $plugin->comment = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ $plugin->comment = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($plugin->comment)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
array(
'table' => 'class_extends',
@@ -10443,7 +9248,7 @@ class Get
))
{
$plugin->fieldsets_label[$unique]
- = $this->setLang($form['label']);
+ = CFactory::_('Language')->key($form['label']);
}
// check for extra rule paths
if (isset($form['addrulepath'])
@@ -10647,14 +9452,14 @@ class Get
$guiMapper['field'] = $scriptMethod . '_'
. $scriptType;
$plugin->{$scriptMethod . '_' . $scriptType}
- = $this->setGuiCodePlaceholder(
- $this->setPlaceholders(
- $this->setDynamicValues(
+ = CFactory::_('Customcode.Gui')->set(
+ CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode(
$plugin->{$scriptMethod . '_'
. $scriptType}
)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
),
$guiMapper
);
@@ -10673,9 +9478,9 @@ class Get
if ($plugin->add_sql == 1
&& StringHelper::check($plugin->sql))
{
- $plugin->sql = $this->setPlaceholders(
- $this->setDynamicValues(base64_decode($plugin->sql)),
- $this->placeholders
+ $plugin->sql = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(base64_decode($plugin->sql)),
+ CFactory::_('Placeholder')->active
);
}
else
@@ -10689,10 +9494,10 @@ class Get
$plugin->sql_uninstall
))
{
- $plugin->sql_uninstall = $this->setPlaceholders(
- $this->setDynamicValues(
+ $plugin->sql_uninstall = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add(
base64_decode($plugin->sql_uninstall)
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
}
else
@@ -10706,9 +9511,9 @@ class Get
$plugin->update_server_url
))
{
- $plugin->update_server_url = $this->setPlaceholders(
- $this->setDynamicValues($plugin->update_server_url),
- $this->placeholders
+ $plugin->update_server_url = CFactory::_('Placeholder')->update(
+ CFactory::_('Customcode')->add($plugin->update_server_url),
+ CFactory::_('Placeholder')->active
);
}
// add the update/sales server FTP details if that is the expected protocol
@@ -10743,43 +9548,36 @@ class Get
// update_server_xml_file_name
// rest globals
- $this->target = $_backup_target;
- $this->lang = $_backup_lang;
+ CFactory::_('Config')->build_target = $_backup_target;
+ CFactory::_('Config')->lang_target = $_backup_lang;
$this->langPrefix = $_backup_langPrefix;
- Config::set('lang_prefix', $_backup_langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix);
unset(
- $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Plugin_name')]
);
- unset($this->placeholders[$this->bbb . 'Plugin' . $this->ddd]);
- unset($this->placeholders[$this->bbb . 'plugin' . $this->ddd]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('Plugin')]);
+ unset(CFactory::_('Placeholder')->active[Placefix::_('plugin')]);
unset(
- $this->placeholders[$this->bbb . 'Plugin_group'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('Plugin_group')]
);
unset(
- $this->placeholders[$this->bbb . 'plugin_group'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin_group')]
);
unset(
- $this->placeholders[$this->bbb . 'plugin.version'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin.version')]
);
unset(
- $this->placeholders[$this->bbb . 'plugin_version'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('plugin_version')]
);
unset(
- $this->placeholders[$this->hhh . 'VERSION'
- . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('VERSION')]
);
unset(
- $this->placeholders[$this->hhh . 'DESCRIPTION'
- . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('DESCRIPTION')]
);
unset(
- $this->placeholders[$this->hhh . 'PLUGIN_NAME'
- . $this->hhh]
+ CFactory::_('Placeholder')->active[Placefix::_h('PLUGIN_NAME')]
);
$this->joomlaPlugins[$id] = $plugin;
@@ -10801,59 +9599,26 @@ class Get
{
$xml = '';
$xml .= PHP_EOL . '';
- $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix
+ $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix
. ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'BUILDDATE' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR'
- . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'AUTHOREMAIL' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'AUTHORWEBSITE' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh
- . 'COPYRIGHT' . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE'
- . $this->hhh . ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->plugin_version
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOR') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHOREMAIL') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('AUTHORWEBSITE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('COPYRIGHT') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('LICENSE') . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->plugin_version
. ' ';
- $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix
+ $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix
. '_XML_DESCRIPTION ';
- $xml .= $this->hhh . 'MAINXML' . $this->hhh;
+ $xml .= Placefix::_h('MAINXML');
$xml .= PHP_EOL . ' ';
return $xml;
}
- /**
- * check if we already have these ids in local memory
- *
- * @return void
- *
- */
- protected function checkCustomCodeMemory($ids)
- {
- // reset custom code
- $this->customCode = array();
- foreach ($ids as $pointer => $id)
- {
- if (isset($this->customCodeMemory[$id]))
- {
- $this->customCode[] = $this->customCodeMemory[$id];
- unset($ids[$pointer]);
- }
- }
- // check if any ids left to fetch
- if (ArrayHelper::check($ids))
- {
- return $ids;
- }
-
- return false;
- }
-
/**
* store the code
*
@@ -10954,17 +9719,14 @@ class Get
$this->globalPlaceholders
);
$placeholders[StringHelper::safe(
- Config::get('component_code_name'), 'F'
+ CFactory::_('Config')->component_code_name, 'F'
) . 'Helper::']
- = $this->bbb
- . 'Component' . $this->ddd . 'Helper::';
+ = Placefix::_('Component') . 'Helper::';
$placeholders['COM_' . StringHelper::safe(
- Config::get('component_code_name'), 'U'
+ CFactory::_('Config')->component_code_name, 'U'
)]
- = 'COM_' . $this->bbb
- . 'COMPONENT' . $this->ddd;
- $placeholders['com_' . Config::get('component_code_name')] = 'com_' . $this->bbb
- . 'component' . $this->ddd;
+ = 'COM_' . Placefix::_('COMPONENT');
+ $placeholders['com_' . CFactory::_('Config')->component_code_name] = 'com_' . Placefix::_('component');
// putt the last first
$placeholders = array_reverse($placeholders, true);
@@ -11034,7 +9796,7 @@ class Get
)
{
// we add a new search for the GUI CODE Blocks
- $this->guiCodeSearch($file, $placeholders, $today, $target);
+ CFactory::_('Customcode.Gui')->search($file, $placeholders, $today, $target);
// reset each time per file
$loadEndFingerPrint = false;
$endFingerPrint = array();
@@ -11120,7 +9882,7 @@ class Get
(int) $lineNumber
); // 'toline'
// first reverse engineer this code block
- $c0de = $this->reversePlaceholders(
+ $c0de = CFactory::_('Placeholder.Reverse')->engine(
implode('', $codeBucket[$pointer[$targetKey]]),
$placeholders, $target
);
@@ -11143,7 +9905,7 @@ class Get
= $this->db->quoteName('to_line') . ' = '
. $this->db->quote($lineNumber);
// first reverse engineer this code block
- $c0de = $this->reversePlaceholders(
+ $c0de = CFactory::_('Placeholder.Reverse')->engine(
implode('', $codeBucket[$pointer[$targetKey]]),
$placeholders, $target,
$this->existingCustomCode[$pointer[$targetKey]]['id']
@@ -11309,7 +10071,7 @@ class Get
); // 'comment_type'
$this->newCustomCode[$pointer[$targetKey]][]
= $this->db->quote(
- (int) Config::get('component_id')
+ (int) CFactory::_('Config')->component_id
); // 'component'
$this->newCustomCode[$pointer[$targetKey]][]
= $this->db->quote(
@@ -11366,7 +10128,7 @@ class Get
. $this->db->quote($commentType);
$this->existingCustomCode[$pointer[$targetKey]]['fields'][]
= $this->db->quoteName('component') . ' = '
- . $this->db->quote(Config::get('component_id'));
+ . $this->db->quote(CFactory::_('Config')->component_id);
$this->existingCustomCode[$pointer[$targetKey]]['fields'][]
= $this->db->quoteName('from_line') . ' = '
. $this->db->quote($lineNumber);
@@ -11456,7 +10218,7 @@ class Get
}
// update the script
- return $this->setPlaceholders($script, $locker);
+ return CFactory::_('Placeholder')->update($script, $locker);
}
// check if we should hash a file
if (strpos($script, 'HASHFILE((((') !== false)
@@ -11485,7 +10247,7 @@ class Get
}
// update the script
- return $this->setPlaceholders($script, $locker);
+ return CFactory::_('Placeholder')->update($script, $locker);
}
return $script;
@@ -11513,15 +10275,15 @@ class Get
{
$locker['LOCKBASE64((((' . $value . '))))']
= "base64_decode( preg_replace('/\s+/', ''," .
- PHP_EOL . $this->_t(2) . "'" .
+ PHP_EOL . Indent::_(2) . "'" .
wordwrap(
- base64_encode($value), 64, PHP_EOL . $this->_t(2), true
+ base64_encode($value), 64, PHP_EOL . Indent::_(2), true
) .
"'))";
}
// update the script
- return $this->setPlaceholders($script, $locker);
+ return CFactory::_('Placeholder')->update($script, $locker);
}
return $script;
@@ -11534,93 +10296,11 @@ class Get
* @param array $config The placeholder config values
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Customcode.Gui')->set($string, $config);
*/
public function setGuiCodePlaceholder($string, $config)
{
- if (StringHelper::check($string))
- {
- if (Config::get('add_placeholders', false)
- && $this->canAddGuiCodePlaceholder(
- $string
- )
- && ArrayHelper::check($config)
- && isset($config['table'])
- && StringHelper::check($config['table'])
- && isset($config['field'])
- && StringHelper::check($config['field'])
- && isset($config['type'])
- && StringHelper::check($config['type'])
- && isset($config['id'])
- && is_numeric($config['id']))
- {
- // if we have a key we must get the ID
- if (isset($config['key'])
- && StringHelper::check($config['key'])
- && $config['key'] !== 'id')
- {
- if (($id = GetHelper::var(
- $config['table'], $config['id'], $config['key'],
- 'id'
- )) !== false
- && is_numeric($id))
- {
- $config['id'] = $id;
- }
- else
- {
- // we must give a error message to inform the user of this issue. (should never happen)
- $this->app->enqueueMessage(
- JText::sprintf(
- 'ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set.',
- $config['table'], $config['field'],
- $config['key'], $config['id']
- ), 'Error'
- );
- // check some config
- if (!isset($config['prefix']))
- {
- $config['prefix'] = '';
- }
-
- return $config['prefix'] . $string;
- }
- }
- // check some config
- if (!isset($config['prefix']))
- {
- $config['prefix'] = PHP_EOL;
- }
- // add placheolder based on type of code
- switch (strtolower($config['type']))
- {
- // adding with html commenting
- case 'html':
- $front = $config['prefix'] . '' . PHP_EOL;
- $back = ''
- );
-
- if (($guiCode = ArrayHelper::merge($guiCode)) !== false
- && ArrayHelper::check($guiCode, true))
- {
- foreach ($guiCode as $code)
- {
- $first_line = strtok($code, PHP_EOL);
- // get the GUI target details
- $query = explode('.', trim($first_line, '.'));
- // only continue if we have 3 values in the query
- if (is_array($query) && count($query) >= 3)
- {
- // cleanup the newlines around the code
- $code = trim(str_replace($first_line, '', $code), PHP_EOL)
- . PHP_EOL;
- // set the ID
- $id = (int) $query[2];
- // make the field name save
- $field = FieldHelper::safe($query[1]);
- // make the table name save
- $table = StringHelper::safe($query[0]);
- // reverse placeholder as much as we can
- $code = $this->reversePlaceholders(
- $code, $placeholders, $target, $id, $field, $table
- );
- // update the GUI/Tables/Database
- $object = new stdClass();
- $object->id = $id;
- $object->{$field} = base64_encode(
- $code
- ); // (TODO) this may not always work...
- // update the value in GUI
- $this->db->updateObject(
- '#__componentbuilder_' . (string) $table, $object, 'id'
- );
- }
- }
- }
+ CFactory::_('Customcode.Gui')->search($file, $placeholders, $today, $target);
}
/**
@@ -11820,24 +10452,14 @@ class Get
* @param string $table The table name
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Placeholder.Reverse')->engine($string, $placeholders, $target, $id, $field, $table);
*/
protected function reversePlaceholders($string, &$placeholders, &$target,
$id = null, $field = 'code', $table = 'custom_code'
)
{
- // get local code if set
- if ($id > 0
- && $code = base64_decode(
- GetHelper::var($table, $id, 'id', $field)
- ))
- {
- $string = $this->setReverseLangPlaceholders(
- $string, $code, $target
- );
- }
-
- return $this->setPlaceholders($string, $placeholders, 2);
+ // use the new container class
+ CFactory::_('Placeholder.Reverse')->engine($string, $placeholders, $target, $id, $field, $table);
}
/**
@@ -11848,7 +10470,7 @@ class Get
* @param string $target The target path type
*
* @return string
- *
+ * @deprecated 3.3 See $this->reversePlaceholders();
*/
protected function setReverseLangPlaceholders($updateString, $string,
&$target
@@ -11871,49 +10493,49 @@ class Get
// start lang holder
$langHolders = array();
// set the lang for both since we don't know what area is being targeted
- $_tmp = $this->lang;
+ $_tmp = CFactory::_('Config')->lang_target;
// set the lang based on target
if (strpos($target, 'module') !== false)
{
// backup lang prefix
- $_tmp_lang_prefix = Config::get('lang_prefix');
+ $_tmp_lang_prefix = CFactory::_('Config')->lang_prefix;
// set the new lang prefix
$this->langPrefix = strtoupper(
str_replace('module', 'mod', $target)
);
- Config::set('lang_prefix', $this->langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $this->langPrefix);
// now set the lang
- if (isset($this->langKeys[Config::get('lang_prefix')]))
+ if (isset(CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix]))
{
- $this->lang = $this->langKeys[Config::get('lang_prefix')];
+ CFactory::_('Config')->lang_target = CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix];
}
else
{
- $this->lang = 'module';
+ CFactory::_('Config')->lang_target = 'module';
}
}
elseif (strpos($target, 'plugin') !== false)
{
// backup lang prefix
- $_tmp_lang_prefix = Config::get('lang_prefix');
+ $_tmp_lang_prefix = CFactory::_('Config')->lang_prefix;
// set the new lang prefix
$this->langPrefix = strtoupper(
str_replace('plugin', 'plg', $target)
);
- Config::set('lang_prefix', $this->langPrefix);
+ CFactory::_('Config')->set('lang_prefix', $this->langPrefix);
// now set the lang
- if (isset($this->langKeys[Config::get('lang_prefix')]))
+ if (isset(CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix]))
{
- $this->lang = $this->langKeys[Config::get('lang_prefix')];
+ CFactory::_('Config')->lang_target = CFactory::_('Language.Extractor')->langKeys[CFactory::_('Config')->lang_prefix];
}
else
{
- $this->lang = 'plugin';
+ CFactory::_('Config')->lang_target = 'plugin';
}
}
else
{
- $this->lang = 'both';
+ CFactory::_('Config')->lang_target = 'both';
}
// set language data
foreach ($langStringTargets as $langStringTarget)
@@ -11941,9 +10563,9 @@ class Get
continue;
}
// build lang key
- $keyLang = Config::get('lang_prefix') . '_' . $_keyLang;
+ $keyLang = CFactory::_('Config')->lang_prefix . '_' . $_keyLang;
// set lang content string
- $this->setLangContent($this->lang, $keyLang, $lang);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $keyLang, $lang);
// reverse the placeholders
foreach ($langStringTargets as $langStringTarget)
{
@@ -11954,17 +10576,17 @@ class Get
}
}
// return the found placeholders
- $updateString = $this->setPlaceholders(
+ $updateString = CFactory::_('Placeholder')->update(
$updateString, $langHolders
);
}
// reset the lang
- $this->lang = $_tmp;
+ CFactory::_('Config')->lang_target = $_tmp;
// also rest the lang prefix if set
if (isset($_tmp_lang_prefix))
{
$this->langPrefix = $_tmp_lang_prefix;
- Config::set('lang_prefix', $_tmp_lang_prefix);
+ CFactory::_('Config')->set('lang_prefix', $_tmp_lang_prefix);
}
}
@@ -11984,63 +10606,12 @@ class Get
* 3 -> Remove placeholders not in data string
*
* @return string
- *
+ * @deprecated 3.3 Use CFactory::_('Placeholder')->update($data, $placeholder, $action);
*/
public function setPlaceholders($data, &$placeholder, $action = 1)
{
- // make sure the placeholders is an array
- if (!ArrayHelper::check($placeholder))
- {
- // This is an error, (TODO) actualy we need to add a kind of log here to know that this happened
- return $data;
- }
- // continue with the work of replacement
- if (1 == $action) // <-- just replace (default)
- {
- return str_replace(
- array_keys($placeholder), array_values($placeholder), $data
- );
- }
- elseif (2 == $action) // <-- check if data string has placeholders
- {
- $replace = false;
- foreach ($placeholder as $key => $val)
- {
- if (strpos($data, $key) !== false)
- {
- $replace = true;
- break;
- }
- }
- // only replace if the data has these placeholder values
- if ($replace === true)
- {
-
- return str_replace(
- array_keys($placeholder), array_values($placeholder), $data
- );
- }
- }
- elseif (3 == $action) // <-- remove placeholders not in data string
- {
- $replace = $placeholder;
- foreach ($replace as $key => $val)
- {
- if (strpos($data, $key) === false)
- {
- unset($replace[$key]);
- }
- }
- // only replace if the data has these placeholder values
- if (ArrayHelper::check($replace))
- {
- return str_replace(
- array_keys($replace), array_values($replace), $data
- );
- }
- }
-
- return $data;
+ // use the new container class
+ CFactory::_('Placeholder')->update($data, $placeholder, $action);
}
/**
@@ -12050,80 +10621,11 @@ class Get
* @param int $id The code id in the system
*
* @return array on success
- *
+ * @deprecated 3.3 Use CFactory::_('Placeholder')->keys($type, $id);
*/
public function getPlaceHolder($type, $id)
{
- switch ($type)
- {
- case 11:
- //***[REPLACED$$$$]***//**1**/
- if (Config::get('add_placeholders', false) === true)
- {
- return array(
- 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/',
- 'end' => '/***[/REPLACED$$$$]***/');
- }
- else
- {
- return array(
- 'start' => "",
- 'end' => "");
- }
- break;
- case 12:
- //***[INSERTED$$$$]***//**1**/
- if (Config::get('add_placeholders', false) === true)
- {
- return array(
- 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/',
- 'end' => '/***[/INSERTED$$$$]***/');
- }
- else
- {
- return array(
- 'start' => "",
- 'end' => "");
- }
- break;
- case 21:
- //
- if (Config::get('add_placeholders', false) === true)
- {
- return array(
- 'start' => '',
- 'end' => '');
- }
- else
- {
- return array(
- 'start' => "",
- 'end' => "");
- }
- break;
- case 22:
- //
- if (Config::get('add_placeholders', false) === true)
- {
- return array(
- 'start' => '',
- 'end' => '');
- }
- else
- {
- return array(
- 'start' => "",
- 'end' => " ");
- }
- break;
- case 3:
- return array(
- 'start' => "",
- 'end' => "");
- break;
- }
-
- return false;
+ return CFactory::_('Placeholder')->keys($type, $id);
}
/**
@@ -12138,15 +10640,15 @@ class Get
$localPaths = array();
// admin path
$localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'
- . Config::get('component_code_name');
+ . CFactory::_('Config')->component_code_name;
// site path
$localPaths['site'] = JPATH_ROOT . '/components/com_'
- . Config::get('component_code_name');
+ . CFactory::_('Config')->component_code_name;
// media path
$localPaths['media'] = JPATH_ROOT . '/media/com_'
- . Config::get('component_code_name');
+ . CFactory::_('Config')->component_code_name;
// power path
- $localPaths['power'] = JPATH_ROOT . '/' . Config::get('jcb_powers_path', 'libraries/jcb_powers');
+ $localPaths['power'] = JPATH_ROOT . '/' . CFactory::_('Config')->get('jcb_powers_path', 'libraries/jcb_powers');
// lets also go over the REPOS (TODO)
// Painfull but we need to folder paths for the linked modules
if (($module_ids = $this->getModuleIDs()) !== false)
diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php
index 6c9e1f0ac..5efa2d28a 100644
--- a/admin/helpers/compiler/b_Structure.php
+++ b/admin/helpers/compiler/b_Structure.php
@@ -20,7 +20,10 @@ use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\FileHelper;
-use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
@@ -29,6 +32,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
class Structure extends Get
{
+
/**
* The folder counter
*
@@ -370,56 +374,50 @@ class Structure extends Get
/**
* Constructor
*/
- public function __construct($config = array())
+ public function __construct()
{
// first we run the perent constructor
- if (parent::__construct($config))
+ if (parent::__construct())
{
// set the standard admin file
$this->stdRootFiles[] = $this->componentData->name_code . '.php';
// set incase no extra admin folder are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FOLDERS')]
= '';
// set incase no extra site folder are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FOLDERS')]
= '';
// set incase no extra media folder are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')]
= '';
// set incase no extra admin files are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_ADMIN_FILES')]
= '';
// set incase no extra site files are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FILES'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_SITE_FILES')]
= '';
// set incase no extra media files are loaded
- $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FILES'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FILES')]
= '';
// run global updater
ComponentbuilderHelper::runGlobalUpdater();
// set the template path
- $this->templatePath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_'
- . $this->joomlaVersions[Config::get('version', 3)]['folder_key'];
+ $this->templatePath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/joomla_'
+ . $this->joomlaVersions[CFactory::_('Config')->joomla_version]['folder_key'];
// set some default names
$this->componentSalesName = 'com_'
. $this->componentData->sales_name . '__J'
- . Config::get('version', 3);
+ . CFactory::_('Config')->joomla_version;
$this->componentBackupName = 'com_'
. $this->componentData->sales_name . '_v' . str_replace(
'.', '_', $this->componentData->component_version
- ) . '__J' . Config::get('version', 3);
+ ) . '__J' . CFactory::_('Config')->joomla_version;
$this->componentFolderName = 'com_'
. $this->componentData->name_code . '_v' . str_replace(
'.', '_', $this->componentData->component_version
- ) . '__J' . Config::get('version', 3);
+ ) . '__J' . CFactory::_('Config')->joomla_version;
// set component folder path
- $this->componentPath = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
+ $this->componentPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
. $this->componentFolderName;
// set the template path for custom
$this->templatePathCustom = $this->params->get(
@@ -438,7 +436,7 @@ class Structure extends Get
// set the Joomla Version Data
$this->joomlaVersionData = $this->setJoomlaVersionData();
// Trigger Event: jcb_ce_onAfterSetJoomlaVersionData
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterSetJoomlaVersionData',
array(&$this->componentContext, &$this->joomlaVersionData)
);
@@ -466,24 +464,6 @@ class Structure extends Get
return false;
}
- /**
- * Set the line number in comments
- *
- * @param int $nr The line number
- *
- * @return string
- *
- */
- private function setLine($nr)
- {
- if (Config::get('debug_line_nr', false))
- {
- return ' [Structure ' . $nr . ']';
- }
-
- return '';
- }
-
/**
* Build the Powers files, folders
*
@@ -492,16 +472,20 @@ class Structure extends Get
*/
private function buildPowers()
{
- if (ArrayHelper::check($this->powers))
+ if (ArrayHelper::check(CFactory::_('Power')->active))
{
+ // for plugin event TODO change event api signatures
+ $this->powers = CFactory::_('Power')->active;
// Trigger Event: jcb_ce_onBeforeSetModules
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBuildPowers',
array(&$this->componentContext, &$this->powers)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Power')->active = $this->powers;
// we track the creation of htaccess files
$htaccess = array();
- foreach ($this->powers as $power)
+ foreach (CFactory::_('Power')->active as $power)
{
if (ObjectHelper::check($power)
&& isset($power->path)
@@ -533,8 +517,8 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL .
- PHP_EOL . $this->hhh . 'POWERCODE' . $this->hhh
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
+ PHP_EOL . Placefix::_h('POWERCODE')
);
$this->newFiles[$power->key][] = $fileDetails;
// count the file created
@@ -606,7 +590,7 @@ class Structure extends Get
if (ArrayHelper::check($this->joomlaModules))
{
// Trigger Event: jcb_ce_onBeforeSetModules
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBuildModules',
array(&$this->componentContext, &$this->joomlaModules)
);
@@ -619,7 +603,7 @@ class Structure extends Get
))
{
// module path
- $module->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
+ $module->folder_path = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
. $module->folder_name;
// set the module paths
$this->dynamicPaths[$module->key] = $module->folder_path;
@@ -635,11 +619,11 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL .
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'MODCODE' . $this->hhh
+ Placefix::_h('MODCODE')
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
@@ -654,7 +638,7 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
@@ -666,7 +650,7 @@ class Structure extends Get
' */' . PHP_EOL .
"class " . $module->class_data_name
. ' extends \JObject' . PHP_EOL .
- "{" . $this->hhh . 'DYNAMICGETS' . $this->hhh . "}"
+ "{" . Placefix::_h('DYNAMICGETS') . "}"
. PHP_EOL
);
$this->newFiles[$module->key][] = $fileDetails;
@@ -683,13 +667,13 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'HELPERCODE' . $this->hhh
+ Placefix::_h('HELPERCODE')
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
@@ -717,11 +701,11 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL .
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'MODDEFAULT' . $this->hhh
+ Placefix::_h('MODDEFAULT')
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
@@ -736,13 +720,13 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'INSTALLCLASS' . $this->hhh
+ Placefix::_h('INSTALLCLASS')
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
@@ -789,16 +773,16 @@ class Structure extends Get
'zip' => 'mod_admin.css');
$this->writeFile(
$fileDetails['path'],
- $this->hhh . 'BOM' . $this->hhh . PHP_EOL
+ Placefix::_h('BOM') . PHP_EOL
. PHP_EOL . $css
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
$this->fileCount++;
// add the field script
- $field_script_bucket[] = $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Custom CSS";
- $field_script_bucket[] = $this->_t(2)
+ $field_script_bucket[] = Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Custom CSS";
+ $field_script_bucket[] = Indent::_(2)
. "\$document->addStyleSheet('" . $target_path
. "/modules/" . $module->folder_name
. "/css/mod_admin.css', ['version' => 'auto', 'relative' => true]);";
@@ -824,16 +808,16 @@ class Structure extends Get
'zip' => 'mod_admin.js');
$this->writeFile(
$fileDetails['path'],
- $this->hhh . 'BOM' . $this->hhh . PHP_EOL
+ Placefix::_h('BOM') . PHP_EOL
. PHP_EOL . $javascript
);
$this->newFiles[$module->key][] = $fileDetails;
// count the file created
$this->fileCount++;
// add the field script
- $field_script_bucket[] = $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Custom JS";
- $field_script_bucket[] = $this->_t(2)
+ $field_script_bucket[] = Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Custom JS";
+ $field_script_bucket[] = Indent::_(2)
. "\$document->addScript('" . $target_path
. "/modules/" . $module->folder_name
. "/js/mod_admin.js', ['version' => 'auto', 'relative' => true]);";
@@ -890,7 +874,7 @@ class Structure extends Get
. '.xml');
// build basic XML
$xml = '';
- $xml .= PHP_EOL . '';
@@ -919,13 +903,13 @@ class Structure extends Get
if ($add_component_path)
{
$xml .= PHP_EOL . ' ';
// add xml to file
@@ -1096,7 +1080,7 @@ class Structure extends Get
$this->createFolder($module->folder_path . '/language');
// also create the lang tag folder
$this->createFolder(
- $module->folder_path . '/language/' . Config::get('lang_tag', 'en-GB')
+ $module->folder_path . '/language/' . CFactory::_('Config')->get('lang_tag', 'en-GB')
);
// check if this lib has files
if (isset($module->files)
@@ -1187,7 +1171,7 @@ class Structure extends Get
if (ArrayHelper::check($this->joomlaPlugins))
{
// Trigger Event: jcb_ce_onBeforeSetPlugins
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBuildPlugins',
array(&$this->componentContext, &$this->joomlaPlugins)
);
@@ -1200,7 +1184,7 @@ class Structure extends Get
))
{
// plugin path
- $plugin->folder_path = Config::get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
+ $plugin->folder_path = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/'
. $plugin->folder_name;
// set the plugin paths
$this->dynamicPaths[$plugin->key] = $plugin->folder_path;
@@ -1216,11 +1200,11 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL .
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL .
PHP_EOL . '// No direct access to this file' . PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'MAINCLASS' . $this->hhh
+ Placefix::_h('MAINCLASS')
);
$this->newFiles[$plugin->key][] = $fileDetails;
// count the file created
@@ -1247,13 +1231,13 @@ class Structure extends Get
$this->writeFile(
$fileDetails['path'],
'hhh . 'BOM' . $this->hhh . PHP_EOL
+ PHP_EOL . Placefix::_h('BOM') . PHP_EOL
.
PHP_EOL . '// No direct access to this file'
. PHP_EOL .
"defined('_JEXEC') or die('Restricted access');"
. PHP_EOL .
- $this->hhh . 'INSTALLCLASS' . $this->hhh
+ Placefix::_h('INSTALLCLASS')
);
$this->newFiles[$plugin->key][] = $fileDetails;
// count the file created
@@ -1299,9 +1283,9 @@ class Structure extends Get
. '.xml');
// biuld basic XML
$xml = '';
- $xml .= PHP_EOL . '';
// search if we must add the component path
$add_component_path = false;
@@ -1328,13 +1312,13 @@ class Structure extends Get
if ($add_component_path)
{
$xml .= PHP_EOL . '';
// add xml to file
@@ -1487,7 +1471,7 @@ class Structure extends Get
$this->createFolder($plugin->folder_path . '/language');
// also creat the lang tag folder path
$this->createFolder(
- $plugin->folder_path . '/language/' . Config::get('lang_tag', 'en-GB')
+ $plugin->folder_path . '/language/' . CFactory::_('Config')->get('lang_tag', 'en-GB')
);
// check if this lib has files
if (isset($plugin->files)
@@ -1603,7 +1587,7 @@ class Structure extends Get
if (ArrayHelper::check($this->libraries))
{
// Trigger Event: jcb_ce_onBeforeSetLibraries
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeSetLibraries',
array(&$this->componentContext, &$this->libraries)
);
@@ -1712,9 +1696,8 @@ class Structure extends Get
if ($addLocalFolder)
{
// add folder to xml of media folders
- $this->fileContentStatic[$this->hhh
- . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]
- .= PHP_EOL . $this->_t(2) . ""
+ $this->fileContentStatic[Placefix::_h('EXSTRA_MEDIA_FOLDERS')]
+ .= PHP_EOL . Indent::_(2) . ""
. $libFolder . " ";
}
}
@@ -2072,7 +2055,7 @@ class Structure extends Get
$this->joomlaVersionData->move->static
))
{
- $codeName = Config::get('component_code_name');
+ $codeName = CFactory::_('Config')->component_code_name;
// TODO needs more looking at this must be dynamic actually
$this->notNew[] = 'LICENSE.txt';
// do license check
@@ -2289,16 +2272,16 @@ class Structure extends Get
if ($add_to_extra)
{
// set the tab
- $eTab = $this->_t(2);
+ $eTab = Indent::_(2);
if ('admin' === $checker[0])
{
- $eTab = $this->_t(3);
+ $eTab = Indent::_(3);
}
// set the xml file
- $this->fileContentStatic[$this->hhh . 'EXSTRA_'
+ $this->fileContentStatic[Placefix::_h('EXSTRA_'
. StringHelper::safe(
$checker[0], 'U'
- ) . '_' . $eNAME . $this->hhh]
+ ) . '_' . $eNAME)]
.= PHP_EOL . $eTab . "<" . $ename . ">"
. $checker[1] . "" . $ename . ">";
}
@@ -2348,24 +2331,18 @@ class Structure extends Get
{
$target
= array('admin' => $view['settings']->name_list);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
if ($view['settings']->name_single != 'null')
{
$target
= array('admin' => $view['settings']->name_single);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique(
$target, 'single', false, $config
);
@@ -2379,12 +2356,9 @@ class Structure extends Get
// setup the front site edit-view files
$target
= array('site' => $view['settings']->name_single);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'edit', false, $config);
}
}
@@ -2416,24 +2390,18 @@ class Structure extends Get
{
// set list view
$target = array('site' => $view['settings']->code);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('site' => $view['settings']->code);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@@ -2456,24 +2424,18 @@ class Structure extends Get
{
// set list view$view
$target = array('custom_admin' => $view['settings']->code);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('custom_admin' => $view['settings']->code);
- $config = array($this->hhh . 'CREATIONDATE'
- . $this->hhh => $created,
- $this->hhh . 'BUILDDATE'
- . $this->hhh => $modified,
- $this->hhh . 'VERSION'
- . $this->hhh => $view['settings']->version);
+ $config = array(Placefix::_h('CREATIONDATE') => $created,
+ Placefix::_h('BUILDDATE') => $modified,
+ Placefix::_h('VERSION') => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@@ -2880,7 +2842,7 @@ class Structure extends Get
private function setJoomlaVersionData()
{
// option to load other settings
- $custom_settings = $this->templatePath . '/settings_' . Config::get('component_code_name') . '.json';
+ $custom_settings = $this->templatePath . '/settings_' . CFactory::_('Config')->component_code_name . '.json';
// set the version data
if (File::exists($custom_settings))
{
@@ -3123,8 +3085,8 @@ class Structure extends Get
'//', '/', $custom['file']
);
// update the dynamic component name placholders in file names
- $custom['path'] = $this->setPlaceholders(
- $custom['path'], $this->placeholders
+ $custom['path'] = CFactory::_('Placeholder')->update(
+ $custom['path'], CFactory::_('Placeholder')->active
);
// get the path info
$pathInfo = pathinfo($custom['path']);
@@ -3263,10 +3225,10 @@ class Structure extends Get
*/
protected function updateDynamicPath($path)
{
- return $this->setPlaceholders(
- $this->setPlaceholders(
+ return CFactory::_('Placeholder')->update(
+ CFactory::_('Placeholder')->update(
$path, ComponentbuilderHelper::$constantPaths
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
}
diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php
index 88ab4163b..a657d6ac7 100644
--- a/admin/helpers/compiler/c_Fields.php
+++ b/admin/helpers/compiler/c_Fields.php
@@ -18,7 +18,10 @@ use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\String\FieldHelper;
-use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Compiler class
@@ -26,6 +29,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
class Fields extends Structure
{
+
/**
* Metadate Switch
*
@@ -369,24 +373,6 @@ class Fields extends Structure
*/
public $movedPublishingFields = array();
- /**
- * Set the line number in comments
- *
- * @param int $nr The line number
- *
- * @return void
- *
- */
- private function setLine($nr)
- {
- if (Config::get('debug_line_nr', false))
- {
- return ' [Fields ' . $nr . ']';
- }
-
- return '';
- }
-
/**
* set the Field set of a view
*
@@ -416,162 +402,162 @@ class Fields extends Structure
$this->accessBuilder[$nameSingleCode] = $nameListCode;
}
// main lang prefix
- $langView = Config::get('lang_prefix') . '_'
- . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
- $langViews = Config::get('lang_prefix') . '_'
- . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
+ $langView = CFactory::_('Config')->lang_prefix . '_'
+ . CFactory::_('Placeholder')->active[Placefix::_h('VIEW')];
+ $langViews = CFactory::_('Config')->lang_prefix . '_'
+ . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')];
// set default lang
- $this->setLangContent(
- $this->lang, $langView, $view['settings']->name_single
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView, $view['settings']->name_single
);
- $this->setLangContent(
- $this->lang, $langViews, $view['settings']->name_list
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews, $view['settings']->name_list
);
// set global item strings
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_ARCHIVED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_ARCHIVED',
"%s " . $view['settings']->name_list . " archived."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_ARCHIVED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_ARCHIVED_1',
"%s " . $view['settings']->name_single . " archived."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_0',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_0',
"No " . $view['settings']->name_single
. " successfully checked in."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_1',
"%d " . $view['settings']->name_single
. " successfully checked in."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_MORE',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_CHECKED_IN_MORE',
"%d " . $view['settings']->name_list
. " successfully checked in."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_DELETED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_DELETED',
"%s " . $view['settings']->name_list . " deleted."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_DELETED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_DELETED_1',
"%s " . $view['settings']->name_single . " deleted."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_FEATURED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FEATURED',
"%s " . $view['settings']->name_list . " featured."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_FEATURED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FEATURED_1',
"%s " . $view['settings']->name_single . " featured."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_PUBLISHED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_PUBLISHED',
"%s " . $view['settings']->name_list . " published."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_PUBLISHED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_PUBLISHED_1',
"%s " . $view['settings']->name_single . " published."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_TRASHED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_TRASHED',
"%s " . $view['settings']->name_list . " trashed."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_TRASHED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_TRASHED_1',
"%s " . $view['settings']->name_single . " trashed."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_UNFEATURED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNFEATURED',
"%s " . $view['settings']->name_list . " unfeatured."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_UNFEATURED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNFEATURED_1',
"%s " . $view['settings']->name_single . " unfeatured."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNPUBLISHED',
"%s " . $view['settings']->name_list . " unpublished."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_UNPUBLISHED_1',
"%s " . $view['settings']->name_single . " unpublished."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FAILED_PUBLISHING',
"%s " . $view['settings']->name_list . " failed publishing."
);
- $this->setLangContent(
- $this->lang, $langViews . '_N_ITEMS_FAILED_PUBLISHING_1',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_N_ITEMS_FAILED_PUBLISHING_1',
"%s " . $view['settings']->name_single . " failed publishing."
);
- $this->setLangContent(
- $this->lang, $langViews . '_BATCH_OPTIONS',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_BATCH_OPTIONS',
"Batch process the selected " . $view['settings']->name_list
);
- $this->setLangContent(
- $this->lang, $langViews . '_BATCH_TIP',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langViews . '_BATCH_TIP',
"All changes will be applied to all selected "
. $view['settings']->name_list
);
// set some basic defaults
- $this->setLangContent(
- $this->lang, $langView . '_ERROR_UNIQUE_ALIAS',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_ERROR_UNIQUE_ALIAS',
"Another " . $view['settings']->name_single
. " has the same alias."
);
- $this->setLangContent(
- $this->lang, $langView . '_CREATED_DATE_LABEL', "Created Date"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_CREATED_DATE_LABEL', "Created Date"
);
- $this->setLangContent(
- $this->lang, $langView . '_CREATED_DATE_DESC',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_CREATED_DATE_DESC',
"The date this " . $view['settings']->name_single
. " was created."
);
- $this->setLangContent(
- $this->lang, $langView . '_MODIFIED_DATE_LABEL', "Modified Date"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_MODIFIED_DATE_LABEL', "Modified Date"
);
- $this->setLangContent(
- $this->lang, $langView . '_MODIFIED_DATE_DESC',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_MODIFIED_DATE_DESC',
"The date this " . $view['settings']->name_single
. " was modified."
);
- $this->setLangContent(
- $this->lang, $langView . '_CREATED_BY_LABEL', "Created By"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_CREATED_BY_LABEL', "Created By"
);
- $this->setLangContent(
- $this->lang, $langView . '_CREATED_BY_DESC',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_CREATED_BY_DESC',
"The user that created this " . $view['settings']->name_single
. "."
);
- $this->setLangContent(
- $this->lang, $langView . '_MODIFIED_BY_LABEL', "Modified By"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_MODIFIED_BY_LABEL', "Modified By"
);
- $this->setLangContent(
- $this->lang, $langView . '_MODIFIED_BY_DESC',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_MODIFIED_BY_DESC',
"The last user that modified this "
. $view['settings']->name_single . "."
);
- $this->setLangContent(
- $this->lang, $langView . '_ORDERING_LABEL', "Ordering"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_ORDERING_LABEL', "Ordering"
);
- $this->setLangContent(
- $this->lang, $langView . '_VERSION_LABEL', "Version"
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_VERSION_LABEL', "Version"
);
- $this->setLangContent(
- $this->lang, $langView . '_VERSION_DESC',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_VERSION_DESC',
"A count of the number of times this "
. $view['settings']->name_single . " has been revised."
);
- $this->setLangContent(
- $this->lang, $langView . '_SAVE_WARNING',
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langView . '_SAVE_WARNING',
"Alias already existed so a number was added at the end. You can re-edit the "
. $view['settings']->name_single . " to customise the alias."
);
// check what type of field builder to use
- if (Config::get('field_builder_type', 2) == 1)
+ if (CFactory::_('Config')->get('field_builder_type', 2) == 1)
{
// build field set using string manipulation
return $this->stringFieldSet(
@@ -612,7 +598,7 @@ class Fields extends Structure
$readOnly = false;
if ($view['settings']->type == 2)
{
- $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t(
+ $readOnly = Indent::_(3) . 'readonly="true"' . PHP_EOL . Indent::_(
3
) . 'disabled="true"';
}
@@ -620,133 +606,141 @@ class Fields extends Structure
$dynamicFields = '';
// set the custom table key
$dbkey = 'g';
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onBeforeBuildFields
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBuildFields',
array(&$this->componentContext, &$dynamicFields, &$readOnly,
&$dbkey, &$view, &$component, &$nameSingleCode,
&$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamicFields .= $this->setDynamicField(
$field, $view, $view['settings']->type, $langView,
- $nameSingleCode, $nameListCode, $this->placeholders, $dbkey,
+ $nameSingleCode, $nameListCode, CFactory::_('Placeholder')->active, $dbkey,
true
);
}
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onAfterBuildFields
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterBuildFields',
array(&$this->componentContext, &$dynamicFields, &$readOnly,
&$dbkey, &$view, &$component, &$nameSingleCode,
&$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// set the default fields
$fieldSet = array();
$fieldSet[] = '';
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "";
// if id is not set
if (!isset($this->fieldsNames[$nameSingleCode]['id']))
{
- $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"id"';
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(2) . "_t(3)
+ $fieldSet[] = Indent::_(3)
. 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"';
- $fieldSet[] = $this->_t(3) . 'readonly="true"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'readonly="true"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// if created is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created"';
- $fieldSet[] = $this->_t(3) . "type=" . '"calendar"';
- $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView
+ $fieldSet[] = Indent::_(2) . "_t(3) . "description=" . '"' . $langView
+ $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView
. '_CREATED_DATE_DESC"';
- $fieldSet[] = $this->_t(3) . "size=" . '"22"';
+ $fieldSet[] = Indent::_(3) . "size=" . '"22"';
if ($readOnly)
{
$fieldSet[] = $readOnly;
}
- $fieldSet[] = $this->_t(3) . "format=" . '"%Y-%m-%d %H:%M:%S"';
- $fieldSet[] = $this->_t(3) . "filter=" . '"user_utc"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . "format=" . '"%Y-%m-%d %H:%M:%S"';
+ $fieldSet[] = Indent::_(3) . "filter=" . '"user_utc"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// if created_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created_by']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created_by"';
- $fieldSet[] = $this->_t(3) . "type=" . '"user"';
- $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView
+ $fieldSet[] = Indent::_(2) . "_t(3) . "description=" . '"' . $langView
+ $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView
. '_CREATED_BY_DESC"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . "description="
+ $fieldSet[] = Indent::_(3) . "description="
. '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"';
if ($readOnly)
{
$fieldSet[] = $readOnly;
}
- $fieldSet[] = $this->_t(3) . "filter="
+ $fieldSet[] = Indent::_(3) . "filter="
. '"intval" size="1" default="1" >';
- $fieldSet[] = $this->_t(3) . "';
- $fieldSet[] = $this->_t(4) . "JPUBLISHED ";
- $fieldSet[] = $this->_t(3) . "';
- $fieldSet[] = $this->_t(4) . "JUNPUBLISHED ";
- $fieldSet[] = $this->_t(3) . "';
- $fieldSet[] = $this->_t(4) . "JARCHIVED ";
- $fieldSet[] = $this->_t(3) . "';
- $fieldSet[] = $this->_t(4) . "JTRASHED ";
- $fieldSet[] = $this->_t(2) . " ";
+ $fieldSet[] = Indent::_(3) . "';
+ $fieldSet[] = Indent::_(4) . "JPUBLISHED ";
+ $fieldSet[] = Indent::_(3) . "';
+ $fieldSet[] = Indent::_(4) . "JUNPUBLISHED ";
+ $fieldSet[] = Indent::_(3) . "';
+ $fieldSet[] = Indent::_(4) . "JARCHIVED ";
+ $fieldSet[] = Indent::_(3) . "';
+ $fieldSet[] = Indent::_(4) . "JTRASHED ";
+ $fieldSet[] = Indent::_(2) . " ";
// count the static field created
$this->fieldCount++;
}
// if modified is not set
if (!isset($this->fieldsNames[$nameSingleCode]['modified']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2)
+ $fieldSet[] = Indent::_(2)
. '_t(3) . 'label="' . $langView
+ $fieldSet[] = Indent::_(3) . 'label="' . $langView
. '_MODIFIED_DATE_LABEL" description="' . $langView
. '_MODIFIED_DATE_DESC"';
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(3)
. 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />';
// count the static field created
$this->fieldCount++;
@@ -754,18 +748,18 @@ class Fields extends Structure
// if modified_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['modified_by']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2)
+ $fieldSet[] = Indent::_(2)
. '_t(3) . 'label="' . $langView
+ $fieldSet[] = Indent::_(3) . 'label="' . $langView
. '_MODIFIED_BY_LABEL"';
- $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView
+ $fieldSet[] = Indent::_(3) . "description=" . '"' . $langView
. '_MODIFIED_BY_DESC"';
- $fieldSet[] = $this->_t(3) . 'class="readonly"';
- $fieldSet[] = $this->_t(3) . 'readonly="true"';
- $fieldSet[] = $this->_t(3) . 'filter="unset"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'class="readonly"';
+ $fieldSet[] = Indent::_(3) . 'readonly="true"';
+ $fieldSet[] = Indent::_(3) . 'filter="unset"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
@@ -776,62 +770,62 @@ class Fields extends Structure
)
&& !isset($this->fieldsNames[$nameSingleCode]['access']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . '_t(3) . 'type="accesslevel"';
- $fieldSet[] = $this->_t(3) . 'label="JFIELD_ACCESS_LABEL"';
- $fieldSet[] = $this->_t(3) . 'description="JFIELD_ACCESS_DESC"';
- $fieldSet[] = $this->_t(3) . 'default="1"';
+ $fieldSet[] = Indent::_(2) . '_t(3) . 'required="false"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'required="false"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// if ordering is not set
if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . 'name="ordering"';
- $fieldSet[] = $this->_t(3) . 'type="number"';
- $fieldSet[] = $this->_t(3) . 'class="inputbox validate-ordering"';
- $fieldSet[] = $this->_t(3) . 'label="' . $langView
+ $fieldSet[] = Indent::_(2) . "_t(3) . 'description=""';
- $fieldSet[] = $this->_t(3) . 'default="0"';
- $fieldSet[] = $this->_t(3) . 'size="6"';
+ $fieldSet[] = Indent::_(3) . 'description=""';
+ $fieldSet[] = Indent::_(3) . 'default="0"';
+ $fieldSet[] = Indent::_(3) . 'size="6"';
if ($readOnly)
{
$fieldSet[] = $readOnly;
}
- $fieldSet[] = $this->_t(3) . 'required="false"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'required="false"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// if version is not set
if (!isset($this->fieldsNames[$nameSingleCode]['version']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . 'name="version"';
- $fieldSet[] = $this->_t(3) . 'type="text"';
- $fieldSet[] = $this->_t(3) . 'class="readonly"';
- $fieldSet[] = $this->_t(3) . 'label="' . $langView
+ $fieldSet[] = Indent::_(2) . "_t(3) . 'description="' . $langView
+ $fieldSet[] = Indent::_(3) . 'description="' . $langView
. '_VERSION_DESC"';
- $fieldSet[] = $this->_t(3) . 'size="6"';
- $fieldSet[] = $this->_t(3) . 'readonly="true"';
- $fieldSet[] = $this->_t(3) . 'filter="unset"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'size="6"';
+ $fieldSet[] = Indent::_(3) . 'readonly="true"';
+ $fieldSet[] = Indent::_(3) . 'filter="unset"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
@@ -844,36 +838,36 @@ class Fields extends Structure
// metakey
if (!isset($this->fieldsNames[$nameSingleCode]['metakey']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metakey"';
- $fieldSet[] = $this->_t(3) . 'type="textarea"';
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(2) . "_t(3)
+ $fieldSet[] = Indent::_(3)
. 'description="JFIELD_META_KEYWORDS_DESC"';
- $fieldSet[] = $this->_t(3) . 'rows="3"';
- $fieldSet[] = $this->_t(3) . 'cols="30"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'rows="3"';
+ $fieldSet[] = Indent::_(3) . 'cols="30"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
// metadesc
if (!isset($this->fieldsNames[$nameSingleCode]['metadesc']))
{
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metadesc"';
- $fieldSet[] = $this->_t(3) . 'type="textarea"';
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(2) . "_t(3)
+ $fieldSet[] = Indent::_(3)
. 'description="JFIELD_META_DESCRIPTION_DESC"';
- $fieldSet[] = $this->_t(3) . 'rows="3"';
- $fieldSet[] = $this->_t(3) . 'cols="30"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(3) . 'rows="3"';
+ $fieldSet[] = Indent::_(3) . 'cols="30"';
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
}
@@ -886,21 +880,21 @@ class Fields extends Structure
// set the field/tab name
$field_name = "title";
$tab_name = "publishing";
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "";
- $fieldSet[] = $this->_t(2) . "";
// at this point we know that we must add a hidden title field
// and make sure it does not get stored to the database
- $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"' . $field_name . '"';
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(2) . "_t(3) . 'default="' . $component . ' '
+ $fieldSet[] = Indent::_(3) . 'default="' . $component . ' '
. $nameSingleCode . '"';
- $fieldSet[] = $this->_t(2) . "/>";
+ $fieldSet[] = Indent::_(2) . "/>";
// count the static field created
$this->fieldCount++;
// setup needed field values for layout
@@ -916,11 +910,11 @@ class Fields extends Structure
// load the dynamic fields now
if (StringHelper::check($dynamicFields))
{
- $fieldSet[] = $this->_t(2) . "" . $dynamicFields;
}
// close fieldset
- $fieldSet[] = $this->_t(1) . " ";
+ $fieldSet[] = Indent::_(1) . "";
// check if metadata is added to this view
if (isset($this->metadataBuilder[$nameSingleCode])
&& StringHelper::check(
@@ -931,72 +925,72 @@ class Fields extends Structure
|| !isset($this->fieldsNames[$nameSingleCode]['rights'])
|| !isset($this->fieldsNames[$nameSingleCode]['author']))
{
- $fieldSet[] = PHP_EOL . $this->_t(1) . "";
- $fieldSet[] = $this->_t(1) . "';
- $fieldSet[] = $this->_t(2) . '_t(3)
+ $fieldSet[] = Indent::_(2) . '';
// robots
if (!isset($this->fieldsNames[$nameSingleCode]['robots']))
{
- $fieldSet[] = $this->_t(3) . "";
- $fieldSet[] = $this->_t(3) . '_t(4) . 'type="list"';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(3) . '_t(4)
+ $fieldSet[] = Indent::_(4)
. 'description="JFIELD_METADATA_ROBOTS_DESC" >';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(4)
. 'JGLOBAL_USE_GLOBAL ';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(4)
. 'JGLOBAL_INDEX_FOLLOW ';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(4)
. 'JGLOBAL_NOINDEX_FOLLOW ';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(4)
. 'JGLOBAL_INDEX_NOFOLLOW ';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(4)
. 'JGLOBAL_NOINDEX_NOFOLLOW ';
- $fieldSet[] = $this->_t(3) . ' ';
+ $fieldSet[] = Indent::_(3) . ' ';
// count the static field created
$this->fieldCount++;
}
// author
if (!isset($this->fieldsNames[$nameSingleCode]['author']))
{
- $fieldSet[] = $this->_t(3) . "";
- $fieldSet[] = $this->_t(3) . '_t(4) . 'type="text"';
- $fieldSet[] = $this->_t(4)
+ $fieldSet[] = Indent::_(3) . '_t(4) . 'size="20"';
- $fieldSet[] = $this->_t(3) . "/>";
+ $fieldSet[] = Indent::_(4) . 'size="20"';
+ $fieldSet[] = Indent::_(3) . "/>";
// count the static field created
$this->fieldCount++;
}
// rights
if (!isset($this->fieldsNames[$nameSingleCode]['rights']))
{
- $fieldSet[] = $this->_t(3) . "";
- $fieldSet[] = $this->_t(3)
+ $fieldSet[] = Indent::_(3)
. '_t(4)
+ $fieldSet[] = Indent::_(4)
. 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"';
- $fieldSet[] = $this->_t(4) . 'cols="30" rows="2"';
- $fieldSet[] = $this->_t(3) . "/>";
+ $fieldSet[] = Indent::_(4) . 'cols="30" rows="2"';
+ $fieldSet[] = Indent::_(3) . "/>";
// count the static field created
$this->fieldCount++;
}
- $fieldSet[] = $this->_t(2) . " ";
- $fieldSet[] = $this->_t(1) . " ";
+ $fieldSet[] = Indent::_(2) . "";
+ $fieldSet[] = Indent::_(1) . "";
}
}
@@ -1031,41 +1025,49 @@ class Fields extends Structure
$dynamicFieldsXML = array();
// set the custom table key
$dbkey = 'g';
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onBeforeBuildFields
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onBeforeBuildFields',
array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML,
&$dbkey, &$view, &$component, &$nameSingleCode,
&$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamicFieldsXML[] = $this->setDynamicField(
$field, $view, $view['settings']->type, $langView,
- $nameSingleCode, $nameListCode, $this->placeholders, $dbkey,
+ $nameSingleCode, $nameListCode, CFactory::_('Placeholder')->active, $dbkey,
true
);
}
+ // for plugin event TODO change event api signatures
+ $this->placeholders = CFactory::_('Placeholder')->active;
// Trigger Event: jcb_ce_onAfterBuildFields
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onAfterBuildFields',
array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML,
&$dbkey, &$view, &$component, &$nameSingleCode,
&$nameListCode, &$this->placeholders, &$langView,
&$langViews)
);
+ // for plugin event TODO change event api signatures
+ CFactory::_('Placeholder')->active = $this->placeholders;
// set the default fields
$XML = new simpleXMLElement(' ');
$fieldSetXML = $XML->addChild('fieldset');
$fieldSetXML->addAttribute('name', 'details');
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__) . " Default Fields."
+ $fieldSetXML, Line::_(__Line__, __Class__) . " Default Fields."
);
ComponentbuilderHelper::xmlComment(
$fieldSetXML,
- $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)"
+ Line::_(__Line__, __Class__) . " Id Field. Type: Text (joomla)"
);
// if id is not set
if (!isset($this->fieldsNames[$nameSingleCode]['id']))
@@ -1099,7 +1101,7 @@ class Fields extends Structure
);
$attributes = array_merge($attributes, $readOnlyXML);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Date Created Field. Type: Calendar (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1118,7 +1120,7 @@ class Fields extends Structure
);
$attributes = array_merge($attributes, $readOnlyXML);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " User Created Field. Type: User (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1136,7 +1138,7 @@ class Fields extends Structure
);
$attributes = array_merge($attributes, $readOnlyXML);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Published Field. Type: List (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1168,7 +1170,7 @@ class Fields extends Structure
'filter' => 'user_utc'
);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Date Modified Field. Type: Calendar (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1189,7 +1191,7 @@ class Fields extends Structure
'filter' => 'unset'
);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " User Modified Field. Type: User (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1214,7 +1216,7 @@ class Fields extends Structure
);
$attributes = array_merge($attributes, $readOnlyXML);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Access Field. Type: Accesslevel (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1237,7 +1239,7 @@ class Fields extends Structure
);
$attributes = array_merge($attributes, $readOnlyXML);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Ordering Field. Type: Numbers (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1260,7 +1262,7 @@ class Fields extends Structure
);
ComponentbuilderHelper::xmlComment(
$fieldSetXML,
- $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)"
+ Line::_(__Line__, __Class__) . " Version Field. Type: Text (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
@@ -1285,7 +1287,7 @@ class Fields extends Structure
'cols' => 30
);
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Metakey Field. Type: Textarea (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1302,7 +1304,7 @@ class Fields extends Structure
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
$attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC';
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__)
+ $fieldSetXML, Line::_(__Line__, __Class__)
. " Metadesc Field. Type: Textarea (joomla)"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1329,17 +1331,17 @@ class Fields extends Structure
);
ComponentbuilderHelper::xmlComment(
$fieldSetXML,
- $this->setLine(__LINE__)
+ Line::_(__Line__, __Class__)
. " Was added due to Permissions JS needing a Title field"
);
ComponentbuilderHelper::xmlComment(
$fieldSetXML,
- $this->setLine(__LINE__)
+ Line::_(__Line__, __Class__)
. " Let us know at gh-629 should this change"
);
ComponentbuilderHelper::xmlComment(
$fieldSetXML,
- $this->setLine(__LINE__)
+ Line::_(__Line__, __Class__)
. " https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235"
);
$fieldXML = $fieldSetXML->addChild('field');
@@ -1360,7 +1362,7 @@ class Fields extends Structure
if (count((array) $dynamicFieldsXML))
{
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields."
+ $fieldSetXML, Line::_(__Line__, __Class__) . " Dynamic Fields."
);
foreach ($dynamicFieldsXML as $dynamicfield)
{
@@ -1378,7 +1380,7 @@ class Fields extends Structure
|| !isset($this->fieldsNames[$nameSingleCode]['rights']))
{
ComponentbuilderHelper::xmlComment(
- $fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields"
+ $fieldSetXML, Line::_(__Line__, __Class__) . " Metadata Fields"
);
$fieldsXML = $fieldSetXML->addChild('fields');
$fieldsXML->addAttribute('name', 'metadata');
@@ -1394,7 +1396,7 @@ class Fields extends Structure
if (!isset($this->fieldsNames[$nameSingleCode]['robots']))
{
ComponentbuilderHelper::xmlComment(
- $fieldsFieldSetXML, $this->setLine(__LINE__)
+ $fieldsFieldSetXML, Line::_(__Line__, __Class__)
. " Robots Field. Type: List (joomla)"
);
$robots = $fieldsFieldSetXML->addChild('field');
@@ -1427,7 +1429,7 @@ class Fields extends Structure
if (!isset($this->fieldsNames[$nameSingleCode]['author']))
{
ComponentbuilderHelper::xmlComment(
- $fieldsFieldSetXML, $this->setLine(__LINE__)
+ $fieldsFieldSetXML, Line::_(__Line__, __Class__)
. " Author Field. Type: Text (joomla)"
);
$author = $fieldsFieldSetXML->addChild('field');
@@ -1448,7 +1450,7 @@ class Fields extends Structure
if (!isset($this->fieldsNames[$nameSingleCode]['rights']))
{
ComponentbuilderHelper::xmlComment(
- $fieldsFieldSetXML, $this->setLine(__LINE__)
+ $fieldsFieldSetXML, Line::_(__Line__, __Class__)
. " Rights Field. Type: Textarea (joomla)"
);
$rights = $fieldsFieldSetXML->addChild('field');
@@ -1587,7 +1589,7 @@ class Fields extends Structure
&$nameSingleCode, &$nameListCode, &$placeholders, &$dbkey, $build
) {
// set default return
- if (Config::get('field_builder_type', 2) == 1)
+ if (CFactory::_('Config')->get('field_builder_type', 2) == 1)
{
// string manipulation
$dynamicField = '';
@@ -1832,7 +1834,7 @@ class Fields extends Structure
) {
// check the field builder type
$xmlField = '';
- if (Config::get('field_builder_type', 2) == 1)
+ if (CFactory::_('Config')->get('field_builder_type', 2) == 1)
{
// string manipulation
$xmlField = $this->setDynamicField(
@@ -1854,10 +1856,10 @@ class Fields extends Structure
$xmlField = dom_import_simplexml(
$newxmlField->fieldXML
);
- $xmlField = PHP_EOL . $this->_t(2) . "' . PHP_EOL
- . $this->_t(1) . $this->xmlPrettyPrint(
+ . Indent::_(1) . $this->xmlPrettyPrint(
$xmlField, 'field'
);
}
@@ -1892,7 +1894,7 @@ class Fields extends Structure
// count the dynamic fields created
$this->fieldCount++;
// check what type of field builder to use
- if (Config::get('field_builder_type', 2) == 1)
+ if (CFactory::_('Config')->get('field_builder_type', 2) == 1)
{
// build field set using string manipulation
return $this->stringSetField(
@@ -1938,19 +1940,19 @@ class Fields extends Structure
if ($setType === 'option')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1)
- . "";
- $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1)
+ $field .= PHP_EOL . Indent::_(1) . $taber . Indent::_(1)
. " $value)
{
if ($property != 'option')
{
- $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1)
+ $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1)
. $property . '="' . $value . '"';
}
elseif ($property === 'option')
@@ -1982,13 +1984,13 @@ class Fields extends Structure
$valueKeyArray[0], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[0]
);
// now add group label
$groups_[$valueKeyArray[1]] = PHP_EOL
- . $this->_t(1) . $taber . $this->_t(2)
+ . Indent::_(1) . $taber . Indent::_(2)
. '';
// set order
$order_['group' . $valueKeyArray[1]]
@@ -2006,16 +2008,16 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['group'][$valueKeyArray[2]][]
- = PHP_EOL . $this->_t(1) . $taber
- . $this->_t(3) . '' . PHP_EOL
- . $this->_t(1) . $taber . $this->_t(4)
+ . Indent::_(1) . $taber . Indent::_(4)
. $langValue . ' ';
$optionArray[$valueKeyArray[0]]
= $langValue;
@@ -2030,16 +2032,16 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['option'][$valueKeyArray[0]]
- = PHP_EOL . $this->_t(1) . $taber
- . $this->_t(2) . '' . PHP_EOL
- . $this->_t(1) . $taber . $this->_t(3)
+ . Indent::_(1) . $taber . Indent::_(3)
. $langValue . ' ';
$optionArray[$valueKeyArray[0]]
= $langValue;
@@ -2056,15 +2058,15 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$grouped_['option'][$option] = PHP_EOL
- . $this->_t(1) . $taber . $this->_t(2)
+ . Indent::_(1) . $taber . Indent::_(2)
. ''
- . PHP_EOL . $this->_t(1) . $taber
- . $this->_t(3) . $langValue . ' ';
+ . PHP_EOL . Indent::_(1) . $taber
+ . Indent::_(3) . $langValue . '';
$optionArray[$option] = $langValue;
// set order
$order_['option' . $option] = $option;
@@ -2096,8 +2098,8 @@ class Fields extends Structure
unset($groups_[$_id]);
unset($grouped_[$key_][$_id]);
// close the group
- $optionSet .= PHP_EOL . $this->_t(1) . $taber
- . $this->_t(2) . ' ';
+ $optionSet .= PHP_EOL . Indent::_(1) . $taber
+ . Indent::_(2) . '';
}
elseif (isset($grouped_[$key_][$_id])
&& StringHelper::check(
@@ -2123,14 +2125,14 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $t
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $t
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(1)
- . $taber . $this->_t(2) . '' . PHP_EOL . $this->_t(1)
- . $taber . $this->_t(3) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(1)
+ . $taber . Indent::_(2) . ' ' . PHP_EOL . Indent::_(1)
+ . $taber . Indent::_(3) . $langValue
. ' ';
$optionArray[$v] = $langValue;
}
@@ -2142,14 +2144,14 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2)
- . $taber . $this->_t(1) . '' . PHP_EOL . $this->_t(2)
- . $taber . $this->_t(2) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(1) . ' ' . PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(2) . $langValue
. ' ';
$optionArray[$option] = $langValue;
}
@@ -2167,11 +2169,11 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent($this->lang, $langValue, $t);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2) . $taber
- . $this->_t(1) . ''
- . PHP_EOL . $this->_t(2) . $taber . $this->_t(2)
+ $optionSet .= PHP_EOL . Indent::_(2) . $taber
+ . Indent::_(1) . ' '
+ . PHP_EOL . Indent::_(2) . $taber . Indent::_(2)
. $langValue . ' ';
$optionArray[$v] = $langValue;
}
@@ -2183,14 +2185,14 @@ class Fields extends Structure
$value, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $value
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $value
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2)
- . $taber . $this->_t(1) . '' . PHP_EOL . $this->_t(2)
- . $taber . $this->_t(2) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(1) . ' ' . PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(2) . $langValue
. ' ';
$optionArray[$value] = $langValue;
}
@@ -2201,54 +2203,54 @@ class Fields extends Structure
if (StringHelper::check($optionSet))
{
$field .= '>';
- $field .= PHP_EOL . $this->_t(3) . $taber . "";
+ $field .= PHP_EOL . Indent::_(3) . $taber . "";
$field .= $optionSet;
- $field .= PHP_EOL . $this->_t(2) . $taber . " ";
+ $field .= PHP_EOL . Indent::_(2) . $taber . "";
}
// if no options found and must have a list of options
elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list'))
{
$optionArray = false;
- $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
- $field .= PHP_EOL . $this->_t(2) . $taber . ""
. PHP_EOL;
}
else
{
$optionArray = false;
- $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
+ $field .= PHP_EOL . Indent::_(2) . $taber . "/>";
}
}
elseif ($setType === 'plain')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(2) . $taber . "";
- $field .= PHP_EOL . $this->_t(2) . $taber . " $value)
{
if ($property != 'option')
{
- $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1)
+ $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1)
. $property . '="' . $value . '"';
}
}
- $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
+ $field .= PHP_EOL . Indent::_(2) . $taber . "/>";
}
elseif ($setType === 'spacer')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(2) . "";
- $field .= PHP_EOL . $this->_t(2) . " $value)
{
if ($property != 'option')
@@ -2264,25 +2266,25 @@ class Fields extends Structure
if ($typeName === 'repeatable')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(2) . "";
- $field .= PHP_EOL . $this->_t(2) . " $value)
{
if ($property != 'fields')
{
- $field .= PHP_EOL . $this->_t(3) . $property . '="'
+ $field .= PHP_EOL . Indent::_(3) . $property . '="'
. $value . '"';
}
}
$field .= ">";
- $field .= PHP_EOL . $this->_t(3) . '';
- $field .= PHP_EOL . $this->_t(4)
+ $field .= PHP_EOL . Indent::_(4)
. '';
if (strpos($fieldAttributes['fields'], ',') !== false)
@@ -2335,7 +2337,7 @@ class Fields extends Structure
$r_multiple = false;
$r_langLabel = '';
// add the tabs needed
- $r_taber = $this->_t(3);
+ $r_taber = Indent::_(3);
// get field values
$r_fieldValues = $this->setFieldAttributes(
$fieldData, $view, $r_name, $r_typeName,
@@ -2385,8 +2387,8 @@ class Fields extends Structure
$r_name, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $r_listLangName,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $r_listLangName,
StringHelper::safe(
$r_name, 'W'
)
@@ -2424,31 +2426,31 @@ class Fields extends Structure
}
}
}
- $field .= PHP_EOL . $this->_t(4) . " ";
- $field .= PHP_EOL . $this->_t(3) . " ";
- $field .= PHP_EOL . $this->_t(2) . " ";
+ $field .= PHP_EOL . Indent::_(4) . "";
+ $field .= PHP_EOL . Indent::_(3) . "";
+ $field .= PHP_EOL . Indent::_(2) . " ";
}
// set the subform fields (it is a repeatable without the modal)
elseif ($typeName === 'subform')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(2) . $taber . "";
- $field .= PHP_EOL . $this->_t(2) . $taber . " $value)
{
if ($property != 'fields')
{
- $field .= PHP_EOL . $this->_t(3) . $taber . $property
+ $field .= PHP_EOL . Indent::_(3) . $taber . $property
. '="' . $value . '"';
}
}
$field .= ">";
- $field .= PHP_EOL . $this->_t(3) . $taber
+ $field .= PHP_EOL . Indent::_(3) . $taber
. '";
- $field .= PHP_EOL . $this->_t(2) . $taber . " ";
+ $field .= PHP_EOL . Indent::_(3) . $taber . "";
+ $field .= PHP_EOL . Indent::_(2) . $taber . " ";
}
}
elseif ($setType === 'custom')
{
// now add to the field set
- $field .= PHP_EOL . $this->_t(2) . $taber . "";
- $field .= PHP_EOL . $this->_t(2) . $taber . " $value)
{
if ($property != 'option')
{
- $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1)
+ $field .= PHP_EOL . Indent::_(2) . $taber . Indent::_(1)
. $property . '="' . $value . '"';
}
elseif ($property === 'option')
@@ -2666,13 +2668,13 @@ class Fields extends Structure
$valueKeyArray[0], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[0]
);
// now add group label
$groups_[$valueKeyArray[1]] = PHP_EOL
- . $this->_t(1) . $taber . $this->_t(2)
+ . Indent::_(1) . $taber . Indent::_(2)
. '';
// set order
$order_['group' . $valueKeyArray[1]]
@@ -2690,16 +2692,16 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['group'][$valueKeyArray[2]][]
- = PHP_EOL . $this->_t(1) . $taber
- . $this->_t(3) . '' . PHP_EOL
- . $this->_t(1) . $taber . $this->_t(4)
+ . Indent::_(1) . $taber . Indent::_(4)
. $langValue . ' ';
$optionArray[$valueKeyArray[0]]
= $langValue;
@@ -2714,16 +2716,16 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
$grouped_['option'][$valueKeyArray[0]]
- = PHP_EOL . $this->_t(1) . $taber
- . $this->_t(2) . '' . PHP_EOL
- . $this->_t(1) . $taber . $this->_t(3)
+ . Indent::_(1) . $taber . Indent::_(3)
. $langValue . ' ';
$optionArray[$valueKeyArray[0]]
= $langValue;
@@ -2740,15 +2742,15 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$grouped_['option'][$option] = PHP_EOL
- . $this->_t(1) . $taber . $this->_t(2)
+ . Indent::_(1) . $taber . Indent::_(2)
. ''
- . PHP_EOL . $this->_t(1) . $taber
- . $this->_t(3) . $langValue . ' ';
+ . PHP_EOL . Indent::_(1) . $taber
+ . Indent::_(3) . $langValue . '';
$optionArray[$option] = $langValue;
// set order
$order_['option' . $option] = $option;
@@ -2780,8 +2782,8 @@ class Fields extends Structure
unset($groups_[$_id]);
unset($grouped_[$key_][$_id]);
// close the group
- $optionSet .= PHP_EOL . $this->_t(1) . $taber
- . $this->_t(2) . ' ';
+ $optionSet .= PHP_EOL . Indent::_(1) . $taber
+ . Indent::_(2) . '';
}
elseif (isset($grouped_[$key_][$_id])
&& StringHelper::check(
@@ -2807,14 +2809,14 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $t
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $t
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(1)
- . $taber . $this->_t(2) . '' . PHP_EOL . $this->_t(1)
- . $taber . $this->_t(3) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(1)
+ . $taber . Indent::_(2) . ' ' . PHP_EOL . Indent::_(1)
+ . $taber . Indent::_(3) . $langValue
. ' ';
$optionArray[$v] = $langValue;
}
@@ -2826,14 +2828,14 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2)
- . $taber . $this->_t(1) . '' . PHP_EOL . $this->_t(2)
- . $taber . $this->_t(2) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(1) . ' ' . PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(2) . $langValue
. ' ';
$optionArray[$option] = $langValue;
}
@@ -2851,11 +2853,11 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent($this->lang, $langValue, $t);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2) . $taber
- . $this->_t(1) . ''
- . PHP_EOL . $this->_t(2) . $taber . $this->_t(2)
+ $optionSet .= PHP_EOL . Indent::_(2) . $taber
+ . Indent::_(1) . ' '
+ . PHP_EOL . Indent::_(2) . $taber . Indent::_(2)
. $langValue . ' ';
$optionArray[$v] = $langValue;
}
@@ -2867,14 +2869,14 @@ class Fields extends Structure
$value, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $value
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $value
);
// now add to option set
- $optionSet .= PHP_EOL . $this->_t(2)
- . $taber . $this->_t(1) . '' . PHP_EOL . $this->_t(2)
- . $taber . $this->_t(2) . $langValue
+ $optionSet .= PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(1) . ' ' . PHP_EOL . Indent::_(2)
+ . $taber . Indent::_(2) . $langValue
. ' ';
$optionArray[$value] = $langValue;
}
@@ -2885,25 +2887,25 @@ class Fields extends Structure
if (StringHelper::check($optionSet))
{
$field .= '>';
- $field .= PHP_EOL . $this->_t(3) . $taber . "";
+ $field .= PHP_EOL . Indent::_(3) . $taber . "";
$field .= $optionSet;
- $field .= PHP_EOL . $this->_t(2) . $taber . " ";
+ $field .= PHP_EOL . Indent::_(2) . $taber . "";
}
// if no options found and must have a list of options
elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list'))
{
$optionArray = false;
- $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
- $field .= PHP_EOL . $this->_t(2) . $taber . ""
. PHP_EOL;
}
else
{
$optionArray = false;
- $field .= PHP_EOL . $this->_t(2) . $taber . "/>";
+ $field .= PHP_EOL . Indent::_(2) . $taber . "/>";
}
// incase the field is in the config and has not been set
if ('config' === $nameSingleCode && 'configs' === $nameListCode
@@ -2955,7 +2957,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name)
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name)
. " Field. Type: " . StringHelper::safe(
$typeName, 'F'
) . ". (joomla)";
@@ -2970,7 +2972,7 @@ class Fields extends Structure
{
ComponentbuilderHelper::xmlComment(
$field->fieldXML,
- $this->setLine(__LINE__) . " Option Set."
+ Line::_(__Line__, __Class__) . " Option Set."
);
if (strtolower($typeName) === 'groupedlist'
&& strpos(
@@ -2998,8 +3000,8 @@ class Fields extends Structure
$valueKeyArray[0], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[0]
);
// now add group label
@@ -3020,8 +3022,8 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
@@ -3041,8 +3043,8 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
@@ -3064,8 +3066,8 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$grouped_['option'][$option]
@@ -3143,8 +3145,8 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $t
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $t
);
// now add to option set
$optionXML->addAttribute('value', $v);
@@ -3158,8 +3160,8 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$optionXML->addAttribute('value', $option);
@@ -3181,7 +3183,7 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent($this->lang, $langValue, $t);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t);
// now add to option set
$optionXML->addAttribute('value', $v);
$optionArray[$v] = $langValue;
@@ -3194,8 +3196,8 @@ class Fields extends Structure
$value, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $value
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $value
);
// now add to option set
$optionXML->addAttribute('value', $value);
@@ -3210,7 +3212,7 @@ class Fields extends Structure
&& ComponentbuilderHelper::fieldCheck($typeName, 'list'))
{
ComponentbuilderHelper::xmlComment(
- $field->fieldXML, $this->setLine(__LINE__)
+ $field->fieldXML, Line::_(__Line__, __Class__)
. " No Manual Options Were Added In Field Settings."
);
}
@@ -3219,7 +3221,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name)
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name)
. " Field. Type: " . StringHelper::safe(
$typeName, 'F'
) . ". (joomla)";
@@ -3236,7 +3238,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name)
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name)
. " Field. Type: " . StringHelper::safe(
$typeName, 'F'
) . ". A None Database Field. (joomla)";
@@ -3256,7 +3258,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst(
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst(
$name
) . " Field. Type: " . StringHelper::safe(
$typeName, 'F'
@@ -3381,8 +3383,8 @@ class Fields extends Structure
$r_name, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $r_listLangName,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $r_listLangName,
StringHelper::safe(
$r_name, 'W'
)
@@ -3427,7 +3429,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst(
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst(
$name
) . " Field. Type: " . StringHelper::safe(
$typeName, 'F'
@@ -3594,8 +3596,8 @@ class Fields extends Structure
$r_name, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $r_listLangName,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $r_listLangName,
StringHelper::safe(
$r_name, 'W'
)
@@ -3641,7 +3643,7 @@ class Fields extends Structure
{
// now add to the field set
$field->fieldXML = new SimpleXMLElement(' ');
- $field->comment = $this->setLine(__LINE__) . " " . ucfirst($name)
+ $field->comment = Line::_(__Line__, __Class__) . " " . ucfirst($name)
. " Field. Type: " . StringHelper::safe(
$typeName, 'F'
) . ". (custom)";
@@ -3655,7 +3657,7 @@ class Fields extends Structure
{
ComponentbuilderHelper::xmlComment(
$field->fieldXML,
- $this->setLine(__LINE__) . " Option Set."
+ Line::_(__Line__, __Class__) . " Option Set."
);
if (strtolower($typeName) === 'groupedlist'
&& strpos(
@@ -3683,8 +3685,8 @@ class Fields extends Structure
$valueKeyArray[0], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[0]
);
// now add group label
@@ -3705,8 +3707,8 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
@@ -3726,8 +3728,8 @@ class Fields extends Structure
$valueKeyArray[1], true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue,
$valueKeyArray[1]
);
// now add to option set
@@ -3749,8 +3751,8 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$grouped_['option'][$option]
@@ -3828,8 +3830,8 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $t
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $t
);
// now add to option set
$optionXML->addAttribute('value', $v);
@@ -3843,8 +3845,8 @@ class Fields extends Structure
$option, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $option
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $option
);
// now add to option set
$optionXML->addAttribute('value', $option);
@@ -3866,7 +3868,7 @@ class Fields extends Structure
$t, true
);
// add to lang array
- $this->setLangContent($this->lang, $langValue, $t);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $t);
// now add to option set
$optionXML->addAttribute('value', $v);
$optionArray[$v] = $langValue;
@@ -3879,8 +3881,8 @@ class Fields extends Structure
$value, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $langValue, $value
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langValue, $value
);
// now add to option set
$optionXML->addAttribute('value', $value);
@@ -4164,7 +4166,7 @@ class Fields extends Structure
elseif ($property['name'] === 'name')
{
// get the actual field name
- $xmlValue = $this->setPlaceholders($name, $placeholders);
+ $xmlValue = CFactory::_('Placeholder')->update($name, $placeholders);
}
elseif ($property['name'] === 'validate')
{
@@ -4184,7 +4186,7 @@ class Fields extends Structure
|| $property['name'] === 'formsource')
{
// get value & replace the placeholders
- $xmlValue = $this->setPlaceholders(
+ $xmlValue = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, $property['name'] . '="',
'"'
@@ -4208,7 +4210,7 @@ class Fields extends Structure
);
// load the php for the custom field file
$fieldAttributes['custom'][$phpKey][$phpLine]
- = $this->setDynamicValues(
+ = CFactory::_('Customcode')->add(
ComponentbuilderHelper::openValidBase64(
GetHelper::between(
$field['settings']->xml,
@@ -4240,7 +4242,7 @@ class Fields extends Structure
// load the view name & replace the placeholders
$fieldAttributes['custom']['view']
= StringHelper::safe(
- $this->setPlaceholders(
+ CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'view="', '"'
), $placeholders
@@ -4252,7 +4254,7 @@ class Fields extends Structure
// load the views name & replace the placeholders
$fieldAttributes['custom']['views']
= StringHelper::safe(
- $this->setPlaceholders(
+ CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'views="', '"'
), $placeholders
@@ -4263,7 +4265,7 @@ class Fields extends Structure
{
// load the component name & replace the placeholders
$fieldAttributes['custom']['component']
- = $this->setPlaceholders(
+ = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'component="', '"'
), $placeholders
@@ -4273,7 +4275,7 @@ class Fields extends Structure
{
// load the main table that is queried & replace the placeholders
$fieldAttributes['custom']['table']
- = $this->setPlaceholders(
+ = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'table="', '"'
), $placeholders
@@ -4373,7 +4375,7 @@ class Fields extends Structure
else
{
// set the rest of the fields
- $xmlValue = (string) $this->setPlaceholders(
+ $xmlValue = (string) CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, $property['name'] . '="',
'"'
@@ -4399,7 +4401,7 @@ class Fields extends Structure
}
}
// replace placeholders
- $xmlValue = $this->setPlaceholders(
+ $xmlValue = CFactory::_('Placeholder')->update(
$xmlValue, $placeholders
);
// insure custom lables dont get messed up
@@ -4413,7 +4415,7 @@ class Fields extends Structure
$name . ' ' . $property['name'], true
);
// add to lang array
- $this->setLangContent($this->lang, $langValue, $xmlValue);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langValue, $xmlValue);
// use lang value
$xmlValue = $langValue;
}
@@ -4502,7 +4504,7 @@ class Fields extends Structure
)) !== $confirmation)
{
$fieldAttributes['custom'][$phpKey][$phpLine]
- = $this->setDynamicValues(
+ = CFactory::_('Customcode')->add(
ComponentbuilderHelper::openValidBase64($value)
);
}
@@ -4735,8 +4737,8 @@ class Fields extends Structure
// set field name
$listFieldName = StringHelper::safe($tempName, 'W');
// add to lang array
- $this->setLangContent(
- $this->lang, $listLangName, $listFieldName
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $listLangName, $listFieldName
);
}
else
@@ -4746,19 +4748,19 @@ class Fields extends Structure
{
$listLangName = $langLabel;
// get field label from the lang label
- if (isset($this->langContent[$this->lang][$langLabel]))
+ if (CFactory::_('Language')->exist(CFactory::_('Config')->lang_target, $langLabel))
{
$listFieldName
- = $this->langContent[$this->lang][$langLabel];
+ = CFactory::_('Language')->get(CFactory::_('Config')->lang_target, $langLabel);
}
else
{
// get it from the field xml string
- $listFieldName = (string) $this->setPlaceholders(
+ $listFieldName = (string) CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'label="',
'"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
}
// make sure there is no html in the list field name
@@ -4772,8 +4774,8 @@ class Fields extends Structure
// set field name
$listFieldName = StringHelper::safe($name, 'W');
// add to lang array
- $this->setLangContent(
- $this->lang, $listLangName, $listFieldName
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $listLangName, $listFieldName
);
}
}
@@ -4955,15 +4957,15 @@ class Fields extends Structure
$otherView = $nameSingleCode;
}
// get the xml extension name
- $_extension = $this->setPlaceholders(
+ $_extension = CFactory::_('Placeholder')->update(
GetHelper::between(
$field['settings']->xml, 'extension="', '"'
- ), $this->placeholders
+ ), CFactory::_('Placeholder')->active
);
// if they left out the extension for some reason
if (!StringHelper::check($_extension))
{
- $_extension = 'com_' . Config::get('component_code_name') . '.'
+ $_extension = 'com_' . CFactory::_('Config')->component_code_name . '.'
. $otherView;
}
// check the context (does our target match)
@@ -5169,7 +5171,7 @@ class Fields extends Structure
= $options;
}
// main lang filter prefix
- $lang_filter_ = Config::get('lang_prefix') . '_FILTER_';
+ $lang_filter_ = CFactory::_('Config')->lang_prefix . '_FILTER_';
// build the sort values
if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1)
&& ($listSwitch || $listJoin)
@@ -5191,8 +5193,8 @@ class Fields extends Structure
$filter_name_asc, 'U'
);
// and to translation
- $this->setLangContent(
- $this->lang, $filter_name_asc_lang, $filter_name_asc
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $filter_name_asc_lang, $filter_name_asc
);
// set the language strings for descending
$filter_name_desc = $listFieldName . ' descending';
@@ -5201,8 +5203,8 @@ class Fields extends Structure
$filter_name_desc, 'U'
);
// and to translation
- $this->setLangContent(
- $this->lang, $filter_name_desc_lang, $filter_name_desc
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $filter_name_desc_lang, $filter_name_desc
);
}
$this->sortBuilder[$nameListCode][] = array('type' => $typeName,
@@ -5251,8 +5253,8 @@ class Fields extends Structure
$filter_name_select, 'U'
);
// and to translation
- $this->setLangContent(
- $this->lang, $filter_name_select_lang, $filter_name_select
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $filter_name_select_lang, $filter_name_select
);
}
@@ -5330,52 +5332,42 @@ class Fields extends Structure
}
// set tab and break replacements
$tabBreak = array(
- '\t' => $this->_t(1),
+ '\t' => Indent::_(1),
'\n' => PHP_EOL
);
// set the [[[PLACEHOLDER]]] options
$replace = array(
- $this->bbb . 'JPREFIX' . $this->ddd => $jprefix,
- $this->bbb . 'TABLE'
- . $this->ddd => (isset($data['custom']['table']))
+ Placefix::_('JPREFIX') => $jprefix,
+ Placefix::_('TABLE') => (isset($data['custom']['table']))
? $data['custom']['table'] : '',
- $this->bbb . 'ID'
- . $this->ddd => (isset($data['custom']['id']))
+ Placefix::_('ID') => (isset($data['custom']['id']))
? $data['custom']['id'] : '',
- $this->bbb . 'TEXT'
- . $this->ddd => (isset($data['custom']['text']))
+ Placefix::_('TEXT') => (isset($data['custom']['text']))
? $data['custom']['text'] : '',
- $this->bbb . 'CODE_TEXT'
- . $this->ddd => (isset($data['code'], $data['custom']['text']))
+ Placefix::_('CODE_TEXT') => (isset($data['code'], $data['custom']['text']))
? $data['code'] . '_' . $data['custom']['text'] : '',
- $this->bbb . 'CODE' . $this->ddd => (isset($data['code']))
+ Placefix::_('CODE') => (isset($data['code']))
? $data['code'] : '',
- $this->bbb . 'view_type' . $this->ddd => $nameSingleCode
+ Placefix::_('view_type') => $nameSingleCode
. '_' . $data['type'],
- $this->bbb . 'type' . $this->ddd => (isset($data['type']))
+ Placefix::_('type') => (isset($data['type']))
? $data['type'] : '',
- $this->bbb . 'com_component'
- . $this->ddd => (isset($data['custom']['component'])
+ Placefix::_('com_component') => (isset($data['custom']['component'])
&& StringHelper::check(
$data['custom']['component']
)) ? StringHelper::safe(
$data['custom']['component']
- ) : 'com_' . Config::get('component_code_name'),
+ ) : 'com_' . CFactory::_('Config')->component_code_name,
// set the generic values
- $this->bbb . 'component'
- . $this->ddd => Config::get('component_code_name'),
- $this->bbb . 'Component'
- . $this->ddd => $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh],
- $this->bbb . 'view'
- . $this->ddd => (isset($data['custom']['view'])
+ Placefix::_('component') => CFactory::_('Config')->component_code_name,
+ Placefix::_('Component') => $this->fileContentStatic[Placefix::_h('Component')],
+ Placefix::_('view') => (isset($data['custom']['view'])
&& StringHelper::check(
$data['custom']['view']
)) ? StringHelper::safe(
$data['custom']['view']
) : $nameSingleCode,
- $this->bbb . 'views'
- . $this->ddd => (isset($data['custom']['views'])
+ Placefix::_('views') => (isset($data['custom']['views'])
&& StringHelper::check(
$data['custom']['views']
)) ? StringHelper::safe(
@@ -5387,8 +5379,8 @@ class Fields extends Structure
{
// update the key value
$replacekey = str_replace(
- array($this->bbb, $this->ddd),
- array($this->hhh, $this->hhh), $replacekey
+ array(Placefix::b(), Placefix::d()),
+ array(Placefix::h(), Placefix::h()), $replacekey
);
// now set the value
$replace[$replacekey] = $replacevalue;
@@ -5407,18 +5399,15 @@ class Fields extends Structure
// start loading the field type
$this->fileContentDynamic['customfield_' . $data['type']] = array();
// JPREFIX <<>>
- $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh
- . 'JPREFIX' . $this->hhh]
+ $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('JPREFIX')]
= $jprefix;
// Type <<>>
- $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh
- . 'Type' . $this->hhh]
+ $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('Type')]
= StringHelper::safe(
$data['custom']['type'], 'F'
);
// type <<>>
- $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh
- . 'type' . $this->hhh]
+ $this->fileContentDynamic['customfield_' . $data['type']][Placefix::_h('type')]
= StringHelper::safe($data['custom']['type']);
// is this a own custom field
if (isset($data['custom']['own_custom']))
@@ -5450,26 +5439,26 @@ class Fields extends Structure
// JFORM_TYPE_HEADER <<>>
$add_default_header = true;
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER' . $this->hhh]
- = "//" . $this->setLine(
- __LINE__
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')]
+ = "//" . Line::_(
+ __LINE__,__CLASS__
) . " Import the " . $JFORM_extends
. " field type classes needed";
// JFORM_extens <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_extends' . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_extends')]
= $JFORM_extends;
// JFORM_EXTENDS <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_EXTENDS' . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_EXTENDS')]
= StringHelper::safe(
$data['custom']['extends'], 'F'
);
// JFORM_TYPE_PHP <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_PHP' . $this->hhh]
- = PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine(
- __LINE__
+ . $data['type']][Placefix::_h('JFORM_TYPE_PHP')]
+ = PHP_EOL . PHP_EOL . Indent::_(1) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " A " . $data['custom']['own_custom'] . " Field";
// load the other PHP options
foreach (ComponentbuilderHelper::$phpFieldArray as $x)
@@ -5486,7 +5475,7 @@ class Fields extends Structure
{
if (StringHelper::check($code))
{
- $phpBucket .= PHP_EOL . $this->setPlaceholders(
+ $phpBucket .= PHP_EOL . CFactory::_('Placeholder')->update(
$code, $tabBreak
);
}
@@ -5495,9 +5484,8 @@ class Fields extends Structure
if ('HEADER' === $x)
{
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
- . $this->hhh]
- .= PHP_EOL . $this->setPlaceholders(
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')]
+ .= PHP_EOL . CFactory::_('Placeholder')->update(
$phpBucket, $replace
);
// stop default headers from loading
@@ -5507,9 +5495,8 @@ class Fields extends Structure
{
// JFORM_TYPE_PHP <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_PHP'
- . $this->hhh]
- .= PHP_EOL . $this->setPlaceholders(
+ . $data['type']][Placefix::_h('JFORM_TYPE_PHP')]
+ .= PHP_EOL . CFactory::_('Placeholder')->update(
$phpBucket, $replace
);
}
@@ -5519,25 +5506,21 @@ class Fields extends Structure
if ($add_default_header)
{
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')]
.= PHP_EOL . "jimport('joomla.form.helper');";
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')]
.= PHP_EOL . "JFormHelper::loadFieldClass('"
. $JFORM_extends . "');";
}
// check the the JFormHelper::loadFieldClass(..) was set
elseif (strpos(
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
- . $this->hhh], 'JFormHelper::loadFieldClass('
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')], 'JFormHelper::loadFieldClass('
) === false)
{
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_TYPE_HEADER'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_TYPE_HEADER')]
.= PHP_EOL . "JFormHelper::loadFieldClass('"
. $JFORM_extends . "');";
}
@@ -5564,19 +5547,19 @@ class Fields extends Structure
{
if ($line == 1)
{
- $phpCode .= $this->setPlaceholders(
+ $phpCode .= CFactory::_('Placeholder')->update(
$code, $tabBreak
);
}
else
{
- $phpCode .= PHP_EOL . $this->_t(2)
- . $this->setPlaceholders($code, $tabBreak);
+ $phpCode .= PHP_EOL . Indent::_(2)
+ . CFactory::_('Placeholder')->update($code, $tabBreak);
}
}
}
// replace the placholders
- $phpCode = $this->setPlaceholders($phpCode, $replace);
+ $phpCode = CFactory::_('Placeholder')->update($phpCode, $replace);
}
// catch empty stuff
if (!StringHelper::check($phpCode))
@@ -5599,21 +5582,21 @@ class Fields extends Structure
{
if ($line == 1)
{
- $phpxCode .= $this->setPlaceholders(
+ $phpxCode .= CFactory::_('Placeholder')->update(
$code, $tabBreak
);
}
else
{
- $phpxCode .= PHP_EOL . $this->_t(2)
- . $this->setPlaceholders(
+ $phpxCode .= PHP_EOL . Indent::_(2)
+ . CFactory::_('Placeholder')->update(
$code, $tabBreak
);
}
}
}
// replace the placholders
- $phpxCode = $this->setPlaceholders($phpxCode, $replace);
+ $phpxCode = CFactory::_('Placeholder')->update($phpxCode, $replace);
}
// catch empty stuff
if (!StringHelper::check($phpxCode))
@@ -5623,39 +5606,36 @@ class Fields extends Structure
// temp holder for name
$tempName = $data['custom']['label'] . ' Group';
// set lang
- $groupLangName = Config::get('lang_prefix') . '_'
+ $groupLangName = CFactory::_('Config')->lang_prefix . '_'
. FieldHelper::safe(
$tempName, true
);
// add to lang array
- $this->setLangContent(
- $this->lang, $groupLangName,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $groupLangName,
StringHelper::safe($tempName, 'W')
);
// build the Group Control
$this->setGroupControl[$data['type']] = $groupLangName;
// JFORM_GETGROUPS_PHP <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_GETGROUPS_PHP'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_GETGROUPS_PHP')]
= $phpCode;
// JFORM_GETEXCLUDED_PHP <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_GETEXCLUDED_PHP'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_GETEXCLUDED_PHP')]
= $phpxCode;
}
else
{
// JFORM_GETOPTIONS_PHP <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'JFORM_GETOPTIONS_PHP'
- . $this->hhh]
+ . $data['type']][Placefix::_h('JFORM_GETOPTIONS_PHP')]
= $phpCode;
}
// type <<>>
$this->fileContentDynamic['customfield_'
- . $data['type']][$this->hhh . 'ADD_BUTTON' . $this->hhh]
+ . $data['type']][Placefix::_h('ADD_BUTTON')]
= $this->setAddButtonToListField($data['custom']);
}
}
@@ -5690,7 +5670,7 @@ class Fields extends Structure
);
// set tab and break replacements
$tabBreak = array(
- '\t' => $this->_t(1),
+ '\t' => Indent::_(1),
'\n' => PHP_EOL
);
// load the other PHP options
@@ -5708,7 +5688,7 @@ class Fields extends Structure
{
if (StringHelper::check($code))
{
- $phpBucket .= PHP_EOL . $this->setPlaceholders(
+ $phpBucket .= PHP_EOL . CFactory::_('Placeholder')->update(
$code, $tabBreak
);
}
@@ -5752,65 +5732,65 @@ class Fields extends Structure
$target, 'filter'
);
// the search language string
- $lang_search = Config::get('lang_prefix') . '_FILTER_SEARCH';
+ $lang_search = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH';
// and to translation
- $this->setLangContent(
- $this->lang, $lang_search, 'Search'
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $lang_search, 'Search'
. StringHelper::safe($nameListCode, 'w')
);
// the search description language string
- $lang_search_desc = Config::get('lang_prefix') . '_FILTER_SEARCH_'
+ $lang_search_desc = CFactory::_('Config')->lang_prefix . '_FILTER_SEARCH_'
. strtoupper($nameListCode);
// and to translation
- $this->setLangContent(
- $this->lang, $lang_search_desc, 'Search the '
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $lang_search_desc, 'Search the '
. StringHelper::safe($nameSingleCode, 'w')
. ' items. Prefix with ID: to search for an item by ID.'
);
// now build the XML
$field_filter_sets = array();
- $field_filter_sets[] = $this->_t(1) . '';
+ $field_filter_sets[] = Indent::_(1) . '';
// we first add the search
- $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="text"';
- $field_filter_sets[] = $this->_t(3) . 'name="search"';
- $field_filter_sets[] = $this->_t(3) . 'inputmode="search"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(2) . '_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'description="' . $lang_search_desc . '"';
- $field_filter_sets[] = $this->_t(3) . 'hint="JSEARCH_FILTER"';
- $field_filter_sets[] = $this->_t(2) . '/>';
+ $field_filter_sets[] = Indent::_(3) . 'hint="JSEARCH_FILTER"';
+ $field_filter_sets[] = Indent::_(2) . '/>';
// add the published filter if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
// the published language string
- $lang_published = Config::get('lang_prefix') . '_FILTER_PUBLISHED';
+ $lang_published = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED';
// and to translation
- $this->setLangContent(
- $this->lang, $lang_published, 'Status'
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $lang_published, 'Status'
);
// the published description language string
- $lang_published_desc = Config::get('lang_prefix') . '_FILTER_PUBLISHED_'
+ $lang_published_desc = CFactory::_('Config')->lang_prefix . '_FILTER_PUBLISHED_'
. strtoupper($nameListCode);
// and to translation
- $this->setLangContent(
- $this->lang, $lang_published_desc, 'Status options for '
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $lang_published_desc, 'Status options for '
. StringHelper::safe($nameListCode, 'w')
);
- $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="status"';
- $field_filter_sets[] = $this->_t(3) . 'name="published"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(2) . '_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'description="' . $lang_published_desc . '"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'onchange="this.form.submit();"';
- $field_filter_sets[] = $this->_t(2) . '>';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(2) . '>';
+ $field_filter_sets[] = Indent::_(3)
. 'JOPTION_SELECT_PUBLISHED ';
- $field_filter_sets[] = $this->_t(2) . ' ';
+ $field_filter_sets[] = Indent::_(2) . ' ';
}
// add the category if found
if (isset($this->categoryBuilder[$nameListCode])
@@ -5821,24 +5801,24 @@ class Fields extends Structure
&& isset($this->categoryBuilder[$nameListCode]['filter'])
&& $this->categoryBuilder[$nameListCode]['filter'] >= 1)
{
- $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="category"';
- $field_filter_sets[] = $this->_t(3) . 'name="category_id"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(2) . 'categoryBuilder[$nameListCode]['name']
. '"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'description="JOPTION_FILTER_CATEGORY_DESC"';
- $field_filter_sets[] = $this->_t(3) . 'multiple="true"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3) . 'multiple="true"';
+ $field_filter_sets[] = Indent::_(3)
. 'class="multipleCategories"';
- $field_filter_sets[] = $this->_t(3) . 'extension="'
+ $field_filter_sets[] = Indent::_(3) . 'extension="'
. $this->categoryBuilder[$nameListCode]['extension'] . '"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'onchange="this.form.submit();"';
// TODO NOT SURE IF THIS SHOULD BE STATIC
- $field_filter_sets[] = $this->_t(3) . 'published="0,1,2"';
- $field_filter_sets[] = $this->_t(2) . '/>';
+ $field_filter_sets[] = Indent::_(3) . 'published="0,1,2"';
+ $field_filter_sets[] = Indent::_(2) . '/>';
}
// add the access filter if this view has access
// and if access manually is not set
@@ -5848,19 +5828,19 @@ class Fields extends Structure
)
&& !isset($this->fieldsNames[$nameSingleCode]['access']))
{
- $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="accesslevel"';
- $field_filter_sets[] = $this->_t(3) . 'name="access"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(2) . '_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'description="JFIELD_ACCESS_DESC"';
- $field_filter_sets[] = $this->_t(3) . 'multiple="true"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3) . 'multiple="true"';
+ $field_filter_sets[] = Indent::_(3)
. 'class="multipleAccessLevels"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'onchange="this.form.submit();"';
- $field_filter_sets[] = $this->_t(2) . '/>';
+ $field_filter_sets[] = Indent::_(2) . '/>';
}
// now add the dynamic fields
if (isset($this->filterBuilder[$nameListCode])
@@ -5872,14 +5852,14 @@ class Fields extends Structure
{
if ($filter['type'] != 'category')
{
- $field_filter_sets[] = $this->_t(2) . '_t(3) . 'type="'
+ $field_filter_sets[] = Indent::_(3) . 'type="'
. $filter['type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['type']);
@@ -5887,38 +5867,38 @@ class Fields extends Structure
else
{
// we use the filter field type that was build
- $field_filter_sets[] = $this->_t(3) . 'type="'
+ $field_filter_sets[] = Indent::_(3) . 'type="'
. $filter['filter_type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['filter_type']);
}
- $field_filter_sets[] = $this->_t(3) . 'name="'
+ $field_filter_sets[] = Indent::_(3) . 'name="'
. $filter['code'] . '"';
- $field_filter_sets[] = $this->_t(3) . 'label="'
+ $field_filter_sets[] = Indent::_(3) . 'label="'
. $filter['label'] . '"';
// if this is a multi field
if ($filter['multi'] == 2)
{
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'class="multiple'
. $filter['class'] . '"';
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'multiple="true"';
}
else
{
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'multiple="false"';
}
- $field_filter_sets[] = $this->_t(3)
+ $field_filter_sets[] = Indent::_(3)
. 'onchange="this.form.submit();"';
- $field_filter_sets[] = $this->_t(2) . '/>';
+ $field_filter_sets[] = Indent::_(2) . '/>';
}
}
}
- $field_filter_sets[] = $this->_t(2)
+ $field_filter_sets[] = Indent::_(2)
. ' ';
- $field_filter_sets[] = $this->_t(1) . ' ';
+ $field_filter_sets[] = Indent::_(1) . ' ';
// now update the file
return implode(PHP_EOL, $field_filter_sets);
@@ -5946,30 +5926,30 @@ class Fields extends Structure
$donelist = array('ordering' => true, 'id' => true);
// now build the XML
$list_sets = array();
- $list_sets[] = $this->_t(1) . '';
- $list_sets[] = $this->_t(2) . '_t(3) . 'name="fullordering"';
- $list_sets[] = $this->_t(3) . 'type="list"';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(1) . '';
+ $list_sets[] = Indent::_(2) . '_t(3)
+ $list_sets[] = Indent::_(3)
. 'description="COM_CONTENT_LIST_FULL_ORDERING_DESC"';
- $list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"';
+ $list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"';
// add dynamic ordering (Admin view)
$default_ordering = $this->getListViewDefaultOrdering(
$nameListCode
);
// set the default ordering
- $list_sets[] = $this->_t(3) . 'default="'
+ $list_sets[] = Indent::_(3) . 'default="'
. $default_ordering['name'] . ' '
. $default_ordering['direction'] . '"';
- $list_sets[] = $this->_t(3) . 'validate="options"';
- $list_sets[] = $this->_t(2) . '>';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3) . 'validate="options"';
+ $list_sets[] = Indent::_(2) . '>';
+ $list_sets[] = Indent::_(3)
. 'JGLOBAL_SORT_BY ';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JGRID_HEADING_ORDERING_ASC ';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JGRID_HEADING_ORDERING_DESC ';
// add the published filter if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
@@ -5977,9 +5957,9 @@ class Fields extends Structure
// add to done list
$donelist['published'] = true;
// add to xml :)
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JSTATUS_ASC ';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JSTATUS_DESC ';
}
@@ -5995,10 +5975,10 @@ class Fields extends Structure
{
if ($filter['type'] === 'category')
{
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. ''
. $filter['lang_asc'] . ' ';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. ''
. $filter['lang_desc'] . ' ';
}
@@ -6006,21 +5986,21 @@ class Fields extends Structure
$filter['custom']
))
{
- $list_sets[] = $this->_t(3) . ''
. $filter['lang_asc'] . ' ';
- $list_sets[] = $this->_t(3) . ''
. $filter['lang_desc'] . ' ';
}
else
{
- $list_sets[] = $this->_t(3) . ''
. $filter['lang_asc'] . ' ';
- $list_sets[] = $this->_t(3) . ''
. $filter['lang_desc'] . ' ';
}
@@ -6030,23 +6010,23 @@ class Fields extends Structure
}
}
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JGRID_HEADING_ID_ASC ';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(3)
. 'JGRID_HEADING_ID_DESC ';
- $list_sets[] = $this->_t(2) . ' ' . PHP_EOL;
+ $list_sets[] = Indent::_(2) . ' ' . PHP_EOL;
- $list_sets[] = $this->_t(2) . '_t(3) . 'name="limit"';
- $list_sets[] = $this->_t(3) . 'type="limitbox"';
- $list_sets[] = $this->_t(3) . 'label="COM_CONTENT_LIST_LIMIT"';
- $list_sets[] = $this->_t(3)
+ $list_sets[] = Indent::_(2) . '_t(3) . 'class="input-mini"';
- $list_sets[] = $this->_t(3) . 'default="25"';
- $list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"';
- $list_sets[] = $this->_t(2) . '/>';
- $list_sets[] = $this->_t(1) . ' ';
+ $list_sets[] = Indent::_(3) . 'class="input-mini"';
+ $list_sets[] = Indent::_(3) . 'default="25"';
+ $list_sets[] = Indent::_(3) . 'onchange="this.form.submit();"';
+ $list_sets[] = Indent::_(2) . '/>';
+ $list_sets[] = Indent::_(1) . '';
return implode(PHP_EOL, $list_sets);
}
@@ -6082,29 +6062,25 @@ class Fields extends Structure
= array();
// JPREFIX <>>
$this->fileContentDynamic['customfilterfield_'
- . $filter['filter_type']][$this->hhh
- . 'JPREFIX' . $this->hhh]
+ . $filter['filter_type']][Placefix::_h('JPREFIX')]
= 'J';
// Type <<>>
$this->fileContentDynamic['customfilterfield_'
- . $filter['filter_type']][$this->hhh
- . 'Type' . $this->hhh]
+ . $filter['filter_type']][Placefix::_h('Type')]
= StringHelper::safe(
$filter['filter_type'], 'F'
);
// type <<>>
$this->fileContentDynamic['customfilterfield_'
- . $filter['filter_type']][$this->hhh
- . 'type' . $this->hhh]
+ . $filter['filter_type']][Placefix::_h('type')]
= StringHelper::safe($filter['filter_type']);
// JFORM_GETOPTIONS_PHP <<>>
$this->fileContentDynamic['customfilterfield_'
- . $filter['filter_type']][$this->hhh . 'JFORM_GETOPTIONS_PHP'
- . $this->hhh]
+ . $filter['filter_type']][Placefix::_h('JFORM_GETOPTIONS_PHP')]
= $getOptions;
// ADD_BUTTON <<>>
$this->fileContentDynamic['customfilterfield_'
- . $filter['filter_type']][$this->hhh . 'ADD_BUTTON' . $this->hhh]
+ . $filter['filter_type']][Placefix::_h('ADD_BUTTON')]
= '';
// now build the custom filter field type file
$target = array('admin' => 'customfilterfield');
@@ -6135,7 +6111,7 @@ class Fields extends Structure
&& StringHelper::check($fieldData['views']))
{
// set local component
- $local_component = "com_" . Config::get('component_code_name');
+ $local_component = "com_" . CFactory::_('Config')->component_code_name;
// check that the component value is set
if (!isset($fieldData['component'])
|| !StringHelper::check(
@@ -6153,13 +6129,13 @@ class Fields extends Structure
$fieldData['component'] = "com_" . $fieldData['component'];
}
// make sure the component is update if # # # or [ [ [ component placeholder is used
- if (strpos($fieldData['component'], $this->hhh) !== false
+ if (strpos($fieldData['component'], Placefix::h()) !== false
|| strpos(
- $fieldData['component'], $this->bbb
+ $fieldData['component'], Placefix::b()
) !== false) // should not be needed... but
{
- $fieldData['component'] = $this->setPlaceholders(
- $fieldData['component'], $this->placeholders
+ $fieldData['component'] = CFactory::_('Placeholder')->update(
+ $fieldData['component'], CFactory::_('Placeholder')->active
);
}
// get core permissions
@@ -6184,112 +6160,112 @@ class Fields extends Structure
}
// start building the add buttons/s
$addButton = array();
- $addButton[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $addButton[] = $this->_t(1) . " * Override to add new button";
- $addButton[] = $this->_t(1) . " *";
- $addButton[] = $this->_t(1)
+ $addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $addButton[] = Indent::_(1) . " * Override to add new button";
+ $addButton[] = Indent::_(1) . " *";
+ $addButton[] = Indent::_(1)
. " * @return string The field input markup.";
- $addButton[] = $this->_t(1) . " *";
- $addButton[] = $this->_t(1) . " * @since 3.2";
- $addButton[] = $this->_t(1) . " */";
- $addButton[] = $this->_t(1) . "protected function getInput()";
- $addButton[] = $this->_t(1) . "{";
- $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(1) . " *";
+ $addButton[] = Indent::_(1) . " * @since 3.2";
+ $addButton[] = Indent::_(1) . " */";
+ $addButton[] = Indent::_(1) . "protected function getInput()";
+ $addButton[] = Indent::_(1) . "{";
+ $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " see if we should add buttons";
- $addButton[] = $this->_t(2)
+ $addButton[] = Indent::_(2)
. "\$set_button = \$this->getAttribute('button');";
- $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " get html";
- $addButton[] = $this->_t(2) . "\$html = parent::getInput();";
- $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(2) . "\$html = parent::getInput();";
+ $addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " if true set button";
- $addButton[] = $this->_t(2) . "if (\$set_button === 'true')";
- $addButton[] = $this->_t(2) . "{";
- $addButton[] = $this->_t(3) . "\$button = array();";
- $addButton[] = $this->_t(3) . "\$script = array();";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(2) . "if (\$set_button === 'true')";
+ $addButton[] = Indent::_(2) . "{";
+ $addButton[] = Indent::_(3) . "\$button = array();";
+ $addButton[] = Indent::_(3) . "\$script = array();";
+ $addButton[] = Indent::_(3)
. "\$button_code_name = \$this->getAttribute('name');";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the input from url";
- $addButton[] = $this->_t(3) . "\$app = JFactory::getApplication();";
- $addButton[] = $this->_t(3) . "\$jinput = \$app->input;";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "\$app = JFactory::getApplication();";
+ $addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the view name & id";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$values = \$jinput->getArray(array(";
- $addButton[] = $this->_t(4) . "'id' => 'int',";
- $addButton[] = $this->_t(4) . "'view' => 'word'";
- $addButton[] = $this->_t(3) . "));";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "'id' => 'int',";
+ $addButton[] = Indent::_(4) . "'view' => 'word'";
+ $addButton[] = Indent::_(3) . "));";
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if new item";
- $addButton[] = $this->_t(3) . "\$ref = '';";
- $addButton[] = $this->_t(3) . "\$refJ = '';";
+ $addButton[] = Indent::_(3) . "\$ref = '';";
+ $addButton[] = Indent::_(3) . "\$refJ = '';";
if ($refLoad)
{
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
- $addButton[] = $this->_t(3) . "{";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "{";
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load referral if not new item.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$_uri = (string) JUri::getInstance();";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$ref .= '&return=' . \$_return;";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$refJ .= '&return=' . \$_return;";
- $addButton[] = $this->_t(3) . "}";
+ $addButton[] = Indent::_(3) . "}";
}
else
{
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
- $addButton[] = $this->_t(3) . "{";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "{";
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " only load field details if not new item.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$_uri = (string) JUri::getInstance();";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load return value.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$ref = '&return=' . \$_return;";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$refJ = '&return=' . \$_return;";
- $addButton[] = $this->_t(3) . "}";
+ $addButton[] = Indent::_(3) . "}";
}
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get button label";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$button_label = trim(\$button_code_name);";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/_+/', ' ', \$button_label);";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$button_label = preg_replace('/\s+/', ' ', \$button_label);";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "\$button_label = ucfirst(strtolower(\$button_label));";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get user object";
- $addButton[] = $this->_t(3) . "\$user = JFactory::getUser();";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "\$user = JFactory::getUser();";
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions.
if ($coreLoad && isset($core['core.create'])
@@ -6302,30 +6278,30 @@ class Fields extends Structure
$this->permissionBuilder['global'][$core['core.create']]
))
{
- $addButton[] = $this->_t(3) . "if (\$user->authorise('"
+ $addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $core['core.create'] . "', '" . $component
. "') && \$app->isAdmin()) // TODO for now only in admin area.";
}
else
{
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "if (\$user->authorise('core.create', '" . $component
. "') && \$app->isAdmin()) // TODO for now only in admin area.";
}
- $addButton[] = $this->_t(3) . "{";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "{";
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build Create button";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$button[] = 'lang_prefix
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
- $addButton[] = $this->_t(5) . "href=\"index.php?option="
+ $addButton[] = Indent::_(5) . "href=\"index.php?option="
. $fieldData['component'] . "&view=" . $fieldData['view']
. "&layout=edit'.\$ref.'\" >";
- $addButton[] = $this->_t(5)
+ $addButton[] = Indent::_(5)
. " ';";
- $addButton[] = $this->_t(3) . "}";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "}";
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to edit " . $fieldData['view'];
// check if the item has permissions.
if ($coreLoad && isset($core['core.edit'])
@@ -6338,88 +6314,88 @@ class Fields extends Structure
$this->permissionBuilder['global'][$core['core.edit']]
))
{
- $addButton[] = $this->_t(3) . "if (\$user->authorise('"
+ $addButton[] = Indent::_(3) . "if (\$user->authorise('"
. $core['core.edit'] . "', '" . $component
. "') && \$app->isAdmin()) // TODO for now only in admin area.";
}
else
{
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "if (\$user->authorise('core.edit', '" . $component
. "') && \$app->isAdmin()) // TODO for now only in admin area.";
}
- $addButton[] = $this->_t(3) . "{";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "{";
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build edit button";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$button[] = 'lang_prefix
. "_EDIT_S', \$button_label).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
- $addButton[] = $this->_t(5)
+ $addButton[] = Indent::_(5)
. " ';";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " build script";
- $addButton[] = $this->_t(4) . "\$script[] = \"";
- $addButton[] = $this->_t(5) . "jQuery(document).ready(function() {";
- $addButton[] = $this->_t(6)
+ $addButton[] = Indent::_(4) . "\$script[] = \"";
+ $addButton[] = Indent::_(5) . "jQuery(document).ready(function() {";
+ $addButton[] = Indent::_(6)
. "jQuery('#adminForm').on('change', '#jform_\".\$button_code_name.\"',function (e) {";
- $addButton[] = $this->_t(7) . "e.preventDefault();";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7) . "e.preventDefault();";
+ $addButton[] = Indent::_(7)
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
- $addButton[] = $this->_t(6) . "});";
- $addButton[] = $this->_t(6)
+ $addButton[] = Indent::_(6) . "});";
+ $addButton[] = Indent::_(6)
. "var \".\$button_code_name.\"Value = jQuery('#jform_\".\$button_code_name.\"').val();";
- $addButton[] = $this->_t(6)
+ $addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
- $addButton[] = $this->_t(5) . "});";
- $addButton[] = $this->_t(5)
+ $addButton[] = Indent::_(5) . "});";
+ $addButton[] = Indent::_(5)
. "function \".\$button_code_name.\"Button(value) {";
- $addButton[] = $this->_t(6)
+ $addButton[] = Indent::_(6)
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
- $addButton[] = $this->_t(7) . "// hide the create button";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7) . "// hide the create button";
+ $addButton[] = Indent::_(7)
. "jQuery('#\".\$button_code_name.\"Create').hide();";
- $addButton[] = $this->_t(7) . "// show edit button";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7) . "// show edit button";
+ $addButton[] = Indent::_(7)
. "jQuery('#\".\$button_code_name.\"Edit').show();";
- $addButton[] = $this->_t(7) . "var url = 'index.php?option="
+ $addButton[] = Indent::_(7) . "var url = 'index.php?option="
. $fieldData['component'] . "&view=" . $fieldData['views']
. "&task=" . $fieldData['view']
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7)
. "jQuery('#\".\$button_code_name.\"Edit').attr('href', url);";
- $addButton[] = $this->_t(6) . "} else {";
- $addButton[] = $this->_t(7) . "// show the create button";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(6) . "} else {";
+ $addButton[] = Indent::_(7) . "// show the create button";
+ $addButton[] = Indent::_(7)
. "jQuery('#\".\$button_code_name.\"Create').show();";
- $addButton[] = $this->_t(7) . "// hide edit button";
- $addButton[] = $this->_t(7)
+ $addButton[] = Indent::_(7) . "// hide edit button";
+ $addButton[] = Indent::_(7)
. "jQuery('#\".\$button_code_name.\"Edit').hide();";
- $addButton[] = $this->_t(6) . "}";
- $addButton[] = $this->_t(5) . "}\";";
- $addButton[] = $this->_t(3) . "}";
- $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(6) . "}";
+ $addButton[] = Indent::_(5) . "}\";";
+ $addButton[] = Indent::_(3) . "}";
+ $addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if button was created for " . $fieldData['view']
. " field.";
- $addButton[] = $this->_t(3)
+ $addButton[] = Indent::_(3)
. "if (is_array(\$button) && count(\$button) > 0)";
- $addButton[] = $this->_t(3) . "{";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(3) . "{";
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load the needed script.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$document = JFactory::getDocument();";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "\$document->addScriptDeclaration(implode(' ',\$script));";
- $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " return the button attached to input field.";
- $addButton[] = $this->_t(4)
+ $addButton[] = Indent::_(4)
. "return '' .\$html . implode('',\$button).'
';";
- $addButton[] = $this->_t(3) . "}";
- $addButton[] = $this->_t(2) . "}";
- $addButton[] = $this->_t(2) . "return \$html;";
- $addButton[] = $this->_t(1) . "}";
+ $addButton[] = Indent::_(3) . "}";
+ $addButton[] = Indent::_(2) . "}";
+ $addButton[] = Indent::_(2) . "return \$html;";
+ $addButton[] = Indent::_(1) . "}";
return implode(PHP_EOL, $addButton);
}
@@ -6444,7 +6420,7 @@ class Fields extends Structure
$dom->getElementsByTagName($nodename)->item(0)
);
// make sure Tidy is enabled
- if (Config::get('tidy', false))
+ if (CFactory::_('Config')->get('tidy', false))
{
$tidy = new Tidy();
$tidy->parseString(
diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php
index 8c3f378ff..71e0592f4 100644
--- a/admin/helpers/compiler/e_Interpretation.php
+++ b/admin/helpers/compiler/e_Interpretation.php
@@ -21,7 +21,10 @@ use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\MathHelper;
-use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
+use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
+use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Compiler class
@@ -29,6 +32,7 @@ use VDM\Joomla\Componentbuilder\Factory\Compiler\Config;
class Interpretation extends Fields
{
+
/**
* The global config Field Sets
*
@@ -246,10 +250,10 @@ class Interpretation extends Fields
/**
* Constructor
*/
- public function __construct($config = array())
+ public function __construct()
{
// first we run the parent constructor
- if (parent::__construct($config))
+ if (parent::__construct())
{
return true;
}
@@ -257,23 +261,6 @@ class Interpretation extends Fields
return false;
}
- /**
- * Set the line number in comments
- *
- * @param int $nr The line number
- *
- * @return string
- */
- private function setLine($nr)
- {
- if (Config::get('debug_line_nr', false))
- {
- return ' [Interpretation ' . $nr . ']';
- }
-
- return '';
- }
-
/**
* add email helper
*/
@@ -283,16 +270,14 @@ class Interpretation extends Fields
&& $this->componentData->add_email_helper)
{
// set email helper in place with component name
- $component = Config::get('component_code_name');
- $Component = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh];
+ $component = CFactory::_('Config')->component_code_name;
+ $Component = $this->fileContentStatic[Placefix::_h('Component')];
$target = array('admin' => 'emailer');
$done = $this->buildDynamique($target, 'emailer', $component);
if ($done)
{
// the text for the file BAKING
- $this->fileContentDynamic['emailer_' . $component][$this->hhh
- . 'BAKING' . $this->hhh]
+ $this->fileContentDynamic['emailer_' . $component][Placefix::_h('BAKING')]
= ''; // <<-- to insure it gets updated
// return the code need to load the abstract class
return PHP_EOL . "JLoader::register('" . $Component
@@ -313,25 +298,20 @@ class Interpretation extends Fields
&& $this->componentData->license_type == 3)
{
if (!isset(
- $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
))
{
$_WHMCS = '_' . StringHelper::safe(
$this->uniquekey(10), 'U'
);
// add it to the system
- $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
= $this->setHelperLicenseLock($_WHMCS, 'site');
- $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')]
= $this->setHelperLicenseLock($_WHMCS, 'admin');
- $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')]
= $this->setInitLicenseLock($_WHMCS);
- $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')]
= PHP_EOL . PHP_EOL . 'defined(\'' . $_WHMCS
. '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));';
}
@@ -339,17 +319,13 @@ class Interpretation extends Fields
else
{
// don't add it to the system
- $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELPER_SITE_LICENSE_LOCK')]
= '';
- $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELPER_LICENSE_LOCK')]
= '';
- $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_INT')]
= '';
- $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('LICENSE_LOCKED_DEFINED')]
= '';
}
}
@@ -366,8 +342,7 @@ class Interpretation extends Fields
&& $this->componentData->license_type == 3)
{
if (!isset(
- $this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD'
- . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')]
))
{
$boolMethod = 'get' . StringHelper::safe(
@@ -377,31 +352,24 @@ class Interpretation extends Fields
$this->uniquekey(3), 'W'
);
// add it to the system
- $this->fileContentDynamic[$view][$this->hhh
- . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')]
= $this->setBoolLicenseLock($boolMethod, $globalbool);
- $this->fileContentDynamic[$view][$this->hhh
- . 'LICENSE_LOCKED_CHECK' . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')]
= $this->checkStatmentLicenseLocked($boolMethod);
- $this->fileContentDynamic[$view][$this->hhh
- . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')]
= $this->checkStatmentLicenseLocked($boolMethod, '$table');
- $this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD'
- . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('BOOLMETHOD')]
= $boolMethod;
}
}
else
{
// don't add it to the system
- $this->fileContentDynamic[$view][$this->hhh
- . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_SET_BOOL')]
= '';
- $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_CHECK'
- . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_LOCKED_CHECK')]
= '';
- $this->fileContentDynamic[$view][$this->hhh
- . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh]
+ $this->fileContentDynamic[$view][Placefix::_h('LICENSE_TABLE_LOCKED_CHECK')]
= '';
}
}
@@ -416,15 +384,15 @@ class Interpretation extends Fields
*/
public function checkStatmentLicenseLocked($boolMethod, $thIIS = '$this')
{
- $statment[] = PHP_EOL . $this->_t(2) . "if (!" . $thIIS . "->"
+ $statment[] = PHP_EOL . Indent::_(2) . "if (!" . $thIIS . "->"
. $boolMethod . "())";
- $statment[] = $this->_t(2) . "{";
- $statment[] = $this->_t(3) . "\$app = JFactory::getApplication();";
- $statment[] = $this->_t(3) . "\$app->enqueueMessage(JText:"
+ $statment[] = Indent::_(2) . "{";
+ $statment[] = Indent::_(3) . "\$app = JFactory::getApplication();";
+ $statment[] = Indent::_(3) . "\$app->enqueueMessage(JText:"
. ":_('NIE_REG_NIE'), 'error');";
- $statment[] = $this->_t(3) . "\$app->redirect('index.php');";
- $statment[] = $this->_t(3) . "return false;";
- $statment[] = $this->_t(2) . "}";
+ $statment[] = Indent::_(3) . "\$app->redirect('index.php');";
+ $statment[] = Indent::_(3) . "return false;";
+ $statment[] = Indent::_(2) . "}";
// return the genuine mentod statement
return implode(PHP_EOL, $statment);
@@ -440,38 +408,38 @@ class Interpretation extends Fields
*/
public function setBoolLicenseLock($boolMethod, $globalbool)
{
- $bool[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $bool[] = $this->_t(1) . " * The private bool.";
- $bool[] = $this->_t(1) . " **/";
- $bool[] = $this->_t(1) . "private $" . $globalbool . ";";
- $bool[] = PHP_EOL . $this->_t(1) . "/**";
- $bool[] = $this->_t(1) . " * Check if this install has a license.";
- $bool[] = $this->_t(1) . " **/";
- $bool[] = $this->_t(1) . "public function " . $boolMethod . "()";
- $bool[] = $this->_t(1) . "{";
- $bool[] = $this->_t(2) . "if(!empty(\$this->" . $globalbool . "))";
- $bool[] = $this->_t(2) . "{";
- $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";";
- $bool[] = $this->_t(2) . "}";
- $bool[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $bool[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $bool[] = Indent::_(1) . " * The private bool.";
+ $bool[] = Indent::_(1) . " **/";
+ $bool[] = Indent::_(1) . "private $" . $globalbool . ";";
+ $bool[] = PHP_EOL . Indent::_(1) . "/**";
+ $bool[] = Indent::_(1) . " * Check if this install has a license.";
+ $bool[] = Indent::_(1) . " **/";
+ $bool[] = Indent::_(1) . "public function " . $boolMethod . "()";
+ $bool[] = Indent::_(1) . "{";
+ $bool[] = Indent::_(2) . "if(!empty(\$this->" . $globalbool . "))";
+ $bool[] = Indent::_(2) . "{";
+ $bool[] = Indent::_(3) . "return \$this->" . $globalbool . ";";
+ $bool[] = Indent::_(2) . "}";
+ $bool[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the global params";
- $bool[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_"
- . Config::get('component_code_name') . "', true);";
- $bool[] = $this->_t(2)
+ $bool[] = Indent::_(2) . "\$params = JComponentHelper::getParams('com_"
+ . CFactory::_('Config')->component_code_name . "', true);";
+ $bool[] = Indent::_(2)
. "\$whmcs_key = \$params->get('whmcs_key', null);";
- $bool[] = $this->_t(2) . "if (\$whmcs_key)";
- $bool[] = $this->_t(2) . "{";
- $bool[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $bool[] = Indent::_(2) . "if (\$whmcs_key)";
+ $bool[] = Indent::_(2) . "{";
+ $bool[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " load the file";
- $bool[] = $this->_t(3)
+ $bool[] = Indent::_(3)
. "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_"
- . Config::get('component_code_name') . "');";
- $bool[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);";
- $bool[] = $this->_t(3) . "\$this->" . $globalbool . " = \$the->_is;";
- $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";";
- $bool[] = $this->_t(2) . "}";
- $bool[] = $this->_t(2) . "return false;";
- $bool[] = $this->_t(1) . "}";
+ . CFactory::_('Config')->component_code_name . "');";
+ $bool[] = Indent::_(3) . "\$the = new WHMCS(\$whmcs_key);";
+ $bool[] = Indent::_(3) . "\$this->" . $globalbool . " = \$the->_is;";
+ $bool[] = Indent::_(3) . "return \$this->" . $globalbool . ";";
+ $bool[] = Indent::_(2) . "}";
+ $bool[] = Indent::_(2) . "return false;";
+ $bool[] = Indent::_(1) . "}";
// return the genuine method statement
return implode(PHP_EOL, $bool);
@@ -487,30 +455,30 @@ class Interpretation extends Fields
*/
public function setHelperLicenseLock($_WHMCS, $target)
{
- $helper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $helper[] = $this->_t(1) . " * Check if this install has a license.";
- $helper[] = $this->_t(1) . " **/";
- $helper[] = $this->_t(1) . "public static function isGenuine()";
- $helper[] = $this->_t(1) . "{";
- $helper[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $helper[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $helper[] = Indent::_(1) . " * Check if this install has a license.";
+ $helper[] = Indent::_(1) . " **/";
+ $helper[] = Indent::_(1) . "public static function isGenuine()";
+ $helper[] = Indent::_(1) . "{";
+ $helper[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the global params";
- $helper[] = $this->_t(2)
+ $helper[] = Indent::_(2)
. "\$params = JComponentHelper::getParams('com_"
- . Config::get('component_code_name') . "', true);";
- $helper[] = $this->_t(2)
+ . CFactory::_('Config')->component_code_name . "', true);";
+ $helper[] = Indent::_(2)
. "\$whmcs_key = \$params->get('whmcs_key', null);";
- $helper[] = $this->_t(2) . "if (\$whmcs_key)";
- $helper[] = $this->_t(2) . "{";
- $helper[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $helper[] = Indent::_(2) . "if (\$whmcs_key)";
+ $helper[] = Indent::_(2) . "{";
+ $helper[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " load the file";
- $helper[] = $this->_t(3)
+ $helper[] = Indent::_(3)
. "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_"
- . Config::get('component_code_name') . "');";
- $helper[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);";
- $helper[] = $this->_t(3) . "return \$the->_is;";
- $helper[] = $this->_t(2) . "}";
- $helper[] = $this->_t(2) . "return false;";
- $helper[] = $this->_t(1) . "}";
+ . CFactory::_('Config')->component_code_name . "');";
+ $helper[] = Indent::_(3) . "\$the = new WHMCS(\$whmcs_key);";
+ $helper[] = Indent::_(3) . "return \$the->_is;";
+ $helper[] = Indent::_(2) . "}";
+ $helper[] = Indent::_(2) . "return false;";
+ $helper[] = Indent::_(1) . "}";
// return the genuine mentod statement
return implode(PHP_EOL, $helper);
@@ -527,13 +495,13 @@ class Interpretation extends Fields
{
$init[] = PHP_EOL . "if (!defined('" . $_WHMCS . "'))";
$init[] = "{";
- $init[] = $this->_t(1) . "\$allow = "
- . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]
+ $init[] = Indent::_(1) . "\$allow = "
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::isGenuine();";
- $init[] = $this->_t(1) . "if (\$allow)";
- $init[] = $this->_t(1) . "{";
- $init[] = $this->_t(2) . "define('" . $_WHMCS . "', 1);";
- $init[] = $this->_t(1) . "}";
+ $init[] = Indent::_(1) . "if (\$allow)";
+ $init[] = Indent::_(1) . "{";
+ $init[] = Indent::_(2) . "define('" . $_WHMCS . "', 1);";
+ $init[] = Indent::_(1) . "}";
$init[] = "}";
// return the initializing statement
@@ -575,252 +543,252 @@ class Interpretation extends Fields
$theKey = base64_encode(serialize($key));
// set the script
$encrypt[] = "/**";
- $encrypt[] = "* " . $this->setLine(__LINE__) . "WHMCS Class ";
+ $encrypt[] = "* " . Line::_(__Line__, __Class__) . "WHMCS Class ";
$encrypt[] = "**/";
$encrypt[] = "class WHMCS";
$encrypt[] = "{";
- $encrypt[] = $this->_t(1) . "public \$_key = false;";
- $encrypt[] = $this->_t(1) . "public \$_is = false;";
- $encrypt[] = PHP_EOL . $this->_t(1)
+ $encrypt[] = Indent::_(1) . "public \$_key = false;";
+ $encrypt[] = Indent::_(1) . "public \$_is = false;";
+ $encrypt[] = PHP_EOL . Indent::_(1)
. "public function __construct(\$Vk5smi0wjnjb)";
- $encrypt[] = $this->_t(1) . "{";
- $encrypt[] = $this->_t(2) . "// get the session";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(1) . "{";
+ $encrypt[] = Indent::_(2) . "// get the session";
+ $encrypt[] = Indent::_(2)
. "\$session = JFactory::getSession();";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$V2uekt2wcgwk = \$session->get(\$Vk5smi0wjnjb, null);";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$h4sgrGsqq = \$this->get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk);";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "if (isset(\$h4sgrGsqq['nuut']) && \$h4sgrGsqq['nuut'] && (isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['eiegrendel']) && strlen(\$h4sgrGsqq['eiegrendel']) > 300)";
- $encrypt[] = $this->_t(2) . "{";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(2) . "{";
+ $encrypt[] = Indent::_(3)
. "\$session->set(\$Vk5smi0wjnjb, \$h4sgrGsqq['eiegrendel']);";
- $encrypt[] = $this->_t(2) . "}";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2) . "}";
+ $encrypt[] = Indent::_(2)
. "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 && isset(\$h4sgrGsqq['customfields']) && strlen(\$h4sgrGsqq['customfields']) > 4)";
- $encrypt[] = $this->_t(2) . "{";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(2) . "{";
+ $encrypt[] = Indent::_(3)
. "\$this->_key = md5(\$h4sgrGsqq['customfields']);";
- $encrypt[] = $this->_t(2) . "}";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2) . "}";
+ $encrypt[] = Indent::_(2)
. "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 )";
- $encrypt[] = $this->_t(2) . "{";
- $encrypt[] = $this->_t(3) . "\$this->_is = true;";
- $encrypt[] = $this->_t(2) . "}";
- $encrypt[] = $this->_t(1) . "}";
- $encrypt[] = PHP_EOL . $this->_t(1)
+ $encrypt[] = Indent::_(2) . "{";
+ $encrypt[] = Indent::_(3) . "\$this->_is = true;";
+ $encrypt[] = Indent::_(2) . "}";
+ $encrypt[] = Indent::_(1) . "}";
+ $encrypt[] = PHP_EOL . Indent::_(1)
. "private function get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk)";
- $encrypt[] = $this->_t(1) . "{";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(1) . "{";
+ $encrypt[] = Indent::_(2)
. "\$Viioj50xuqu2 = unserialize(base64_decode('" . $theKey
. "'));";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$Visqfrd1caus = time() . md5(mt_rand(1000000000, 9999999999) . \$Vk5smi0wjnjb);";
- $encrypt[] = $this->_t(2) . "\$Vo4tezfgcf3e = date(\"Ymd\");";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2) . "\$Vo4tezfgcf3e = date(\"Ymd\");";
+ $encrypt[] = Indent::_(2)
. "\$Vozblwvfym2f = \$_SERVER['SERVER_NAME'];";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$Vozblwvfym2fdie = isset(\$_SERVER['SERVER_ADDR']) ? \$_SERVER['SERVER_ADDR'] : \$_SERVER['LOCAL_ADDR'];";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$V343jp03dxco = dirname(__FILE__);";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(2)
. "\$Vc2rayehw4f0 = unserialize(base64_decode('czozNjoibW9kdWxlcy9zZXJ2ZXJzL2xpY2Vuc2luZy92ZXJpZnkucGhwIjs='));";
- $encrypt[] = $this->_t(2) . "\$Vlpolphukogz = false;";
- $encrypt[] = $this->_t(2) . "if (\$V2uekt2wcgwk) {";
- $encrypt[] = $this->_t(3) . "\$V2uekt2wcgwk = str_replace(\""
+ $encrypt[] = Indent::_(2) . "\$Vlpolphukogz = false;";
+ $encrypt[] = Indent::_(2) . "if (\$V2uekt2wcgwk) {";
+ $encrypt[] = Indent::_(3) . "\$V2uekt2wcgwk = str_replace(\""
. '".PHP_EOL."' . "\", '', \$V2uekt2wcgwk);";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3)
. "\$Vm5cxjdc43g4 = substr(\$V2uekt2wcgwk, 0, strlen(\$V2uekt2wcgwk) - 32);";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3)
. "\$Vbgx0efeu2sy = substr(\$V2uekt2wcgwk, strlen(\$V2uekt2wcgwk) - 32);";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3)
. "if (\$Vbgx0efeu2sy == md5(\$Vm5cxjdc43g4 . \$Viioj50xuqu2['geheim'])) {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vm5cxjdc43g4 = strrev(\$Vm5cxjdc43g4);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vbgx0efeu2sy = substr(\$Vm5cxjdc43g4, 0, 32);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vm5cxjdc43g4 = substr(\$Vm5cxjdc43g4, 32);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vm5cxjdc43g4 = base64_decode(\$Vm5cxjdc43g4);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vm5cxjdc43g4finding = unserialize(\$Vm5cxjdc43g4);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$V3qqz0p00fbq = \$Vm5cxjdc43g4finding['dan'];";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "if (\$Vbgx0efeu2sy == md5(\$V3qqz0p00fbq . \$Viioj50xuqu2['geheim'])) {";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "if (\$V3qqz0p00fbq > \$Vbfbwv2y4kre) {";
- $encrypt[] = $this->_t(6) . "\$Vlpolphukogz = true;";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6) . "\$Vlpolphukogz = true;";
+ $encrypt[] = Indent::_(6)
. "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "\$Vcixw3trerrt = explode(',', \$Vwasqoybpyed['validdomain']);";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "if (!in_array(\$_SERVER['SERVER_NAME'], \$Vcixw3trerrt)) {";
- $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;";
- $encrypt[] = $this->_t(7)
+ $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;";
+ $encrypt[] = Indent::_(7)
. "\$Vm5cxjdc43g4finding['status'] = \"sleg\";";
- $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();";
- $encrypt[] = $this->_t(6) . "}";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();";
+ $encrypt[] = Indent::_(6) . "}";
+ $encrypt[] = Indent::_(6)
. "\$Vkni3xyhkqzv = explode(',', \$Vwasqoybpyed['validip']);";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "if (!in_array(\$Vozblwvfym2fdie, \$Vkni3xyhkqzv)) {";
- $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;";
- $encrypt[] = $this->_t(7)
+ $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;";
+ $encrypt[] = Indent::_(7)
. "\$Vm5cxjdc43g4finding['status'] = \"sleg\";";
- $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();";
- $encrypt[] = $this->_t(6) . "}";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();";
+ $encrypt[] = Indent::_(6) . "}";
+ $encrypt[] = Indent::_(6)
. "\$Vckfvnepoaxj = explode(',', \$Vwasqoybpyed['validdirectory']);";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "if (!in_array(\$V343jp03dxco, \$Vckfvnepoaxj)) {";
- $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;";
- $encrypt[] = $this->_t(7)
+ $encrypt[] = Indent::_(7) . "\$Vlpolphukogz = false;";
+ $encrypt[] = Indent::_(7)
. "\$Vm5cxjdc43g4finding['status'] = \"sleg\";";
- $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();";
- $encrypt[] = $this->_t(6) . "}";
- $encrypt[] = $this->_t(5) . "}";
- $encrypt[] = $this->_t(4) . "}";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(2) . "}";
- $encrypt[] = $this->_t(2) . "if (!\$Vlpolphukogz) {";
- $encrypt[] = $this->_t(3) . "\$V1u0c4dl3ehp = array(";
- $encrypt[] = $this->_t(4) . "'licensekey' => \$Vk5smi0wjnjb,";
- $encrypt[] = $this->_t(4) . "'domain' => \$Vozblwvfym2f,";
- $encrypt[] = $this->_t(4) . "'ip' => \$Vozblwvfym2fdie,";
- $encrypt[] = $this->_t(4) . "'dir' => \$V343jp03dxco,";
- $encrypt[] = $this->_t(3) . ");";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(7) . "\$Vwasqoybpyed = array();";
+ $encrypt[] = Indent::_(6) . "}";
+ $encrypt[] = Indent::_(5) . "}";
+ $encrypt[] = Indent::_(4) . "}";
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(2) . "}";
+ $encrypt[] = Indent::_(2) . "if (!\$Vlpolphukogz) {";
+ $encrypt[] = Indent::_(3) . "\$V1u0c4dl3ehp = array(";
+ $encrypt[] = Indent::_(4) . "'licensekey' => \$Vk5smi0wjnjb,";
+ $encrypt[] = Indent::_(4) . "'domain' => \$Vozblwvfym2f,";
+ $encrypt[] = Indent::_(4) . "'ip' => \$Vozblwvfym2fdie,";
+ $encrypt[] = Indent::_(4) . "'dir' => \$V343jp03dxco,";
+ $encrypt[] = Indent::_(3) . ");";
+ $encrypt[] = Indent::_(3)
. "if (\$Visqfrd1caus) \$V1u0c4dl3ehp['check_token'] = \$Visqfrd1caus;";
- $encrypt[] = $this->_t(3) . "\$Vdsjeyjmpq2o = '';";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3) . "\$Vdsjeyjmpq2o = '';";
+ $encrypt[] = Indent::_(3)
. "foreach (\$V1u0c4dl3ehp AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vdsjeyjmpq2o .= \$V2sgyscukmgi.'='.urlencode(\$V1u00zkzmb1d).'&';";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3)
. "if (function_exists('curl_exec')) {";
- $encrypt[] = $this->_t(4) . "\$Vdathuqgjyf0 = curl_init();";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4) . "\$Vdathuqgjyf0 = curl_init();";
+ $encrypt[] = Indent::_(4)
. "curl_setopt(\$Vdathuqgjyf0, CURLOPT_URL, \$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POST, 1);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POSTFIELDS, \$Vdsjeyjmpq2o);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "curl_setopt(\$Vdathuqgjyf0, CURLOPT_TIMEOUT, 30);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "curl_setopt(\$Vdathuqgjyf0, CURLOPT_RETURNTRANSFER, 1);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5 = curl_exec(\$Vdathuqgjyf0);";
- $encrypt[] = $this->_t(4) . "curl_close(\$Vdathuqgjyf0);";
- $encrypt[] = $this->_t(3) . "} else {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4) . "curl_close(\$Vdathuqgjyf0);";
+ $encrypt[] = Indent::_(3) . "} else {";
+ $encrypt[] = Indent::_(4)
. "\$Vrpmu4bvnmkp = fsockopen(\$Viioj50xuqu2['kasier'], 80, \$Vc0t5kmpwkwk, \$Va3g41fnofhu, 5);";
- $encrypt[] = $this->_t(4) . "if (\$Vrpmu4bvnmkp) {";
- $encrypt[] = $this->_t(5) . "\$Vznkm0a0me1y = \"\r" . PHP_EOL
+ $encrypt[] = Indent::_(4) . "if (\$Vrpmu4bvnmkp) {";
+ $encrypt[] = Indent::_(5) . "\$Vznkm0a0me1y = \"\r" . PHP_EOL
. "\";";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop = \"POST \".\$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0 . \" HTTP/1.0\" . \$Vznkm0a0me1y;";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop .= \"Host: \".\$Viioj50xuqu2['kasier'] . \$Vznkm0a0me1y;";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop .= \"Content-type: application/x-www-form-urlencoded\" . \$Vznkm0a0me1y;";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop .= \"Content-length: \".@strlen(\$Vdsjeyjmpq2o) . \$Vznkm0a0me1y;";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop .= \"Connection: close\" . \$Vznkm0a0me1y . \$Vznkm0a0me1y;";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2sgyscukmgiop .= \$Vdsjeyjmpq2o;";
- $encrypt[] = $this->_t(5) . "\$Vqojefyeohg5 = '';";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5) . "\$Vqojefyeohg5 = '';";
+ $encrypt[] = Indent::_(5)
. "@stream_set_timeout(\$Vrpmu4bvnmkp, 20);";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "@fputs(\$Vrpmu4bvnmkp, \$V2sgyscukmgiop);";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "while (!@feof(\$Vrpmu4bvnmkp)&&\$V2czq24pjexf) {";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "\$Vqojefyeohg5 .= @fgets(\$Vrpmu4bvnmkp, 1024);";
- $encrypt[] = $this->_t(6)
+ $encrypt[] = Indent::_(6)
. "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);";
- $encrypt[] = $this->_t(5) . "}";
- $encrypt[] = $this->_t(5) . "@fclose (\$Vqojefyeohg5);";
- $encrypt[] = $this->_t(4) . "}";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3) . "if (!\$Vqojefyeohg5) {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(5) . "}";
+ $encrypt[] = Indent::_(5) . "@fclose (\$Vqojefyeohg5);";
+ $encrypt[] = Indent::_(4) . "}";
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3) . "if (!\$Vqojefyeohg5) {";
+ $encrypt[] = Indent::_(4)
. "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "if (isset(\$V3qqz0p00fbq) && \$V3qqz0p00fbq > \$Vbfbwv2y4kre) {";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;";
- $encrypt[] = $this->_t(4) . "} else {";
- $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed = array();";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(4) . "} else {";
+ $encrypt[] = Indent::_(5) . "\$Vwasqoybpyed = array();";
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed['status'] = \"sleg\";";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed['description'] = \"Remote Check Failed\";";
- $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;";
- $encrypt[] = $this->_t(4) . "}";
- $encrypt[] = $this->_t(3) . "} else {";
- $encrypt[] = $this->_t(4) . "preg_match_all('"
+ $encrypt[] = Indent::_(5) . "return \$Vwasqoybpyed;";
+ $encrypt[] = Indent::_(4) . "}";
+ $encrypt[] = Indent::_(3) . "} else {";
+ $encrypt[] = Indent::_(4) . "preg_match_all('"
. '/<(.*?)>([^<]+)<\/\\1>/i'
. "', \$Vqojefyeohg5, \$V1ot20wob03f);";
- $encrypt[] = $this->_t(4) . "\$Vwasqoybpyed = array();";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4) . "\$Vwasqoybpyed = array();";
+ $encrypt[] = Indent::_(4)
. "foreach (\$V1ot20wob03f[1] AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed[\$V1u00zkzmb1d] = \$V1ot20wob03f[2][\$V2sgyscukmgi];";
- $encrypt[] = $this->_t(4) . "}";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3) . "if (!is_array(\$Vwasqoybpyed)) {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4) . "}";
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3) . "if (!is_array(\$Vwasqoybpyed)) {";
+ $encrypt[] = Indent::_(4)
. "die(\"Invalid License Server Response\");";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3)
. "if (isset(\$Vwasqoybpyed['md5hash']) && \$Vwasqoybpyed['md5hash']) {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "if (\$Vwasqoybpyed['md5hash'] != md5(\$Viioj50xuqu2['geheim'] . \$Visqfrd1caus)) {";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed['status'] = \"sleg\";";
- $encrypt[] = $this->_t(5)
+ $encrypt[] = Indent::_(5)
. "\$Vwasqoybpyed['description'] = \"MD5 Checksum Verification Failed\";";
- $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;";
- $encrypt[] = $this->_t(4) . "}";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3)
+ $encrypt[] = Indent::_(5) . "return \$Vwasqoybpyed;";
+ $encrypt[] = Indent::_(4) . "}";
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3)
. "if (isset(\$Vwasqoybpyed['status']) && \$Vwasqoybpyed['status'] == \"Active\") {";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vwasqoybpyed['dan'] = \$Vo4tezfgcf3e;";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = serialize(\$Vwasqoybpyed);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = base64_encode(\$Vqojefyeohg5ing);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = md5(\$Vo4tezfgcf3e . \$Viioj50xuqu2['geheim']) . \$Vqojefyeohg5ing;";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = strrev(\$Vqojefyeohg5ing);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = \$Vqojefyeohg5ing . md5(\$Vqojefyeohg5ing . \$Viioj50xuqu2['geheim']);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \""
. '".PHP_EOL."' . "\", true);";
- $encrypt[] = $this->_t(4)
+ $encrypt[] = Indent::_(4)
. "\$Vwasqoybpyed['eiegrendel'] = \$Vqojefyeohg5ing;";
- $encrypt[] = $this->_t(3) . "}";
- $encrypt[] = $this->_t(3) . "\$Vwasqoybpyed['nuut'] = true;";
- $encrypt[] = $this->_t(2) . "}";
- $encrypt[] = $this->_t(2)
+ $encrypt[] = Indent::_(3) . "}";
+ $encrypt[] = Indent::_(3) . "\$Vwasqoybpyed['nuut'] = true;";
+ $encrypt[] = Indent::_(2) . "}";
+ $encrypt[] = Indent::_(2)
. "unset(\$V1u0c4dl3ehp,\$Vqojefyeohg5,\$V1ot20wob03f,\$Viioj50xuqu2['kasier'],\$Viioj50xuqu2['geheim'],\$Vo4tezfgcf3e,\$Vozblwvfym2fdie,\$Viioj50xuqu2['onthou'],\$Vbgx0efeu2sy);";
- $encrypt[] = $this->_t(2) . "return \$Vwasqoybpyed;";
- $encrypt[] = $this->_t(1) . "}";
+ $encrypt[] = Indent::_(2) . "return \$Vwasqoybpyed;";
+ $encrypt[] = Indent::_(1) . "}";
$encrypt[] = "}";
// return the help methods
@@ -837,9 +805,9 @@ class Interpretation extends Fields
), 'Error'
);
- return "//" . $this->setLine(__LINE__)
+ return "//" . Line::_(__Line__, __Class__)
. " The WHMCS class could not be added to this component." . PHP_EOL
- . "//" . $this->setLine(__LINE__)
+ . "//" . Line::_(__Line__, __Class__)
. " Please note that you will need to enable the add-on in the Joomla Component area (Add WHMCS)->Yes.";
}
@@ -851,7 +819,7 @@ class Interpretation extends Fields
public function setGetCryptKey()
{
// WHMCS_ENCRYPT_FILE
- $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')]
= '';
// check if encryption is ative
if ((isset($this->basicFieldModeling)
@@ -876,36 +844,34 @@ class Interpretation extends Fields
$target = array('admin' => 'whmcs');
$done = $this->buildDynamique($target, 'whmcs');
// the text for the file WHMCS_ENCRYPTION_BODY
- $this->fileContentDynamic['whmcs'][$this->hhh
- . 'WHMCS_ENCRYPTION_BODY' . $this->hhh]
+ $this->fileContentDynamic['whmcs'][Placefix::_h('WHMCS_ENCRYPTION_BODY')]
= $this->setWHMCSCryption();
// ENCRYPT_FILE
- $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE'
- . $this->hhh]
- = PHP_EOL . $this->_t(3) . "whmcs.php ";
+ $this->fileContentStatic[Placefix::_h('WHMCS_ENCRYPT_FILE')]
+ = PHP_EOL . Indent::_(3) . "whmcs.php ";
}
// get component name
- $component = Config::get('component_code_name');
+ $component = CFactory::_('Config')->component_code_name;
// set the getCryptKey function to the helper class
$function = array();
// start building the getCryptKey function/class method
- $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $function[] = $this->_t(1) . " * Get The Encryption Keys";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1)
+ $function[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $function[] = Indent::_(1) . " * Get The Encryption Keys";
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1)
. " * @param string \$type The type of key";
- $function[] = $this->_t(1)
+ $function[] = Indent::_(1)
. " * @param string/bool \$default The return value if no key was found";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1) . " * @return string On success";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1) . " **/";
- $function[] = $this->_t(1)
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1) . " * @return string On success";
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1) . " **/";
+ $function[] = Indent::_(1)
. "public static function getCryptKey(\$type, \$default = false)";
- $function[] = $this->_t(1) . "{";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(1) . "{";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the global params";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "\$params = JComponentHelper::getParams('com_" . $component
. "', true);";
// add the basic option
@@ -914,18 +880,18 @@ class Interpretation extends Fields
$this->basicFieldModeling
))
{
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Basic Encryption Type";
- $function[] = $this->_t(2) . "if ('basic' === \$type)";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(2) . "if ('basic' === \$type)";
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3)
. "\$basic_key = \$params->get('basic_key', \$default);";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "if (self::checkString(\$basic_key))";
- $function[] = $this->_t(3) . "{";
- $function[] = $this->_t(4) . "return \$basic_key;";
- $function[] = $this->_t(3) . "}";
- $function[] = $this->_t(2) . "}";
+ $function[] = Indent::_(3) . "{";
+ $function[] = Indent::_(4) . "return \$basic_key;";
+ $function[] = Indent::_(3) . "}";
+ $function[] = Indent::_(2) . "}";
}
// add the medium option
if (isset($this->mediumFieldModeling)
@@ -933,166 +899,166 @@ class Interpretation extends Fields
$this->mediumFieldModeling
))
{
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Medium Encryption Type";
- $function[] = $this->_t(2) . "if ('medium' === \$type)";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "if ('medium' === \$type)";
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " check if medium key is already loaded.";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "if (self::checkString(self::\$mediumCryptKey))";
- $function[] = $this->_t(3) . "{";
- $function[] = $this->_t(4)
+ $function[] = Indent::_(3) . "{";
+ $function[] = Indent::_(4)
. "return (self::\$mediumCryptKey !== 'none') ? trim(self::\$mediumCryptKey) : \$default;";
- $function[] = $this->_t(3) . "}";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "}";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the path to the medium encryption key.";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "\$medium_key_path = \$params->get('medium_key_path', null);";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "if (self::checkString(\$medium_key_path))";
- $function[] = $this->_t(3) . "{";
- $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "{";
+ $function[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load the key from the file.";
- $function[] = $this->_t(4)
+ $function[] = Indent::_(4)
. "if (self::getMediumCryptKey(\$medium_key_path))";
- $function[] = $this->_t(4) . "{";
- $function[] = $this->_t(5)
+ $function[] = Indent::_(4) . "{";
+ $function[] = Indent::_(5)
. "return trim(self::\$mediumCryptKey);";
- $function[] = $this->_t(4) . "}";
- $function[] = $this->_t(3) . "}";
- $function[] = $this->_t(2) . "}";
+ $function[] = Indent::_(4) . "}";
+ $function[] = Indent::_(3) . "}";
+ $function[] = Indent::_(2) . "}";
}
// add the whmcs option
if (isset($this->whmcsFieldModeling)
&& ArrayHelper::check($this->whmcsFieldModeling)
|| $this->componentData->add_license)
{
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " WHMCS Encryption Type";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "if ('whmcs' === \$type || 'advanced' === \$type)";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3)
. "\$key = \$params->get('whmcs_key', \$default);";
- $function[] = $this->_t(3) . "if (self::checkString(\$key))";
- $function[] = $this->_t(3) . "{";
- $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "if (self::checkString(\$key))";
+ $function[] = Indent::_(3) . "{";
+ $function[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " load the file";
- $function[] = $this->_t(4)
+ $function[] = Indent::_(4)
. "JLoader::import( 'whmcs', JPATH_COMPONENT_ADMINISTRATOR);";
- $function[] = PHP_EOL . $this->_t(4)
+ $function[] = PHP_EOL . Indent::_(4)
. "\$the = new WHMCS(\$key);";
- $function[] = PHP_EOL . $this->_t(4) . "return \$the->_key;";
- $function[] = $this->_t(3) . "}";
- $function[] = $this->_t(2) . "}";
+ $function[] = PHP_EOL . Indent::_(4) . "return \$the->_key;";
+ $function[] = Indent::_(3) . "}";
+ $function[] = Indent::_(2) . "}";
}
// end the function
- $function[] = PHP_EOL . $this->_t(2) . "return \$default;";
- $function[] = $this->_t(1) . "}";
+ $function[] = PHP_EOL . Indent::_(2) . "return \$default;";
+ $function[] = Indent::_(1) . "}";
// set the getMediumCryptKey class/method
if (isset($this->mediumFieldModeling)
&& ArrayHelper::check(
$this->mediumFieldModeling
))
{
- $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $function[] = $this->_t(1) . " * The Medium Encryption Key";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1) . " * @var string/bool";
- $function[] = $this->_t(1) . " **/";
- $function[] = $this->_t(1)
+ $function[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $function[] = Indent::_(1) . " * The Medium Encryption Key";
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1) . " * @var string/bool";
+ $function[] = Indent::_(1) . " **/";
+ $function[] = Indent::_(1)
. "protected static \$mediumCryptKey = false;";
- $function[] = PHP_EOL . $this->_t(1) . "/**";
- $function[] = $this->_t(1)
+ $function[] = PHP_EOL . Indent::_(1) . "/**";
+ $function[] = Indent::_(1)
. " * Get The Medium Encryption Key";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1)
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1)
. " * @param string \$path The path to the medium crypt key folder";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1)
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1)
. " * @return string On success";
- $function[] = $this->_t(1) . " *";
- $function[] = $this->_t(1) . " **/";
- $function[] = $this->_t(1)
+ $function[] = Indent::_(1) . " *";
+ $function[] = Indent::_(1) . " **/";
+ $function[] = Indent::_(1)
. "public static function getMediumCryptKey(\$path)";
- $function[] = $this->_t(1) . "{";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(1) . "{";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Prep the path a little";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "\$path = '/'. trim(str_replace('//', '/', \$path), '/');";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check if folder exist";
- $function[] = $this->_t(2) . "if (!Folder::exists(\$path))";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "if (!Folder::exists(\$path))";
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Lock key.";
- $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set the error message.";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "JFactory::getApplication()->enqueueMessage(JText::_('"
- . $this->langPrefix
+ . CFactory::_('Config')->lang_prefix
. "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');";
- $function[] = $this->_t(3) . "return false;";
- $function[] = $this->_t(2) . "}";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "return false;";
+ $function[] = Indent::_(2) . "}";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Create FileName and set file path";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "\$filePath = \$path.'/.'.md5('medium_crypt_key_file');";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check if we already have the file set";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "if ((self::\$mediumCryptKey = @file_get_contents(\$filePath)) !== FALSE)";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3) . "return true;";
- $function[] = $this->_t(2) . "}";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3) . "return true;";
+ $function[] = Indent::_(2) . "}";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Set the key for the first time";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "self::\$mediumCryptKey = self::randomkey(128);";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Open the key file";
- $function[] = $this->_t(2) . "\$fh = @fopen(\$filePath, 'w');";
- $function[] = $this->_t(2) . "if (!is_resource(\$fh))";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "\$fh = @fopen(\$filePath, 'w');";
+ $function[] = Indent::_(2) . "if (!is_resource(\$fh))";
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Lock key.";
- $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set the error message.";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "JFactory::getApplication()->enqueueMessage(JText::_('"
- . $this->langPrefix
+ . CFactory::_('Config')->lang_prefix
. "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');";
- $function[] = $this->_t(3) . "return false;";
- $function[] = $this->_t(2) . "}";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "return false;";
+ $function[] = Indent::_(2) . "}";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Write to the key file";
- $function[] = $this->_t(2)
+ $function[] = Indent::_(2)
. "if (!fwrite(\$fh, self::\$mediumCryptKey))";
- $function[] = $this->_t(2) . "{";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "{";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Close key file.";
- $function[] = $this->_t(3) . "fclose(\$fh);";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "fclose(\$fh);";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Lock key.";
- $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';";
- $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "self::\$mediumCryptKey = 'none';";
+ $function[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set the error message.";
- $function[] = $this->_t(3)
+ $function[] = Indent::_(3)
. "JFactory::getApplication()->enqueueMessage(JText::_('"
- . $this->langPrefix
+ . CFactory::_('Config')->lang_prefix
. "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');";
- $function[] = $this->_t(3) . "return false;";
- $function[] = $this->_t(2) . "}";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(3) . "return false;";
+ $function[] = Indent::_(2) . "}";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Close key file.";
- $function[] = $this->_t(2) . "fclose(\$fh);";
- $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $function[] = Indent::_(2) . "fclose(\$fh);";
+ $function[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Key is set.";
- $function[] = $this->_t(2) . "return true;";
- $function[] = $this->_t(1) . "}";
+ $function[] = Indent::_(2) . "return true;";
+ $function[] = Indent::_(1) . "}";
}
// return the help methods
@@ -1172,8 +1138,7 @@ class Interpretation extends Fields
$name = explode('.xml', $name)[0];
$target = array('admin' => $name);
$this->buildDynamique($target, 'update_server');
- $this->fileContentDynamic[$name][$this->hhh
- . 'UPDATE_SERVER_XML' . $this->hhh]
+ $this->fileContentDynamic[$name][Placefix::_h('UPDATE_SERVER_XML')]
= implode(PHP_EOL, $updateXML);
// set the Update server file name
@@ -1189,24 +1154,23 @@ class Interpretation extends Fields
{
// UPDATESERVER
$updateServer = array();
- $updateServer[] = PHP_EOL . $this->_t(1) . "";
- $updateServer[] = $this->_t(2)
+ $updateServer[] = PHP_EOL . Indent::_(1) . "";
+ $updateServer[] = Indent::_(2)
. '' . $this->componentData->update_server_url
+ . CFactory::_('Config')->component_code_name . '" name="'
+ . $this->fileContentStatic[Placefix::_h('Component_name')] . '">' . $this->componentData->update_server_url
. ' ';
- $updateServer[] = $this->_t(1) . ' ';
+ $updateServer[] = Indent::_(1) . ' ';
// return the array to string
$updateServer = implode(PHP_EOL, $updateServer);
// add update server details to component XML file
- $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('UPDATESERVER')]
= $updateServer;
}
else
{
// add update server details to component XML file
- $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('UPDATESERVER')]
= '';
}
// ensure to update Component version data
@@ -1221,14 +1185,14 @@ class Interpretation extends Fields
}
// update the joomla component table
$newJ = array();
- $newJ['id'] = (int) Config::get('component_id');
+ $newJ['id'] = (int) CFactory::_('Config')->component_id;
$newJ['component_version']
= $this->componentData->component_version;
// update the component with the new dynamic SQL
$modelJ = ComponentbuilderHelper::getModel('joomla_component');
$modelJ->save($newJ); // <-- to insure the history is also updated
// reset the watch here
- $this->getHistoryWatch('joomla_component', Config::get('component_id'));
+ $this->getHistoryWatch('joomla_component', CFactory::_('Config')->component_id);
// update the component update table
$newU = array();
@@ -1239,7 +1203,7 @@ class Interpretation extends Fields
}
else
{
- $newU['joomla_component'] = (int) Config::get('component_id');
+ $newU['joomla_component'] = (int) CFactory::_('Config')->component_id;
}
$newU['version_update'] = json_encode($buket);
// update the component with the new dynamic SQL
@@ -1297,7 +1261,7 @@ class Interpretation extends Fields
'.', '', $this->componentData->old_component_version
)
);
- $update_['url'] = $this->setPlaceholders(
+ $update_['url'] = CFactory::_('Placeholder')->update(
$this->lastupdateURL, $paceholders
);
}
@@ -1328,8 +1292,8 @@ class Interpretation extends Fields
// setup SQL
if (StringHelper::check($update['mysql']))
{
- $update['mysql'] = $this->setPlaceholders(
- $update['mysql'], $this->placeholders
+ $update['mysql'] = CFactory::_('Placeholder')->update(
+ $update['mysql'], CFactory::_('Placeholder')->active
);
}
// add dynamic SQL
@@ -1363,8 +1327,7 @@ class Interpretation extends Fields
$target = array('admin' => $name);
$this->buildDynamique($target, 'sql_update', $update['version']);
$this->fileContentDynamic[$name . '_'
- . $update['version']][$this->hhh . 'UPDATE_VERSION_MYSQL'
- . $this->hhh]
+ . $update['version']][Placefix::_h('UPDATE_VERSION_MYSQL')]
= $update['mysql'];
}
elseif (isset($update['url'])
@@ -1379,7 +1342,7 @@ class Interpretation extends Fields
&& $this->componentData->update_server_target != 3)
{
// we set the defaults
- $u_element = 'com_' . Config::get('component_code_name');
+ $u_element = 'com_' . CFactory::_('Config')->component_code_name;
$u_server_type = 'component';
$u_state = 'stable';
$u_target_version = '3.*';
@@ -1399,27 +1362,23 @@ class Interpretation extends Fields
? $update['update_client'] : $u_client;
}
// build update xml
- $updateXML[] = $this->_t(1) . "";
- $updateXML[] = $this->_t(2) . ""
- . $this->fileContentStatic[$this->hhh . 'Component_name'
- . $this->hhh] . " ";
- $updateXML[] = $this->_t(2) . ""
- . $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION'
- . $this->hhh] . " ";
- $updateXML[] = $this->_t(2) . "$u_element ";
- $updateXML[] = $this->_t(2) . "$u_server_type ";
+ $updateXML[] = Indent::_(1) . "";
+ $updateXML[] = Indent::_(2) . ""
+ . $this->fileContentStatic[Placefix::_h('Component_name')] . " ";
+ $updateXML[] = Indent::_(2) . ""
+ . $this->fileContentStatic[Placefix::_h('SHORT_DESCRIPTION')] . " ";
+ $updateXML[] = Indent::_(2) . "$u_element ";
+ $updateXML[] = Indent::_(2) . "$u_server_type ";
// check if we should add the target client value
if ($u_client)
{
- $updateXML[] = $this->_t(2) . "$u_client ";
+ $updateXML[] = Indent::_(2) . "$u_client ";
}
- $updateXML[] = $this->_t(2) . "" . $update['version']
+ $updateXML[] = Indent::_(2) . "" . $update['version']
. " ";
- $updateXML[] = $this->_t(2) . '' . $this->fileContentStatic[$this->hhh
- . 'AUTHORWEBSITE' . $this->hhh] . ' ';
- $updateXML[] = $this->_t(2) . "";
+ $updateXML[] = Indent::_(2) . '' . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . ' ';
+ $updateXML[] = Indent::_(2) . "";
if (!isset($update['url'])
|| !StringHelper::check(
$update['url']
@@ -1427,22 +1386,21 @@ class Interpretation extends Fields
{
$update['url'] = 'http://domain.com/demo.zip';
}
- $updateXML[] = $this->_t(3)
+ $updateXML[] = Indent::_(3)
. '' . $update['url']
. ' ';
- $updateXML[] = $this->_t(2) . " ";
- $updateXML[] = $this->_t(2) . "";
- $updateXML[] = $this->_t(3) . "$u_state ";
- $updateXML[] = $this->_t(2) . " ";
- $updateXML[] = $this->_t(2) . ""
- . $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh]
+ $updateXML[] = Indent::_(2) . " ";
+ $updateXML[] = Indent::_(2) . "";
+ $updateXML[] = Indent::_(3) . "$u_state ";
+ $updateXML[] = Indent::_(2) . " ";
+ $updateXML[] = Indent::_(2) . ""
+ . $this->fileContentStatic[Placefix::_h('AUTHOR')]
. " ";
- $updateXML[] = $this->_t(2) . ""
- . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE'
- . $this->hhh] . " ";
- $updateXML[] = $this->_t(2)
+ $updateXML[] = Indent::_(2) . ""
+ . $this->fileContentStatic[Placefix::_h('AUTHORWEBSITE')] . " ";
+ $updateXML[] = Indent::_(2)
. ' ';
- $updateXML[] = $this->_t(1) . " ";
+ $updateXML[] = Indent::_(1) . " ";
}
}
@@ -1454,13 +1412,13 @@ class Interpretation extends Fields
public function noHelp()
{
$help = array();
- $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $help[] = $this->_t(1) . " * Can be used to build help urls.";
- $help[] = $this->_t(1) . " **/";
- $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)";
- $help[] = $this->_t(1) . "{";
- $help[] = $this->_t(2) . "return false;";
- $help[] = $this->_t(1) . "}";
+ $help[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $help[] = Indent::_(1) . " * Can be used to build help urls.";
+ $help[] = Indent::_(1) . " **/";
+ $help[] = Indent::_(1) . "public static function getHelpUrl(\$view)";
+ $help[] = Indent::_(1) . "{";
+ $help[] = Indent::_(2) . "return false;";
+ $help[] = Indent::_(1) . "}";
// return the no help method
return implode(PHP_EOL, $help);
@@ -1479,14 +1437,13 @@ class Interpretation extends Fields
if ($admindone && $sitedone)
{
// HELP
- $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELP')]
= $this->setHelp(1);
// HELP_SITE
- $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('HELP_SITE')]
= $this->setHelp(2);
// to make sure the file is updated TODO
- $this->fileContentDynamic['help'][$this->hhh . 'BLABLA'
- . $this->hhh]
+ $this->fileContentDynamic['help'][Placefix::_h('BLABLA')]
= 'blabla';
return true;
@@ -1505,91 +1462,91 @@ class Interpretation extends Fields
$target = 'site_view';
}
$help = array();
- $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $help[] = $this->_t(1) . " * Load the Component Help URLs.";
- $help[] = $this->_t(1) . " **/";
- $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)";
- $help[] = $this->_t(1) . "{";
- $help[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $help[] = $this->_t(2) . "\$groups = \$user->get('groups');";
- $help[] = $this->_t(2) . "\$db = JFactory::getDbo();";
- $help[] = $this->_t(2) . "\$query = \$db->getQuery(true);";
- $help[] = $this->_t(2)
+ $help[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $help[] = Indent::_(1) . " * Load the Component Help URLs.";
+ $help[] = Indent::_(1) . " **/";
+ $help[] = Indent::_(1) . "public static function getHelpUrl(\$view)";
+ $help[] = Indent::_(1) . "{";
+ $help[] = Indent::_(2) . "\$user = JFactory::getUser();";
+ $help[] = Indent::_(2) . "\$groups = \$user->get('groups');";
+ $help[] = Indent::_(2) . "\$db = JFactory::getDbo();";
+ $help[] = Indent::_(2) . "\$query = \$db->getQuery(true);";
+ $help[] = Indent::_(2)
. "\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));";
- $help[] = $this->_t(2) . "\$query->from('#__" . Config::get('component_code_name')
+ $help[] = Indent::_(2) . "\$query->from('#__" . CFactory::_('Config')->component_code_name
. "_help_document AS a');";
- $help[] = $this->_t(2) . "\$query->where('a." . $target
+ $help[] = Indent::_(2) . "\$query->where('a." . $target
. " = '.\$db->quote(\$view));";
- $help[] = $this->_t(2) . "\$query->where('a.location = "
+ $help[] = Indent::_(2) . "\$query->where('a.location = "
. (int) $location . "');";
- $help[] = $this->_t(2) . "\$query->where('a.published = 1');";
- $help[] = $this->_t(2) . "\$db->setQuery(\$query);";
- $help[] = $this->_t(2) . "\$db->execute();";
- $help[] = $this->_t(2) . "if(\$db->getNumRows())";
- $help[] = $this->_t(2) . "{";
- $help[] = $this->_t(3) . "\$helps = \$db->loadObjectList();";
- $help[] = $this->_t(3) . "if (self::checkArray(\$helps))";
- $help[] = $this->_t(3) . "{";
- $help[] = $this->_t(4) . "foreach (\$helps as \$nr => \$help)";
- $help[] = $this->_t(4) . "{";
- $help[] = $this->_t(5) . "if (\$help->target == 1)";
- $help[] = $this->_t(5) . "{";
- $help[] = $this->_t(6)
+ $help[] = Indent::_(2) . "\$query->where('a.published = 1');";
+ $help[] = Indent::_(2) . "\$db->setQuery(\$query);";
+ $help[] = Indent::_(2) . "\$db->execute();";
+ $help[] = Indent::_(2) . "if(\$db->getNumRows())";
+ $help[] = Indent::_(2) . "{";
+ $help[] = Indent::_(3) . "\$helps = \$db->loadObjectList();";
+ $help[] = Indent::_(3) . "if (self::checkArray(\$helps))";
+ $help[] = Indent::_(3) . "{";
+ $help[] = Indent::_(4) . "foreach (\$helps as \$nr => \$help)";
+ $help[] = Indent::_(4) . "{";
+ $help[] = Indent::_(5) . "if (\$help->target == 1)";
+ $help[] = Indent::_(5) . "{";
+ $help[] = Indent::_(6)
. "\$targetgroups = json_decode(\$help->groups, true);";
- $help[] = $this->_t(6)
+ $help[] = Indent::_(6)
. "if (!array_intersect(\$targetgroups, \$groups))";
- $help[] = $this->_t(6) . "{";
- $help[] = $this->_t(7) . "//" . $this->setLine(__LINE__)
+ $help[] = Indent::_(6) . "{";
+ $help[] = Indent::_(7) . "//" . Line::_(__Line__, __Class__)
. " if user not in those target groups then remove the item";
- $help[] = $this->_t(7) . "unset(\$helps[\$nr]);";
- $help[] = $this->_t(7) . "continue;";
- $help[] = $this->_t(6) . "}";
- $help[] = $this->_t(5) . "}";
- $help[] = $this->_t(5) . "//" . $this->setLine(__LINE__)
+ $help[] = Indent::_(7) . "unset(\$helps[\$nr]);";
+ $help[] = Indent::_(7) . "continue;";
+ $help[] = Indent::_(6) . "}";
+ $help[] = Indent::_(5) . "}";
+ $help[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
. " set the return type";
- $help[] = $this->_t(5) . "switch (\$help->type)";
- $help[] = $this->_t(5) . "{";
- $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__)
+ $help[] = Indent::_(5) . "switch (\$help->type)";
+ $help[] = Indent::_(5) . "{";
+ $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
. " set joomla article";
- $help[] = $this->_t(6) . "case 1:";
- $help[] = $this->_t(7)
+ $help[] = Indent::_(6) . "case 1:";
+ $help[] = Indent::_(7)
. "return self::loadArticleLink(\$help->article);";
- $help[] = $this->_t(7) . "break;";
- $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__)
+ $help[] = Indent::_(7) . "break;";
+ $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
. " set help text";
- $help[] = $this->_t(6) . "case 2:";
- $help[] = $this->_t(7) . "return self::loadHelpTextLink(\$help->id);";
- $help[] = $this->_t(7) . "break;";
- $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " set Link";
- $help[] = $this->_t(6) . "case 3:";
- $help[] = $this->_t(7) . "return \$help->url;";
- $help[] = $this->_t(7) . "break;";
- $help[] = $this->_t(5) . "}";
- $help[] = $this->_t(4) . "}";
- $help[] = $this->_t(3) . "}";
- $help[] = $this->_t(2) . "}";
- $help[] = $this->_t(2) . "return false;";
- $help[] = $this->_t(1) . "}";
- $help[] = PHP_EOL . $this->_t(1) . "/**";
- $help[] = $this->_t(1) . " * Get the Article Link.";
- $help[] = $this->_t(1) . " **/";
- $help[] = $this->_t(1)
+ $help[] = Indent::_(6) . "case 2:";
+ $help[] = Indent::_(7) . "return self::loadHelpTextLink(\$help->id);";
+ $help[] = Indent::_(7) . "break;";
+ $help[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__) . " set Link";
+ $help[] = Indent::_(6) . "case 3:";
+ $help[] = Indent::_(7) . "return \$help->url;";
+ $help[] = Indent::_(7) . "break;";
+ $help[] = Indent::_(5) . "}";
+ $help[] = Indent::_(4) . "}";
+ $help[] = Indent::_(3) . "}";
+ $help[] = Indent::_(2) . "}";
+ $help[] = Indent::_(2) . "return false;";
+ $help[] = Indent::_(1) . "}";
+ $help[] = PHP_EOL . Indent::_(1) . "/**";
+ $help[] = Indent::_(1) . " * Get the Article Link.";
+ $help[] = Indent::_(1) . " **/";
+ $help[] = Indent::_(1)
. "protected static function loadArticleLink(\$id)";
- $help[] = $this->_t(1) . "{";
- $help[] = $this->_t(2)
+ $help[] = Indent::_(1) . "{";
+ $help[] = Indent::_(2)
. "return JURI::root().'index.php?option=com_content&view=article&id='.\$id.'&tmpl=component&layout=modal';";
- $help[] = $this->_t(1) . "}";
- $help[] = PHP_EOL . $this->_t(1) . "/**";
- $help[] = $this->_t(1) . " * Get the Help Text Link.";
- $help[] = $this->_t(1) . " **/";
- $help[] = $this->_t(1)
+ $help[] = Indent::_(1) . "}";
+ $help[] = PHP_EOL . Indent::_(1) . "/**";
+ $help[] = Indent::_(1) . " * Get the Help Text Link.";
+ $help[] = Indent::_(1) . " **/";
+ $help[] = Indent::_(1)
. "protected static function loadHelpTextLink(\$id)";
- $help[] = $this->_t(1) . "{";
- $help[] = $this->_t(2) . "\$token = JSession::getFormToken();";
- $help[] = $this->_t(2) . "return 'index.php?option=com_"
- . Config::get('component_code_name')
+ $help[] = Indent::_(1) . "{";
+ $help[] = Indent::_(2) . "\$token = JSession::getFormToken();";
+ $help[] = Indent::_(2) . "return 'index.php?option=com_"
+ . CFactory::_('Config')->component_code_name
. "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;";
- $help[] = $this->_t(1) . "}";
+ $help[] = Indent::_(1) . "}";
// return the help methods
return implode(PHP_EOL, $help);
@@ -1600,286 +1557,285 @@ class Interpretation extends Fields
if ($this->addEximport)
{
// we use the company name set in the GUI
- $company_name = $this->fileContentStatic[$this->hhh . 'COMPANYNAME'
- . $this->hhh];
+ $company_name = $this->fileContentStatic[Placefix::_h('COMPANYNAME')];
// start building the xml function
$exel = array();
- $exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $exel[] = $this->_t(1) . "* Prepares the xml document";
- $exel[] = $this->_t(1) . "*/";
- $exel[] = $this->_t(1)
+ $exel[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $exel[] = Indent::_(1) . "* Prepares the xml document";
+ $exel[] = Indent::_(1) . "*/";
+ $exel[] = Indent::_(1)
. "public static function xls(\$rows, \$fileName = null, \$title = null, \$subjectTab = null, \$creator = '$company_name', \$description = null, \$category = null,\$keywords = null, \$modified = null)";
- $exel[] = $this->_t(1) . "{";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(1) . "{";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set the user";
- $exel[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$user = JFactory::getUser();";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set fileName if not set";
- $exel[] = $this->_t(2) . "if (!\$fileName)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(2) . "if (!\$fileName)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3)
. "\$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set modified if not set";
- $exel[] = $this->_t(2) . "if (!\$modified)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "\$modified = \$user->name;";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "if (!\$modified)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "\$modified = \$user->name;";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set title if not set";
- $exel[] = $this->_t(2) . "if (!\$title)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "\$title = 'Book1';";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "if (!\$title)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "\$title = 'Book1';";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set tab name if not set";
- $exel[] = $this->_t(2) . "if (!\$subjectTab)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "\$subjectTab = 'Sheet1';";
- $exel[] = $this->_t(2) . "}";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "if (!\$subjectTab)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "\$subjectTab = 'Sheet1';";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " make sure we have the composer classes loaded";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "self::composerAutoload('phpspreadsheet');";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Create new Spreadsheet object";
- $exel[] = $this->_t(2) . "\$spreadsheet = new Spreadsheet();";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$spreadsheet = new Spreadsheet();";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Set document properties";
- $exel[] = $this->_t(2) . "\$spreadsheet->getProperties()";
- $exel[] = $this->_t(3) . "->setCreator(\$creator)";
- $exel[] = $this->_t(3) . "->setCompany('$company_name')";
- $exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)";
- $exel[] = $this->_t(3) . "->setTitle(\$title)";
- $exel[] = $this->_t(3) . "->setSubject(\$subjectTab);";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$spreadsheet->getProperties()";
+ $exel[] = Indent::_(3) . "->setCreator(\$creator)";
+ $exel[] = Indent::_(3) . "->setCompany('$company_name')";
+ $exel[] = Indent::_(3) . "->setLastModifiedBy(\$modified)";
+ $exel[] = Indent::_(3) . "->setTitle(\$title)";
+ $exel[] = Indent::_(3) . "->setSubject(\$subjectTab);";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " The file type";
- $exel[] = $this->_t(2) . "\$file_type = 'Xls';";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$file_type = 'Xls';";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set description";
- $exel[] = $this->_t(2) . "if (\$description)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(2) . "if (\$description)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3)
. "\$spreadsheet->getProperties()->setDescription(\$description);";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set keywords";
- $exel[] = $this->_t(2) . "if (\$keywords)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(2) . "if (\$keywords)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3)
. "\$spreadsheet->getProperties()->setKeywords(\$keywords);";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set category";
- $exel[] = $this->_t(2) . "if (\$category)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(2) . "if (\$category)";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3)
. "\$spreadsheet->getProperties()->setCategory(\$category);";
- $exel[] = $this->_t(2) . "}";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Some styles";
- $exel[] = $this->_t(2) . "\$headerStyles = array(";
- $exel[] = $this->_t(3) . "'font' => array(";
- $exel[] = $this->_t(4) . "'bold' => true,";
- $exel[] = $this->_t(4) . "'color' => array('rgb' => '1171A3'),";
- $exel[] = $this->_t(4) . "'size' => 12,";
- $exel[] = $this->_t(4) . "'name' => 'Verdana'";
- $exel[] = $this->_t(2) . "));";
- $exel[] = $this->_t(2) . "\$sideStyles = array(";
- $exel[] = $this->_t(3) . "'font' => array(";
- $exel[] = $this->_t(4) . "'bold' => true,";
- $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),";
- $exel[] = $this->_t(4) . "'size' => 11,";
- $exel[] = $this->_t(4) . "'name' => 'Verdana'";
- $exel[] = $this->_t(2) . "));";
- $exel[] = $this->_t(2) . "\$normalStyles = array(";
- $exel[] = $this->_t(3) . "'font' => array(";
- $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),";
- $exel[] = $this->_t(4) . "'size' => 11,";
- $exel[] = $this->_t(4) . "'name' => 'Verdana'";
- $exel[] = $this->_t(2) . "));";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$headerStyles = array(";
+ $exel[] = Indent::_(3) . "'font' => array(";
+ $exel[] = Indent::_(4) . "'bold' => true,";
+ $exel[] = Indent::_(4) . "'color' => array('rgb' => '1171A3'),";
+ $exel[] = Indent::_(4) . "'size' => 12,";
+ $exel[] = Indent::_(4) . "'name' => 'Verdana'";
+ $exel[] = Indent::_(2) . "));";
+ $exel[] = Indent::_(2) . "\$sideStyles = array(";
+ $exel[] = Indent::_(3) . "'font' => array(";
+ $exel[] = Indent::_(4) . "'bold' => true,";
+ $exel[] = Indent::_(4) . "'color' => array('rgb' => '444444'),";
+ $exel[] = Indent::_(4) . "'size' => 11,";
+ $exel[] = Indent::_(4) . "'name' => 'Verdana'";
+ $exel[] = Indent::_(2) . "));";
+ $exel[] = Indent::_(2) . "\$normalStyles = array(";
+ $exel[] = Indent::_(3) . "'font' => array(";
+ $exel[] = Indent::_(4) . "'color' => array('rgb' => '444444'),";
+ $exel[] = Indent::_(4) . "'size' => 11,";
+ $exel[] = Indent::_(4) . "'name' => 'Verdana'";
+ $exel[] = Indent::_(2) . "));";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Add some data";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "if ((\$size = self::checkArray(\$rows)) !== false)";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "\$i = 1;";
- $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "\$i = 1;";
+ $exel[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Based on data size we adapt the behaviour.";
- $exel[] = $this->_t(3) . "\$xls_mode = 1;";
- $exel[] = $this->_t(3) . "if (\$size > 3000)";
- $exel[] = $this->_t(3) . "{";
- $exel[] = $this->_t(4) . "\$xls_mode = 3;";
- $exel[] = $this->_t(4) . "\$file_type = 'Csv';";
- $exel[] = $this->_t(3) . "}";
- $exel[] = $this->_t(3) . "elseif (\$size > 2000)";
- $exel[] = $this->_t(3) . "{";
- $exel[] = $this->_t(4) . "\$xls_mode = 2;";
- $exel[] = $this->_t(3) . "}";
- $exel[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(3) . "\$xls_mode = 1;";
+ $exel[] = Indent::_(3) . "if (\$size > 3000)";
+ $exel[] = Indent::_(3) . "{";
+ $exel[] = Indent::_(4) . "\$xls_mode = 3;";
+ $exel[] = Indent::_(4) . "\$file_type = 'Csv';";
+ $exel[] = Indent::_(3) . "}";
+ $exel[] = Indent::_(3) . "elseif (\$size > 2000)";
+ $exel[] = Indent::_(3) . "{";
+ $exel[] = Indent::_(4) . "\$xls_mode = 2;";
+ $exel[] = Indent::_(3) . "}";
+ $exel[] = PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set active sheet and get it.";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$active_sheet = \$spreadsheet->setActiveSheetIndex(0);";
- $exel[] = $this->_t(3) . "foreach (\$rows as \$array)";
- $exel[] = $this->_t(3) . "{";
- $exel[] = $this->_t(4) . "\$a = 'A';";
- $exel[] = $this->_t(4) . "foreach (\$array as \$value)";
- $exel[] = $this->_t(4) . "{";
- $exel[] = $this->_t(5)
+ $exel[] = Indent::_(3) . "foreach (\$rows as \$array)";
+ $exel[] = Indent::_(3) . "{";
+ $exel[] = Indent::_(4) . "\$a = 'A';";
+ $exel[] = Indent::_(4) . "foreach (\$array as \$value)";
+ $exel[] = Indent::_(4) . "{";
+ $exel[] = Indent::_(5)
. "\$active_sheet->setCellValue(\$a.\$i, \$value);";
- $exel[] = $this->_t(5) . "if (\$xls_mode != 3)";
- $exel[] = $this->_t(5) . "{";
- $exel[] = $this->_t(6) . "if (\$i == 1)";
- $exel[] = $this->_t(6) . "{";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(5) . "if (\$xls_mode != 3)";
+ $exel[] = Indent::_(5) . "{";
+ $exel[] = Indent::_(6) . "if (\$i == 1)";
+ $exel[] = Indent::_(6) . "{";
+ $exel[] = Indent::_(7)
. "\$active_sheet->getColumnDimension(\$a)->setAutoSize(true);";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(7)
. "\$active_sheet->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);";
- $exel[] = $this->_t(6) . "}";
- $exel[] = $this->_t(6) . "elseif (\$a === 'A')";
- $exel[] = $this->_t(6) . "{";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(6) . "}";
+ $exel[] = Indent::_(6) . "elseif (\$a === 'A')";
+ $exel[] = Indent::_(6) . "{";
+ $exel[] = Indent::_(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);";
- $exel[] = $this->_t(6) . "}";
- $exel[] = $this->_t(6) . "elseif (\$xls_mode == 1)";
- $exel[] = $this->_t(6) . "{";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(6) . "}";
+ $exel[] = Indent::_(6) . "elseif (\$xls_mode == 1)";
+ $exel[] = Indent::_(6) . "{";
+ $exel[] = Indent::_(7)
. "\$active_sheet->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);";
- $exel[] = $this->_t(6) . "}";
- $exel[] = $this->_t(5) . "}";
- $exel[] = $this->_t(5) . "\$a++;";
- $exel[] = $this->_t(4) . "}";
- $exel[] = $this->_t(4) . "\$i++;";
- $exel[] = $this->_t(3) . "}";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "else";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "return false;";
- $exel[] = $this->_t(2) . "}";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(6) . "}";
+ $exel[] = Indent::_(5) . "}";
+ $exel[] = Indent::_(5) . "\$a++;";
+ $exel[] = Indent::_(4) . "}";
+ $exel[] = Indent::_(4) . "\$i++;";
+ $exel[] = Indent::_(3) . "}";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "else";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "return false;";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Rename worksheet";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "\$spreadsheet->getActiveSheet()->setTitle(\$subjectTab);";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Set active sheet index to the first sheet, so Excel opens this as the first sheet";
- $exel[] = $this->_t(2) . "\$spreadsheet->setActiveSheetIndex(0);";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "\$spreadsheet->setActiveSheetIndex(0);";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Redirect output to a client's web browser (Excel5)";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "header('Content-Type: application/vnd.ms-excel');";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "header('Content-Disposition: attachment;filename=\"' . \$fileName . '.' . strtolower(\$file_type) .'\"');";
- $exel[] = $this->_t(2) . "header('Cache-Control: max-age=0');";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "header('Cache-Control: max-age=0');";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " If you're serving to IE 9, then the following may be needed";
- $exel[] = $this->_t(2) . "header('Cache-Control: max-age=1');";
- $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "header('Cache-Control: max-age=1');";
+ $exel[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " If you're serving to IE over SSL, then the following may be needed";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); //"
- . $this->setLine(__LINE__) . " Date in the past";
- $exel[] = $this->_t(2)
+ . Line::_(__Line__, __Class__) . " Date in the past";
+ $exel[] = Indent::_(2)
. "header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); //"
- . $this->setLine(__LINE__) . " always modified";
- $exel[] = $this->_t(2)
+ . Line::_(__Line__, __Class__) . " always modified";
+ $exel[] = Indent::_(2)
. "header ('Cache-Control: cache, must-revalidate'); //"
- . $this->setLine(__LINE__) . " HTTP/1.1";
- $exel[] = $this->_t(2) . "header ('Pragma: public'); //"
- . $this->setLine(__LINE__) . " HTTP/1.0";
- $exel[] = PHP_EOL . $this->_t(2)
+ . Line::_(__Line__, __Class__) . " HTTP/1.1";
+ $exel[] = Indent::_(2) . "header ('Pragma: public'); //"
+ . Line::_(__Line__, __Class__) . " HTTP/1.0";
+ $exel[] = PHP_EOL . Indent::_(2)
. "\$writer = IOFactory::createWriter(\$spreadsheet, \$file_type);";
- $exel[] = $this->_t(2) . "\$writer->save('php://output');";
- $exel[] = $this->_t(2) . "jexit();";
- $exel[] = $this->_t(1) . "}";
- $exel[] = PHP_EOL . $this->_t(1) . "/**";
- $exel[] = $this->_t(1) . "* Get CSV Headers";
- $exel[] = $this->_t(1) . "*/";
- $exel[] = $this->_t(1)
+ $exel[] = Indent::_(2) . "\$writer->save('php://output');";
+ $exel[] = Indent::_(2) . "jexit();";
+ $exel[] = Indent::_(1) . "}";
+ $exel[] = PHP_EOL . Indent::_(1) . "/**";
+ $exel[] = Indent::_(1) . "* Get CSV Headers";
+ $exel[] = Indent::_(1) . "*/";
+ $exel[] = Indent::_(1)
. "public static function getFileHeaders(\$dataType)";
- $exel[] = $this->_t(1) . "{";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(1) . "{";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " make sure we have the composer classes loaded";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "self::composerAutoload('phpspreadsheet');";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " get session object";
- $exel[] = $this->_t(2) . "\$session = JFactory::getSession();";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2) . "\$session = JFactory::getSession();";
+ $exel[] = Indent::_(2)
. "\$package = \$session->get('package', null);";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "\$package = json_decode(\$package, true);";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set the headers";
- $exel[] = $this->_t(2) . "if(isset(\$package['dir']))";
- $exel[] = $this->_t(2) . "{";
- $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "if(isset(\$package['dir']))";
+ $exel[] = Indent::_(2) . "{";
+ $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only load first three rows";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$chunkFilter = new PhpOffice\PhpSpreadsheet\Reader\chunkReadFilter(2,1);";
- $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " identify the file type";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$inputFileType = IOFactory::identify(\$package['dir']);";
- $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " create the reader for this file type";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$excelReader = IOFactory::createReader(\$inputFileType);";
- $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " load the limiting filter";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$excelReader->setReadFilter(\$chunkFilter);";
- $exel[] = $this->_t(3) . "\$excelReader->setReadDataOnly(true);";
- $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(3) . "\$excelReader->setReadDataOnly(true);";
+ $exel[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " load the rows (only first three)";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3)
. "\$excelObj = \$excelReader->load(\$package['dir']);";
- $exel[] = $this->_t(3) . "\$headers = array();";
- $exel[] = $this->_t(3)
+ $exel[] = Indent::_(3) . "\$headers = array();";
+ $exel[] = Indent::_(3)
. "foreach (\$excelObj->getActiveSheet()->getRowIterator() as \$row)";
- $exel[] = $this->_t(3) . "{";
- $exel[] = $this->_t(4) . "if(\$row->getRowIndex() == 1)";
- $exel[] = $this->_t(4) . "{";
- $exel[] = $this->_t(5)
+ $exel[] = Indent::_(3) . "{";
+ $exel[] = Indent::_(4) . "if(\$row->getRowIndex() == 1)";
+ $exel[] = Indent::_(4) . "{";
+ $exel[] = Indent::_(5)
. "\$cellIterator = \$row->getCellIterator();";
- $exel[] = $this->_t(5)
+ $exel[] = Indent::_(5)
. "\$cellIterator->setIterateOnlyExistingCells(false);";
- $exel[] = $this->_t(5) . "foreach (\$cellIterator as \$cell)";
- $exel[] = $this->_t(5) . "{";
- $exel[] = $this->_t(6) . "if (!is_null(\$cell))";
- $exel[] = $this->_t(6) . "{";
- $exel[] = $this->_t(7)
+ $exel[] = Indent::_(5) . "foreach (\$cellIterator as \$cell)";
+ $exel[] = Indent::_(5) . "{";
+ $exel[] = Indent::_(6) . "if (!is_null(\$cell))";
+ $exel[] = Indent::_(6) . "{";
+ $exel[] = Indent::_(7)
. "\$headers[\$cell->getColumn()] = \$cell->getValue();";
- $exel[] = $this->_t(6) . "}";
- $exel[] = $this->_t(5) . "}";
- $exel[] = $this->_t(5) . "\$excelObj->disconnectWorksheets();";
- $exel[] = $this->_t(5) . "unset(\$excelObj);";
- $exel[] = $this->_t(5) . "break;";
- $exel[] = $this->_t(4) . "}";
- $exel[] = $this->_t(3) . "}";
- $exel[] = $this->_t(3) . "return \$headers;";
- $exel[] = $this->_t(2) . "}";
- $exel[] = $this->_t(2) . "return false;";
- $exel[] = $this->_t(1) . "}";
- $exel[] = PHP_EOL . $this->_t(1) . "/**";
- $exel[] = $this->_t(1)
+ $exel[] = Indent::_(6) . "}";
+ $exel[] = Indent::_(5) . "}";
+ $exel[] = Indent::_(5) . "\$excelObj->disconnectWorksheets();";
+ $exel[] = Indent::_(5) . "unset(\$excelObj);";
+ $exel[] = Indent::_(5) . "break;";
+ $exel[] = Indent::_(4) . "}";
+ $exel[] = Indent::_(3) . "}";
+ $exel[] = Indent::_(3) . "return \$headers;";
+ $exel[] = Indent::_(2) . "}";
+ $exel[] = Indent::_(2) . "return false;";
+ $exel[] = Indent::_(1) . "}";
+ $exel[] = PHP_EOL . Indent::_(1) . "/**";
+ $exel[] = Indent::_(1)
. "* Load the Composer Vendor phpspreadsheet";
- $exel[] = $this->_t(1) . "*/";
- $exel[] = $this->_t(1)
+ $exel[] = Indent::_(1) . "*/";
+ $exel[] = Indent::_(1)
. "protected static function composephpspreadsheet()";
- $exel[] = $this->_t(1) . "{";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(1) . "{";
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " load the autoloader for phpspreadsheet";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "require_once JPATH_SITE . '/libraries/phpspreadsheet/vendor/autoload.php';";
- $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $exel[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " do not load again";
- $exel[] = $this->_t(2)
+ $exel[] = Indent::_(2)
. "self::\$composer['phpspreadsheet'] = true;";
- $exel[] = PHP_EOL . $this->_t(2) . "return true;";
- $exel[] = $this->_t(1) . "}";
+ $exel[] = PHP_EOL . Indent::_(2) . "return true;";
+ $exel[] = Indent::_(1) . "}";
// return the help methods
return implode(PHP_EOL, $exel);
@@ -1893,320 +1849,320 @@ class Interpretation extends Fields
if ($add)
{
$method = array();
- $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $method[] = $this->_t(1) . " * Greate user and update given table";
- $method[] = $this->_t(1) . " *";
- $method[] = $this->_t(1)
+ $method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $method[] = Indent::_(1) . " * Greate user and update given table";
+ $method[] = Indent::_(1) . " *";
+ $method[] = Indent::_(1)
. " * @param array \$credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string)";
- $method[] = $this->_t(1) . " * @param int \$autologin";
- $method[] = $this->_t(1)
+ $method[] = Indent::_(1) . " * @param int \$autologin";
+ $method[] = Indent::_(1)
. " * @param array \$params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int)";
- $method[] = $this->_t(1)
+ $method[] = Indent::_(1)
. " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
- $method[] = $this->_t(1) . " *";
- $method[] = $this->_t(1)
+ $method[] = Indent::_(1) . " *";
+ $method[] = Indent::_(1)
. " * @return int|Error User ID on success, or an error.";
- $method[] = $this->_t(1) . " */";
- $method[] = $this->_t(1)
+ $method[] = Indent::_(1) . " */";
+ $method[] = Indent::_(1)
. "public static function createUser(\$credentials, \$autologin = 0,";
- $method[] = $this->_t(2) . "\$params = array(";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "\$params = array(";
+ $method[] = Indent::_(3)
. "'useractivation' => 0, 'sendpassword' => 1";
- $method[] = $this->_t(2) . "), \$mode = 1";
- $method[] = $this->_t(1) . ")";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "), \$mode = 1";
+ $method[] = Indent::_(1) . ")";
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Override mode";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "if (\$mode == 2 && method_exists(__CLASS__, 'registerUser'))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Update params";
- $method[] = $this->_t(3) . "\$params['autologin'] = \$autologin;";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "\$params['autologin'] = \$autologin;";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Now Register User";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "return self::registerUser(\$credentials, \$params);";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "elseif (\$mode == 2)";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "elseif (\$mode == 2)";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Fallback to Site Registrations";
- $method[] = $this->_t(3) . "\$mode = 1;";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "\$mode = 1;";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " load the user component language files if there is an error.";
- $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();";
- $method[] = $this->_t(2) . "\$extension = 'com_users';";
- $method[] = $this->_t(2) . "\$base_dir = JPATH_SITE;";
- $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB')
+ $method[] = Indent::_(2) . "\$lang = JFactory::getLanguage();";
+ $method[] = Indent::_(2) . "\$extension = 'com_users';";
+ $method[] = Indent::_(2) . "\$base_dir = JPATH_SITE;";
+ $method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB')
. "';";
- $method[] = $this->_t(2) . "\$reload = true;";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2) . "\$reload = true;";
+ $method[] = Indent::_(2)
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Load the correct user model.";
- $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine(
- __LINE__
+ $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
+ __LINE__,__CLASS__
)
. " 1 = Site Registrations";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Load the user site-registration model";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$model = self::getModel('registration', \$base_dir . '/components/' . \$extension, 'Users');";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
. " 0 = Admin Registration";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Load the backend-user model";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . \$extension, 'Users');";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check if we have params/config";
- $method[] = $this->_t(2) . "if (self::checkArray(\$params))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "if (self::checkArray(\$params))";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Make changes to user config";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "foreach (\$params as \$param => \$set)";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " If you know of a better path, let me know";
- $method[] = $this->_t(4)
+ $method[] = Indent::_(4)
. "\$params[\$param] = self::setParams(\$extension, \$param, \$set);";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Set username to email if not set";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "if (!isset(\$credentials['username']) || !self::checkString(\$credentials['username']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3)
. "\$credentials['username'] = \$credentials['email'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Lineup new user data array";
- $method[] = $this->_t(2) . "\$data = array(";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "\$data = array(";
+ $method[] = Indent::_(3)
. "'username' => \$credentials['username'],";
- $method[] = $this->_t(3) . "'name' => \$credentials['name'],";
- $method[] = $this->_t(3) . "'block' => 0 );";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "'name' => \$credentials['name'],";
+ $method[] = Indent::_(3) . "'block' => 0 );";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Added details based on mode";
- $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine(
- __LINE__
+ $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
+ __LINE__,__CLASS__
)
. " 1 = Site-registration mode";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3)
. "\$data['email1'] = \$credentials['email'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
. " 0 = Admin-registration mode";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3)
. "\$data['email'] = \$credentials['email'];";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$data['registerDate'] = JFactory::getDate()->toSql();";
- $method[] = $this->_t(2) . "}";
+ $method[] = Indent::_(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check if password was set";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "if (\$mode == 1 && (!isset(\$credentials['password']) || !isset(\$credentials['password2']) || !self::checkString(\$credentials['password']) || !self::checkString(\$credentials['password2'])))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set random password when empty password was submitted,";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " when using the 1 = site-registration mode";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$credentials['password'] = self::randomkey(8);";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$credentials['password2'] = \$credentials['password'];";
- $method[] = $this->_t(2) . "}";
+ $method[] = Indent::_(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Now Add password if set";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "if (isset(\$credentials['password']) && isset(\$credentials['password2']) && self::checkString(\$credentials['password']) && self::checkString(\$credentials['password2']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "if (\$mode == 1) //" . $this->setLine(
- __LINE__
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "if (\$mode == 1) //" . Line::_(
+ __LINE__,__CLASS__
)
. " 1 = Site-registration mode";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4)
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4)
. "\$data['password1'] = \$credentials['password'];";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(3) . "else //" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(3) . "else //" . Line::_(__Line__, __Class__)
. " 0 = Admin-registration mode";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4)
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4)
. "\$data['password'] = \$credentials['password'];";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(3)
. "\$data['password2'] = \$credentials['password2'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Load the group/s value if set, only for Admin Registration (\$mode == 0)";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "if (\$mode == 0 && isset(\$credentials['groups']) && self::checkArray(\$credentials['groups']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3)
. "\$data['groups'] = \$credentials['groups'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Create the new user";
- $method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine(
- __LINE__
+ $method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
+ __LINE__,__CLASS__
)
. " 1 = Site-registration mode";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "\$userId = \$model->register(\$data);";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "\$userId = \$model->register(\$data);";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
. " 0 = Admin-registration mode";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "\$model->save(\$data);";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "\$model->save(\$data);";
+ $method[] = Indent::_(3)
. "\$userId = \$model->getState('user.id', 0);";
- $method[] = $this->_t(2) . "}";
+ $method[] = Indent::_(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check if we have params";
- $method[] = $this->_t(2) . "if (self::checkArray(\$params))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "if (self::checkArray(\$params))";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Change user params/config back";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "foreach (\$params as \$param => \$set)";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " If you know of a better path, let me know";
- $method[] = $this->_t(4)
+ $method[] = Indent::_(4)
. "self::setParams(\$extension, \$param, \$set);";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " if user is created";
- $method[] = $this->_t(2) . "if (\$userId > 0)";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "if (\$userId > 0)";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Auto Login if Needed";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "if (\$autologin && isset(\$credentials['password']))";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Try to login";
- $method[] = $this->_t(4) . "try{";
- $method[] = $this->_t(5)
+ $method[] = Indent::_(4) . "try{";
+ $method[] = Indent::_(5)
. "JFactory::getApplication()->login(\$credentials);";
- $method[] = $this->_t(4) . "} catch (Exception \$exception){";
- $method[] = $this->_t(5) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(4) . "} catch (Exception \$exception){";
+ $method[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
. " Do noting for now, may want to set redirect.";
- $method[] = $this->_t(4) . "}";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(4) . "}";
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Return ID";
- $method[] = $this->_t(3) . "return \$userId;";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "return \$model->getError();";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(3) . "return \$userId;";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "return \$model->getError();";
+ $method[] = Indent::_(1) . "}";
- $method[] = PHP_EOL . $this->_t(1)
+ $method[] = PHP_EOL . Indent::_(1)
. "public static function setParams(\$component,\$target,\$value)";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the params and set the new values";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "\$params = JComponentHelper::getParams(\$component);";
- $method[] = $this->_t(2) . "\$was = \$params->get(\$target, null);";
- $method[] = $this->_t(2) . "if (\$was != \$value)";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "\$params->set(\$target, \$value);";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "\$was = \$params->get(\$target, null);";
+ $method[] = Indent::_(2) . "if (\$was != \$value)";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "\$params->set(\$target, \$value);";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get a new database query instance";
- $method[] = $this->_t(3) . "\$db = JFactory::getDBO();";
- $method[] = $this->_t(3) . "\$query = \$db->getQuery(true);";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "\$db = JFactory::getDBO();";
+ $method[] = Indent::_(3) . "\$query = \$db->getQuery(true);";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Build the query";
- $method[] = $this->_t(3) . "\$query->update('#__extensions AS a');";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3) . "\$query->update('#__extensions AS a');";
+ $method[] = Indent::_(3)
. "\$query->set('a.params = ' . \$db->quote((string)\$params));";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$query->where('a.element = ' . \$db->quote((string)\$component));";
- $method[] = $this->_t(3);
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3);
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Execute the query";
- $method[] = $this->_t(3) . "\$db->setQuery(\$query);";
- $method[] = $this->_t(3) . "\$db->execute();";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "return \$was;";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(3) . "\$db->setQuery(\$query);";
+ $method[] = Indent::_(3) . "\$db->execute();";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "return \$was;";
+ $method[] = Indent::_(1) . "}";
- $method[] = PHP_EOL . $this->_t(1) . "/**";
- $method[] = $this->_t(1) . " * Update user values";
- $method[] = $this->_t(1) . " */";
- $method[] = $this->_t(1)
+ $method[] = PHP_EOL . Indent::_(1) . "/**";
+ $method[] = Indent::_(1) . " * Update user values";
+ $method[] = Indent::_(1) . " */";
+ $method[] = Indent::_(1)
. "public static function updateUser(\$new)";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2)
. "// load the user component language files if there is an error.";
- $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();";
- $method[] = $this->_t(2) . "\$extension = 'com_users';";
- $method[] = $this->_t(2) . "\$base_dir = JPATH_ADMINISTRATOR;";
- $method[] = $this->_t(2) . "\$language_tag = '" . Config::get('lang_tag', 'en-GB')
+ $method[] = Indent::_(2) . "\$lang = JFactory::getLanguage();";
+ $method[] = Indent::_(2) . "\$extension = 'com_users';";
+ $method[] = Indent::_(2) . "\$base_dir = JPATH_ADMINISTRATOR;";
+ $method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB')
. "';";
- $method[] = $this->_t(2) . "\$reload = true;";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2) . "\$reload = true;";
+ $method[] = Indent::_(2)
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
- $method[] = $this->_t(2) . "// load the user model";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2) . "// load the user model";
+ $method[] = Indent::_(2)
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');";
- $method[] = $this->_t(2) . "// Check if password was set";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2) . "// Check if password was set";
+ $method[] = Indent::_(2)
. "if (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "// Use the users passwords";
- $method[] = $this->_t(3) . "\$password = \$new['password'];";
- $method[] = $this->_t(3) . "\$password2 = \$new['password2'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "// set username";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "// Use the users passwords";
+ $method[] = Indent::_(3) . "\$password = \$new['password'];";
+ $method[] = Indent::_(3) . "\$password2 = \$new['password2'];";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "// set username";
+ $method[] = Indent::_(2)
. "if (!isset(\$new['username']) || !self::checkString(\$new['username']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3)
. "\$new['username'] = \$new['email'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "// lineup update user data";
- $method[] = $this->_t(2) . "\$data = array(";
- $method[] = $this->_t(3) . "'id' => \$new['id'],";
- $method[] = $this->_t(3) . "'username' => \$new['username'],";
- $method[] = $this->_t(3) . "'name' => \$new['name'],";
- $method[] = $this->_t(3) . "'email' => \$new['email'],";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "// lineup update user data";
+ $method[] = Indent::_(2) . "\$data = array(";
+ $method[] = Indent::_(3) . "'id' => \$new['id'],";
+ $method[] = Indent::_(3) . "'username' => \$new['username'],";
+ $method[] = Indent::_(3) . "'name' => \$new['name'],";
+ $method[] = Indent::_(3) . "'email' => \$new['email'],";
+ $method[] = Indent::_(3)
. "'password' => \$password, // First password field";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "'password2' => \$password2, // Confirm password field";
- $method[] = $this->_t(3) . "'block' => 0 );";
- $method[] = $this->_t(2) . "// set groups if found";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(3) . "'block' => 0 );";
+ $method[] = Indent::_(2) . "// set groups if found";
+ $method[] = Indent::_(2)
. "if (isset(\$new['groups']) && self::checkArray(\$new['groups']))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "\$data['groups'] = \$new['groups'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "// register the new user";
- $method[] = $this->_t(2) . "\$done = \$model->save(\$data);";
- $method[] = $this->_t(2) . "// if user is updated";
- $method[] = $this->_t(2) . "if (\$done)";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "return \$new['id'];";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "return \$model->getError();";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "\$data['groups'] = \$new['groups'];";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "// register the new user";
+ $method[] = Indent::_(2) . "\$done = \$model->save(\$data);";
+ $method[] = Indent::_(2) . "// if user is updated";
+ $method[] = Indent::_(2) . "if (\$done)";
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "return \$new['id'];";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "return \$model->getError();";
+ $method[] = Indent::_(1) . "}";
// return the help method
return implode(PHP_EOL, $method);
@@ -2225,31 +2181,31 @@ class Interpretation extends Fields
{
// set the lang
$lang = StringHelper::safe(
- 'com_' . Config::get('component_code_name') . '_menu_'
+ 'com_' . CFactory::_('Config')->component_code_name . '_menu_'
. $nameSingleCode,
'U'
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_TITLE',
'Create ' . $view['settings']->name_single
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_OPTION',
'Create ' . $view['settings']->name_single
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_DESC',
$view['settings']->short_description
);
//start loading xml
$xml = '';
$xml .= PHP_EOL . '';
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(2) . '';
- $xml .= PHP_EOL . $this->_t(3) . '';
- $xml .= PHP_EOL . $this->_t(2) . ' ';
- $xml .= PHP_EOL . $this->_t(1) . ' ';
+ $xml .= PHP_EOL . Indent::_(2) . '';
+ $xml .= PHP_EOL . Indent::_(3) . '';
+ $xml .= PHP_EOL . Indent::_(2) . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '';
$xml .= PHP_EOL . ' ';
}
else
@@ -2275,42 +2231,42 @@ class Interpretation extends Fields
{
// set the lang
$lang = StringHelper::safe(
- 'com_' . Config::get('component_code_name') . '_menu_'
+ 'com_' . CFactory::_('Config')->component_code_name . '_menu_'
. $view['settings']->code, 'U'
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_TITLE', $view['settings']->name
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_OPTION', $view['settings']->name
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'adminsys', $lang . '_DESC', $view['settings']->description
);
//start loading xml
$xml = '';
$xml .= PHP_EOL . '';
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(2) . '';
- $xml .= PHP_EOL . $this->_t(3) . '';
- $xml .= PHP_EOL . $this->_t(2) . ' ';
- $xml .= PHP_EOL . $this->_t(1) . ' ';
+ $xml .= PHP_EOL . Indent::_(2) . '';
+ $xml .= PHP_EOL . Indent::_(3) . '';
+ $xml .= PHP_EOL . Indent::_(2) . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . '';
if (isset($this->hasIdRequest[$view['settings']->code])
|| isset($this->hasCatIdRequest[$view['settings']->code]))
{
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(2) . '_t(3)
+ $xml .= PHP_EOL . Indent::_(1) . '';
+ $xml .= PHP_EOL . Indent::_(2) . '_t(3)
+ . CFactory::_('Config')->component_code_name . '/models/rules"';
+ $xml .= PHP_EOL . Indent::_(3)
. 'addfieldpath="/administrator/components/com_'
- . Config::get('component_code_name') . '/models/fields">';
+ . CFactory::_('Config')->component_code_name . '/models/fields">';
if (isset($this->hasIdRequest[$view['settings']->code])
&& ArrayHelper::check(
$this->hasIdRequest[$view['settings']->code]
@@ -2321,7 +2277,7 @@ class Interpretation extends Fields
$requestFieldXML
)
{
- $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML;
+ $xml .= PHP_EOL . Indent::_(3) . $requestFieldXML;
}
}
if (isset($this->hasCatIdRequest[$view['settings']->code])
@@ -2334,11 +2290,11 @@ class Interpretation extends Fields
$requestFieldXML
)
{
- $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML;
+ $xml .= PHP_EOL . Indent::_(3) . $requestFieldXML;
}
}
- $xml .= PHP_EOL . $this->_t(2) . ' ';
- $xml .= PHP_EOL . $this->_t(1) . ' ';
+ $xml .= PHP_EOL . Indent::_(2) . ' ';
+ $xml .= PHP_EOL . Indent::_(1) . ' ';
}
if (isset($this->frontEndParams)
&& isset($this->frontEndParams[$view['settings']->name]))
@@ -2351,23 +2307,22 @@ class Interpretation extends Fields
// now load the fields
if (ArrayHelper::check($params))
{
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(1) . '';
- $xml .= PHP_EOL . $this->_t(2)
+ $xml .= PHP_EOL . Indent::_(1) . '';
+ $xml .= PHP_EOL . Indent::_(2)
. '_t(3)
+ . $this->fileContentStatic[Placefix::_h('COMPONENT')] . '"';
+ $xml .= PHP_EOL . Indent::_(3)
. 'addrulepath="/administrator/components/com_'
- . Config::get('component_code_name') . '/models/rules"';
- $xml .= PHP_EOL . $this->_t(3)
+ . CFactory::_('Config')->component_code_name . '/models/rules"';
+ $xml .= PHP_EOL . Indent::_(3)
. 'addfieldpath="/administrator/components/com_'
- . Config::get('component_code_name') . '/models/fields">';
- $xml .= implode($this->_t(3), $params);
- $xml .= PHP_EOL . $this->_t(2) . ' ';
- $xml .= PHP_EOL . $this->_t(1) . ' ';
+ . CFactory::_('Config')->component_code_name . '/models/fields">';
+ $xml .= implode(Indent::_(3), $params);
+ $xml .= PHP_EOL . Indent::_(2) . '';
+ $xml .= PHP_EOL . Indent::_(1) . ' ';
}
}
$xml .= PHP_EOL . ' ';
@@ -2408,9 +2363,9 @@ class Interpretation extends Fields
// we add the global option
$field = str_replace(
'Option Set. -->',
- $this->setLine(__LINE__) . ' Global & Option Set. -->'
- . PHP_EOL . $this->_t(3) . '' . PHP_EOL
- . $this->_t(4) . 'JGLOBAL_USE_GLOBAL ', $field
+ Line::_(__Line__, __Class__) . ' Global & Option Set. -->'
+ . PHP_EOL . Indent::_(3) . '' . PHP_EOL
+ . Indent::_(4) . 'JGLOBAL_USE_GLOBAL ', $field
);
// update the default to be global
$field = preg_replace(
@@ -2449,34 +2404,34 @@ class Interpretation extends Fields
{
// to insure that there be no double entries of a call
$checker = md5(serialize($the_get) . $code);
- if (!isset($this->customViewQueryChecker[$this->target])
- || !isset($checker, $this->customViewQueryChecker[$this->target][$checker]))
+ if (!isset($this->customViewQueryChecker[CFactory::_('Config')->build_target])
+ || !isset($checker, $this->customViewQueryChecker[CFactory::_('Config')->build_target][$checker]))
{
// load this unuiqe key
- $this->customViewQueryChecker[$this->target][$checker]
+ $this->customViewQueryChecker[CFactory::_('Config')->build_target][$checker]
= true;
if (isset($the_get['selection']['type'])
&& StringHelper::check(
$the_get['selection']['type']
))
{
- $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "//" . $this->setLine(__LINE__)
+ $getItem = PHP_EOL . PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "//" . Line::_(__Line__, __Class__)
. " Get from " . $the_get['selection']['table']
. " as " . $the_get['as'];
// set the selection
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. $the_get['selection']['select'];
}
else
{
- $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "//" . $this->setLine(__LINE__)
+ $getItem = PHP_EOL . PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "//" . Line::_(__Line__, __Class__)
. " Get data";
// set the selection
- $getItem .= PHP_EOL . $this->setPlaceholders(
+ $getItem .= PHP_EOL . CFactory::_('Placeholder')->update(
$the_get['selection']['select'],
- $this->placeholders
+ CFactory::_('Placeholder')->active
);
}
// load the from selection
@@ -2495,7 +2450,7 @@ class Interpretation extends Fields
$the_get['selection']['type']
))))
{
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. '$query->from(' . $the_get['selection']['from']
. ');';
}
@@ -2508,7 +2463,7 @@ class Interpretation extends Fields
$the_get['selection']['type']
))
{
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query->join('" . $the_get['type'];
$getItem .= "', (" . $the_get['selection']['from'];
$getItem .= ") . ' ON (' . \$db->quoteName('"
@@ -2525,19 +2480,19 @@ class Interpretation extends Fields
$the_get, $code
)) !== false)
{
- if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']])
+ if (isset($this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']])
&& StringHelper::check(
- $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]
)
&& !in_array($check, $mainAsArray))
{
// load to other query
- if (!isset($this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]))
+ if (!isset($this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]))
{
- $this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
+ $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
= '';
}
- $this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
+ $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
.= $getItem;
}
else
@@ -2586,196 +2541,193 @@ class Interpretation extends Fields
{
case 4:
// COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS
- $filter .= PHP_EOL . PHP_EOL . $this->_t(1)
- . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__) . " filter "
+ $filter .= PHP_EOL . PHP_EOL . Indent::_(1)
+ . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__) . " filter "
. $as . " based on user groups";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1)
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1)
. "\$remove = (count(array_intersect((array) \$this->groups, (array) "
. $string . "->" . $field
. "))) ? false : true;";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "if (\$remove)";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "if (\$remove)";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
if ($removeString == $string)
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Remove " . $string
. " if user not in groups";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . $string . " = null;";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "return false;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . $string . " = null;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "return false;";
}
else
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Unset " . $string
. " if user not in groups";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "unset("
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "unset("
. $removeString . ");";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "continue;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "continue;";
}
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "}";
break;
case 9:
// COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE
- $filter .= PHP_EOL . PHP_EOL . $this->_t(1)
- . $tab . $this->_t(1) . "if ("
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ $filter .= PHP_EOL . PHP_EOL . Indent::_(1)
+ . $tab . Indent::_(1) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(" . $string . "->"
. $field . "))";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " do your thing here";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "}";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "else";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "else";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
if ($removeString == $string)
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Remove " . $string
. " if not array.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . $string . " = null;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . $string . " = null;";
}
else
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Unset " . $string
. " if not array.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "unset("
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "unset("
. $removeString . ");";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "continue;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "continue;";
}
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "}";
break;
case 10:
// COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE
- $filter .= PHP_EOL . PHP_EOL . $this->_t(1)
- . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__) . " filter "
+ $filter .= PHP_EOL . PHP_EOL . Indent::_(1)
+ . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__) . " filter "
. $as . " based on repeatable value";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "if ("
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkString(" . $string . "->"
. $field . "))";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
- $filter .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "\$array = json_decode("
+ $filter .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "\$array = json_decode("
. $string . "->" . $field . ",true);";
- $filter .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "if ("
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ $filter .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$array))";
- $filter .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "{";
- $filter .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " do your thing here";
- $filter .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "}";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "else";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "{";
+ $filter .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "else";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "{";
if ($removeString == $string)
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Remove " . $string
. " if not array.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(3) . $string . " = null;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(3) . $string . " = null;";
}
else
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Unset " . $string
. " if not array.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(3) . "unset("
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(3) . "unset("
. $removeString . ");";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(3) . "continue;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(3) . "continue;";
}
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "}";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "}";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "else";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "else";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
if ($removeString == $string)
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Remove " . $string
. " if not string.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . $string . " = null;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . $string . " = null;";
}
else
{
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Unset " . $string
. " if not string.";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "unset("
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "unset("
. $removeString . ");";
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . "continue;";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . "continue;";
}
- $filter .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "}";
+ $filter .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "}";
break;
}
}
@@ -2816,23 +2768,22 @@ class Interpretation extends Fields
$decoder = '';
if ('json' === $decode)
{
- $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "if (" . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::checkJson("
+ $if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "if (" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson("
. $string . "->" . $field . "))" . PHP_EOL
- . $this->_t(1) . $tab . $this->_t(1) . "{";
+ . Indent::_(1) . $tab . Indent::_(1) . "{";
// json_decode
$decoder = $string . "->" . $field . " = json_decode("
. $string . "->" . $field . ", true);";
}
elseif ('base64' === $decode)
{
- $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $if = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "if (!empty(" . $string . "->" . $field . ") && "
. $string . "->" . $field
. " === base64_encode(base64_decode(" . $string
- . "->" . $field . ")))" . PHP_EOL . $this->_t(1)
- . $tab . $this->_t(1) . "{";
+ . "->" . $field . ")))" . PHP_EOL . Indent::_(1)
+ . $tab . Indent::_(1) . "{";
// base64_decode
$decoder = $string . "->" . $field . " = base64_decode("
. $string . "->" . $field . ");";
@@ -2847,16 +2798,16 @@ class Interpretation extends Fields
{
if ('expert' !== $cryptionType)
{
- $if = PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "if (!empty(" . $string
+ $if = PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "if (!empty(" . $string
. "->" . $field . ") && \$"
. $cryptionType . "key && !is_numeric("
. $string . "->" . $field . ") && "
. $string . "->" . $field
. " === base64_encode(base64_decode("
. $string . "->" . $field . ", true)))"
- . PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "{";
+ . PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "{";
// set decryption
$decoder = $string . "->" . $field
. " = rtrim(\$" . $cryptionType
@@ -2871,11 +2822,11 @@ class Interpretation extends Fields
$_placeholder_for_field
= array('[[[field]]]' => $string
. "->" . $field);
- $fieldDecode .= $this->setPlaceholders(
- PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . implode(
- PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1),
+ $fieldDecode .= CFactory::_('Placeholder')->update(
+ PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . implode(
+ PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1),
$this->{$cryptionType
. 'FieldModeling'}[$array['admin_view']][$field]['get']
), $_placeholder_for_field
@@ -2890,19 +2841,19 @@ class Interpretation extends Fields
if (StringHelper::check($if))
{
// build decoder string
- $fieldDecode .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "//" . $this->setLine(__LINE__)
+ $fieldDecode .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "//" . Line::_(__Line__, __Class__)
. " Check if we can decode " . $field . $if
- . PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
- . "//" . $this->setLine(__LINE__) . " Decode "
+ . PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
+ . "//" . Line::_(__Line__, __Class__) . " Decode "
. $field;
}
if (StringHelper::check($decoder))
{
// build decoder string
- $fieldDecode .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(2) . $decoder . PHP_EOL . $this->_t(1)
- . $tab . $this->_t(1) . "}";
+ $fieldDecode .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(2) . $decoder . PHP_EOL . Indent::_(1)
+ . $tab . Indent::_(1) . "}";
}
}
}
@@ -2918,11 +2869,10 @@ class Interpretation extends Fields
$fieldPrepare = '';
$runplugins = false;
// set component
- $Component = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh];
+ $Component = $this->fileContentStatic[Placefix::_h('Component')];
// set context
$context = (isset($get['context'])) ? $get['context'] : $code;
- $context = 'com_' . Config::get('component_code_name') . '.' . $context;
+ $context = 'com_' . CFactory::_('Config')->component_code_name . '.' . $context;
// load parms builder only once
$params = false;
foreach ($checker as $field => $array)
@@ -2941,21 +2891,21 @@ class Interpretation extends Fields
// build decoder string
if (!$runplugins)
{
- $runplugins = PHP_EOL . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__)
+ $runplugins = PHP_EOL . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__)
. " Load the JEvent Dispatcher";
- $runplugins .= PHP_EOL . $tab . $this->_t(1)
+ $runplugins .= PHP_EOL . $tab . Indent::_(1)
. "JPluginHelper::importPlugin('content');";
- $runplugins .= PHP_EOL . $tab . $this->_t(1)
+ $runplugins .= PHP_EOL . $tab . Indent::_(1)
. '$this->_dispatcher = JFactory::getApplication();';
}
if (!$params)
{
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(
1
- ) . "//" . $this->setLine(__LINE__)
+ ) . "//" . Line::_(__Line__, __Class__)
. " Check if item has params, or pass whole item.";
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(
1
) . "\$params = (isset(" . $string . "->params) && "
. $Component . "Helper::checkJson(" . $string
@@ -2963,21 +2913,21 @@ class Interpretation extends Fields
. $string . ";";
$params = true;
}
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "//" . $this->setLine(__LINE__)
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "//" . Line::_(__Line__, __Class__)
. " Make sure the content prepare plugins fire on "
. $field;
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$_" . $field . " = new stdClass();";
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$_" . $field . '->text =& ' . $string . '->' . $field
- . '; //' . $this->setLine(__LINE__)
+ . '; //' . Line::_(__Line__, __Class__)
. ' value must be in text';
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "//" . $this->setLine(__LINE__)
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "//" . Line::_(__Line__, __Class__)
. " Since all values are now in text (Joomla Limitation), we also add the field name ("
. $field . ") to context";
- $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $fieldPrepare .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. '$this->_dispatcher->triggerEvent("onContentPrepare", array(\''
. $context . '.' . $field . '\', &$_' . $field
. ', &$params, 0));';
@@ -2986,8 +2936,7 @@ class Interpretation extends Fields
// load dispatcher
if ($runplugins)
{
- $this->JEventDispatcher = array($this->hhh . 'DISPATCHER'
- . $this->hhh => $runplugins);
+ $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => $runplugins);
}
// return content prepare fix
@@ -3015,13 +2964,12 @@ class Interpretation extends Fields
// only load for uikit version 2 (TODO) we may need to add another check here
if (2 == $this->uikit || 1 == $this->uikit)
{
- $fieldUikit .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "//" . $this->setLine(__LINE__) . " Checking if "
+ $fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "//" . Line::_(__Line__, __Class__) . " Checking if "
. $field . " has uikit components that must be loaded.";
- $fieldUikit .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $fieldUikit .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$this->uikitComp = "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::getUikitComp(" . $string . "->"
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::getUikitComp(" . $string . "->"
. $field . ",\$this->uikitComp);";
}
}
@@ -3047,37 +2995,34 @@ class Interpretation extends Fields
if ($this->checkJoint($default, $get, $asBucket))
{
// build custom join string
- $otherJoin = PHP_EOL . $this->_t(1) . $this->hhh . "TAB"
- . $this->hhh . $this->_t(1) . "//" . $this->setLine(
- __LINE__
- ) . " set " . $default['valueName'] . " to the "
- . $this->hhh . "STRING" . $this->hhh . " object.";
- $otherJoin .= PHP_EOL . $this->_t(1) . $this->hhh
- . "TAB" . $this->hhh . $this->_t(1) . $this->hhh
- . "STRING" . $this->hhh . "->"
+ $otherJoin = PHP_EOL . Indent::_(1) . Placefix::_h("TAB")
+ . Indent::_(1) . "//" . Line::_(__LINE__,__CLASS__)
+ . " set " . $default['valueName'] . " to the "
+ . Placefix::_h("STRING") . " object.";
+ $otherJoin .= PHP_EOL . Indent::_(1) . Placefix::_h("TAB")
+ . Indent::_(1) . Placefix::_h("STRING") . "->"
. $default['valueName'] . " = \$this->get"
- . $default['methodName'] . "(" . $this->hhh
- . "STRING" . $this->hhh . "->"
+ . $default['methodName'] . "(" . Placefix::_h("STRING") . "->"
. $this->getAsLookup[$get['key']][$get['on_field']]
. ");";
// load to other join
- if (!isset($this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]))
+ if (!isset($this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]))
{
- $this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
+ $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
= '';
}
- $this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
+ $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']]
.= $otherJoin;
}
else
{
// build custom join string
- $customJoin .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "//" . $this->setLine(__LINE__)
+ $customJoin .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "//" . Line::_(__Line__, __Class__)
. " set " . $default['valueName'] . " to the "
. $string . " object.";
- $customJoin .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . $string . "->"
+ $customJoin .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . $string . "->"
. $default['valueName'] . " = \$this->get"
. $default['methodName'] . "(" . $string . "->"
. $this->getAsLookup[$get['key']][$get['on_field']]
@@ -3104,9 +3049,9 @@ class Interpretation extends Fields
return false;
}
// default fallback
- elseif (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']])
+ elseif (isset($this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']])
&& StringHelper::check(
- $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]
+ $this->siteDynamicGet[CFactory::_('Config')->build_target][$default['code']][$default['as']][$default['join_field']]
))
{
return true;
@@ -3135,19 +3080,19 @@ class Interpretation extends Fields
{
case 1:
// COM_COMPONENTBUILDER_DYNAMIC_GET_ID
- $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query->where('" . $ter['table_key'] . " "
. $ter['operator'] . " ' . (int) \$pk);";
break;
case 2:
// COM_COMPONENTBUILDER_DYNAMIC_GET_USER
- $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query->where('" . $ter['table_key'] . " "
. $ter['operator'] . " ' . (int) \$this->userId);";
break;
case 3:
// COM_COMPONENTBUILDER_DYNAMIC_GET_ACCESS_LEVEL
- $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query->where('" . $ter['table_key'] . " "
. $ter['operator']
. " (' . implode(',', \$this->levels) . ')');";
@@ -3160,12 +3105,12 @@ class Interpretation extends Fields
|| $ter['state_key'] === 'array')
{
// set needed fields to filter after query
- $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field]
+ $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field]
= $ter;
}
else
{
- $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(
+ $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(
1
) . "\$query->where('" . $ter['table_key'] . " "
. $ter['operator']
@@ -3174,20 +3119,20 @@ class Interpretation extends Fields
break;
case 5:
// COM_COMPONENTBUILDER_DYNAMIC_GET_CATEGORIES
- $string = PHP_EOL . $this->_t(2) . $tab . "//"
- . $this->setLine(__LINE__)
+ $string = PHP_EOL . Indent::_(2) . $tab . "//"
+ . Line::_(__Line__, __Class__)
. " (TODO) The dynamic category filter is not ready.";
break;
case 6:
// COM_COMPONENTBUILDER_DYNAMIC_GET_TAGS
- $string = PHP_EOL . $this->_t(2) . $tab . "//"
- . $this->setLine(__LINE__)
+ $string = PHP_EOL . Indent::_(2) . $tab . "//"
+ . Line::_(__Line__, __Class__)
. " (TODO) The dynamic tags filter is not ready.";
break;
case 7:
// COM_COMPONENTBUILDER_DYNAMIC_GET_DATE
- $string = PHP_EOL . $this->_t(2) . $tab . "//"
- . $this->setLine(__LINE__)
+ $string = PHP_EOL . Indent::_(2) . $tab . "//"
+ . Line::_(__Line__, __Class__)
. " (TODO) The dynamic date filter is not ready.";
break;
case 8:
@@ -3195,70 +3140,68 @@ class Interpretation extends Fields
if ($ter['operator'] === 'IN'
|| $ter['operator'] === 'NOT IN')
{
- $string = PHP_EOL . $this->_t(2) . $tab . "//"
- . $this->setLine(__LINE__) . " Check if "
+ $string = PHP_EOL . Indent::_(2) . $tab . "//"
+ . Line::_(__Line__, __Class__) . " Check if "
. $ter['state_key']
. " is an array with values.";
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "\$array = " . $ter['state_key'] . ";";
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "if (isset(\$array) && "
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$array))";
- $string .= PHP_EOL . $this->_t(2) . $tab . "{";
- $string .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "\$query->where('"
+ $string .= PHP_EOL . Indent::_(2) . $tab . "{";
+ $string .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "\$query->where('"
. $ter['table_key'] . " " . $ter['operator']
. " (' . implode(',', \$array) . ')');";
- $string .= PHP_EOL . $this->_t(2) . $tab . "}";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "}";
// check if empty is allowed
if (!isset($ter['empty']) || !$ter['empty'])
{
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "else";
- $string .= PHP_EOL . $this->_t(2) . $tab . "{";
- $string .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "return false;";
- $string .= PHP_EOL . $this->_t(2) . $tab . "}";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "{";
+ $string .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "return false;";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "}";
}
}
else
{
- $string = PHP_EOL . $this->_t(2) . $tab . "//"
- . $this->setLine(__LINE__) . " Check if "
+ $string = PHP_EOL . Indent::_(2) . $tab . "//"
+ . Line::_(__Line__, __Class__) . " Check if "
. $ter['state_key']
. " is a string or numeric value.";
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "\$checkValue = " . $ter['state_key'] . ";";
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "if (isset(\$checkValue) && "
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkString(\$checkValue))";
- $string .= PHP_EOL . $this->_t(2) . $tab . "{";
- $string .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "\$query->where('"
+ $string .= PHP_EOL . Indent::_(2) . $tab . "{";
+ $string .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "\$query->where('"
. $ter['table_key'] . " " . $ter['operator']
. " ' . \$db->quote(\$checkValue));";
- $string .= PHP_EOL . $this->_t(2) . $tab . "}";
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab . "}";
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "elseif (is_numeric(\$checkValue))";
- $string .= PHP_EOL . $this->_t(2) . $tab . "{";
- $string .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "\$query->where('"
+ $string .= PHP_EOL . Indent::_(2) . $tab . "{";
+ $string .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "\$query->where('"
. $ter['table_key'] . " " . $ter['operator']
. " ' . \$checkValue);";
- $string .= PHP_EOL . $this->_t(2) . $tab . "}";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "}";
// check if empty is allowed
if (!isset($ter['empty']) || !$ter['empty'])
{
- $string .= PHP_EOL . $this->_t(2) . $tab
+ $string .= PHP_EOL . Indent::_(2) . $tab
. "else";
- $string .= PHP_EOL . $this->_t(2) . $tab . "{";
- $string .= PHP_EOL . $this->_t(2) . $tab
- . $this->_t(1) . "return false;";
- $string .= PHP_EOL . $this->_t(2) . $tab . "}";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "{";
+ $string .= PHP_EOL . Indent::_(2) . $tab
+ . Indent::_(1) . "return false;";
+ $string .= PHP_EOL . Indent::_(2) . $tab . "}";
}
}
break;
@@ -3266,14 +3209,14 @@ class Interpretation extends Fields
// COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE
$string = "";
// set needed fields to filter after query
- $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field]
+ $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field]
= $ter;
break;
case 10:
// COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE
$string = "";
// set needed fields to filter after query
- $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field]
+ $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$ter['key']][$as][$field]
= $ter;
break;
case 11:
@@ -3286,7 +3229,7 @@ class Interpretation extends Fields
);
$field = trim(str_replace(')', '', $field));
}
- $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $string = PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query->where('" . $ter['table_key'] . " "
. $ter['operator'] . " " . $ter['state_key']
. "');";
@@ -3297,16 +3240,16 @@ class Interpretation extends Fields
{
// sort where
if ($as === 'a'
- || (isset($this->siteMainGet[$this->target][$code][$as])
+ || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as])
&& StringHelper::check(
- $this->siteMainGet[$this->target][$code][$as]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]
)))
{
$filters .= $string;
}
elseif ($as !== 'a')
{
- $this->otherFilter[$this->target][$code][$as][$field]
+ $this->otherFilter[CFactory::_('Config')->build_target][$code][$as][$field]
= $string;
}
}
@@ -3330,18 +3273,18 @@ class Interpretation extends Fields
$string = "\$query->group('" . $gr['table_key'] . "');";
// sort where
if ($as === 'a'
- || (isset($this->siteMainGet[$this->target][$code][$as])
+ || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as])
&& StringHelper::check(
- $this->siteMainGet[$this->target][$code][$as]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]
)))
{
- $grouping .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $grouping .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. $string;
}
else
{
- $this->otherGroup[$this->target][$code][$as][$field]
- = PHP_EOL . $this->_t(2) . $string;
+ $this->otherGroup[CFactory::_('Config')->build_target][$code][$as][$field]
+ = PHP_EOL . Indent::_(2) . $string;
}
}
}
@@ -3373,18 +3316,18 @@ class Interpretation extends Fields
}
// sort where
if ($as === 'a'
- || (isset($this->siteMainGet[$this->target][$code][$as])
+ || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as])
&& StringHelper::check(
- $this->siteMainGet[$this->target][$code][$as]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]
)))
{
- $ordering .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $ordering .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. $string;
}
else
{
- $this->otherOrder[$this->target][$code][$as][$field]
- = PHP_EOL . $this->_t(2) . $string;
+ $this->otherOrder[CFactory::_('Config')->build_target][$code][$as][$field]
+ = PHP_EOL . Indent::_(2) . $string;
}
}
}
@@ -3452,51 +3395,50 @@ class Interpretation extends Fields
|| $whe['operator'] === 'NOT IN')
{
$string = "if (isset(" . $whe['value_key'] . ") && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray("
. $whe['value_key'] . "))";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "{";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2)
- . "//" . $this->setLine(__LINE__) . " Get where "
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2)
+ . "//" . Line::_(__Line__, __Class__) . " Get where "
. $whe['table_key'] . " is " . $whe['value_key'];
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2)
. "\$query->where('" . $whe['table_key'] . " "
. $whe['operator'] . $value;
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "}";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "else";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "{";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(2)
. "return false;";
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "}";
}
else
{
- $string = "//" . $this->setLine(__LINE__)
+ $string = "//" . Line::_(__Line__, __Class__)
. " Get where " . $whe['table_key'] . " is "
. $whe['value_key'];
- $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1)
+ $string .= PHP_EOL . Indent::_(1) . $tabe . Indent::_(1)
. "\$query->where('" . $whe['table_key'] . " "
. $whe['operator'] . $value;
}
// sort where
if ($as === 'a'
- || (isset($this->siteMainGet[$this->target][$code][$as])
+ || (isset($this->siteMainGet[CFactory::_('Config')->build_target][$code][$as])
&& StringHelper::check(
- $this->siteMainGet[$this->target][$code][$as]
+ $this->siteMainGet[CFactory::_('Config')->build_target][$code][$as]
)))
{
- $wheres .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $wheres .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. $string;
}
elseif ($as !== 'a')
{
- $this->otherWhere[$this->target][$code][$as][$field]
- = PHP_EOL . $this->_t(2) . $string;
+ $this->otherWhere[CFactory::_('Config')->build_target][$code][$as][$field]
+ = PHP_EOL . Indent::_(2) . $string;
}
}
}
@@ -3533,10 +3475,10 @@ class Interpretation extends Fields
// only add if the filter is set
if (StringHelper::check($value))
{
- $globals .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "//" . $this->setLine(__LINE__)
+ $globals .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "//" . Line::_(__Line__, __Class__)
. " set the global " . $glo['name'] . " value."
- . PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ . PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. $value;
}
}
@@ -3585,54 +3527,51 @@ class Interpretation extends Fields
}
// check that the default and the redirect page is not the same
if (isset(
- $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW'
- . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
)
- && $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW'
- . $this->hhh] != $view['settings']->code)
+ && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $view['settings']->code)
{
- $redirectMessage = $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $redirectMessage = Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
)
. " redirect away to the default view if no access allowed.";
$redirectString = "JRoute::_('index.php?option=com_"
- . Config::get('component_code_name') . "&view="
- . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW'
- . $this->hhh] . "')";
+ . CFactory::_('Config')->component_code_name . "&view="
+ . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')";
}
else
{
- $redirectMessage = $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $redirectMessage = Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " redirect away to the home page if no access allowed.";
$redirectString = 'JURI::root()';
}
- $accessCheck[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $accessCheck[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " check if this user has permission to access item";
- $accessCheck[] = $this->_t(2) . "if (!" . $userString
+ $accessCheck[] = Indent::_(2) . "if (!" . $userString
. "->authorise('site." . $view['settings']->code
- . ".access', 'com_" . Config::get('component_code_name') . "'))";
- $accessCheck[] = $this->_t(2) . "{";
- $accessCheck[] = $this->_t(3)
+ . ".access', 'com_" . CFactory::_('Config')->component_code_name . "'))";
+ $accessCheck[] = Indent::_(2) . "{";
+ $accessCheck[] = Indent::_(3)
. "\$app = JFactory::getApplication();";
// set lang
- $langKeyWord = $this->langPrefix . '_'
+ $langKeyWord = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe(
'Not authorised to view ' . $view['settings']->code . '!',
'U'
);
- $this->setLangContent(
+ CFactory::_('Language')->set(
'site', $langKeyWord,
'Not authorised to view ' . $view['settings']->code . '!'
);
- $accessCheck[] = $this->_t(3) . "\$app->enqueueMessage(JText:"
+ $accessCheck[] = Indent::_(3) . "\$app->enqueueMessage(JText:"
. ":_('" . $langKeyWord . "'), 'error');";
$accessCheck[] = $redirectMessage;
- $accessCheck[] = $this->_t(3) . "\$app->redirect(" . $redirectString
+ $accessCheck[] = Indent::_(3) . "\$app->redirect(" . $redirectString
. ");";
- $accessCheck[] = $this->_t(3) . "return false;";
- $accessCheck[] = $this->_t(2) . "}";
+ $accessCheck[] = Indent::_(3) . "return false;";
+ $accessCheck[] = Indent::_(2) . "}";
// return the access check
return implode(PHP_EOL, $accessCheck);
@@ -3670,18 +3609,18 @@ class Interpretation extends Fields
$get->php_before_getitem
))
{
- $getItem .= $this->setPlaceholders(
- $get->php_before_getitem, $this->placeholders
+ $getItem .= CFactory::_('Placeholder')->update(
+ $get->php_before_getitem, CFactory::_('Placeholder')->active
);
}
// start loadin the get Item
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__) . " Get a db connection.";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__) . " Get a db connection.";
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$db = JFactory::getDbo();";
- $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Create a new query object.";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . PHP_EOL . $tab . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Create a new query object.";
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$query = \$db->getQuery(true);";
// set main get query
$getItem .= $this->setCustomViewQuery($get->main_get, $code, $tab);
@@ -3708,106 +3647,103 @@ class Interpretation extends Fields
$getItem .= $this->setCustomViewGroup($get->group, $code, $tab);
}
// db set query data placeholder
- $getItem .= $this->hhh . "DB_SET_QUERY_DATA" . $this->hhh;
+ $getItem .= Placefix::_h("DB_SET_QUERY_DATA") ;
// set after item php
if (isset($get->add_php_after_getitem)
&& $get->add_php_after_getitem == 1
&& isset($get->php_after_getitem)
&& StringHelper::check($get->php_after_getitem))
{
- $getItem .= $this->setPlaceholders(
- $get->php_after_getitem, $this->placeholders
+ $getItem .= CFactory::_('Placeholder')->update(
+ $get->php_after_getitem, CFactory::_('Placeholder')->active
);
}
// check the getItem string to see if we should still add set query to data
if (strpos($getItem, '$data =') === false)
{
// get ready to get query
- $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] =
- PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] =
+ PHP_EOL . PHP_EOL . $tab . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Reset the query using our newly populated query object.";
- $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .=
- PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .=
+ PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$db->setQuery(\$query);";
- $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .=
- PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__)
+ $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .=
+ PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__)
. " Load the results as a stdClass object.";
- $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .=
- PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] .=
+ PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$data = \$db->loadObject();";
// add the db set query to data
}
else
{
// remove our placeholder
- $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = '';
+ $setQuery[Placefix::_h("DB_SET_QUERY_DATA")] = '';
}
// add the db set query to data
$getItem = str_replace(
array_keys($setQuery),
array_values($setQuery), $getItem
);
- $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . PHP_EOL . $tab . Indent::_(2)
. "if (empty(\$data))";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{";
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "{";
if ($type === 'main')
{
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "\$app = JFactory::getApplication();";
- $langKeyWoord = $this->langPrefix . '_'
+ $langKeyWoord = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe(
'Not found or access denied', 'U'
);
- $this->setLangContent(
- $this->lang, $langKeyWoord, 'Not found, or access denied.'
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $langKeyWoord, 'Not found, or access denied.'
);
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " If no data is found redirect to default page and show warning.";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "\$app->enqueueMessage(JText:" . ":_('" . $langKeyWoord
. "'), 'warning');";
- if ('site' === $this->target)
+ if ('site' === CFactory::_('Config')->build_target)
{
// check that the default and the redirect page is not the same
if (isset(
- $this->fileContentStatic[$this->hhh
- . 'SITE_DEFAULT_VIEW' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')]
)
- && $this->fileContentStatic[$this->hhh
- . 'SITE_DEFAULT_VIEW' . $this->hhh] != $code)
+ && $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] != $code)
{
$redirectString = "JRoute::_('index.php?option=com_"
- . Config::get('component_code_name') . "&view="
- . $this->fileContentStatic[$this->hhh
- . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')";
+ . CFactory::_('Config')->component_code_name . "&view="
+ . $this->fileContentStatic[Placefix::_h('SITE_DEFAULT_VIEW')] . "')";
}
else
{
$redirectString = 'JURI::root()';
}
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "\$app->redirect(" . $redirectString . ");";
}
else
{
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "\$app->redirect('index.php?option=com_"
- . Config::get('component_code_name') . "');";
+ . CFactory::_('Config')->component_code_name . "');";
}
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "return false;";
}
else
{
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(2)
. "return false;";
}
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}";
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "}";
// dispatcher placeholder
- $getItem .= $this->hhh . "DISPATCHER" . $this->hhh;
+ $getItem .= Placefix::_h("DISPATCHER") ;
if (ArrayHelper::check($get->main_get))
{
$asBucket = array();
@@ -3831,10 +3767,10 @@ class Interpretation extends Fields
}
}
- if (isset($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]))
+ if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']]))
{
$decodeFilter
- = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']];
+ = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']];
if (ArrayHelper::check(
$decodeFilter
))
@@ -3883,8 +3819,7 @@ class Interpretation extends Fields
}
}
// set the scripts
- $Component = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh];
+ $Component = $this->fileContentStatic[Placefix::_h('Component')];
$script = '';
foreach ($this->cryptionTypes as $cryptionType)
{
@@ -3893,16 +3828,16 @@ class Interpretation extends Fields
{
if ('expert' !== $cryptionType)
{
- $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . "//" . $this->setLine(__LINE__)
+ $script .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . "//" . Line::_(__Line__, __Class__)
. " Get the " . $cryptionType . " encryption.";
- $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$" . $cryptionType . "key = " . $Component
. "Helper::getCryptKey('" . $cryptionType . "');";
- $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
- . "//" . $this->setLine(__LINE__)
+ $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
+ . "//" . Line::_(__Line__, __Class__)
. " Get the encryption object.";
- $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $script .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$" . $cryptionType . " = new FOFEncryptAes(\$"
. $cryptionType . "key);";
}
@@ -3920,8 +3855,8 @@ class Interpretation extends Fields
. 'FieldModelInitiator'}[$code]['get'] as $block
)
{
- $script .= PHP_EOL . $this->_t(1) . implode(
- PHP_EOL . $this->_t(1), $block
+ $script .= PHP_EOL . Indent::_(1) . implode(
+ PHP_EOL . Indent::_(1), $block
);
}
}
@@ -3940,38 +3875,38 @@ class Interpretation extends Fields
if ($get->addcalculation == 1)
{
$get->php_calculation = (array) explode(
- PHP_EOL, $this->setPlaceholders(
- $get->php_calculation, $this->placeholders
+ PHP_EOL, CFactory::_('Placeholder')->update(
+ $get->php_calculation, CFactory::_('Placeholder')->active
)
);
- $getItem .= PHP_EOL . $this->_t(1) . $tab
- . $this->_t(1) . implode(
- PHP_EOL . $this->_t(1) . $tab . $this->_t(1),
+ $getItem .= PHP_EOL . Indent::_(1) . $tab
+ . Indent::_(1) . implode(
+ PHP_EOL . Indent::_(1) . $tab . Indent::_(1),
$get->php_calculation
);
}
if ($type === 'custom')
{
// return the object
- $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(
+ $getItem .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_(
1
- ) . "//" . $this->setLine(__LINE__)
+ ) . "//" . Line::_(__Line__, __Class__)
. " return data object.";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "return \$data;";
}
else
{
// set the object
- $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(
+ $getItem .= PHP_EOL . PHP_EOL . Indent::_(1) . $tab . Indent::_(
1
- ) . "//" . $this->setLine(__LINE__)
+ ) . "//" . Line::_(__Line__, __Class__)
. " set data object to item.";
- $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1)
+ $getItem .= PHP_EOL . Indent::_(1) . $tab . Indent::_(1)
. "\$this->_item[\$pk] = \$data;";
}
// only update if dispacher placholder is found
- if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh)
+ if (strpos($getItem, Placefix::_h('DISPATCHER'))
!== false)
{
// check if the dispather should be added
@@ -3980,8 +3915,7 @@ class Interpretation extends Fields
$this->JEventDispatcher
))
{
- $this->JEventDispatcher = array($this->hhh . 'DISPATCHER'
- . $this->hhh => '');
+ $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => '');
}
$getItem = str_replace(
array_keys($this->JEventDispatcher),
@@ -3992,8 +3926,8 @@ class Interpretation extends Fields
return $getItem;
}
- return PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//"
- . $this->setLine(__LINE__) . "add your custom code here.";
+ return PHP_EOL . Indent::_(1) . $tab . Indent::_(1) . "//"
+ . Line::_(__Line__, __Class__) . "add your custom code here.";
}
public function setCustomViewCustomMethods($main_view, $code)
@@ -4033,23 +3967,23 @@ class Interpretation extends Fields
if ($view->gettype == 3)
{
// SITE_GET_ITEM <<>>
- $main .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . PHP_EOL . Indent::_(2)
. "if (!isset(\$this->initSet) || !\$this->initSet)";
- $main .= PHP_EOL . $this->_t(2) . "{";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(2) . "{";
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->user = JFactory::getUser();";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->userId = \$this->user->get('id');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->guest = \$this->user->get('guest');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->groups = \$this->user->get('groups');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->levels = \$this->user->getAuthorisedViewLevels();";
- $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;";
- $main .= PHP_EOL . $this->_t(2) . "}";
+ $main .= PHP_EOL . Indent::_(3) . "\$this->initSet = true;";
+ $main .= PHP_EOL . Indent::_(2) . "}";
$main .= $this->setCustomViewGetItem(
$view, $view->code, '', 'custom'
);
@@ -4058,28 +3992,28 @@ class Interpretation extends Fields
}
elseif ($view->gettype == 4)
{
- $main .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . PHP_EOL . Indent::_(2)
. "if (!isset(\$this->initSet) || !\$this->initSet)";
- $main .= PHP_EOL . $this->_t(2) . "{";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(2) . "{";
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->user = JFactory::getUser();";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->userId = \$this->user->get('id');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->guest = \$this->user->get('guest');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->groups = \$this->user->get('groups');";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();";
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. "\$this->levels = \$this->user->getAuthorisedViewLevels();";
- $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;";
- $main .= PHP_EOL . $this->_t(2) . "}";
- $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Get the global params";
- $main .= PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . Indent::_(3) . "\$this->initSet = true;";
+ $main .= PHP_EOL . Indent::_(2) . "}";
+ $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Get the global params";
+ $main .= PHP_EOL . Indent::_(2)
. "\$globalParams = JComponentHelper::getParams('com_"
- . Config::get('component_code_name') . "', true);";
+ . CFactory::_('Config')->component_code_name . "', true);";
// set php before listquery
if (isset($view->add_php_getlistquery)
&& $view->add_php_getlistquery == 1
@@ -4088,8 +4022,8 @@ class Interpretation extends Fields
$view->php_getlistquery
))
{
- $main .= $this->setPlaceholders(
- $view->php_getlistquery, $this->placeholders
+ $main .= CFactory::_('Placeholder')->update(
+ $view->php_getlistquery, CFactory::_('Placeholder')->active
);
}
// SITE_GET_LIST_QUERY <<>>
@@ -4104,17 +4038,17 @@ class Interpretation extends Fields
$view->php_before_getitems
))
{
- $main .= $this->setPlaceholders(
- $view->php_before_getitems, $this->placeholders
+ $main .= CFactory::_('Placeholder')->update(
+ $view->php_before_getitems, CFactory::_('Placeholder')->active
);
}
// load the object list
- $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $main .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Reset the query using our newly populated query object.";
- $main .= PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . Indent::_(2)
. "\$db->setQuery(\$query);";
- $main .= PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . Indent::_(2)
. "\$items = \$db->loadObjectList();";
// set after items php
if (isset($view->add_php_after_getitems)
@@ -4124,21 +4058,21 @@ class Interpretation extends Fields
$view->php_after_getitems
))
{
- $main .= $this->setPlaceholders(
- $view->php_after_getitems, $this->placeholders
+ $main .= CFactory::_('Placeholder')->update(
+ $view->php_after_getitems, CFactory::_('Placeholder')->active
);
}
- $main .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $main .= PHP_EOL . PHP_EOL . Indent::_(2)
. "if (empty(\$items))";
- $main .= PHP_EOL . $this->_t(2) . "{";
- $main .= PHP_EOL . $this->_t(3) . "return false;";
- $main .= PHP_EOL . $this->_t(2) . "}";
+ $main .= PHP_EOL . Indent::_(2) . "{";
+ $main .= PHP_EOL . Indent::_(3) . "return false;";
+ $main .= PHP_EOL . Indent::_(2) . "}";
// SITE_GET_ITEMS <<>>
$main .= $this->setCustomViewGetItems($view, $view->code);
- $main .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $main .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " return items";
- $main .= PHP_EOL . $this->_t(2) . "return \$items;";
+ $main .= PHP_EOL . Indent::_(2) . "return \$items;";
$type
= 'mixed An array of objects on success, false on failure.';
}
@@ -4169,115 +4103,115 @@ class Interpretation extends Fields
{
// build uikit get method
$ukit = array();
- $ukit[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $ukit[] = $this->_t(1) . " * UIKIT Component Classes";
- $ukit[] = $this->_t(1) . " **/";
- $ukit[] = $this->_t(1) . "public static \$uk_components = array(";
- $ukit[] = $this->_t(3) . "'data-uk-grid' => array(";
- $ukit[] = $this->_t(4) . "'grid' ),";
- $ukit[] = $this->_t(3) . "'uk-accordion' => array(";
- $ukit[] = $this->_t(4) . "'accordion' ),";
- $ukit[] = $this->_t(3) . "'uk-autocomplete' => array(";
- $ukit[] = $this->_t(4) . "'autocomplete' ),";
- $ukit[] = $this->_t(3) . "'data-uk-datepicker' => array(";
- $ukit[] = $this->_t(4) . "'datepicker' ),";
- $ukit[] = $this->_t(3) . "'uk-form-password' => array(";
- $ukit[] = $this->_t(4) . "'form-password' ),";
- $ukit[] = $this->_t(3) . "'uk-form-select' => array(";
- $ukit[] = $this->_t(4) . "'form-select' ),";
- $ukit[] = $this->_t(3) . "'data-uk-htmleditor' => array(";
- $ukit[] = $this->_t(4) . "'htmleditor' ),";
- $ukit[] = $this->_t(3) . "'data-uk-lightbox' => array(";
- $ukit[] = $this->_t(4) . "'lightbox' ),";
- $ukit[] = $this->_t(3) . "'uk-nestable' => array(";
- $ukit[] = $this->_t(4) . "'nestable' ),";
- $ukit[] = $this->_t(3) . "'UIkit.notify' => array(";
- $ukit[] = $this->_t(4) . "'notify' ),";
- $ukit[] = $this->_t(3) . "'data-uk-parallax' => array(";
- $ukit[] = $this->_t(4) . "'parallax' ),";
- $ukit[] = $this->_t(3) . "'uk-search' => array(";
- $ukit[] = $this->_t(4) . "'search' ),";
- $ukit[] = $this->_t(3) . "'uk-slider' => array(";
- $ukit[] = $this->_t(4) . "'slider' ),";
- $ukit[] = $this->_t(3) . "'uk-slideset' => array(";
- $ukit[] = $this->_t(4) . "'slideset' ),";
- $ukit[] = $this->_t(3) . "'uk-slideshow' => array(";
- $ukit[] = $this->_t(4) . "'slideshow',";
- $ukit[] = $this->_t(4) . "'slideshow-fx' ),";
- $ukit[] = $this->_t(3) . "'uk-sortable' => array(";
- $ukit[] = $this->_t(4) . "'sortable' ),";
- $ukit[] = $this->_t(3) . "'data-uk-sticky' => array(";
- $ukit[] = $this->_t(4) . "'sticky' ),";
- $ukit[] = $this->_t(3) . "'data-uk-timepicker' => array(";
- $ukit[] = $this->_t(4) . "'timepicker' ),";
- $ukit[] = $this->_t(3) . "'data-uk-tooltip' => array(";
- $ukit[] = $this->_t(4) . "'tooltip' ),";
- $ukit[] = $this->_t(3) . "'uk-placeholder' => array(";
- $ukit[] = $this->_t(4) . "'placeholder' ),";
- $ukit[] = $this->_t(3) . "'uk-dotnav' => array(";
- $ukit[] = $this->_t(4) . "'dotnav' ),";
- $ukit[] = $this->_t(3) . "'uk-slidenav' => array(";
- $ukit[] = $this->_t(4) . "'slidenav' ),";
- $ukit[] = $this->_t(3) . "'uk-form' => array(";
- $ukit[] = $this->_t(4) . "'form-advanced' ),";
- $ukit[] = $this->_t(3) . "'uk-progress' => array(";
- $ukit[] = $this->_t(4) . "'progress' ),";
- $ukit[] = $this->_t(3) . "'upload-drop' => array(";
- $ukit[] = $this->_t(4) . "'upload', 'form-file' )";
- $ukit[] = $this->_t(3) . ");";
- $ukit[] = PHP_EOL . $this->_t(1) . "/**";
- $ukit[] = $this->_t(1) . " * Add UIKIT Components";
- $ukit[] = $this->_t(1) . " **/";
- $ukit[] = $this->_t(1) . "public static \$uikit = false;";
+ $ukit[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $ukit[] = Indent::_(1) . " * UIKIT Component Classes";
+ $ukit[] = Indent::_(1) . " **/";
+ $ukit[] = Indent::_(1) . "public static \$uk_components = array(";
+ $ukit[] = Indent::_(3) . "'data-uk-grid' => array(";
+ $ukit[] = Indent::_(4) . "'grid' ),";
+ $ukit[] = Indent::_(3) . "'uk-accordion' => array(";
+ $ukit[] = Indent::_(4) . "'accordion' ),";
+ $ukit[] = Indent::_(3) . "'uk-autocomplete' => array(";
+ $ukit[] = Indent::_(4) . "'autocomplete' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-datepicker' => array(";
+ $ukit[] = Indent::_(4) . "'datepicker' ),";
+ $ukit[] = Indent::_(3) . "'uk-form-password' => array(";
+ $ukit[] = Indent::_(4) . "'form-password' ),";
+ $ukit[] = Indent::_(3) . "'uk-form-select' => array(";
+ $ukit[] = Indent::_(4) . "'form-select' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-htmleditor' => array(";
+ $ukit[] = Indent::_(4) . "'htmleditor' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-lightbox' => array(";
+ $ukit[] = Indent::_(4) . "'lightbox' ),";
+ $ukit[] = Indent::_(3) . "'uk-nestable' => array(";
+ $ukit[] = Indent::_(4) . "'nestable' ),";
+ $ukit[] = Indent::_(3) . "'UIkit.notify' => array(";
+ $ukit[] = Indent::_(4) . "'notify' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-parallax' => array(";
+ $ukit[] = Indent::_(4) . "'parallax' ),";
+ $ukit[] = Indent::_(3) . "'uk-search' => array(";
+ $ukit[] = Indent::_(4) . "'search' ),";
+ $ukit[] = Indent::_(3) . "'uk-slider' => array(";
+ $ukit[] = Indent::_(4) . "'slider' ),";
+ $ukit[] = Indent::_(3) . "'uk-slideset' => array(";
+ $ukit[] = Indent::_(4) . "'slideset' ),";
+ $ukit[] = Indent::_(3) . "'uk-slideshow' => array(";
+ $ukit[] = Indent::_(4) . "'slideshow',";
+ $ukit[] = Indent::_(4) . "'slideshow-fx' ),";
+ $ukit[] = Indent::_(3) . "'uk-sortable' => array(";
+ $ukit[] = Indent::_(4) . "'sortable' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-sticky' => array(";
+ $ukit[] = Indent::_(4) . "'sticky' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-timepicker' => array(";
+ $ukit[] = Indent::_(4) . "'timepicker' ),";
+ $ukit[] = Indent::_(3) . "'data-uk-tooltip' => array(";
+ $ukit[] = Indent::_(4) . "'tooltip' ),";
+ $ukit[] = Indent::_(3) . "'uk-placeholder' => array(";
+ $ukit[] = Indent::_(4) . "'placeholder' ),";
+ $ukit[] = Indent::_(3) . "'uk-dotnav' => array(";
+ $ukit[] = Indent::_(4) . "'dotnav' ),";
+ $ukit[] = Indent::_(3) . "'uk-slidenav' => array(";
+ $ukit[] = Indent::_(4) . "'slidenav' ),";
+ $ukit[] = Indent::_(3) . "'uk-form' => array(";
+ $ukit[] = Indent::_(4) . "'form-advanced' ),";
+ $ukit[] = Indent::_(3) . "'uk-progress' => array(";
+ $ukit[] = Indent::_(4) . "'progress' ),";
+ $ukit[] = Indent::_(3) . "'upload-drop' => array(";
+ $ukit[] = Indent::_(4) . "'upload', 'form-file' )";
+ $ukit[] = Indent::_(3) . ");";
+ $ukit[] = PHP_EOL . Indent::_(1) . "/**";
+ $ukit[] = Indent::_(1) . " * Add UIKIT Components";
+ $ukit[] = Indent::_(1) . " **/";
+ $ukit[] = Indent::_(1) . "public static \$uikit = false;";
$ukit[] = "";
- $ukit[] = $this->_t(1) . "/**";
- $ukit[] = $this->_t(1) . " * Get UIKIT Components";
- $ukit[] = $this->_t(1) . " **/";
- $ukit[] = $this->_t(1)
+ $ukit[] = Indent::_(1) . "/**";
+ $ukit[] = Indent::_(1) . " * Get UIKIT Components";
+ $ukit[] = Indent::_(1) . " **/";
+ $ukit[] = Indent::_(1)
. "public static function getUikitComp(\$content,\$classes = array())";
- $ukit[] = $this->_t(1) . "{";
- $ukit[] = $this->_t(2)
+ $ukit[] = Indent::_(1) . "{";
+ $ukit[] = Indent::_(2)
. "if (strpos(\$content,'class=\"uk-') !== false)";
- $ukit[] = $this->_t(2) . "{";
- $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " reset";
- $ukit[] = $this->_t(3) . "\$temp = array();";
- $ukit[] = $this->_t(3)
+ $ukit[] = Indent::_(2) . "{";
+ $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " reset";
+ $ukit[] = Indent::_(3) . "\$temp = array();";
+ $ukit[] = Indent::_(3)
. "foreach (self::\$uk_components as \$looking => \$add)";
- $ukit[] = $this->_t(3) . "{";
- $ukit[] = $this->_t(4)
+ $ukit[] = Indent::_(3) . "{";
+ $ukit[] = Indent::_(4)
. "if (strpos(\$content,\$looking) !== false)";
- $ukit[] = $this->_t(4) . "{";
- $ukit[] = $this->_t(5) . "\$temp[] = \$looking;";
- $ukit[] = $this->_t(4) . "}";
- $ukit[] = $this->_t(3) . "}";
- $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $ukit[] = Indent::_(4) . "{";
+ $ukit[] = Indent::_(5) . "\$temp[] = \$looking;";
+ $ukit[] = Indent::_(4) . "}";
+ $ukit[] = Indent::_(3) . "}";
+ $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " make sure uikit is loaded to config";
- $ukit[] = $this->_t(3)
+ $ukit[] = Indent::_(3)
. "if (strpos(\$content,'class=\"uk-') !== false)";
- $ukit[] = $this->_t(3) . "{";
- $ukit[] = $this->_t(4) . "self::\$uikit = true;";
- $ukit[] = $this->_t(3) . "}";
- $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $ukit[] = Indent::_(3) . "{";
+ $ukit[] = Indent::_(4) . "self::\$uikit = true;";
+ $ukit[] = Indent::_(3) . "}";
+ $ukit[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " sorter";
- $ukit[] = $this->_t(3) . "if (self::checkArray(\$temp))";
- $ukit[] = $this->_t(3) . "{";
- $ukit[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $ukit[] = Indent::_(3) . "if (self::checkArray(\$temp))";
+ $ukit[] = Indent::_(3) . "{";
+ $ukit[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " merger";
- $ukit[] = $this->_t(4) . "if (self::checkArray(\$classes))";
- $ukit[] = $this->_t(4) . "{";
- $ukit[] = $this->_t(5)
+ $ukit[] = Indent::_(4) . "if (self::checkArray(\$classes))";
+ $ukit[] = Indent::_(4) . "{";
+ $ukit[] = Indent::_(5)
. "\$newTemp = array_merge(\$temp,\$classes);";
- $ukit[] = $this->_t(5) . "\$temp = array_unique(\$newTemp);";
- $ukit[] = $this->_t(4) . "}";
- $ukit[] = $this->_t(4) . "return \$temp;";
- $ukit[] = $this->_t(3) . "}";
- $ukit[] = $this->_t(2) . "}";
- $ukit[] = $this->_t(2) . "if (self::checkArray(\$classes))";
- $ukit[] = $this->_t(2) . "{";
- $ukit[] = $this->_t(3) . "return \$classes;";
- $ukit[] = $this->_t(2) . "}";
- $ukit[] = $this->_t(2) . "return false;";
- $ukit[] = $this->_t(1) . "}";
+ $ukit[] = Indent::_(5) . "\$temp = array_unique(\$newTemp);";
+ $ukit[] = Indent::_(4) . "}";
+ $ukit[] = Indent::_(4) . "return \$temp;";
+ $ukit[] = Indent::_(3) . "}";
+ $ukit[] = Indent::_(2) . "}";
+ $ukit[] = Indent::_(2) . "if (self::checkArray(\$classes))";
+ $ukit[] = Indent::_(2) . "{";
+ $ukit[] = Indent::_(3) . "return \$classes;";
+ $ukit[] = Indent::_(2) . "}";
+ $ukit[] = Indent::_(2) . "return false;";
+ $ukit[] = Indent::_(1) . "}";
// return the help methods
return implode(PHP_EOL, $ukit);
@@ -4293,26 +4227,25 @@ class Interpretation extends Fields
if (2 == $this->uikit || 1 == $this->uikit)
{
// build uikit get method
- $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $method .= PHP_EOL . $this->_t(1)
+ $method .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $method .= PHP_EOL . Indent::_(1)
. " * Get the uikit needed components";
- $method .= PHP_EOL . $this->_t(1) . " *";
- $method .= PHP_EOL . $this->_t(1)
+ $method .= PHP_EOL . Indent::_(1) . " *";
+ $method .= PHP_EOL . Indent::_(1)
. " * @return mixed An array of objects on success.";
- $method .= PHP_EOL . $this->_t(1) . " *";
- $method .= PHP_EOL . $this->_t(1) . " */";
- $method .= PHP_EOL . $this->_t(1)
+ $method .= PHP_EOL . Indent::_(1) . " *";
+ $method .= PHP_EOL . Indent::_(1) . " */";
+ $method .= PHP_EOL . Indent::_(1)
. "public function getUikitComp()";
- $method .= PHP_EOL . $this->_t(1) . "{";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(1) . "{";
+ $method .= PHP_EOL . Indent::_(2)
. "if (isset(\$this->uikitComp) && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$this->uikitComp))";
- $method .= PHP_EOL . $this->_t(2) . "{";
- $method .= PHP_EOL . $this->_t(3) . "return \$this->uikitComp;";
- $method .= PHP_EOL . $this->_t(2) . "}";
- $method .= PHP_EOL . $this->_t(2) . "return false;";
- $method .= PHP_EOL . $this->_t(1) . "}";
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$this->uikitComp))";
+ $method .= PHP_EOL . Indent::_(2) . "{";
+ $method .= PHP_EOL . Indent::_(3) . "return \$this->uikitComp;";
+ $method .= PHP_EOL . Indent::_(2) . "}";
+ $method .= PHP_EOL . Indent::_(2) . "return false;";
+ $method .= PHP_EOL . Indent::_(1) . "}";
}
return $method;
@@ -4324,16 +4257,16 @@ class Interpretation extends Fields
if (StringHelper::check($body))
{
// build custom method
- $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $method .= PHP_EOL . $this->_t(1) . " * Custom Method";
- $method .= PHP_EOL . $this->_t(1) . " *";
- $method .= PHP_EOL . $this->_t(1) . " * @return " . $type;
- $method .= PHP_EOL . $this->_t(1) . " *";
- $method .= PHP_EOL . $this->_t(1) . " */";
- $method .= PHP_EOL . $this->_t(1) . "public function " . $nAme
+ $method .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $method .= PHP_EOL . Indent::_(1) . " * Custom Method";
+ $method .= PHP_EOL . Indent::_(1) . " *";
+ $method .= PHP_EOL . Indent::_(1) . " * @return " . $type;
+ $method .= PHP_EOL . Indent::_(1) . " *";
+ $method .= PHP_EOL . Indent::_(1) . " */";
+ $method .= PHP_EOL . Indent::_(1) . "public function " . $nAme
. "()";
- $method .= PHP_EOL . $this->_t(1) . "{" . $body;
- $method .= PHP_EOL . $this->_t(1) . "}";
+ $method .= PHP_EOL . Indent::_(1) . "{" . $body;
+ $method .= PHP_EOL . Indent::_(1) . "}";
}
return $method;
@@ -4362,87 +4295,84 @@ class Interpretation extends Fields
)) !== false)
{
// build custom method
- $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $methods .= PHP_EOL . $this->_t(1)
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $methods .= PHP_EOL . Indent::_(1)
. " * Method to get an array of " . $default['name']
. " Objects.";
- $methods .= PHP_EOL . $this->_t(1) . " *";
- $methods .= PHP_EOL . $this->_t(1)
+ $methods .= PHP_EOL . Indent::_(1) . " *";
+ $methods .= PHP_EOL . Indent::_(1)
. " * @return mixed An array of "
. $default['name']
. " Objects on success, false on failure.";
- $methods .= PHP_EOL . $this->_t(1) . " *";
- $methods .= PHP_EOL . $this->_t(1) . " */";
- $methods .= PHP_EOL . $this->_t(1)
+ $methods .= PHP_EOL . Indent::_(1) . " *";
+ $methods .= PHP_EOL . Indent::_(1) . " */";
+ $methods .= PHP_EOL . Indent::_(1)
. "public function get" . $default['methodName']
. "(\$" . $default['on_field'] . ")";
- $methods .= PHP_EOL . $this->_t(1) . "{" . $this->hhh
- . "CRYPT" . $this->hhh;
- $methods .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $methods .= PHP_EOL . Indent::_(1) . "{" . Placefix::_h("CRYPT") ;
+ $methods .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Get a db connection.";
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "\$db = JFactory::getDbo();";
- $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Create a new query object.";
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "\$query = \$db->getQuery(true);";
- $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Get from "
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Get from "
. $get['selection']['table'] . " as "
. $default['as'];
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. $get['selection']['select'];
- $methods .= PHP_EOL . $this->_t(2) . '$query->from('
+ $methods .= PHP_EOL . Indent::_(2) . '$query->from('
. $get['selection']['from'] . ');';
// set the string
if ($get['operator'] === 'IN'
|| $get['operator'] === 'NOT IN')
{
- $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Check if \$"
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Check if \$"
. $default['on_field']
. " is an array with values.";
- $methods .= PHP_EOL . $this->_t(2) . "\$array = ("
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ $methods .= PHP_EOL . Indent::_(2) . "\$array = ("
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkJson(\$"
. $default['on_field']
. ", true)) ? json_decode(\$"
. $default['on_field'] . ",true) : \$"
. $default['on_field'] . ";";
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "if (isset(\$array) && "
- . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$array, true))";
- $methods .= PHP_EOL . $this->_t(2) . "{";
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(2) . "{";
+ $methods .= PHP_EOL . Indent::_(3)
. "\$query->where('" . $get['join_field'] . " "
. $get['operator']
. " (' . implode(',', \$array) . ')');";
- $methods .= PHP_EOL . $this->_t(2) . "}";
- $methods .= PHP_EOL . $this->_t(2) . "else";
- $methods .= PHP_EOL . $this->_t(2) . "{";
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(2) . "}";
+ $methods .= PHP_EOL . Indent::_(2) . "else";
+ $methods .= PHP_EOL . Indent::_(2) . "{";
+ $methods .= PHP_EOL . Indent::_(3)
. "return false;";
- $methods .= PHP_EOL . $this->_t(2) . "}";
+ $methods .= PHP_EOL . Indent::_(2) . "}";
}
else
{
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "\$query->where('" . $get['join_field'] . " "
. $get['operator'] . " ' . \$db->quote(\$"
. $default['on_field'] . "));";
}
// check if other queries should be loaded
$queryChecker
- = (isset($this->otherQuery[$this->target][$default['code']][$default['as']])
+ = (isset($this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherQuery[$this->target][$default['code']][$default['as']]
+ $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
- ? $this->otherQuery[$this->target][$default['code']][$default['as']]
+ ? $this->otherQuery[CFactory::_('Config')->build_target][$default['code']][$default['as']]
: '';
if (ArrayHelper::check($queryChecker))
{
@@ -4452,13 +4382,13 @@ class Interpretation extends Fields
}
}
// add any other filter that was set
- if (isset($this->otherFilter[$this->target][$default['code']][$default['as']])
+ if (isset($this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherFilter[$this->target][$default['code']][$default['as']]
+ $this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
{
foreach (
- $this->otherFilter[$this->target][$default['code']][$default['as']]
+ $this->otherFilter[CFactory::_('Config')->build_target][$default['code']][$default['as']]
as $field => $string
)
{
@@ -4466,13 +4396,13 @@ class Interpretation extends Fields
}
}
// add any other where that was set
- if (isset($this->otherWhere[$this->target][$default['code']][$default['as']])
+ if (isset($this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherWhere[$this->target][$default['code']][$default['as']]
+ $this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
{
foreach (
- $this->otherWhere[$this->target][$default['code']][$default['as']]
+ $this->otherWhere[CFactory::_('Config')->build_target][$default['code']][$default['as']]
as $field => $string
)
{
@@ -4480,13 +4410,13 @@ class Interpretation extends Fields
}
}
// add any other order that was set
- if (isset($this->otherOrder[$this->target][$default['code']][$default['as']])
+ if (isset($this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherOrder[$this->target][$default['code']][$default['as']]
+ $this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
{
foreach (
- $this->otherOrder[$this->target][$default['code']][$default['as']]
+ $this->otherOrder[CFactory::_('Config')->build_target][$default['code']][$default['as']]
as $field => $string
)
{
@@ -4494,33 +4424,33 @@ class Interpretation extends Fields
}
}
// add any other grouping that was set
- if (isset($this->otherGroup[$this->target][$default['code']][$default['as']])
+ if (isset($this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherGroup[$this->target][$default['code']][$default['as']]
+ $this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
{
foreach (
- $this->otherGroup[$this->target][$default['code']][$default['as']]
+ $this->otherGroup[CFactory::_('Config')->build_target][$default['code']][$default['as']]
as $field => $string
)
{
$methods .= $string;
}
}
- $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Reset the query using our newly populated query object.";
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "\$db->setQuery(\$query);";
- $methods .= PHP_EOL . $this->_t(2) . "\$db->execute();";
- $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $methods .= PHP_EOL . Indent::_(2) . "\$db->execute();";
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " check if there was data returned";
- $methods .= PHP_EOL . $this->_t(2)
+ $methods .= PHP_EOL . Indent::_(2)
. "if (\$db->getNumRows())";
- $methods .= PHP_EOL . $this->_t(2) . "{";
+ $methods .= PHP_EOL . Indent::_(2) . "{";
// set dispatcher placeholder
- $methods .= $this->hhh . "DISPATCHER" . $this->hhh;
+ $methods .= Placefix::_h("DISPATCHER") ;
// set decoding of needed fields
if (isset($this->siteFieldData['decode'][$default['code']][$get['key']][$default['as']]))
{
@@ -4528,10 +4458,10 @@ class Interpretation extends Fields
= $this->siteFieldData['decode'][$default['code']][$get['key']][$default['as']];
}
// also filter fields if needed
- if (isset($this->siteFieldDecodeFilter[$this->target][$default['code']][$get['key']][$default['as']]))
+ if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$default['code']][$get['key']][$default['as']]))
{
$decodeFilter
- = $this->siteFieldDecodeFilter[$this->target][$default['code']][$get['key']][$default['as']];
+ = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$default['code']][$get['key']][$default['as']];
}
// set uikit checkers on needed fields
if (isset($this->siteFieldData['uikit'][$default['code']][$get['key']][$default['as']]))
@@ -4546,16 +4476,14 @@ class Interpretation extends Fields
= $this->siteFieldData['textareas'][$default['code']][$get['key']][$default['as']];
}
// set joined values
- $placeholders = array($this->hhh . 'TAB'
- . $this->hhh => $this->_t(2),
- $this->hhh . 'STRING'
- . $this->hhh => '$item');
+ $placeholders = array(Placefix::_h('TAB') => Indent::_(2),
+ Placefix::_h('STRING') => '$item');
$joinedChecker
- = (isset($this->otherJoin[$this->target][$default['code']][$default['as']])
+ = (isset($this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']])
&& ArrayHelper::check(
- $this->otherJoin[$this->target][$default['code']][$default['as']]
+ $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']]
))
- ? $this->otherJoin[$this->target][$default['code']][$default['as']]
+ ? $this->otherJoin[CFactory::_('Config')->build_target][$default['code']][$default['as']]
: '';
if ((isset($decodeChecker)
&& ArrayHelper::check(
@@ -4586,7 +4514,7 @@ class Interpretation extends Fields
// also filter fields if needed
$decoder = $this->setCustomViewFieldDecode(
$get, $decodeChecker, '$item',
- $default['code'], $this->_t(2)
+ $default['code'], Indent::_(2)
);
}
$decoder_filter = '';
@@ -4598,7 +4526,7 @@ class Interpretation extends Fields
$decoder_filter
= $this->setCustomViewFieldDecodeFilter(
$get, $decodeFilter, '$item', '$items[$nr]',
- $default['code'], $this->_t(2)
+ $default['code'], Indent::_(2)
);
}
$contentprepare = '';
@@ -4610,7 +4538,7 @@ class Interpretation extends Fields
$contentprepare
= $this->setCustomViewFieldonContentPrepareChecker(
$get, $contentprepareChecker, '$item',
- $default['code'], $this->_t(2)
+ $default['code'], Indent::_(2)
);
}
$uikit = '';
@@ -4621,7 +4549,7 @@ class Interpretation extends Fields
{
$uikit = $this->setCustomViewFieldUikitChecker(
$get, $uikitChecker, '$item',
- $default['code'], $this->_t(2)
+ $default['code'], Indent::_(2)
);
}
$joine = '';
@@ -4631,7 +4559,7 @@ class Interpretation extends Fields
{
foreach ($joinedChecker as $joinedString)
{
- $joine .= $this->setPlaceholders(
+ $joine .= CFactory::_('Placeholder')->update(
$joinedString, $placeholders
);
}
@@ -4646,14 +4574,14 @@ class Interpretation extends Fields
)
|| StringHelper::check($joine))
{
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(3)
. "\$items = \$db->loadObjectList();";
- $methods .= PHP_EOL . PHP_EOL . $this->_t(3)
- . "//" . $this->setLine(__LINE__)
+ $methods .= PHP_EOL . PHP_EOL . Indent::_(3)
+ . "//" . Line::_(__Line__, __Class__)
. " Convert the parameter fields into objects.";
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(3)
. "foreach (\$items as \$nr => &\$item)";
- $methods .= PHP_EOL . $this->_t(3) . "{";
+ $methods .= PHP_EOL . Indent::_(3) . "{";
if (StringHelper::check(
$decoder
))
@@ -4680,28 +4608,27 @@ class Interpretation extends Fields
{
$methods .= $joine;
}
- $methods .= PHP_EOL . $this->_t(3) . "}";
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(3) . "}";
+ $methods .= PHP_EOL . Indent::_(3)
. "return \$items;";
}
else
{
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(3)
. "return \$db->loadObjectList();";
}
}
else
{
- $methods .= PHP_EOL . $this->_t(3)
+ $methods .= PHP_EOL . Indent::_(3)
. "return \$db->loadObjectList();";
}
- $methods .= PHP_EOL . $this->_t(2) . "}";
- $methods .= PHP_EOL . $this->_t(2) . "return false;";
- $methods .= PHP_EOL . $this->_t(1) . "}";
+ $methods .= PHP_EOL . Indent::_(2) . "}";
+ $methods .= PHP_EOL . Indent::_(2) . "return false;";
+ $methods .= PHP_EOL . Indent::_(1) . "}";
// set the script if it was found
- $Component = $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh];
+ $Component = $this->fileContentStatic[Placefix::_h('Component')];
$script = '';
foreach ($this->cryptionTypes as $cryptionType)
{
@@ -4710,17 +4637,17 @@ class Interpretation extends Fields
{
if ('expert' !== $cryptionType)
{
- $script .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Get the "
+ $script .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Get the "
. $cryptionType . " encryption.";
- $script .= PHP_EOL . $this->_t(2) . "\$"
+ $script .= PHP_EOL . Indent::_(2) . "\$"
. $cryptionType . "key = " . $Component
. "Helper::getCryptKey('"
. $cryptionType . "');";
- $script .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $script .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Get the encryption object.";
- $script .= PHP_EOL . $this->_t(2) . "\$"
+ $script .= PHP_EOL . Indent::_(2) . "\$"
. $cryptionType
. " = new FOFEncryptAes(\$"
. $cryptionType . "key);" . PHP_EOL;
@@ -4740,16 +4667,16 @@ class Interpretation extends Fields
as $block
)
{
- $script .= PHP_EOL . $this->_t(2)
+ $script .= PHP_EOL . Indent::_(2)
. implode(
- PHP_EOL . $this->_t(2), $block
+ PHP_EOL . Indent::_(2), $block
);
}
}
}
}
$methods = str_replace(
- $this->hhh . 'CRYPT' . $this->hhh, $script, $methods
+ Placefix::_h('CRYPT'), $script, $methods
);
}
}
@@ -4757,20 +4684,19 @@ class Interpretation extends Fields
if (StringHelper::check($methods))
{
$methods = str_replace(
- $this->hhh . 'CRYPT' . $this->hhh, '', $methods
+ Placefix::_h('CRYPT'), '', $methods
);
}
}
}
// only update if dispacher placholder is found
- if (strpos($methods, $this->hhh . 'DISPATCHER' . $this->hhh) !== false)
+ if (strpos($methods, Placefix::_h('DISPATCHER')) !== false)
{
// check if the dispather should be added
if (!isset($this->JEventDispatcher)
|| !ArrayHelper::check($this->JEventDispatcher))
{
- $this->JEventDispatcher = array($this->hhh . 'DISPATCHER'
- . $this->hhh => '');
+ $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => '');
}
$methods = str_replace(
array_keys($this->JEventDispatcher),
@@ -4834,34 +4760,34 @@ class Interpretation extends Fields
{
if ($get->pagination == 1)
{
- $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $getItem = PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Get a db connection.";
}
else
{
- $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $getItem = PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
)
. " Make sure all records load, since no pagination allowed.";
- $getItem .= PHP_EOL . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(2)
. "\$this->setState('list.limit', 0);";
- $getItem .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $getItem .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Get a db connection.";
}
- $getItem .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();";
- $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Create a new query object.";
- $getItem .= PHP_EOL . $this->_t(2)
+ $getItem .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDbo();";
+ $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Create a new query object.";
+ $getItem .= PHP_EOL . Indent::_(2)
. "\$query = \$db->getQuery(true);";
// set main get query
$getItem .= $this->setCustomViewQuery($get->main_get, $code);
// check if there is any custom script
$getItem .= $this->getCustomScriptBuilder(
- $this->target . '_php_getlistquery', $code, '',
- PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ CFactory::_('Config')->build_target . '_php_getlistquery', $code, '',
+ PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filtering.", true
);
// setup filters
@@ -4887,15 +4813,15 @@ class Interpretation extends Fields
if ($return)
{
// return the query object
- $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " return the query object"
- . PHP_EOL . $this->_t(2) . "return \$query;";
+ $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " return the query object"
+ . PHP_EOL . Indent::_(2) . "return \$query;";
}
return $getItem;
}
- return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ return PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. "add your custom code here.";
}
@@ -4914,24 +4840,23 @@ class Interpretation extends Fields
$this->siteDecrypt[$cryptionType][$code] = false;
}
// set the component name
- $Component = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh];
+ $Component = $this->fileContentStatic[Placefix::_h('Component')];
// start load the get item
if (ObjectHelper::check($get))
{
- $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $getItem .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " Insure all item fields are adapted where needed.";
- $getItem .= PHP_EOL . $this->_t(2) . "if (" . $Component
+ $getItem .= PHP_EOL . Indent::_(2) . "if (" . $Component
. "Helper::checkArray(\$items))";
- $getItem .= PHP_EOL . $this->_t(2) . "{";
- $getItem .= $this->hhh . "DISPATCHER" . $this->hhh;
- $getItem .= PHP_EOL . $this->_t(3)
+ $getItem .= PHP_EOL . Indent::_(2) . "{";
+ $getItem .= Placefix::_h("DISPATCHER") ;
+ $getItem .= PHP_EOL . Indent::_(3)
. "foreach (\$items as \$nr => &\$item)";
- $getItem .= PHP_EOL . $this->_t(3) . "{";
- $getItem .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $getItem .= PHP_EOL . Indent::_(3) . "{";
+ $getItem .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Always create a slug for sef URL's";
- $getItem .= PHP_EOL . $this->_t(4)
+ $getItem .= PHP_EOL . Indent::_(4)
. "\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;";
if (isset($get->main_get)
&& ArrayHelper::check(
@@ -4950,20 +4875,20 @@ class Interpretation extends Fields
// set decoding of needed fields
$getItem .= $this->setCustomViewFieldDecode(
$main_get, $decodeChecker, "\$item", $code,
- $this->_t(2)
+ Indent::_(2)
);
}
}
// also filter fields if needed
- if (isset($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]))
+ if (isset($this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']]))
{
$decodeFilter
- = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']];
+ = $this->siteFieldDecodeFilter[CFactory::_('Config')->build_target][$code][$main_get['key']][$main_get['as']];
if (ArrayHelper::check($decodeFilter))
{
$getItem .= $this->setCustomViewFieldDecodeFilter(
$main_get, $decodeFilter, "\$item",
- '$items[$nr]', $code, $this->_t(2)
+ '$items[$nr]', $code, Indent::_(2)
);
}
}
@@ -4978,7 +4903,7 @@ class Interpretation extends Fields
// set contentprepare checkers on needed fields
$getItem .= $this->setCustomViewFieldonContentPrepareChecker(
$main_get, $contentprepareChecker, "\$item",
- $code, $this->_t(2)
+ $code, Indent::_(2)
);
}
}
@@ -4991,7 +4916,7 @@ class Interpretation extends Fields
// set uikit checkers on needed fields
$getItem .= $this->setCustomViewFieldUikitChecker(
$main_get, $uikitChecker, "\$item", $code,
- $this->_t(2)
+ Indent::_(2)
);
}
}
@@ -4999,7 +4924,7 @@ class Interpretation extends Fields
}
}
// only update if dispacher placholder is found
- if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh)
+ if (strpos($getItem, Placefix::_h('DISPATCHER'))
!== false)
{
// check if the dispather should be added
@@ -5008,8 +4933,7 @@ class Interpretation extends Fields
$this->JEventDispatcher
))
{
- $this->JEventDispatcher = array($this->hhh . 'DISPATCHER'
- . $this->hhh => '');
+ $this->JEventDispatcher = array(Placefix::_h('DISPATCHER') => '');
}
$getItem = str_replace(
array_keys($this->JEventDispatcher),
@@ -5018,11 +4942,11 @@ class Interpretation extends Fields
}
// setup Globals
$getItem .= $this->setCustomViewGlobals(
- $get->global, '$item', $asBucket, $this->_t(2)
+ $get->global, '$item', $asBucket, Indent::_(2)
);
// setup the custom gets that returns multipal values
$getItem .= $this->setCustomViewCustomJoin(
- $get->custom_get, "\$item", $code, $asBucket, $this->_t(2)
+ $get->custom_get, "\$item", $code, $asBucket, Indent::_(2)
);
// set calculations
if ($get->addcalculation == 1)
@@ -5032,16 +4956,16 @@ class Interpretation extends Fields
);
if (ArrayHelper::check($get->php_calculation))
{
- $_tmp = PHP_EOL . $this->_t(4) . implode(
- PHP_EOL . $this->_t(4), $get->php_calculation
+ $_tmp = PHP_EOL . Indent::_(4) . implode(
+ PHP_EOL . Indent::_(4), $get->php_calculation
);
- $getItem .= $this->setPlaceholders(
- $_tmp, $this->placeholders
+ $getItem .= CFactory::_('Placeholder')->update(
+ $_tmp, CFactory::_('Placeholder')->active
);
}
}
- $getItem .= PHP_EOL . $this->_t(3) . "}";
- $getItem .= PHP_EOL . $this->_t(2) . "}";
+ $getItem .= PHP_EOL . Indent::_(3) . "}";
+ $getItem .= PHP_EOL . Indent::_(2) . "}";
// remove empty foreach
if (strlen($getItem) <= 100)
{
@@ -5057,16 +4981,16 @@ class Interpretation extends Fields
{
if ('expert' !== $cryptionType)
{
- $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Get the " . $cryptionType
+ $script .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Get the " . $cryptionType
. " encryption.";
- $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType
+ $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType
. "key = " . $Component . "Helper::getCryptKey('"
. $cryptionType . "');";
- $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $script .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Get the encryption object.";
- $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType
+ $script .= PHP_EOL . Indent::_(2) . "\$" . $cryptionType
. " = new FOFEncryptAes(\$" . $cryptionType . "key);";
}
elseif (isset(
@@ -5082,8 +5006,8 @@ class Interpretation extends Fields
. 'FieldModelInitiator'}[$code]['get'] as $block
)
{
- $script .= PHP_EOL . $this->_t(2) . implode(
- PHP_EOL . $this->_t(2), $block
+ $script .= PHP_EOL . Indent::_(2) . implode(
+ PHP_EOL . Indent::_(2), $block
);
}
}
@@ -5108,30 +5032,30 @@ class Interpretation extends Fields
if (isset($this->adminFilterType[$nameListCode])
&& $this->adminFilterType[$nameListCode] == 2)
{
- $script .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(
- __LINE__
+ $script .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Load the filter form from xml.";
- $script .= PHP_EOL . $this->_t(2) . "\$this->filterForm "
+ $script .= PHP_EOL . Indent::_(2) . "\$this->filterForm "
. "= \$this->get('FilterForm');";
- $script .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(
- __LINE__
+ $script .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Load the active filters.";
- $script .= PHP_EOL . $this->_t(2) . "\$this->activeFilters "
+ $script .= PHP_EOL . Indent::_(2) . "\$this->activeFilters "
. "= \$this->get('ActiveFilters');";
}
// get the default ordering values
$default_ordering = $this->getListViewDefaultOrdering($nameListCode);
// now add the default ordering
- $script .= PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(
- __LINE__
+ $script .= PHP_EOL . Indent::_(2) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Add the list ordering clause.";
- $script .= PHP_EOL . $this->_t(2)
+ $script .= PHP_EOL . Indent::_(2)
. "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', '"
. $default_ordering['name'] . "'));";
- $script .= PHP_EOL . $this->_t(2)
+ $script .= PHP_EOL . Indent::_(2)
. "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', '"
. $default_ordering['direction'] . "'));";
@@ -5152,33 +5076,33 @@ class Interpretation extends Fields
))
{
// load the dispatcher
- $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Initialise dispatcher.";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "\$dispatcher = JEventDispatcher::getInstance();";
}
if ($view['settings']->main_get->gettype == 1)
{
// for single views
- $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Initialise variables.";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "\$this->item = \$this->get('Item');";
}
elseif ($view['settings']->main_get->gettype == 2)
{
// for list views
- $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Initialise variables.";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "\$this->items = \$this->get('Items');";
// only add if pagination is requered
if ($view['settings']->main_get->pagination == 1)
{
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "\$this->pagination = \$this->get('Pagination');";
}
}
@@ -5193,7 +5117,7 @@ class Interpretation extends Fields
$custom_get_name = str_replace(
'get', '', $custom_get->getcustom
);
- $method .= PHP_EOL . $this->_t(2) . "\$this->"
+ $method .= PHP_EOL . Indent::_(2) . "\$this->"
. StringHelper::safe($custom_get_name)
. " = \$this->get('" . $custom_get_name . "');";
}
@@ -5208,79 +5132,77 @@ class Interpretation extends Fields
$view['settings']->php_jview_display
))
{
- $_tmp = PHP_EOL . $this->_t(2) . implode(
- PHP_EOL . $this->_t(2),
+ $_tmp = PHP_EOL . Indent::_(2) . implode(
+ PHP_EOL . Indent::_(2),
$view['settings']->php_jview_display
);
- $method .= $this->setPlaceholders(
- $_tmp, $this->placeholders
+ $method .= CFactory::_('Placeholder')->update(
+ $_tmp, CFactory::_('Placeholder')->active
);
}
}
- if ('site' === $this->target)
+ if ('site' === CFactory::_('Config')->build_target)
{
- $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Set the toolbar";
- $method .= PHP_EOL . $this->_t(2) . "\$this->addToolBar();";
- $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " set the document";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Set the toolbar";
+ $method .= PHP_EOL . Indent::_(2) . "\$this->addToolBar();";
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " set the document";
+ $method .= PHP_EOL . Indent::_(2)
. "\$this->_prepareDocument();";
}
- elseif ('custom_admin' === $this->target)
+ elseif ('custom_admin' === CFactory::_('Config')->build_target)
{
- $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__)
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__)
. " We don't need toolbar in the modal window.";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "if (\$this->getLayout() !== 'modal')";
- $method .= PHP_EOL . $this->_t(2) . "{";
- $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(2) . "{";
+ $method .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " add the tool bar";
- $method .= PHP_EOL . $this->_t(3) . "\$this->addToolBar();";
- $method .= PHP_EOL . $this->_t(2) . "}";
- $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " set the document";
- $method .= PHP_EOL . $this->_t(2) . "\$this->setDocument();";
+ $method .= PHP_EOL . Indent::_(3) . "\$this->addToolBar();";
+ $method .= PHP_EOL . Indent::_(2) . "}";
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " set the document";
+ $method .= PHP_EOL . Indent::_(2) . "\$this->setDocument();";
}
- $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Check for errors.";
- $method .= PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . Indent::_(2)
. "if (count(\$errors = \$this->get('Errors')))";
- $method .= PHP_EOL . $this->_t(2) . "{";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(2) . "{";
+ $method .= PHP_EOL . Indent::_(3)
. "throw new Exception(implode(PHP_EOL, \$errors), 500);";
- $method .= PHP_EOL . $this->_t(2) . "}";
+ $method .= PHP_EOL . Indent::_(2) . "}";
// add events if needed
if ($view['settings']->main_get->gettype == 1
&& ArrayHelper::check(
$view['settings']->main_get->plugin_events
))
{
- $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Process the content plugins.";
- $method .= PHP_EOL . $this->_t(2) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkObject(\$this->item))";
- $method .= PHP_EOL . $this->_t(2) . "{";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(2) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$this->item))";
+ $method .= PHP_EOL . Indent::_(2) . "{";
+ $method .= PHP_EOL . Indent::_(3)
. "JPluginHelper::importPlugin('content');";
- $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Setup Event Object.";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(3)
. "\$this->item->event = new stdClass;";
- $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $method .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Check if item has params, or pass global params";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(3)
. "\$params = (isset(\$this->item->params) && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkJson(\$this->item->params)) ? json_decode(\$this->item->params) : \$this->params;";
// load the defaults
foreach (
@@ -5291,28 +5213,28 @@ class Interpretation extends Fields
if ('onContentPrepare' === $plugin_event)
{
// TODO the onContentPrepare already gets triggered on the fields of its relation
- // $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " onContentPrepare Event Trigger.";
- // $method .= PHP_EOL . $this->_t(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . Config::get('component_code_name') . ".article', &\$this->item, &\$this->params, 0));";
+ // $method .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " onContentPrepare Event Trigger.";
+ // $method .= PHP_EOL . Indent::_(2) . "\$dispatcher->trigger('onContentPrepare', array ('com_" . CFactory::_('Config')->component_code_name . ".article', &\$this->item, &\$this->params, 0));";
}
else
{
- $method .= PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__) . " " . $plugin_event
+ $method .= PHP_EOL . Indent::_(3) . "//"
+ . Line::_(__Line__, __Class__) . " " . $plugin_event
. " Event Trigger.";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(3)
. "\$results = \$dispatcher->trigger('"
. $plugin_event . "', array('com_"
- . Config::get('component_code_name') . "."
+ . CFactory::_('Config')->component_code_name . "."
. $view['settings']->context
. "', &\$this->item, &\$params, 0));";
- $method .= PHP_EOL . $this->_t(3)
+ $method .= PHP_EOL . Indent::_(3)
. '$this->item->event->' . $plugin_event
. ' = trim(implode("\n", $results));';
}
}
- $method .= PHP_EOL . $this->_t(2) . "}";
+ $method .= PHP_EOL . Indent::_(2) . "}";
}
- $method .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $method .= PHP_EOL . PHP_EOL . Indent::_(2)
. "parent::display(\$tpl);";
}
@@ -5322,190 +5244,186 @@ class Interpretation extends Fields
public function setPrepareDocument(&$view)
{
// fix just incase we missed it somewhere
- $tmp = $this->lang;
- if ('site' === $this->target)
+ $tmp = CFactory::_('Config')->lang_target;
+ if ('site' === CFactory::_('Config')->build_target)
{
- $this->lang = 'site';
+ CFactory::_('Config')->lang_target = 'site';
}
else
{
- $this->lang = 'admin';
+ CFactory::_('Config')->lang_target = 'admin';
}
// ensure correct target is set
- $TARGET = StringHelper::safe($this->target, 'U');
+ $TARGET = StringHelper::safe(CFactory::_('Config')->build_target, 'U');
// set libraries $TARGET.'_LIBRARIES_LOADER
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_LIBRARIES_LOADER' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_LIBRARIES_LOADER' )]
= $this->setLibrariesLoader($view);
// set uikit $TARGET.'_UIKIT_LOADER
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_UIKIT_LOADER' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_UIKIT_LOADER' )]
= $this->setUikitLoader($view);
// set Google Charts $TARGET.'_GOOGLECHART_LOADER
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_GOOGLECHART_LOADER' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_GOOGLECHART_LOADER' )]
= $this->setGoogleChartLoader($view);
// set Footable FOOTABLE_LOADER
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_FOOTABLE_LOADER' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_FOOTABLE_LOADER' )]
= $this->setFootableScriptsLoader($view);
// set metadata DOCUMENT_METADATA
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_DOCUMENT_METADATA' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_DOCUMENT_METADATA' )]
= $this->setDocumentMetadata($view);
// set custom php scripting DOCUMENT_CUSTOM_PHP
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_DOCUMENT_CUSTOM_PHP' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_DOCUMENT_CUSTOM_PHP' )]
= $this->setDocumentCustomPHP($view);
// set custom css DOCUMENT_CUSTOM_CSS
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_DOCUMENT_CUSTOM_CSS' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_DOCUMENT_CUSTOM_CSS' )]
= $this->setDocumentCustomCSS($view);
// set custom javascript DOCUMENT_CUSTOM_JS
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_DOCUMENT_CUSTOM_JS' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_DOCUMENT_CUSTOM_JS' )]
= $this->setDocumentCustomJS($view);
// set custom css file VIEWCSS
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_VIEWCSS' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_VIEWCSS' )]
= $this->setCustomCSS($view);
// incase no buttons are found
- $this->fileContentDynamic[$view['settings']->code][$this->hhh
- . 'SITE_JAVASCRIPT_FOR_BUTTONS' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h('SITE_JAVASCRIPT_FOR_BUTTONS')]
= '';
// set the custom buttons CUSTOM_BUTTONS
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_CUSTOM_BUTTONS' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS' )]
= $this->setCustomButtons($view);
// see if we should add get modules to the view.html
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_GET_MODULE' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_GET_MODULE' )]
= $this->setGetModules($view, $TARGET);
// set a JavaScript file if needed
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_LIBRARIES_LOADER' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_LIBRARIES_LOADER' )]
.= $this->setJavaScriptFile($view, $TARGET);
// fix just incase we missed it somewhere
- $this->lang = $tmp;
+ CFactory::_('Config')->lang_target = $tmp;
}
public function setGetModules($view, $TARGET)
{
- if (isset($this->getModule[$this->target][$view['settings']->code])
- && $this->getModule[$this->target][$view['settings']->code])
+ if (isset($this->getModule[CFactory::_('Config')->build_target][$view['settings']->code])
+ && $this->getModule[CFactory::_('Config')->build_target][$view['settings']->code])
{
$addModule = array();
- $addModule[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $addModule[] = $this->_t(1)
+ $addModule[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $addModule[] = Indent::_(1)
. " * Get the modules published in a position";
- $addModule[] = $this->_t(1) . " */";
- $addModule[] = $this->_t(1)
+ $addModule[] = Indent::_(1) . " */";
+ $addModule[] = Indent::_(1)
. "public function getModules(\$position, \$seperator = '', \$class = '')";
- $addModule[] = $this->_t(1) . "{";
- $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(1) . "{";
+ $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " set default";
- $addModule[] = $this->_t(2) . "\$found = false;";
- $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(2) . "\$found = false;";
+ $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " check if we aleady have these modules loaded";
- $addModule[] = $this->_t(2)
+ $addModule[] = Indent::_(2)
. "if (isset(\$this->setModules[\$position]))";
- $addModule[] = $this->_t(2) . "{";
- $addModule[] = $this->_t(3) . "\$found = true;";
- $addModule[] = $this->_t(2) . "}";
- $addModule[] = $this->_t(2) . "else";
- $addModule[] = $this->_t(2) . "{";
- $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(2) . "{";
+ $addModule[] = Indent::_(3) . "\$found = true;";
+ $addModule[] = Indent::_(2) . "}";
+ $addModule[] = Indent::_(2) . "else";
+ $addModule[] = Indent::_(2) . "{";
+ $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " this is where you want to load your module position";
- $addModule[] = $this->_t(3)
+ $addModule[] = Indent::_(3)
. "\$modules = JModuleHelper::getModules(\$position);";
- $addModule[] = $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh]
+ $addModule[] = Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$modules, true))";
- $addModule[] = $this->_t(3) . "{";
- $addModule[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(3) . "{";
+ $addModule[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " set the place holder";
- $addModule[] = $this->_t(4)
+ $addModule[] = Indent::_(4)
. "\$this->setModules[\$position] = array();";
- $addModule[] = $this->_t(4) . "foreach(\$modules as \$module)";
- $addModule[] = $this->_t(4) . "{";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(4) . "foreach(\$modules as \$module)";
+ $addModule[] = Indent::_(4) . "{";
+ $addModule[] = Indent::_(5)
. "\$this->setModules[\$position][] = JModuleHelper::renderModule(\$module);";
- $addModule[] = $this->_t(4) . "}";
- $addModule[] = $this->_t(4) . "\$found = true;";
- $addModule[] = $this->_t(3) . "}";
- $addModule[] = $this->_t(2) . "}";
- $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(4) . "}";
+ $addModule[] = Indent::_(4) . "\$found = true;";
+ $addModule[] = Indent::_(3) . "}";
+ $addModule[] = Indent::_(2) . "}";
+ $addModule[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " check if modules were found";
- $addModule[] = $this->_t(2)
+ $addModule[] = Indent::_(2)
. "if (\$found && isset(\$this->setModules[\$position]) && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$this->setModules[\$position]))";
- $addModule[] = $this->_t(2) . "{";
- $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(2) . "{";
+ $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " set class";
- $addModule[] = $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkString(\$class))";
- $addModule[] = $this->_t(3) . "{";
- $addModule[] = $this->_t(4)
+ $addModule[] = Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkString(\$class))";
+ $addModule[] = Indent::_(3) . "{";
+ $addModule[] = Indent::_(4)
. "\$class = ' class=\"'.\$class.'\" ';";
- $addModule[] = $this->_t(3) . "}";
- $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $addModule[] = Indent::_(3) . "}";
+ $addModule[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " set seperating return values";
- $addModule[] = $this->_t(3) . "switch(\$seperator)";
- $addModule[] = $this->_t(3) . "{";
- $addModule[] = $this->_t(4) . "case 'none':";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(3) . "switch(\$seperator)";
+ $addModule[] = Indent::_(3) . "{";
+ $addModule[] = Indent::_(4) . "case 'none':";
+ $addModule[] = Indent::_(5)
. "return implode('', \$this->setModules[\$position]);";
- $addModule[] = $this->_t(5) . "break;";
- $addModule[] = $this->_t(4) . "case 'div':";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(5) . "break;";
+ $addModule[] = Indent::_(4) . "case 'div':";
+ $addModule[] = Indent::_(5)
. "return ''.implode('
', \$this->setModules[\$position]).'
';";
- $addModule[] = $this->_t(5) . "break;";
- $addModule[] = $this->_t(4) . "case 'list':";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(5) . "break;";
+ $addModule[] = Indent::_(4) . "case 'list':";
+ $addModule[] = Indent::_(5)
. "return ''.implode(' ', \$this->setModules[\$position]).' ';";
- $addModule[] = $this->_t(5) . "break;";
- $addModule[] = $this->_t(4) . "case 'array':";
- $addModule[] = $this->_t(4) . "case 'Array':";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(5) . "break;";
+ $addModule[] = Indent::_(4) . "case 'array':";
+ $addModule[] = Indent::_(4) . "case 'Array':";
+ $addModule[] = Indent::_(5)
. "return \$this->setModules[\$position];";
- $addModule[] = $this->_t(5) . "break;";
- $addModule[] = $this->_t(4) . "default:";
- $addModule[] = $this->_t(5)
+ $addModule[] = Indent::_(5) . "break;";
+ $addModule[] = Indent::_(4) . "default:";
+ $addModule[] = Indent::_(5)
. "return implode(' ', \$this->setModules[\$position]);";
- $addModule[] = $this->_t(5) . "break;";
- $addModule[] = $this->_t(4);
- $addModule[] = $this->_t(3) . "}";
- $addModule[] = $this->_t(2) . "}";
- $addModule[] = $this->_t(2) . "return false;";
- $addModule[] = $this->_t(1) . "}";
+ $addModule[] = Indent::_(5) . "break;";
+ $addModule[] = Indent::_(4);
+ $addModule[] = Indent::_(3) . "}";
+ $addModule[] = Indent::_(2) . "}";
+ $addModule[] = Indent::_(2) . "return false;";
+ $addModule[] = Indent::_(1) . "}";
- $this->fileContentDynamic[$view['settings']->code][$this->hhh
- . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_GET_MODULE_JIMPORT')]
= PHP_EOL . "jimport('joomla.application.module.helper');";
return implode(PHP_EOL, $addModule);
}
- $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET
- . '_GET_MODULE_JIMPORT' . $this->hhh]
+ $this->fileContentDynamic[$view['settings']->code][Placefix::_h($TARGET
+ . '_GET_MODULE_JIMPORT')]
= '';
return '';
@@ -5522,11 +5440,11 @@ class Interpretation extends Fields
$view['settings']->php_document
))
{
- $_tmp = PHP_EOL . $this->_t(2) . implode(
- PHP_EOL . $this->_t(2), $view['settings']->php_document
+ $_tmp = PHP_EOL . Indent::_(2) . implode(
+ PHP_EOL . Indent::_(2), $view['settings']->php_document
);
- return $this->setPlaceholders($_tmp, $this->placeholders);
+ return CFactory::_('Placeholder')->update($_tmp, CFactory::_('Placeholder')->active);
}
}
@@ -5538,7 +5456,7 @@ class Interpretation extends Fields
// do not validate selection
$validateSelection = 'false';
// ensure correct target is set
- $TARGET = StringHelper::safe($this->target, 'U');
+ $TARGET = StringHelper::safe(CFactory::_('Config')->build_target, 'U');
if (1 == $type || 2 == $type)
{
if (1 == $type)
@@ -5550,11 +5468,11 @@ class Interpretation extends Fields
$viewCodeName = $view['settings']->name_single_code;
}
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET
- . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = '';
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_CONTROLLER' )] = '';
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET
- . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = '';
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_METHOD' )] = '';
}
elseif (3 == $type)
{
@@ -5562,12 +5480,12 @@ class Interpretation extends Fields
$viewCodeName = $view['settings']->name_single_code;
$viewsCodeName = $view['settings']->name_list_code;
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST
- $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET
- . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh]
+ $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_CONTROLLER_LIST' )]
= '';
// set the custom buttons CUSTOM_BUTTONS_METHOD_LIST
- $this->fileContentDynamic[$viewsCodeName][$this->hhh . $TARGET
- . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh]
+ $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_METHOD_LIST' )]
= '';
// validate selection
$validateSelection = 'true';
@@ -5575,48 +5493,40 @@ class Interpretation extends Fields
// reset buttons
$buttons = array();
// if site add buttons to view
- if ($this->target === 'site')
+ if (CFactory::_('Config')->build_target === 'site')
{
// set the custom buttons SITE_TOP_BUTTON
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_TOP_BUTTON'
- . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')]
= '';
// set the custom buttons SITE_BOTTOM_BUTTON
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_BOTTOM_BUTTON' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')]
= '';
// load into place
switch ($view['settings']->button_position)
{
case 1:
// set buttons to top right of the view
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_TOP_BUTTON' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')]
= '';
break;
case 2:
// set buttons to top left of the view
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_TOP_BUTTON' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_TOP_BUTTON')]
= 'toolbar->render(); ?>';
break;
case 3:
// set buttons to buttom right of the view
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_BOTTOM_BUTTON' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')]
= '';
break;
case 4:
// set buttons to buttom left of the view
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . 'SITE_BOTTOM_BUTTON' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h('SITE_BOTTOM_BUTTON')]
= 'toolbar->render(); ?>';
break;
case 5:
// set buttons to buttom left of the view
- $this->placeholders[$this->bbb . 'SITE_TOOLBAR'
- . $this->ddd]
+ CFactory::_('Placeholder')->active[Placefix::_('SITE_TOOLBAR')]
= 'toolbar->render(); ?>';
break;
}
@@ -5629,13 +5539,12 @@ class Interpretation extends Fields
|| ($this->dynamicDashboardType === 'custom_admin_views'
&& $this->dynamicDashboard !== $viewCodeName))
{
- $buttons[] = $tab . $this->_t(2)
- . "//" . $this->setLine(__LINE__) . " add cpanel button";
- $buttons[] = $tab . $this->_t(2)
+ $buttons[] = $tab . Indent::_(2)
+ . "//" . Line::_(__Line__, __Class__) . " add cpanel button";
+ $buttons[] = $tab . Indent::_(2)
. "JToolBarHelper::custom('" . $viewCodeName . "."
. "dashboard', 'grid-2', '', 'COM_"
- . $this->fileContentStatic[$this->hhh
- . 'COMPONENT' . $this->hhh]
+ . $this->fileContentStatic[Placefix::_h('COMPONENT')]
. "_DASH', false);";
}
}
@@ -5653,50 +5562,50 @@ class Interpretation extends Fields
foreach ($view['settings']->custom_buttons as $custom_button)
{
// Load to lang
- $keyLang = $this->langPrefix . '_'
+ $keyLang = CFactory::_('Config')->lang_prefix . '_'
. StringHelper::safe(
$custom_button['name'], 'U'
);
$keyCode = StringHelper::safe(
$custom_button['name']
);
- $this->setLangContent(
- $this->lang, $keyLang, $custom_button['name']
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $keyLang, $custom_button['name']
);
// load the button
if (3 !== $type
&& ($custom_button['target'] != 2
- || $this->target === 'site'))
+ || CFactory::_('Config')->build_target === 'site'))
{
// add cpanel button TODO does not work well on site with permissions
if ($custom_button['target'] == 2
- || $this->target === 'site')
+ || CFactory::_('Config')->build_target === 'site')
{
- $buttons[] = $this->_t(1) . $tab . $this->_t(1)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1)
. "if (\$this->user->authorise('"
. $viewCodeName
. "." . $keyCode . "', 'com_"
- . Config::get('component_code_name') . "'))";
+ . CFactory::_('Config')->component_code_name . "'))";
}
else
{
- $buttons[] = $this->_t(1) . $tab . $this->_t(1)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1)
. "if (\$this->canDo->get('" . $viewCodeName
. "."
. $keyCode . "'))";
}
- $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{";
- $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " add "
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "{";
+ $buttons[] = Indent::_(1) . $tab . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " add "
. $custom_button['name'] . " button.";
- $buttons[] = $this->_t(1) . $tab . $this->_t(2)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(2)
. "JToolBarHelper::custom('" . $viewCodeName . "."
. $custom_button['method'] . "', '"
. $custom_button['icomoon'] . " custom-button-"
. strtolower($custom_button['method']) . "', '', '"
. $keyLang
. "', false);";
- $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}";
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1) . "}";
}
// load the list button
elseif (3 == $type && $custom_button['target'] != 1)
@@ -5711,26 +5620,26 @@ class Interpretation extends Fields
= array();
}
$this->onlyFunctionButton[$viewsCodeName][]
- = $this->_t(
+ = Indent::_(
1
) . $tab . "if (\$this->user->authorise('"
. $viewCodeName . "." . $keyCode . "', 'com_"
- . Config::get('component_code_name') . "'))";
+ . CFactory::_('Config')->component_code_name . "'))";
$this->onlyFunctionButton[$viewsCodeName][]
- = $this->_t(
+ = Indent::_(
1
) . $tab . "{";
$this->onlyFunctionButton[$viewsCodeName][]
- = $this->_t(
+ = Indent::_(
1
- ) . $tab . $this->_t(1) . "//" . $this->setLine(
- __LINE__
+ ) . $tab . Indent::_(1) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " add " . $custom_button['name']
. " button.";
$this->onlyFunctionButton[$viewsCodeName][]
- = $this->_t(
+ = Indent::_(
1
- ) . $tab . $this->_t(1)
+ ) . $tab . Indent::_(1)
. "JToolBarHelper::custom('" . $viewsCodeName
. "."
. $custom_button['method'] . "', '"
@@ -5739,23 +5648,23 @@ class Interpretation extends Fields
. "', '', '"
. $keyLang . "', false);";
$this->onlyFunctionButton[$viewsCodeName][]
- = $this->_t(
+ = Indent::_(
1
) . $tab . "}";
}
else
{
- $buttons[] = $this->_t(1) . $tab . $this->_t(1)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1)
. "if (\$this->user->authorise('"
. $viewCodeName
. "." . $keyCode . "', 'com_"
- . Config::get('component_code_name') . "'))";
- $buttons[] = $this->_t(1) . $tab . $this->_t(1)
+ . CFactory::_('Config')->component_code_name . "'))";
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1)
. "{";
- $buttons[] = $this->_t(1) . $tab . $this->_t(2)
- . "//" . $this->setLine(__LINE__) . " add "
+ $buttons[] = Indent::_(1) . $tab . Indent::_(2)
+ . "//" . Line::_(__Line__, __Class__) . " add "
. $custom_button['name'] . " button.";
- $buttons[] = $this->_t(1) . $tab . $this->_t(2)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(2)
. "JToolBarHelper::custom('" . $viewsCodeName
. "."
. $custom_button['method'] . "', '"
@@ -5764,7 +5673,7 @@ class Interpretation extends Fields
. "', '', '"
. $keyLang . "', '" . $validateSelection
. "');";
- $buttons[] = $this->_t(1) . $tab . $this->_t(1)
+ $buttons[] = Indent::_(1) . $tab . Indent::_(1)
. "}";
}
}
@@ -5781,12 +5690,11 @@ class Interpretation extends Fields
&& $view['settings']->php_controller_list != '//')
{
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewsCodeName][$this->hhh
- . $TARGET
- . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh]
- = PHP_EOL . PHP_EOL . $this->setPlaceholders(
+ $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_CONTROLLER_LIST')]
+ = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
$view['settings']->php_controller_list,
- $this->placeholders
+ CFactory::_('Placeholder')->active
);
}
// load the model
@@ -5797,12 +5705,11 @@ class Interpretation extends Fields
&& $view['settings']->php_model_list != '//')
{
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewsCodeName][$this->hhh
- . $TARGET
- . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh]
- = PHP_EOL . PHP_EOL . $this->setPlaceholders(
+ $this->fileContentDynamic[$viewsCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_METHOD_LIST')]
+ = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
$view['settings']->php_model_list,
- $this->placeholders
+ CFactory::_('Placeholder')->active
);
}
}
@@ -5815,18 +5722,17 @@ class Interpretation extends Fields
&& $view['settings']->php_controller != '//')
{
// set the custom buttons CUSTOM_BUTTONS_CONTROLLER
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . $TARGET
- . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh]
- = PHP_EOL . PHP_EOL . $this->setPlaceholders(
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_CONTROLLER')]
+ = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
$view['settings']->php_controller,
- $this->placeholders
+ CFactory::_('Placeholder')->active
);
- if ('site' === $this->target)
+ if ('site' === CFactory::_('Config')->build_target)
{
// add the controller for this view
// build the file
- $target = array($this->target => $viewCodeName);
+ $target = array(CFactory::_('Config')->build_target => $viewCodeName);
$this->buildDynamique($target, 'custom_form');
// GET_FORM_CUSTOM
}
@@ -5838,10 +5744,9 @@ class Interpretation extends Fields
&& $view['settings']->php_model != '//')
{
// set the custom buttons CUSTOM_BUTTONS_METHOD
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . $TARGET
- . '_CUSTOM_BUTTONS_METHOD' . $this->hhh]
- = PHP_EOL . PHP_EOL . $this->setPlaceholders(
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET
+ . '_CUSTOM_BUTTONS_METHOD')]
+ = PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
$view['settings']->php_model, $this->placeholders
);
}
@@ -5868,8 +5773,8 @@ class Interpretation extends Fields
) === false))
{
// set the custom get form method JAVASCRIPT_FOR_BUTTONS
- $this->fileContentDynamic[$viewCodeName][$this->hhh
- . $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh]
+ $this->fileContentDynamic[$viewCodeName][Placefix::_h($TARGET
+ . '_JAVASCRIPT_FOR_BUTTONS')]
= $this->setJavaScriptForButtons();
}
// insure the form is added (only if no form exist)
@@ -5878,7 +5783,7 @@ class Interpretation extends Fields
$view['settings']->default, '";
// Trigger Event: jcb_ce_onSetDefaultViewsBodyBottom
- $this->triggerEvent(
+ CFactory::_J('Event')->trigger(
'jcb_ce_onSetDefaultViewsBodyBottom',
array(&$this,
&$body,
@@ -12439,39 +12318,39 @@ class Interpretation extends Fields
// set id lang
$idLangName = $langView . '_ID';
// add to lang array
- $this->setLangContent($this->lang, $statusLangName, 'Status');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $statusLangName, 'Status');
// add to lang array
- $this->setLangContent($this->lang, $idLangName, 'Id');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $idLangName, 'Id');
// set default
$head = '';
- $head .= PHP_EOL . $this->_t(1)
+ $head .= PHP_EOL . Indent::_(1)
. "canEdit&& \$this->canState): ?>";
if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
{
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3)
+ $head .= PHP_EOL . Indent::_(3)
. "listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'"
. $jhtml_sort_icon_2 . "); ?>";
- $head .= PHP_EOL . $this->_t(2) . " ";
+ $head .= PHP_EOL . Indent::_(2) . "";
}
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3)
+ $head .= PHP_EOL . Indent::_(3)
. "";
- $head .= PHP_EOL . $this->_t(2) . " ";
- $head .= PHP_EOL . $this->_t(1) . "";
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(2) . "";
+ $head .= PHP_EOL . Indent::_(1) . "";
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3) . "▾";
- $head .= PHP_EOL . $this->_t(2) . " ";
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(3) . "▾";
+ $head .= PHP_EOL . Indent::_(2) . "";
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3) . "■";
- $head .= PHP_EOL . $this->_t(2) . " ";
- $head .= PHP_EOL . $this->_t(1) . "";
+ $head .= PHP_EOL . Indent::_(3) . "■";
+ $head .= PHP_EOL . Indent::_(2) . "";
+ $head .= PHP_EOL . Indent::_(1) . "";
// set footer Column number
$this->listColnrBuilder[$nameListCode] = 4;
// build the dynamic fields
@@ -12532,42 +12411,42 @@ class Interpretation extends Fields
$title = "";
}
- $head .= PHP_EOL . $this->_t(1) . '';
- $head .= PHP_EOL . $this->_t(3) . $title;
- $head .= PHP_EOL . $this->_t(1) . " ";
+ $head .= PHP_EOL . Indent::_(3) . $title;
+ $head .= PHP_EOL . Indent::_(1) . "";
$this->listColnrBuilder[$nameListCode]++;
}
}
// set default
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
- $head .= PHP_EOL . $this->_t(1)
+ $head .= PHP_EOL . Indent::_(1)
. "canState): ?>";
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3)
+ $head .= PHP_EOL . Indent::_(3)
. "listDirn, \$this->listOrder); ?>";
- $head .= PHP_EOL . $this->_t(2) . " ";
- $head .= PHP_EOL . $this->_t(1) . "";
- $head .= PHP_EOL . $this->_t(2)
+ $head .= PHP_EOL . Indent::_(2) . "";
+ $head .= PHP_EOL . Indent::_(1) . "";
+ $head .= PHP_EOL . Indent::_(2)
. '';
- $head .= PHP_EOL . $this->_t(3) . "";
- $head .= PHP_EOL . $this->_t(2) . " ";
- $head .= PHP_EOL . $this->_t(1) . "";
+ $head .= PHP_EOL . Indent::_(2) . "";
+ $head .= PHP_EOL . Indent::_(1) . "";
}
if (!isset($this->fieldsNames[$nameSingleCode]['id']))
{
- $head .= PHP_EOL . $this->_t(1)
+ $head .= PHP_EOL . Indent::_(1)
. '';
- $head .= PHP_EOL . $this->_t(3)
+ $head .= PHP_EOL . Indent::_(3)
. "listDirn, \$this->listOrder); ?>";
- $head .= PHP_EOL . $this->_t(1) . " ";
+ $head .= PHP_EOL . Indent::_(1) . "";
}
$head .= PHP_EOL . " ";
@@ -12620,23 +12499,23 @@ class Interpretation extends Fields
foreach ($fields as $field)
{
// add each field
- $fieldArray[] = PHP_EOL . $this->_t(4) . "'" . $field
+ $fieldArray[] = PHP_EOL . Indent::_(4) . "'" . $field
. "'";
}
// add the alignemnt key
- $alignmentArray[] = PHP_EOL . $this->_t(3) . "'"
+ $alignmentArray[] = PHP_EOL . Indent::_(3) . "'"
. $this->alignmentOptions[$alignment] . "' => array("
- . implode(',', $fieldArray) . PHP_EOL . $this->_t(3)
+ . implode(',', $fieldArray) . PHP_EOL . Indent::_(3)
. ")";
}
// add the layout key
- $layoutArray[] = PHP_EOL . $this->_t(2) . "'"
+ $layoutArray[] = PHP_EOL . Indent::_(2) . "'"
. StringHelper::safe($layout)
. "' => array(" . implode(',', $alignmentArray) . PHP_EOL
- . $this->_t(2) . ")";
+ . Indent::_(2) . ")";
}
- return 'array(' . implode(',', $layoutArray) . PHP_EOL . $this->_t(
+ return 'array(' . implode(',', $layoutArray) . PHP_EOL . Indent::_(
1
) . ")";
}
@@ -12699,7 +12578,7 @@ class Interpretation extends Fields
$body = PHP_EOL . '";
+ $body .= PHP_EOL . Indent::_(1) . "";
}
$body .= PHP_EOL . "";
// check if left has been set
@@ -12971,7 +12850,7 @@ class Interpretation extends Fields
/// set the values to use in search latter
$searchTabs[$tabCodeName] = $tabNr;
// add to lang array
- $this->setLangContent($this->lang, $tabLangName, $tabName);
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, $tabName);
// check if linked view belongs to this tab
$buildLayout = true;
$linkedViewId = '';
@@ -13009,7 +12888,7 @@ class Interpretation extends Fields
}
else
{
- $items .= "," . PHP_EOL . $this->_t(1) . "'" . $name
+ $items .= "," . PHP_EOL . Indent::_(1) . "'" . $name
. "'";
}
$itemCounter++;
@@ -13061,7 +12940,7 @@ class Interpretation extends Fields
'layouttitle'
);
// load to header
- $header .= PHP_EOL . $this->_t(1)
+ $header .= PHP_EOL . Indent::_(1)
. "";
@@ -13087,7 +12966,7 @@ class Interpretation extends Fields
'layoutitems'
);
// load the body
- $leftside .= PHP_EOL . $this->_t(1)
+ $leftside .= PHP_EOL . Indent::_(1)
. "";
@@ -13100,7 +12979,7 @@ class Interpretation extends Fields
'layoutitems'
);
// load the body
- $rightside .= PHP_EOL . $this->_t(1)
+ $rightside .= PHP_EOL . Indent::_(1)
. "";
@@ -13182,9 +13061,9 @@ class Interpretation extends Fields
{
case 1: // left
case 2: // right
- $main .= PHP_EOL . $this->_t(3) . '';
- $main .= PHP_EOL . $this->_t(4) . $string;
- $main .= PHP_EOL . $this->_t(3) . '
';
+ $main .= PHP_EOL . Indent::_(3) . '';
+ $main .= PHP_EOL . Indent::_(4) . $string;
+ $main .= PHP_EOL . Indent::_(3) . '
';
break;
}
}
@@ -13194,20 +13073,20 @@ class Interpretation extends Fields
{
case 1: // left
case 2: // right
- $main .= PHP_EOL . $this->_t(3)
+ $main .= PHP_EOL . Indent::_(3)
. '';
- $main .= PHP_EOL . $this->_t(4) . $string;
- $main .= PHP_EOL . $this->_t(3) . '
';
+ $main .= PHP_EOL . Indent::_(4) . $string;
+ $main .= PHP_EOL . Indent::_(3) . '';
break;
}
}
switch ($position)
{
case 3: // fullwidth
- $mainbottom .= PHP_EOL . $this->_t(3)
+ $mainbottom .= PHP_EOL . Indent::_(3)
. '';
- $mainbottom .= PHP_EOL . $this->_t(4) . $string;
- $mainbottom .= PHP_EOL . $this->_t(3) . '
';
+ $mainbottom .= PHP_EOL . Indent::_(4) . $string;
+ $mainbottom .= PHP_EOL . Indent::_(3) . '';
break;
}
}
@@ -13230,7 +13109,7 @@ class Interpretation extends Fields
// set default publishing tab lang
$tabLangName = $langView . '_PUBLISHING';
// add to lang array
- $this->setLangContent($this->lang, $tabLangName, 'Publishing');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, 'Publishing');
// the default publishing items
$items = array('left' => array(), 'right' => array());
// Setup the default (custom) fields
@@ -13318,7 +13197,7 @@ class Interpretation extends Fields
if (ArrayHelper::check($items['left']))
{
$items_one .= "'" . implode(
- "'," . PHP_EOL . $this->_t(1) . "'", $items['left']
+ "'," . PHP_EOL . Indent::_(1) . "'", $items['left']
) . "'";
}
if (ArrayHelper::check($items['right']))
@@ -13326,9 +13205,9 @@ class Interpretation extends Fields
// there is already fields just add these
if (strlen($items_one) > 3)
{
- $items_one .= "," . PHP_EOL . $this->_t(1) . "'"
+ $items_one .= "," . PHP_EOL . Indent::_(1) . "'"
. implode(
- "'," . PHP_EOL . $this->_t(1) . "'",
+ "'," . PHP_EOL . Indent::_(1) . "'",
$items['right']
) . "'";
}
@@ -13336,7 +13215,7 @@ class Interpretation extends Fields
else
{
$items_one .= "'" . implode(
- "'," . PHP_EOL . $this->_t(1) . "'",
+ "'," . PHP_EOL . Indent::_(1) . "'",
$items['right']
) . "'";
}
@@ -13385,7 +13264,7 @@ class Interpretation extends Fields
{
// load all items
$items_one = "'" . implode(
- "'," . PHP_EOL . $this->_t(1) . "'", $items['left']
+ "'," . PHP_EOL . Indent::_(1) . "'", $items['left']
) . "'";
// set the publishing layout
$this->setLayout(
@@ -13399,7 +13278,7 @@ class Interpretation extends Fields
{
// load all items
$items_two = "'" . implode(
- "'," . PHP_EOL . $this->_t(1) . "'", $items['right']
+ "'," . PHP_EOL . Indent::_(1) . "'", $items['right']
) . "'";
// set the publishing layout
$this->setLayout(
@@ -13498,38 +13377,38 @@ class Interpretation extends Fields
// add the AND values to OR
$publishingPerOR[] = '(' . implode(' && ', $publishingPerAND) . ')';
// now build the complete showhide behaviour for the publishing area
- $tabs .= PHP_EOL . PHP_EOL . $this->_t(1) . "";
// set the default publishing tab
- $tabs .= PHP_EOL . $this->_t(1)
+ $tabs .= PHP_EOL . Indent::_(1)
. "";
- $tabs .= PHP_EOL . $this->_t(2)
+ $tabs .= PHP_EOL . Indent::_(2)
. '";
}
if ($items_two)
{
- $tabs .= PHP_EOL . $this->_t(3) . '';
- $tabs .= PHP_EOL . $this->_t(4)
+ $tabs .= PHP_EOL . Indent::_(4)
. "";
- $tabs .= PHP_EOL . $this->_t(3) . "
";
+ $tabs .= PHP_EOL . Indent::_(3) . "";
}
- $tabs .= PHP_EOL . $this->_t(2) . "";
- $tabs .= PHP_EOL . $this->_t(1)
+ $tabs .= PHP_EOL . Indent::_(2) . "";
+ $tabs .= PHP_EOL . Indent::_(1)
. "";
- $tabs .= PHP_EOL . $this->_t(1) . "";
+ $tabs .= PHP_EOL . Indent::_(1) . "";
// check if custom tab must be added
if (($_customTabHTML = $this->addCustomTabs(
15, $nameSingleCode, 2
@@ -13549,34 +13428,34 @@ class Interpretation extends Fields
// set permissions tab code name
$tabCodeName = 'permissions';
// add to lang array
- $this->setLangContent($this->lang, $tabLangName, 'Permissions');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $tabLangName, 'Permissions');
// set the permissions tab
- $tabs .= PHP_EOL . PHP_EOL . $this->_t(1)
+ $tabs .= PHP_EOL . PHP_EOL . Indent::_(1)
. "canDo->get('core.admin')) : ?>";
- $tabs .= PHP_EOL . $this->_t(1)
+ $tabs .= PHP_EOL . Indent::_(1)
. "";
- $tabs .= PHP_EOL . $this->_t(2)
+ $tabs .= PHP_EOL . Indent::_(2)
. '";
+ $tabs .= PHP_EOL . Indent::_(2) . "";
+ $tabs .= PHP_EOL . Indent::_(1)
. "";
- $tabs .= PHP_EOL . $this->_t(1) . "";
+ $tabs .= PHP_EOL . Indent::_(1) . "";
}
return $tabs;
@@ -13624,34 +13503,34 @@ class Interpretation extends Fields
{
// set view name
$fadein[] = "";
$fadein[] = "componentCodeName
. "_loader\" style=\"display: none;\">";
@@ -13677,7 +13556,7 @@ class Interpretation extends Fields
$target = array('admin' => $nameSingleCode);
$this->buildDynamique($target, $type, $layoutName);
// add to front if needed
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
$target = array('site' => $nameSingleCode);
$this->buildDynamique($target, $type, $layoutName);
@@ -13686,14 +13565,14 @@ class Interpretation extends Fields
{
// LAYOUTITEMS <<
>>
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh . 'LAYOUTITEMS' . $this->hhh]
+ . $layoutName][Placefix::_h('LAYOUTITEMS')]
= $items;
}
else
{
// LAYOUTITEMS <<>>
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh . 'bogus' . $this->hhh]
+ . $layoutName][Placefix::_h('bogus')]
= 'boom';
}
}
@@ -13715,7 +13594,7 @@ class Interpretation extends Fields
$target = array('admin' => $nameSingleCode);
$this->buildDynamique($target, 'layoutoverride', $layoutName);
// add to front if needed
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
$target = array('site' => $nameSingleCode);
$this->buildDynamique($target, 'layoutoverride', $layoutName);
@@ -13727,37 +13606,33 @@ class Interpretation extends Fields
}
// set placeholder
$placeholder = $this->placeholders;
- $placeholder[$this->hhh . 'LAYOUTITEMS' . $this->hhh] = $items;
+ $placeholder[Placefix::_h('LAYOUTITEMS')] = $items;
// OVERRIDE_LAYOUT_CODE <<>>
$php_view = (array) explode(PHP_EOL, $data['php_view']);
if (ArrayHelper::check($php_view))
{
$php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view);
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh
- . 'OVERRIDE_LAYOUT_CODE' . $this->hhh]
- = $this->setPlaceholders(
+ . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')]
+ = CFactory::_('Placeholder')->update(
$php_view, $placeholder
);
}
else
{
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh
- . 'OVERRIDE_LAYOUT_CODE' . $this->hhh]
+ . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_CODE')]
= '';
}
// OVERRIDE_LAYOUT_BODY <<>>
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh
- . 'OVERRIDE_LAYOUT_BODY' . $this->hhh]
- = PHP_EOL . $this->setPlaceholders(
+ . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_BODY')]
+ = PHP_EOL . CFactory::_('Placeholder')->update(
$data['html'], $placeholder
);
// OVERRIDE_LAYOUT_HEADER <<>>
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutName][$this->hhh
- . 'OVERRIDE_LAYOUT_HEADER' . $this->hhh]
+ . $layoutName][Placefix::_h('OVERRIDE_LAYOUT_HEADER')]
= (($header = $this->setFileHeader(
'override.layout',
$layoutName, false)
@@ -13784,10 +13659,10 @@ class Interpretation extends Fields
array($this->componentCodeName . $nameSingleCode . $layoutName)
))
{
- $data = $this->layoutData[$this->target][$this->componentCodeName
+ $data = $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName
. $nameSingleCode . $layoutName];
// remove since we will add the layout now
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
unset(
$this->layoutData['admin'][$this->componentCodeName
@@ -13801,7 +13676,7 @@ class Interpretation extends Fields
else
{
unset(
- $this->layoutData[$this->target][$this->componentCodeName
+ $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName
. $nameSingleCode . $layoutName]
);
}
@@ -13814,10 +13689,10 @@ class Interpretation extends Fields
array($this->componentCodeName . $layoutName)
))
{
- $data = $this->layoutData[$this->target][$this->componentCodeName
+ $data = $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName
. $layoutName];
// remove since we will add the layout now
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
unset(
$this->layoutData['admin'][$this->componentCodeName
@@ -13831,7 +13706,7 @@ class Interpretation extends Fields
else
{
unset(
- $this->layoutData[$this->target][$this->componentCodeName
+ $this->layoutData[CFactory::_('Config')->build_target][$this->componentCodeName
. $layoutName]
);
}
@@ -13844,10 +13719,10 @@ class Interpretation extends Fields
array($nameSingleCode . $layoutName)
))
{
- $data = $this->layoutData[$this->target][$nameSingleCode
+ $data = $this->layoutData[CFactory::_('Config')->build_target][$nameSingleCode
. $layoutName];
// remove since we will add the layout now
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
unset(
$this->layoutData['admin'][$nameSingleCode . $layoutName]
@@ -13856,7 +13731,7 @@ class Interpretation extends Fields
}
else
{
- unset($this->layoutData[$this->target][$layoutName]);
+ unset($this->layoutData[CFactory::_('Config')->build_target][$layoutName]);
}
return $data;
@@ -13867,16 +13742,16 @@ class Interpretation extends Fields
array($layoutName)
))
{
- $data = $this->layoutData[$this->target][$layoutName];
+ $data = $this->layoutData[CFactory::_('Config')->build_target][$layoutName];
// remove since we will add the layout now
- if ($this->lang === 'both')
+ if (CFactory::_('Config')->lang_target === 'both')
{
unset($this->layoutData['admin'][$layoutName]);
unset($this->layoutData['site'][$layoutName]);
}
else
{
- unset($this->layoutData[$this->target][$layoutName]);
+ unset($this->layoutData[CFactory::_('Config')->build_target][$layoutName]);
}
return $data;
@@ -13924,47 +13799,46 @@ class Interpretation extends Fields
$functionName = StringHelper::safe($codeName, 'F');
// LAYOUTITEMSTABLE <<>>
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh]
+ . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')]
= $head . $body;
// LAYOUTITEMSHEADER <<>>
- $headerscript = '//' . $this->setLine(__LINE__)
+ $headerscript = '//' . Line::_(__Line__, __Class__)
. ' set the edit URL';
$headerscript .= PHP_EOL . '$edit = "index.php?option=com_'
. $this->componentCodeName . '&view=' . $name_list_code
. '&task='
. $name_single_code . '.edit";';
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' set a return value';
$headerscript .= PHP_EOL
. '$return = ($id) ? "index.php?option=com_'
. $this->componentCodeName . '&view=' . $nameSingleCode
. '&layout=edit&id=" . $id : "";';
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' check for a return value';
$headerscript .= PHP_EOL
. '$jinput = JFactory::getApplication()->input;';
$headerscript .= PHP_EOL
. "if (\$_return = \$jinput->get('return', null, 'base64'))";
$headerscript .= PHP_EOL . '{';
- $headerscript .= PHP_EOL . $this->_t(1)
+ $headerscript .= PHP_EOL . Indent::_(1)
. '$return .= "&return=" . $_return;';
$headerscript .= PHP_EOL . '}';
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' check if return value was set';
$headerscript .= PHP_EOL . 'if ('
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper::checkString($return))';
+ . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::checkString($return))';
$headerscript .= PHP_EOL . '{';
- $headerscript .= PHP_EOL . $this->_t(1) . '//' . $this->setLine(
- __LINE__
+ $headerscript .= PHP_EOL . Indent::_(1) . '//' . Line::_(
+ __LINE__,__CLASS__
) . ' set the referral values';
- $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref='
+ $headerscript .= PHP_EOL . Indent::_(1) . '$ref = ($id) ? "&ref='
. $nameSingleCode
. '&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));';
$headerscript .= PHP_EOL . '}';
$headerscript .= PHP_EOL . 'else';
$headerscript .= PHP_EOL . '{';
- $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref='
+ $headerscript .= PHP_EOL . Indent::_(1) . '$ref = ($id) ? "&ref='
. $nameSingleCode . '&refid=" . $id : "";';
$headerscript .= PHP_EOL . '}';
if ($addNewButon > 0)
@@ -13972,7 +13846,7 @@ class Interpretation extends Fields
// add the link for new
if ($addNewButon == 1 || $addNewButon == 2)
{
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' set the create new URL';
$headerscript .= PHP_EOL . '$new = "index.php?option=com_'
. $this->componentCodeName . '&view=' . $name_list_code
@@ -13982,7 +13856,7 @@ class Interpretation extends Fields
// and the link for close and new
if ($addNewButon == 2 || $addNewButon == 3)
{
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' set the create new and close URL';
$headerscript .= PHP_EOL
. '$close_new = "index.php?option=com_'
@@ -13990,28 +13864,25 @@ class Interpretation extends Fields
. '&task='
. $name_single_code . '.edit";';
}
- $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__)
+ $headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
. ' load the action object';
$headerscript .= PHP_EOL . '$can = '
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper::getActions(' . "'"
+ . $this->fileContentStatic[Placefix::_h('Component')] . 'Helper::getActions(' . "'"
. $name_single_code . "'"
. ');';
}
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh]
+ . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')]
= $headerscript;
// LINKEDVIEWITEMS <<>>
- $this->fileContentDynamic[$nameSingleCode][$this->hhh
- . 'LINKEDVIEWITEMS' . $this->hhh]
- .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
- ) . " Get Linked view data" . PHP_EOL . $this->_t(2)
+ $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWITEMS')]
+ .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
+ ) . " Get Linked view data" . PHP_EOL . Indent::_(2)
. "\$this->" . $codeName . " = \$this->get('" . $functionName
. "');";
// LINKEDVIEWTABLESCRIPTS <<>>
- $this->fileContentDynamic[$nameSingleCode][$this->hhh
- . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh]
+ $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWTABLESCRIPTS')]
= $this->setFootableScripts();
if (strpos($parentKey, '-R>') !== false
|| strpos($parentKey, '-A>') !== false)
@@ -14053,9 +13924,8 @@ class Interpretation extends Fields
= StringHelper::safe(
$_key . $this->uniquekey(4)
);
- $this->fileContentDynamic[$nameSingleCode][$this->hhh
- . 'LINKEDVIEWGLOBAL' . $this->hhh]
- .= PHP_EOL . $this->_t(2) . "\$this->"
+ $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')]
+ .= PHP_EOL . Indent::_(2) . "\$this->"
. $globalKey[$parent_key] . " = \$item->" . $parent_key
. ";";
}
@@ -14066,14 +13936,12 @@ class Interpretation extends Fields
$globalKey = StringHelper::safe(
$_key . $this->uniquekey(4)
);
- $this->fileContentDynamic[$nameSingleCode][$this->hhh
- . 'LINKEDVIEWGLOBAL' . $this->hhh]
- .= PHP_EOL . $this->_t(2) . "\$this->" . $globalKey
+ $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWGLOBAL')]
+ .= PHP_EOL . Indent::_(2) . "\$this->" . $globalKey
. " = \$item->" . $parent_key . ";";
}
// LINKEDVIEWMETHODS <<>>
- $this->fileContentDynamic[$nameSingleCode][$this->hhh
- . 'LINKEDVIEWMETHODS' . $this->hhh]
+ $this->fileContentDynamic[$nameSingleCode][Placefix::_h('LINKEDVIEWMETHODS')]
.= $this->setListQueryLinked(
$name_single_code, $name_list_code, $functionName, $key, $_key,
$parentKey,
@@ -14083,10 +13951,10 @@ class Interpretation extends Fields
else
{
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh]
+ . $layoutCodeName][Placefix::_h('LAYOUTITEMSTABLE')]
= 'oops! error.....';
$this->fileContentDynamic[$nameSingleCode . '_'
- . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh]
+ . $layoutCodeName][Placefix::_h('LAYOUTITEMSHEADER')]
= '';
}
}
@@ -14101,62 +13969,62 @@ class Interpretation extends Fields
if (!isset($this->footableVersion)
|| 2 == $this->footableVersion) // loading version 2
{
- $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $foo = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Add the CSS for Footable.";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('stylesheet', 'media/com_"
. $this->componentCodeName
. "/footable-v2/css/footable.core.min.css', ['version' => 'auto']);";
- $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Use the Metro Style";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)";
- $foo .= PHP_EOL . $this->_t(2) . "{";
- $foo .= PHP_EOL . $this->_t(3)
+ $foo .= PHP_EOL . Indent::_(2) . "{";
+ $foo .= PHP_EOL . Indent::_(3)
. "JHtml::_('stylesheet', 'media/com_"
. $this->componentCodeName
. "/footable-v2/css/footable.metro.min.css', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2) . "}";
- $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $foo .= PHP_EOL . Indent::_(2) . "}";
+ $foo .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Use the Legacy Style.";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)";
- $foo .= PHP_EOL . $this->_t(2) . "{";
- $foo .= PHP_EOL . $this->_t(3)
+ $foo .= PHP_EOL . Indent::_(2) . "{";
+ $foo .= PHP_EOL . Indent::_(3)
. "JHtml::_('stylesheet', 'media/com_"
. $this->componentCodeName
. "/footable-v2/css/footable.standalone.min.css', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2) . "}";
- $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $foo .= PHP_EOL . Indent::_(2) . "}";
+ $foo .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Add the JavaScript for Footable";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('script', 'media/com_"
. $this->componentCodeName . "/footable-v2/js/footable.js', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('script', 'media/com_"
. $this->componentCodeName
. "/footable-v2/js/footable.sort.js', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('script', 'media/com_"
. $this->componentCodeName
. "/footable-v2/js/footable.filter.js', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('script', 'media/com_"
. $this->componentCodeName
. "/footable-v2/js/footable.paginate.js', ['version' => 'auto']);";
if ($init)
{
- $foo .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . PHP_EOL . Indent::_(2)
. '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('
. "'.footable'" . ').footable(); }); jQuery('
. "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'"
. ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('
. "'.footable'" . ').trigger(' . "'footable_resize'"
. '); }";';
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "\$this->document->addScriptDeclaration(\$footable);"
. PHP_EOL;
}
@@ -14164,27 +14032,27 @@ class Interpretation extends Fields
elseif (3 == $this->footableVersion) // loading version 3
{
- $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $foo = PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Add the CSS for Footable";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('stylesheet', 'media/com_"
. $this->componentCodeName
. "/footable-v3/css/footable.standalone.min.css', ['version' => 'auto']);";
- $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $foo .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Add the JavaScript for Footable (adding all functions)";
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "JHtml::_('script', 'media/com_"
. $this->componentCodeName
. "/footable-v3/js/footable.min.js', ['version' => 'auto']);";
if ($init)
{
- $foo .= PHP_EOL . PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . PHP_EOL . Indent::_(2)
. '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('
. "'.footable'" . ').footable();});});";';
- $foo .= PHP_EOL . $this->_t(2)
+ $foo .= PHP_EOL . Indent::_(2)
. "\$this->document->addScriptDeclaration(\$footable);"
. PHP_EOL;
}
@@ -14212,8 +14080,7 @@ class Interpretation extends Fields
))
{
// component helper name
- $Helper = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper';
+ $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
// make sure the custom links are only added once
$firstTimeBeingAdded = true;
// setup correct core target
@@ -14228,16 +14095,16 @@ class Interpretation extends Fields
// add the default
$body = PHP_EOL . "";
$body .= PHP_EOL . " \$item): ?>";
- $body .= PHP_EOL . $this->_t(1) . "_t(2)
+ $body .= PHP_EOL . Indent::_(1) . "authorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;";
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. "\$userChkOut = JFactory::getUser(\$item->checked_out);";
- $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper
+ $body .= PHP_EOL . Indent::_(2) . "\$canDo = " . $Helper
. "::getActions('" . $nameSingleCode . "',\$item,'"
. $nameListCode . "');";
- $body .= PHP_EOL . $this->_t(1) . "?>";
- $body .= PHP_EOL . $this->_t(1) . '';
+ $body .= PHP_EOL . Indent::_(1) . "?>";
+ $body .= PHP_EOL . Indent::_(1) . ' ';
// check if this view has fields that should not be escaped
$doNotEscape = false;
if (isset($this->doNotEscape[$nameListCode]))
@@ -14272,10 +14139,10 @@ class Interpretation extends Fields
$firstTimeBeingAdded = false;
}
// add row to body
- $body .= PHP_EOL . $this->_t(2) . "";
+ $body .= PHP_EOL . Indent::_(2) . " ";
$body .= $itemRow;
$body .= $customAdminViewButtons;
- $body .= PHP_EOL . $this->_t(2) . " ";
+ $body .= PHP_EOL . Indent::_(2) . "";
// increment counter
$counter++;
}
@@ -14288,95 +14155,95 @@ class Interpretation extends Fields
{
$counter++;
// add the defaults
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. "published == 1): ?>";
- $body .= PHP_EOL . $this->_t(3) . '';
- $body .= PHP_EOL . $this->_t(4)
+ $body .= PHP_EOL . Indent::_(4)
. 'langPrefix . "_PUBLISHED'"
. '); ?>">';
- $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_PUBLISHED'" . '); ?>';
- $body .= PHP_EOL . $this->_t(4) . ' ';
- $body .= PHP_EOL . $this->_t(3) . ' ';
+ $body .= PHP_EOL . Indent::_(4) . '';
+ $body .= PHP_EOL . Indent::_(3) . '';
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. "published == 0): ?>";
- $body .= PHP_EOL . $this->_t(3) . '';
- $body .= PHP_EOL . $this->_t(4)
+ $body .= PHP_EOL . Indent::_(4)
. 'langPrefix . "_INACTIVE'"
. '); ?>">';
- $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_INACTIVE'" . '); ?>';
- $body .= PHP_EOL . $this->_t(4) . ' ';
- $body .= PHP_EOL . $this->_t(3) . ' ';
+ $body .= PHP_EOL . Indent::_(4) . '';
+ $body .= PHP_EOL . Indent::_(3) . '';
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. "published == 2): ?>";
- $body .= PHP_EOL . $this->_t(3) . '';
- $body .= PHP_EOL . $this->_t(4)
+ $body .= PHP_EOL . Indent::_(4)
. 'langPrefix . "_ARCHIVED'"
. '); ?>">';
- $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_ARCHIVED'" . '); ?>';
- $body .= PHP_EOL . $this->_t(4) . ' ';
- $body .= PHP_EOL . $this->_t(3) . ' ';
+ $body .= PHP_EOL . Indent::_(4) . '';
+ $body .= PHP_EOL . Indent::_(3) . '';
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. "published == -2): ?>";
- $body .= PHP_EOL . $this->_t(3) . '';
- $body .= PHP_EOL . $this->_t(4)
+ $body .= PHP_EOL . Indent::_(4)
. 'langPrefix . "_TRASHED'"
. '); ?>">';
- $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_TRASHED'" . '); ?>';
- $body .= PHP_EOL . $this->_t(4) . ' ';
- $body .= PHP_EOL . $this->_t(3) . ' ';
- $body .= PHP_EOL . $this->_t(2) . '';
+ $body .= PHP_EOL . Indent::_(4) . '';
+ $body .= PHP_EOL . Indent::_(3) . '';
+ $body .= PHP_EOL . Indent::_(2) . '';
}
// add the defaults
if (!isset($this->fieldsNames[$nameSingleCode]['id']))
{
$counter++;
- $body .= PHP_EOL . $this->_t(2)
+ $body .= PHP_EOL . Indent::_(2)
. '';
- $body .= PHP_EOL . $this->_t(3) . "id; ?>";
- $body .= PHP_EOL . $this->_t(2) . " ";
+ $body .= PHP_EOL . Indent::_(3) . "id; ?>";
+ $body .= PHP_EOL . Indent::_(2) . "";
}
- $body .= PHP_EOL . $this->_t(1) . " ";
+ $body .= PHP_EOL . Indent::_(1) . "";
$body .= PHP_EOL . "";
$body .= PHP_EOL . " ";
if (2 == $this->footableVersion)
{
$body .= PHP_EOL . '';
- $body .= PHP_EOL . $this->_t(1) . '';
- $body .= PHP_EOL . $this->_t(2) . '';
- $body .= PHP_EOL . $this->_t(3)
+ $body .= PHP_EOL . Indent::_(3)
. '';
- $body .= PHP_EOL . $this->_t(2) . ' ';
- $body .= PHP_EOL . $this->_t(1) . ' ';
+ $body .= PHP_EOL . Indent::_(2) . '';
+ $body .= PHP_EOL . Indent::_(1) . '';
$body .= PHP_EOL . ' ';
}
$body .= PHP_EOL . '';
$body .= PHP_EOL . '';
- $body .= PHP_EOL . $this->_t(1)
+ $body .= PHP_EOL . Indent::_(1)
. '';
- $body .= PHP_EOL . $this->_t(2) . '';
- $body .= PHP_EOL . $this->_t(1) . '
';
+ $body .= PHP_EOL . Indent::_(1) . ' ';
$body .= PHP_EOL . '';
// return the build
@@ -14406,8 +14273,7 @@ class Interpretation extends Fields
))
{
// component helper name
- $Helper = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper';
+ $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
$head = '';
// only add new button if set
if ($addNewButon > 0)
@@ -14444,13 +14310,13 @@ class Interpretation extends Fields
$tabB = "";
if ($addNewButon == 2)
{
- $head .= PHP_EOL . $this->_t(1) . '';
- $tabB = $this->_t(1);
+ $head .= PHP_EOL . Indent::_(1) . '
';
+ $tabB = Indent::_(1);
}
// add the new buttons
if ($addNewButon == 1 || $addNewButon == 2)
{
- $head .= PHP_EOL . $tabB . $this->_t(1)
+ $head .= PHP_EOL . $tabB . Indent::_(1)
. '
langPrefix . "_NEW'"
. '); ?>';
@@ -14458,7 +14324,7 @@ class Interpretation extends Fields
// add the close and new button
if ($addNewButon == 2 || $addNewButon == 3)
{
- $head .= PHP_EOL . $tabB . $this->_t(1)
+ $head .= PHP_EOL . $tabB . Indent::_(1)
. '
_t(1) . '';
+ $head .= PHP_EOL . Indent::_(1) . '
';
}
else
{
@@ -14503,10 +14369,10 @@ class Interpretation extends Fields
// make sure only first link is used as togeler
$firstLink = true;
// add to lang array
- $this->setLangContent($this->lang, $statusLangName, 'Status');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $statusLangName, 'Status');
// add to lang array
- $this->setLangContent($this->lang, $idLangName, 'Id');
- $head .= PHP_EOL . $this->_t(1) . "";
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $idLangName, 'Id');
+ $head .= PHP_EOL . Indent::_(1) . " ";
// set controller for data hiding options
$controller = 1;
// build the dynamic fields
@@ -14546,11 +14412,11 @@ class Interpretation extends Fields
? ' data-toggle="true"' : '';
$firstLink = false;
}
- $head .= PHP_EOL . $this->_t(2) . "";
- $head .= PHP_EOL . $this->_t(3) . "";
- $head .= PHP_EOL . $this->_t(2) . " ";
+ $head .= PHP_EOL . Indent::_(2) . "";
$controller++;
}
}
@@ -14560,11 +14426,11 @@ class Interpretation extends Fields
// add the defaults
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
- $head .= PHP_EOL . $this->_t(2) . '';
- $head .= PHP_EOL . $this->_t(3) . "";
- $head .= PHP_EOL . $this->_t(2) . " ";
+ $head .= PHP_EOL . Indent::_(2) . "";
}
// add the defaults
@@ -14573,15 +14439,15 @@ class Interpretation extends Fields
$data_type = (2 == $this->footableVersion)
? 'data-type="numeric"'
: 'data-type="number"';
- $head .= PHP_EOL . $this->_t(2) . '';
- $head .= PHP_EOL . $this->_t(3) . "";
- $head .= PHP_EOL . $this->_t(2) . " ";
+ $head .= PHP_EOL . Indent::_(2) . "";
}
- $head .= PHP_EOL . $this->_t(1) . " ";
+ $head .= PHP_EOL . Indent::_(1) . "";
$head .= PHP_EOL . "";
return $head;
@@ -14619,44 +14485,44 @@ class Interpretation extends Fields
{
$addCategory = false;
}
- $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $query .= PHP_EOL . $this->_t(1) . " * Method to get list data.";
- $query .= PHP_EOL . $this->_t(1) . " *";
- $query .= PHP_EOL . $this->_t(1)
+ $query = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $query .= PHP_EOL . Indent::_(1) . " * Method to get list data.";
+ $query .= PHP_EOL . Indent::_(1) . " *";
+ $query .= PHP_EOL . Indent::_(1)
. " * @return mixed An array of data items on success, false on failure.";
- $query .= PHP_EOL . $this->_t(1) . " */";
- $query .= PHP_EOL . $this->_t(1) . "public function get" . $functionName
+ $query .= PHP_EOL . Indent::_(1) . " */";
+ $query .= PHP_EOL . Indent::_(1) . "public function get" . $functionName
. "()";
- $query .= PHP_EOL . $this->_t(1) . "{";
+ $query .= PHP_EOL . Indent::_(1) . "{";
// setup the query
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Get the user object.";
- $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();";
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Create a new query object.";
- $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();";
- $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);";
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDBO();";
+ $query .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);";
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Select some fields";
- $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');";
+ $query .= PHP_EOL . Indent::_(2) . "\$query->select('a.*');";
// add the category
if ($addCategory)
{
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->select(\$db->quoteName('c.title','category_title'));";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " From the " . $this->componentCodeName . "_"
. $nameSingleCode
. " table";
- $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__"
+ $query .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__"
. $this->componentCodeName . "_" . $nameSingleCode . "', 'a'));";
// add the category
if ($addCategory)
{
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a."
. $categoryCodeName
. "') . ' = ' . \$db->quoteName('c.id') . ')');";
@@ -14678,28 +14544,28 @@ class Interpretation extends Fields
&& strpos($parentKey, '-A>') === false
&& strpos($parentKey, '-OR>') === false)
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by " . $globalKey . " global.";
- $query .= PHP_EOL . $this->_t(2) . "\$" . $globalKey . " = \$this->"
+ $query .= PHP_EOL . Indent::_(2) . "\$" . $globalKey . " = \$this->"
. $globalKey . ";";
- $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $globalKey
+ $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$" . $globalKey
. " ))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key
. " = ' . (int) \$" . $globalKey . " );";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$"
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "elseif (is_string(\$"
. $globalKey . "))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key
. " = ' . \$db->quote(\$" . $globalKey . "));";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "else";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "else";
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $key
. " = -5');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
}
elseif (strpos($parentKey, '-OR>') !== false
|| strpos($key, '-OR>') !== false)
@@ -14730,30 +14596,30 @@ class Interpretation extends Fields
$ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$"
. $_globalKey . ")";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(__LINE__) . " Filter by " . $_globalKey
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(__Line__, __Class__) . " Filter by " . $_globalKey
. " global.";
- $query .= PHP_EOL . $this->_t(2) . "\$" . $_globalKey
+ $query .= PHP_EOL . Indent::_(2) . "\$" . $_globalKey
. " = \$this->" . $_globalKey . ";";
- $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$"
+ $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$"
. $_globalKey . " ))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('" . implode(
" . ' OR ", $ORquery['i']
) . ", ' OR');";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$"
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "elseif (is_string(\$"
. $_globalKey . "))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('" . implode(
" . ' OR ", $ORquery['s']
) . ", ' OR');";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "else";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $ORkey
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "else";
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$query->where('a." . $ORkey
. " = -5');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
}
}
if (isset($this->accessBuilder[$nameSingleCode])
@@ -14761,58 +14627,57 @@ class Interpretation extends Fields
$this->accessBuilder[$nameSingleCode]
))
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Join over the asset groups.";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->select('ag.title AS access_level');";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');";
// check if the access field was over ridden
if (!isset($this->fieldsNames[$nameSingleCode]['access']))
{
// component helper name
- $Helper = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper';
+ $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
// load the access filter query code
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
)
. " Filter by access level.";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$_access = \$this->getState('filter.access');";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "if (\$_access && is_numeric(\$_access))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.access = ' . (int) \$_access);";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "elseif ("
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "elseif ("
. $Helper . "::checkArray(\$_access))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "//"
+ . Line::_(__Line__, __Class__)
. " Secure the array for the query";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$_access = ArrayHelper::toInteger(\$_access);";
- $query .= PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__) . " Filter by the Access Array.";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "//"
+ . Line::_(__Line__, __Class__) . " Filter by the Access Array.";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.access IN (' . implode(',', \$_access) . ')');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
}
// TODO the following will fight against the above access filter
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "if (!\$user->authorise('core.options', 'com_"
. $this->componentCodeName . "'))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3)
. "\$groups = implode(',', \$user->getAuthorisedViewLevels());";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.access IN (' . \$groups . ')');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
}
// add dynamic ordering (Linked view)
if (isset($this->viewsDefaultOrdering[$nameListCode])
@@ -14831,11 +14696,11 @@ class Interpretation extends Fields
)) !== false)
{
// default ordering is by publish and ordering
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//"
- . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Order the results by ordering";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->order('"
. $order_field_name . " " . $order_field['direction']
. "');";
@@ -14845,33 +14710,33 @@ class Interpretation extends Fields
else
{
// default ordering is by publish and ordering
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Order the results by ordering";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->order('a.published ASC');";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->order('a.ordering ASC');";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Load the items";
- $query .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);";
- $query .= PHP_EOL . $this->_t(2) . "\$db->execute();";
- $query .= PHP_EOL . $this->_t(2) . "if (\$db->getNumRows())";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();";
+ $query .= PHP_EOL . Indent::_(2) . "\$db->setQuery(\$query);";
+ $query .= PHP_EOL . Indent::_(2) . "\$db->execute();";
+ $query .= PHP_EOL . Indent::_(2) . "if (\$db->getNumRows())";
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "\$items = \$db->loadObjectList();";
// add the fixing strings method
$query .= $this->setGetItemsMethodStringFix(
$nameSingleCode, $nameListCode,
- $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh],
- $this->_t(1)
+ $this->fileContentStatic[Placefix::_h('Component')],
+ Indent::_(1)
);
// add translations
$query .= $this->setSelectionTranslationFix(
$nameListCode,
- $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh],
- $this->_t(1)
+ $this->fileContentStatic[Placefix::_h('Component')],
+ Indent::_(1)
);
// filter by child repetable field values
if (StringHelper::check($globalKey) && $key
@@ -14881,44 +14746,41 @@ class Interpretation extends Fields
&& strpos($key, '-A>') === false)
{
list($field, $target) = explode('-R>', $key);
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by " . $globalKey . " in this Repetable Field";
- $query .= PHP_EOL . $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->"
+ $query .= PHP_EOL . Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$this->"
. $globalKey . "))";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
- $query .= PHP_EOL . $this->_t(4) . "{";
- $query .= PHP_EOL . $this->_t(5) . "if (isset(\$item->" . $field
- . ") && " . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6)
+ $query .= PHP_EOL . Indent::_(4) . "{";
+ $query .= PHP_EOL . Indent::_(5) . "if (isset(\$item->" . $field
+ . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $field . "))";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6)
. "\$tmpArray = json_decode(\$item->" . $field . ",true);";
- $query .= PHP_EOL . $this->_t(6) . "if (!isset(\$tmpArray['"
- . $target . "']) || !" . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['"
+ $query .= PHP_EOL . Indent::_(6) . "if (!isset(\$tmpArray['"
+ . $target . "']) || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$tmpArray['"
. $target . "']) || !in_array(\$this->" . $globalKey
. ", \$tmpArray['" . $target . "']))";
- $query .= PHP_EOL . $this->_t(6) . "{";
- $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(7) . "continue;";
- $query .= PHP_EOL . $this->_t(6) . "}";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "else";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(4) . "}";
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(3) . "else";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4) . "return false;";
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(6) . "{";
+ $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(7) . "continue;";
+ $query .= PHP_EOL . Indent::_(6) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "else";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(4) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "else";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "return false;";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// filter by child array field values
if (StringHelper::check($globalKey) && $key
@@ -14927,71 +14789,66 @@ class Interpretation extends Fields
) === false
&& strpos($key, '-A>') !== false)
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by " . $globalKey . " Array Field";
- $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->"
+ $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->"
. $globalKey . ";";
- $query .= PHP_EOL . $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey
+ $query .= PHP_EOL . Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && \$" . $globalKey
. ")";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
- $query .= PHP_EOL . $this->_t(4) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "{";
list($bin, $target) = explode('-A>', $key);
if (StringHelper::check($target))
{
- $query .= PHP_EOL . $this->_t(5) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkJson(\$item->" . $target
+ $query .= PHP_EOL . Indent::_(5) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkJson(\$item->" . $target
. "))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "\$item->" . $target
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "\$item->" . $target
. " = json_decode(\$item->" . $target . ", true);";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->"
- . $target . ") || !" . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::checkArray(\$item->"
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->"
+ . $target . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->"
. $target . "))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$"
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "if (!in_array(\$"
. $globalKey . ",\$item->" . $target . "))";
}
else
{
- $query .= PHP_EOL . $this->_t(5) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "\$item->" . $_key
+ $query .= PHP_EOL . Indent::_(5) . "if ("
+ . $this->fileContentStatic[Placefix::_h('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 . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->"
- . $_key . ") || !" . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::checkArray(\$item->"
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "elseif (!isset(\$item->"
+ . $_key . ") || !" . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$item->"
. $_key . "))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$"
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "if (!in_array(\$"
. $globalKey . ",\$item->" . $_key . "))";
}
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(4) . "}";
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(3) . "else";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4) . "return false;";
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(4) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "else";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "return false;";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// filter by parent repetable field values
if (StringHelper::check($globalKey) && $key
@@ -15001,45 +14858,42 @@ class Interpretation extends Fields
&& strpos($parentKey, '-A>') === false)
{
list($bin, $target) = explode('-R>', $parentKey);
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by " . $_key . " Repetable Field";
- $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey
+ $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey
. " = json_decode(\$this->" . $globalKey . ",true);";
- $query .= PHP_EOL . $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$items) && isset(\$"
- . $globalKey . ") && " . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::checkArray(\$"
+ $query .= PHP_EOL . Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && isset(\$"
+ . $globalKey . ") && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$"
. $globalKey . "))";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
- $query .= PHP_EOL . $this->_t(4) . "{";
- $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key
+ $query .= PHP_EOL . Indent::_(4) . "{";
+ $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key
. " && isset(\$" . $globalKey . "['" . $target . "']) && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['"
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['"
. $target . "']))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->" . $_key
. ",\$" . $globalKey . "['" . $target . "']))";
- $query .= PHP_EOL . $this->_t(6) . "{";
- $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(7) . "continue;";
- $query .= PHP_EOL . $this->_t(6) . "}";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "else";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(4) . "}";
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(3) . "else";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4) . "return false;";
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(6) . "{";
+ $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(7) . "continue;";
+ $query .= PHP_EOL . Indent::_(6) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "else";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(4) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "else";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "return false;";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// filter by parent array field values
if (StringHelper::check($globalKey) && $key
@@ -15048,69 +14902,66 @@ class Interpretation extends Fields
) === false
&& strpos($parentKey, '-A>') !== false)
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by " . $globalKey . " Array Field";
- $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->"
+ $query .= PHP_EOL . Indent::_(3) . "\$" . $globalKey . " = \$this->"
. $globalKey . ";";
- $query .= PHP_EOL . $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$items) && "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$items) && "
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "))";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "foreach (\$items as \$nr => &\$item)";
- $query .= PHP_EOL . $this->_t(4) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "{";
list($bin, $target) = explode('-A>', $parentKey);
if (StringHelper::check($target))
{
- $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key
- . " && " . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['"
+ $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key
+ . " && " . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$" . $globalKey . "['"
. $target . "']))";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->"
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->"
. $_key . ",\$" . $globalKey . "['" . $target . "']))";
}
else
{
- $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . ")";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->"
+ $query .= PHP_EOL . Indent::_(5) . "if (\$item->" . $_key . ")";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "if (!in_array(\$item->"
. $_key . ",\$" . $globalKey . "))";
}
- $query .= PHP_EOL . $this->_t(6) . "{";
- $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(7) . "continue;";
- $query .= PHP_EOL . $this->_t(6) . "}";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(5) . "else";
- $query .= PHP_EOL . $this->_t(5) . "{";
- $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);";
- $query .= PHP_EOL . $this->_t(6) . "continue;";
- $query .= PHP_EOL . $this->_t(5) . "}";
- $query .= PHP_EOL . $this->_t(4) . "}";
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(3) . "else";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4) . "return false;";
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(6) . "{";
+ $query .= PHP_EOL . Indent::_(7) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(7) . "continue;";
+ $query .= PHP_EOL . Indent::_(6) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(5) . "else";
+ $query .= PHP_EOL . Indent::_(5) . "{";
+ $query .= PHP_EOL . Indent::_(6) . "unset(\$items[\$nr]);";
+ $query .= PHP_EOL . Indent::_(6) . "continue;";
+ $query .= PHP_EOL . Indent::_(5) . "}";
+ $query .= PHP_EOL . Indent::_(4) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "else";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "return false;";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// add custom php to getitems method after all
$query .= $this->getCustomScriptBuilder(
'php_getitems_after_all', $nameSingleCode,
- PHP_EOL . PHP_EOL . $this->_t(1)
+ PHP_EOL . PHP_EOL . Indent::_(1)
);
- $query .= PHP_EOL . $this->_t(3) . "return \$items;";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "return false;";
- $query .= PHP_EOL . $this->_t(1) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "return \$items;";
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "return false;";
+ $query .= PHP_EOL . Indent::_(1) . "}";
// SELECTIONTRANSLATIONFIXFUNC<<>>
$query .= $this->setSelectionTranslationFixFunc(
$nameListCode,
- $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]
+ $this->fileContentStatic[Placefix::_h('Component')]
);
// fixe mothod name clash
@@ -15143,24 +14994,24 @@ class Interpretation extends Fields
{
// Load to lang
$keyLang = $this->langPrefix . '_' . $custom_button['NAME'];
- $this->setLangContent(
- $this->lang, $keyLang, StringHelper::safe(
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $keyLang, StringHelper::safe(
$custom_button['name'], 'Ww'
)
);
// add cpanel button
- $buttons[] = $this->_t(2) . "if (\$this->canDo->get('"
+ $buttons[] = Indent::_(2) . "if (\$this->canDo->get('"
. $custom_button['link'] . ".access'))";
- $buttons[] = $this->_t(2) . "{";
- $buttons[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $buttons[] = Indent::_(2) . "{";
+ $buttons[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " add " . $custom_button['name'] . " button.";
- $buttons[] = $this->_t(3) . "JToolBarHelper::custom('"
+ $buttons[] = Indent::_(3) . "JToolBarHelper::custom('"
. $nameListCode . ".redirectTo"
. StringHelper::safe(
$custom_button['link'], 'F'
) . "', '" . $custom_button['icon'] . "', '', '" . $keyLang
. "', true);";
- $buttons[] = $this->_t(2) . "}";
+ $buttons[] = Indent::_(2) . "}";
}
if (ArrayHelper::check($buttons))
{
@@ -15191,59 +15042,59 @@ class Interpretation extends Fields
)
{
// add the custom redirect method
- $method[] = PHP_EOL . PHP_EOL . $this->_t(1)
+ $method[] = PHP_EOL . PHP_EOL . Indent::_(1)
. "public function redirectTo"
. StringHelper::safe(
$custom_button['link'], 'F'
) . "()";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check for request forgeries";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "JSession::checkToken() or die(JText:"
. ":_('JINVALID_TOKEN'));";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " check if export is allowed for this user.";
- $method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('"
+ $method[] = Indent::_(2) . "\$user = JFactory::getUser();";
+ $method[] = Indent::_(2) . "if (\$user->authorise('"
. $custom_button['link'] . ".access', 'com_"
. $this->componentCodeName . "'))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the input";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$input = JFactory::getApplication()->input;";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$pks = \$input->post->get('cid', array(), 'array');";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Sanitize the input";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$pks = ArrayHelper::toInteger(\$pks);";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " convert to string";
- $method[] = $this->_t(3) . "\$ids = implode('_', \$pks);";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3) . "\$ids = implode('_', \$pks);";
+ $method[] = Indent::_(3)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName . "&view="
. $custom_button['link'] . "&cid='.\$ids, false));";
- $method[] = $this->_t(3) . "return;";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "return;";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Redirect to the list screen with error.";
- $method[] = $this->_t(2) . "\$message = JText:" . ":_('"
+ $method[] = Indent::_(2) . "\$message = JText:" . ":_('"
. $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME']
. "_FAILED');";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName . "&view=" . $nameListCode
. "', false), \$message, 'error');";
- $method[] = $this->_t(2) . "return;";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(2) . "return;";
+ $method[] = Indent::_(1) . "}";
// add to lang array
$lankey = $this->langPrefix . "_ACCESS_TO_"
. $custom_button['NAME'] . "_FAILED";
- $this->setLangContent(
- $this->lang, $lankey,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $lankey,
'Access to ' . $custom_button['link'] . ' was denied.'
);
}
@@ -15279,109 +15130,107 @@ class Interpretation extends Fields
&& $this->eximportView[$nameListCode])
|| !$isExport)
{
- $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
- $query .= PHP_EOL . $this->_t(1) . " * " . $config['docDesc'];
- $query .= PHP_EOL . $this->_t(1) . " *";
- $query .= PHP_EOL . $this->_t(1)
+ $query = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
+ $query .= PHP_EOL . Indent::_(1) . " * " . $config['docDesc'];
+ $query .= PHP_EOL . Indent::_(1) . " *";
+ $query .= PHP_EOL . Indent::_(1)
. " * @param array \$pks The ids of the items to get";
- $query .= PHP_EOL . $this->_t(1)
+ $query .= PHP_EOL . Indent::_(1)
. " * @param JUser \$user The user making the request";
- $query .= PHP_EOL . $this->_t(1) . " *";
- $query .= PHP_EOL . $this->_t(1)
+ $query .= PHP_EOL . Indent::_(1) . " *";
+ $query .= PHP_EOL . Indent::_(1)
. " * @return mixed An array of data items on success, false on failure.";
- $query .= PHP_EOL . $this->_t(1) . " */";
- $query .= PHP_EOL . $this->_t(1) . "public function "
+ $query .= PHP_EOL . Indent::_(1) . " */";
+ $query .= PHP_EOL . Indent::_(1) . "public function "
. $config['functionName'] . "(\$pks, \$user = null)";
- $query .= PHP_EOL . $this->_t(1) . "{";
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(1) . "{";
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " setup the query";
- $query .= PHP_EOL . $this->_t(2) . "if ((\$pks_size = "
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh]
+ $query .= PHP_EOL . Indent::_(2) . "if ((\$pks_size = "
+ . $this->fileContentStatic[Placefix::_h('Component')]
. "Helper::checkArray(\$pks)) !== false || 'bulk' === \$pks)";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Set a value to know this is " . $config['type']
. " method. (USE IN CUSTOM CODE TO ALTER OUTCOME)";
- $query .= PHP_EOL . $this->_t(3) . "\$_" . $config['type']
+ $query .= PHP_EOL . Indent::_(3) . "\$_" . $config['type']
. " = true;";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the user object if not set.";
- $query .= PHP_EOL . $this->_t(3) . "if (!isset(\$user) || !"
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkObject(\$user))";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4) . "\$user = JFactory::getUser();";
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(3) . "if (!isset(\$user) || !"
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$user))";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4) . "\$user = JFactory::getUser();";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Create a new query object.";
- $query .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDBO();";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "\$db = JFactory::getDBO();";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query = \$db->getQuery(true);";
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Select some fields";
- $query .= PHP_EOL . $this->_t(3) . "\$query->select('a.*');";
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(3) . "\$query->select('a.*');";
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " From the " . $this->componentCodeName . "_"
. $nameSingleCode . " table";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->from(\$db->quoteName('#__"
. $this->componentCodeName . "_" . $nameSingleCode
. "', 'a'));";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " The bulk export path";
- $query .= PHP_EOL . $this->_t(3) . "if ('bulk' === \$pks)";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "if ('bulk' === \$pks)";
+ $query .= PHP_EOL . Indent::_(3)
. "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "\$query->where('a.id > 0');";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "}";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " A large array of ID's will not work out well";
- $query .= PHP_EOL . $this->_t(3) . "elseif (\$pks_size > 500)";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "elseif (\$pks_size > 500)";
+ $query .= PHP_EOL . Indent::_(3)
. "{";
- $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Use lowest ID";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "\$query->where('a.id >= ' . (int) min(\$pks));";
- $query .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Use highest ID";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "\$query->where('a.id <= ' . (int) max(\$pks));";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "}";
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " The normal default path";
- $query .= PHP_EOL . $this->_t(3) . "else";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "else";
+ $query .= PHP_EOL . Indent::_(3)
. "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "\$query->where('a.id IN (' . implode(',',\$pks) . ')');";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "}";
// add custom filtering php
$query .= $this->getCustomScriptBuilder(
'php_getlistquery', $nameSingleCode,
- PHP_EOL . PHP_EOL . $this->_t(1)
+ PHP_EOL . PHP_EOL . Indent::_(1)
);
// first check if we export of text only is avalable
if ($this->exportTextOnly)
{
// add switch
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Get global switch to activate text only export";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$export_text_only = JComponentHelper::getParams('com_"
. $this->componentCodeName
. "')->get('export_text_only', 0);";
// first check if we have custom queries
$custom_query = $this->setCustomQuery(
- $nameListCode, $nameSingleCode, $this->_t(2), true
+ $nameListCode, $nameSingleCode, Indent::_(2), true
);
}
// if values were returned add the area
@@ -15390,14 +15239,14 @@ class Interpretation extends Fields
$custom_query
))
{
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Add these queries only if text only is required";
- $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)";
- $query .= PHP_EOL . $this->_t(3) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "if (\$export_text_only)";
+ $query .= PHP_EOL . Indent::_(3) . "{";
// add the custom fields query
$query .= $custom_query;
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// add access levels if the view has access set
if (isset($this->accessBuilder[$nameSingleCode])
@@ -15405,18 +15254,18 @@ class Interpretation extends Fields
$this->accessBuilder[$nameSingleCode]
))
{
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "if (!\$user->authorise('core.options', 'com_"
. $this->componentCodeName . "'))";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "\$groups = implode(',', \$user->getAuthorisedViewLevels());";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "\$query->where('a.access IN (' . \$groups . ')');";
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// add dynamic ordering (Exported data)
if (isset($this->viewsDefaultOrdering[$nameListCode])
@@ -15432,11 +15281,11 @@ class Interpretation extends Fields
$nameListCode, $order_field['field']
)) !== false)
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Order the results by ordering";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->order('"
. $order_field_name . " "
. $order_field['direction'] . "');";
@@ -15445,68 +15294,67 @@ class Interpretation extends Fields
}
else
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//"
+ . Line::_(
+ __LINE__,__CLASS__
) . " Order the results by ordering";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->order('a.ordering ASC');";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Load the items";
- $query .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);";
- $query .= PHP_EOL . $this->_t(3) . "\$db->execute();";
- $query .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())";
- $query .= PHP_EOL . $this->_t(3) . "{";
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(3) . "\$db->setQuery(\$query);";
+ $query .= PHP_EOL . Indent::_(3) . "\$db->execute();";
+ $query .= PHP_EOL . Indent::_(3) . "if (\$db->getNumRows())";
+ $query .= PHP_EOL . Indent::_(3) . "{";
+ $query .= PHP_EOL . Indent::_(4)
. "\$items = \$db->loadObjectList();";
// set the string fixing code
$query .= $this->setGetItemsMethodStringFix(
$nameSingleCode, $nameListCode,
- $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh],
- $this->_t(2), $isExport, true
+ $this->fileContentStatic[Placefix::_h('Component')],
+ Indent::_(2), $isExport, true
);
// first check if we export of text only is avalable
if ($this->exportTextOnly)
{
$query_translations = $this->setSelectionTranslationFix(
$nameListCode,
- $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh], $this->_t(3)
+ $this->fileContentStatic[Placefix::_h('Component')], Indent::_(3)
);
}
// add translations
if (isset($query_translations)
&& StringHelper::check($query_translations))
{
- $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(3) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Add these translation only if text only is required";
- $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)";
- $query .= PHP_EOL . $this->_t(3) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "if (\$export_text_only)";
+ $query .= PHP_EOL . Indent::_(3) . "{";
$query .= $query_translations;
- $query .= PHP_EOL . $this->_t(3) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
}
// add custom php to getItems method after all
$query .= $this->getCustomScriptBuilder(
'php_getitems_after_all', $nameSingleCode,
- PHP_EOL . PHP_EOL . $this->_t(2)
+ PHP_EOL . PHP_EOL . Indent::_(2)
);
// in privacy export we must return array of arrays
if ('privacy' === $config['type'])
{
- $query .= PHP_EOL . $this->_t(4)
+ $query .= PHP_EOL . Indent::_(4)
. "return json_decode(json_encode(\$items), true);";
}
else
{
- $query .= PHP_EOL . $this->_t(4) . "return \$items;";
+ $query .= PHP_EOL . Indent::_(4) . "return \$items;";
}
- $query .= PHP_EOL . $this->_t(3) . "}";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "return false;";
- $query .= PHP_EOL . $this->_t(1) . "}";
+ $query .= PHP_EOL . Indent::_(3) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "return false;";
+ $query .= PHP_EOL . Indent::_(1) . "}";
// get the header script
if ($isExport)
{
@@ -15517,7 +15365,7 @@ class Interpretation extends Fields
'php_import_headers', 'import_' . $nameListCode,
PHP_EOL . PHP_EOL, null, true,
// set a default script for those with no custom script
- PHP_EOL . PHP_EOL . $this->setPlaceholders(
+ PHP_EOL . PHP_EOL . CFactory::_('Placeholder')->update(
$header, $this->placeholders
)
);
@@ -15538,150 +15386,147 @@ class Interpretation extends Fields
$method = array();
// add the export method
- $method[] = PHP_EOL . PHP_EOL . $this->_t(1)
+ $method[] = PHP_EOL . PHP_EOL . Indent::_(1)
. "public function exportData()";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check for request forgeries";
- $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:"
+ $method[] = Indent::_(2) . "JSession::checkToken() or die(JText:"
. ":_('JINVALID_TOKEN'));";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " check if export is allowed for this user.";
- $method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('"
+ $method[] = Indent::_(2) . "\$user = JFactory::getUser();";
+ $method[] = Indent::_(2) . "if (\$user->authorise('"
. $nameSingleCode . ".export', 'com_"
. $this->componentCodeName
. "') && \$user->authorise('core.export', 'com_"
. $this->componentCodeName . "'))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the input";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$input = JFactory::getApplication()->input;";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$pks = \$input->post->get('cid', array(), 'array');";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Sanitize the input";
- $method[] = $this->_t(3) . "\$pks = ArrayHelper::toInteger(\$pks);";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "\$pks = ArrayHelper::toInteger(\$pks);";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the model";
- $method[] = $this->_t(3) . "\$model = \$this->getModel('"
+ $method[] = Indent::_(3) . "\$model = \$this->getModel('"
. StringHelper::safe($nameListCode, 'F')
. "');";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the data to export";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$data = \$model->getExportData(\$pks);";
- $method[] = $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkArray(\$data))";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkArray(\$data))";
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " now set the data to the spreadsheet";
- $method[] = $this->_t(4) . "\$date = JFactory::getDate();";
- $method[] = $this->_t(4) . $this->fileContentStatic[$this->hhh
- . 'Component' . $this->hhh] . "Helper::xls(\$data,'"
+ $method[] = Indent::_(4) . "\$date = JFactory::getDate();";
+ $method[] = Indent::_(4) . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::xls(\$data,'"
. StringHelper::safe($nameListCode, 'F')
. "_'.\$date->format('jS_F_Y'),'"
. StringHelper::safe($nameListCode, 'Ww')
. " exported ('.\$date->format('jS F, Y').')','"
. StringHelper::safe($nameListCode, 'w')
. "');";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Redirect to the list screen with error.";
- $method[] = $this->_t(2) . "\$message = JText:" . ":_('"
+ $method[] = Indent::_(2) . "\$message = JText:" . ":_('"
. $this->langPrefix . "_EXPORT_FAILED');";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName . "&view=" . $nameListCode
. "', false), \$message, 'error');";
- $method[] = $this->_t(2) . "return;";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(2) . "return;";
+ $method[] = Indent::_(1) . "}";
// add the import method
- $method[] = PHP_EOL . PHP_EOL . $this->_t(1)
+ $method[] = PHP_EOL . PHP_EOL . Indent::_(1)
. "public function importData()";
- $method[] = $this->_t(1) . "{";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(1) . "{";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Check for request forgeries";
- $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:"
+ $method[] = Indent::_(2) . "JSession::checkToken() or die(JText:"
. ":_('JINVALID_TOKEN'));";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " check if import is allowed for this user.";
- $method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('"
+ $method[] = Indent::_(2) . "\$user = JFactory::getUser();";
+ $method[] = Indent::_(2) . "if (\$user->authorise('"
. $nameSingleCode . ".import', 'com_"
. $this->componentCodeName
. "') && \$user->authorise('core.import', 'com_"
. $this->componentCodeName . "'))";
- $method[] = $this->_t(2) . "{";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(2) . "{";
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " Get the import model";
- $method[] = $this->_t(3) . "\$model = \$this->getModel('"
+ $method[] = Indent::_(3) . "\$model = \$this->getModel('"
. StringHelper::safe($nameListCode, 'F')
. "');";
- $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the headers to import";
- $method[] = $this->_t(3)
+ $method[] = Indent::_(3)
. "\$headers = \$model->getExImPortHeaders();";
- $method[] = $this->_t(3) . "if ("
- . $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . "Helper::checkObject(\$headers))";
- $method[] = $this->_t(3) . "{";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(3) . "if ("
+ . $this->fileContentStatic[Placefix::_h('Component')] . "Helper::checkObject(\$headers))";
+ $method[] = Indent::_(3) . "{";
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load headers to session.";
- $method[] = $this->_t(4) . "\$session = JFactory::getSession();";
- $method[] = $this->_t(4) . "\$headers = json_encode(\$headers);";
- $method[] = $this->_t(4) . "\$session->set('" . $nameSingleCode
+ $method[] = Indent::_(4) . "\$session = JFactory::getSession();";
+ $method[] = Indent::_(4) . "\$headers = json_encode(\$headers);";
+ $method[] = Indent::_(4) . "\$session->set('" . $nameSingleCode
. "_VDM_IMPORTHEADERS', \$headers);";
- $method[] = $this->_t(4) . "\$session->set('backto_VDM_IMPORT', '"
+ $method[] = Indent::_(4) . "\$session->set('backto_VDM_IMPORT', '"
. $nameListCode . "');";
- $method[] = $this->_t(4)
+ $method[] = Indent::_(4)
. "\$session->set('dataType_VDM_IMPORTINTO', '"
. $nameSingleCode . "');";
- $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Redirect to import view.";
// add to lang array
$selectImportFileNote = $this->langPrefix
. "_IMPORT_SELECT_FILE_FOR_"
. StringHelper::safe($nameListCode, 'U');
- $this->setLangContent(
- $this->lang, $selectImportFileNote,
+ CFactory::_('Language')->set(
+ CFactory::_('Config')->lang_target, $selectImportFileNote,
'Select the file to import data to ' . $nameListCode . '.'
);
- $method[] = $this->_t(4) . "\$message = JText:" . ":_('"
+ $method[] = Indent::_(4) . "\$message = JText:" . ":_('"
. $selectImportFileNote . "');";
// if this view has custom script it must have as custom import (model, veiw, controller)
if (isset($this->importCustomScripts[$nameListCode])
&& $this->importCustomScripts[$nameListCode])
{
- $method[] = $this->_t(4)
+ $method[] = Indent::_(4)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName . "&view=import_"
. $nameListCode . "', false), \$message);";
}
else
{
- $method[] = $this->_t(4)
+ $method[] = Indent::_(4)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName
. "&view=import', false), \$message);";
}
- $method[] = $this->_t(4) . "return;";
- $method[] = $this->_t(3) . "}";
- $method[] = $this->_t(2) . "}";
- $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $method[] = Indent::_(4) . "return;";
+ $method[] = Indent::_(3) . "}";
+ $method[] = Indent::_(2) . "}";
+ $method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Redirect to the list screen with error.";
- $method[] = $this->_t(2) . "\$message = JText:" . ":_('"
+ $method[] = Indent::_(2) . "\$message = JText:" . ":_('"
. $this->langPrefix . "_IMPORT_FAILED');";
- $method[] = $this->_t(2)
+ $method[] = Indent::_(2)
. "\$this->setRedirect(JRoute::_('index.php?option=com_"
. $this->componentCodeName . "&view=" . $nameListCode
. "', false), \$message, 'error');";
- $method[] = $this->_t(2) . "return;";
- $method[] = $this->_t(1) . "}";
+ $method[] = Indent::_(2) . "return;";
+ $method[] = Indent::_(1) . "}";
return implode(PHP_EOL, $method);
}
@@ -15699,16 +15544,16 @@ class Interpretation extends Fields
$langExport = $this->langPrefix . '_'
. StringHelper::safe('Export Data', 'U');
// add to lang array
- $this->setLangContent($this->lang, $langExport, 'Export Data');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langExport, 'Export Data');
$button = array();
- $button[] = PHP_EOL . PHP_EOL . $this->_t(3)
+ $button[] = PHP_EOL . PHP_EOL . Indent::_(3)
. "if (\$this->canDo->get('core.export') && \$this->canDo->get('"
. $nameSingleCode . ".export'))";
- $button[] = $this->_t(3) . "{";
- $button[] = $this->_t(4) . "JToolBarHelper::custom('"
+ $button[] = Indent::_(3) . "{";
+ $button[] = Indent::_(4) . "JToolBarHelper::custom('"
. $nameListCode . ".exportData', 'download', '', '"
. $langExport . "', true);";
- $button[] = $this->_t(3) . "}";
+ $button[] = Indent::_(3) . "}";
return implode(PHP_EOL, $button);
}
@@ -15726,17 +15571,17 @@ class Interpretation extends Fields
$langImport = $this->langPrefix . '_'
. StringHelper::safe('Import Data', 'U');
// add to lang array
- $this->setLangContent($this->lang, $langImport, 'Import Data');
+ CFactory::_('Language')->set(CFactory::_('Config')->lang_target, $langImport, 'Import Data');
$button = array();
- $button[] = PHP_EOL . PHP_EOL . $this->_t(2)
+ $button[] = PHP_EOL . PHP_EOL . Indent::_(2)
. "if (\$this->canDo->get('core.import') && \$this->canDo->get('"
. $nameSingleCode . ".import'))";
- $button[] = $this->_t(2) . "{";
- $button[] = $this->_t(3) . "JToolBarHelper::custom('"
+ $button[] = Indent::_(2) . "{";
+ $button[] = Indent::_(3) . "JToolBarHelper::custom('"
. $nameListCode . ".importData', 'upload', '', '"
. $langImport
. "', false);";
- $button[] = $this->_t(2) . "}";
+ $button[] = Indent::_(2) . "}";
return implode(PHP_EOL, $button);
}
@@ -15751,46 +15596,40 @@ class Interpretation extends Fields
$this->buildDynamique($target, 'customimport');
// load the custom script to the files
// IMPORT_EXT_METHOD <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_EXT_METHOD' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_EXT_METHOD')]
= $this->getCustomScriptBuilder(
'php_import_ext', 'import_' . $nameListCode, PHP_EOL, null,
true
);
// IMPORT_DISPLAY_METHOD_CUSTOM <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_DISPLAY_METHOD_CUSTOM' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DISPLAY_METHOD_CUSTOM')]
= $this->getCustomScriptBuilder(
'php_import_display', 'import_' . $nameListCode, PHP_EOL,
null,
true
);
// IMPORT_SETDATA_METHOD <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_SETDATA_METHOD' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SETDATA_METHOD')]
= $this->getCustomScriptBuilder(
'php_import_setdata', 'import_' . $nameListCode, PHP_EOL,
null,
true
);
// IMPORT_METHOD_CUSTOM <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_METHOD_CUSTOM' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_METHOD_CUSTOM')]
= $this->getCustomScriptBuilder(
'php_import', 'import_' . $nameListCode, PHP_EOL, null,
true
);
// IMPORT_SAVE_METHOD <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_SAVE_METHOD' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_SAVE_METHOD')]
= $this->getCustomScriptBuilder(
'php_import_save', 'import_' . $nameListCode, PHP_EOL,
null,
true
);
// IMPORT_DEFAULT_VIEW_CUSTOM <<>>
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'IMPORT_DEFAULT_VIEW_CUSTOM' . $this->hhh]
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('IMPORT_DEFAULT_VIEW_CUSTOM')]
= $this->getCustomScriptBuilder(
'html_import_view', 'import_' . $nameListCode, PHP_EOL,
null,
@@ -15798,30 +15637,18 @@ class Interpretation extends Fields
);
// insure we have the view placeholders setup
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'VIEW' . $this->hhh]
- = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS'
- . $this->hhh];
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'View' . $this->hhh]
- = 'Import_' . $this->placeholders[$this->hhh . 'views'
- . $this->hhh];
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'view' . $this->hhh]
- = 'import_' . $this->placeholders[$this->hhh . 'views'
- . $this->hhh];
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'VIEWS' . $this->hhh]
- = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS'
- . $this->hhh];
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'Views' . $this->hhh]
- = 'Import_' . $this->placeholders[$this->hhh . 'views'
- . $this->hhh];
- $this->fileContentDynamic['import_' . $nameListCode][$this->hhh
- . 'views' . $this->hhh]
- = 'import_' . $this->placeholders[$this->hhh . 'views'
- . $this->hhh];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEW')]
+ = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('View')]
+ = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('view')]
+ = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('VIEWS')]
+ = 'IMPORT_' . CFactory::_('Placeholder')->active[Placefix::_h('VIEWS')];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('Views')]
+ = 'Import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')];
+ $this->fileContentDynamic['import_' . $nameListCode][Placefix::_h('views')]
+ = 'import_' . CFactory::_('Placeholder')->active[Placefix::_h('views')];
}
public function setListQuery(&$nameSingleCode, &$nameListCode)
@@ -15843,31 +15670,31 @@ class Interpretation extends Fields
$addCategoryFilter = 0;
}
// setup the query
- $query = "//" . $this->setLine(__LINE__) . " Get the user object.";
- $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();";
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query = "//" . Line::_(__Line__, __Class__) . " Get the user object.";
+ $query .= PHP_EOL . Indent::_(2) . "\$user = JFactory::getUser();";
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Create a new query object.";
- $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();";
- $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);";
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(2) . "\$db = JFactory::getDBO();";
+ $query .= PHP_EOL . Indent::_(2) . "\$query = \$db->getQuery(true);";
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Select some fields";
- $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');";
+ $query .= PHP_EOL . Indent::_(2) . "\$query->select('a.*');";
// add the category
if ($addCategory)
{
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->select(\$db->quoteName('c.title','category_title'));";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " From the " . $this->componentCodeName . "_item table";
- $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__"
+ $query .= PHP_EOL . Indent::_(2) . "\$query->from(\$db->quoteName('#__"
. $this->componentCodeName . "_" . $nameSingleCode . "', 'a'));";
// add the category
if ($addCategory)
{
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a."
. $categoryCodeName
. "') . ' = ' . \$db->quoteName('c.id') . ')');";
@@ -15878,78 +15705,77 @@ class Interpretation extends Fields
);
// add the custom fields query
$query .= $this->setCustomQuery($nameListCode, $nameSingleCode);
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Filter by published state";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$published = \$this->getState('filter.published');";
- $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$published))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(2) . "if (is_numeric(\$published))";
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.published = ' . (int) \$published);";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "elseif (\$published === '')";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "elseif (\$published === '')";
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('(a.published = 0 OR a.published = 1)');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
if (isset($this->accessBuilder[$nameSingleCode])
&& StringHelper::check(
$this->accessBuilder[$nameSingleCode]
))
{
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
) . " Join over the asset groups.";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->select('ag.title AS access_level');";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');";
// check if the access field was over ridden
if (!isset($this->fieldsNames[$nameSingleCode]['access']))
{
// component helper name
- $Helper = $this->fileContentStatic[$this->hhh . 'Component'
- . $this->hhh] . 'Helper';
+ $Helper = $this->fileContentStatic[Placefix::_h('Component')] . 'Helper';
// load the access filter query code
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
- __LINE__
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(
+ __LINE__,__CLASS__
)
. " Filter by access level.";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "\$_access = \$this->getState('filter.access');";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "if (\$_access && is_numeric(\$_access))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.access = ' . (int) \$_access);";
- $query .= PHP_EOL . $this->_t(2) . "}";
- $query .= PHP_EOL . $this->_t(2) . "elseif ("
+ $query .= PHP_EOL . Indent::_(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "elseif ("
. $Helper . "::checkArray(\$_access))";
- $query .= PHP_EOL . $this->_t(2) . "{";
- $query .= PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "{";
+ $query .= PHP_EOL . Indent::_(3) . "//"
+ . Line::_(__Line__, __Class__)
. " Secure the array for the query";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3)
. "\$_access = ArrayHelper::toInteger(\$_access);";
- $query .= PHP_EOL . $this->_t(3) . "//"
- . $this->setLine(__LINE__) . " Filter by the Access Array.";
- $query .= PHP_EOL . $this->_t(3)
+ $query .= PHP_EOL . Indent::_(3) . "//"
+ . Line::_(__Line__, __Class__) . " Filter by the Access Array.";
+ $query .= PHP_EOL . Indent::_(3)
. "\$query->where('a.access IN (' . implode(',', \$_access) . ')');";
- $query .= PHP_EOL . $this->_t(2) . "}";
+ $query .= PHP_EOL . Indent::_(2) . "}";
}
// TODO the following will fight against the above access filter
- $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__)
+ $query .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(2)
+ $query .= PHP_EOL . Indent::_(2)
. "if (!\$user->authorise('core.options', 'com_"