2016-02-26 00:20:09 +00:00
< ? php
2021-12-21 14:44:50 +00:00
/**
2018-05-18 06:28:27 +00:00
* @ package Joomla . Component . Builder
*
* @ created 30 th April , 2015
2021-12-21 14:44:50 +00:00
* @ author Llewellyn van der Merwe < https :// dev . vdm . io >
* @ gitea Joomla Component Builder < https :// git . vdm . dev / joomla / Component - Builder >
2018-05-18 06:28:27 +00:00
* @ github Joomla Component Builder < https :// github . com / vdm - io / Joomla - Component - Builder >
2021-01-03 16:49:35 +00:00
* @ copyright Copyright ( C ) 2015 Vast Development Method . All rights reserved .
2018-05-18 06:28:27 +00:00
* @ license GNU General Public License version 2 or later ; see LICENSE . txt
*/
2016-02-26 00:20:09 +00:00
// No direct access to this file
defined ( '_JEXEC' ) or die ( 'Restricted access' );
2022-03-09 23:46:45 +00:00
use VDM\Joomla\Utilities\StringHelper ;
use VDM\Joomla\Utilities\JsonHelper ;
use VDM\Joomla\Utilities\ArrayHelper ;
2022-08-30 15:28:41 +00:00
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory ;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix ;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent ;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line ;
2023-01-22 00:38:21 +00:00
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Unique ;
2021-03-07 21:40:55 +00:00
2016-02-26 00:20:09 +00:00
/**
* Get class as the main compilers class
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
class Get
{
2019-05-15 22:50:45 +00:00
2019-08-08 15:35:58 +00:00
/**
* The Joomla Version
2020-03-28 13:34:14 +00:00
*
2019-08-08 15:35:58 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> joomla_version ;
2019-08-08 15:35:58 +00:00
*/
public $joomlaVersion ;
2021-12-21 14:44:50 +00:00
/**
* The Joomla Versions
*
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> joomla_versions ;
2021-12-21 14:44:50 +00:00
*/
public $joomlaVersions = array (
3 => array ( 'folder_key' => 3 , 'xml_version' => 3.9 ), // only joomla 3
3.10 => array ( 'folder_key' => 3 , 'xml_version' => 4.0 ) // legacy joomla 4
);
2018-05-22 19:01:36 +00:00
/**
* The hash placeholder
2020-03-28 13:34:14 +00:00
*
2018-05-22 19:01:36 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use Placefix :: h ();
2018-05-22 19:01:36 +00:00
*/
public $hhh = '#' . '#' . '#' ;
/**
* The open bracket placeholder
2020-03-28 13:34:14 +00:00
*
2018-05-22 19:01:36 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use Placefix :: b ();
2018-05-22 19:01:36 +00:00
*/
public $bbb = '[' . '[' . '[' ;
/**
* The close bracket placeholder
2020-03-28 13:34:14 +00:00
*
2018-05-22 19:01:36 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use Placefix :: d ();
2018-05-22 19:01:36 +00:00
*/
public $ddd = ']' . ']' . ']' ;
2017-10-26 16:43:51 +00:00
/**
* The app
2020-03-28 13:34:14 +00:00
*
2017-10-26 16:43:51 +00:00
* @ var object
*/
public $app ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Params
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var object
*/
public $params ;
2017-12-14 23:10:47 +00:00
2019-09-10 16:47:39 +00:00
/**
* Add strict field export permissions
2020-03-28 13:34:14 +00:00
*
2019-09-10 16:47:39 +00:00
* @ var boolean
*/
public $strictFieldExportPermissions = false ;
/**
* Add text only export options
2020-03-28 13:34:14 +00:00
*
2019-09-10 16:47:39 +00:00
* @ var boolean
*/
public $exportTextOnly = false ;
2019-02-15 22:03:21 +00:00
/**
* The global placeholders
2020-03-28 13:34:14 +00:00
*
2019-02-15 22:03:21 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Placeholder' ) -> get ();
2019-02-15 22:03:21 +00:00
*/
public $globalPlaceholders = array ();
2017-02-13 23:24:38 +00:00
/**
* The placeholders
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder' ) -> active [];
2017-02-13 23:24:38 +00:00
*/
public $placeholders = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Compiler Path
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var object
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> compiler_path ;
2016-02-26 00:20:09 +00:00
*/
public $compilerPath ;
2017-12-14 23:10:47 +00:00
2021-12-21 14:44:50 +00:00
/**
* The JCB Powers Path
*
* @ var object
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> jcb_powers_path ;
2021-12-21 14:44:50 +00:00
*/
public $jcbPowersPath ;
2020-12-10 01:24:29 +00:00
/**
* Switch to add assets table fix
*
* @ var int
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_assets_table_fix ;
2020-12-10 01:24:29 +00:00
*/
public $addAssetsTableFix = 1 ;
2020-12-12 06:24:57 +00:00
/**
* Assets table worse case
*
* @ var int
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> access_worse_case ;
2020-12-12 06:24:57 +00:00
*/
public $accessWorseCase ;
2020-12-10 01:24:29 +00:00
/**
* Switch to add assets table name fix
*
* @ var bool
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_assets_table_name_fix ;
2020-12-10 01:24:29 +00:00
*/
public $addAssetsTableNameFix = false ;
2017-02-14 00:33:24 +00:00
/**
* Switch to add custom code placeholders
2020-03-28 13:34:14 +00:00
*
2017-02-14 00:33:24 +00:00
* @ var bool
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_placeholders ;
2017-02-14 00:33:24 +00:00
*/
public $addPlaceholders = false ;
2017-12-14 23:10:47 +00:00
2020-08-19 00:54:09 +00:00
/**
* Switch to remove line breaks from language strings
*
* @ var bool
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> remove_line_breaks ;
2020-08-19 00:54:09 +00:00
*/
public $removeLineBreaks = false ;
2018-08-02 05:36:47 +00:00
/**
* The placeholders for custom code keys
2020-03-28 13:34:14 +00:00
*
2018-08-02 05:36:47 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2018-08-02 05:36:47 +00:00
*/
2020-03-28 13:34:14 +00:00
protected $customCodeKeyPlacholders
= array (
'[' => '[' ,
']' => ']' ,
',' => ',' ,
'+' => '+' ,
'=' => '='
2018-08-02 05:36:47 +00:00
);
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Component data
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var object
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component' );
2016-02-26 00:20:09 +00:00
*/
public $componentData ;
2017-12-14 23:10:47 +00:00
2022-04-04 15:35:08 +00:00
/**
* The Switch to add Powers data
*
* @ var boolean
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_power ;
2022-04-04 15:35:08 +00:00
*/
2022-05-16 04:25:03 +00:00
public $addPower ;
2022-04-04 15:35:08 +00:00
2021-12-21 14:44:50 +00:00
/**
* The Powers data
*
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Power' ) -> active ;
2021-12-21 14:44:50 +00:00
*/
public $powers = array ();
/**
* The state of all Powers
*
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2021-12-21 14:44:50 +00:00
*/
public $statePowers = array ();
/**
* The linked Powers
*
* @ var array
*/
public $linkedPowers = array ();
2019-08-22 01:54:47 +00:00
/**
* The Plugins data
2020-03-28 13:34:14 +00:00
*
2019-08-22 01:54:47 +00:00
* @ var array
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlaplugin.Data' ) -> get ();
2019-08-22 01:54:47 +00:00
*/
public $joomlaPlugins = array ();
2019-12-06 05:31:32 +00:00
/**
* The Modules data
*
* @ var array
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlamodule.Data' ) -> get ();
2019-12-06 05:31:32 +00:00
*/
public $joomlaModules = array ();
2019-08-15 14:26:46 +00:00
/**
2020-03-28 13:34:14 +00:00
* The custom script placeholders - we use the ( xxx ) to avoid detection it should be ( *** )
* ##################################---> PHP/JS <---####################################
*
* New Insert Code = / xxx [ INSERT <> $ $ $ $ ] xxx / / xxx [ / INSERT <> $ $ $ $ ] xxx /
* New Replace Code = / xxx [ REPLACE <> $ $ $ $ ] xxx / / xxx [ / REPLACE <> $ $ $ $ ] xxx /
*
* //////////////////////////////// when JCB adds it back //////////////////////////////////
2021-08-11 12:15:35 +00:00
* JCB Add Inserted Code = / xxx [ INSERTED $ $ $ $ ] xxx //xx23xx/ /xxx[/INSERTED$$$$]xxx/
* JCB Add Replaced Code = / xxx [ REPLACED $ $ $ $ ] xxx //xx25xx/ /xxx[/REPLACED$$$$]xxx/
2020-03-28 13:34:14 +00:00
*
* /////////////////////////////// changeing existing custom code /////////////////////////
2021-08-11 12:15:35 +00:00
* Update Inserted Code = / xxx [ INSERTED <> $ $ $ $ ] xxx //xx23xx/ /xxx[/INSERTED<>$$$$]xxx/
* Update Replaced Code = / xxx [ REPLACED <> $ $ $ $ ] xxx //xx25xx/ /xxx[/REPLACED<>$$$$]xxx/
2020-03-28 13:34:14 +00:00
*
* The custom script placeholders - we use the ( == ) to avoid detection it should be ( -- )
* ###################################---> HTML <---#####################################
*
* New Insert Code = <!== [ INSERT <> $ $ $ $ ] ==> <!== [ / INSERT <> $ $ $ $ ] ==>
* New Replace Code = <!== [ REPLACE <> $ $ $ $ ] ==> <!== [ / REPLACE <> $ $ $ $ ] ==>
*
* ///////////////////////////////// when JCB adds it back ///////////////////////////////
* JCB Add Inserted Code = <!== [ INSERTED $ $ $ $ ] ==><!== 23 ==> <!== [ / INSERTED $ $ $ $ ] ==>
* JCB Add Replaced Code = <!== [ REPLACED $ $ $ $ ] ==><!== 25 ==> <!== [ / REPLACED $ $ $ $ ] ==>
*
* //////////////////////////// changeing existing custom code ///////////////////////////
* Update Inserted Code = <!== [ INSERTED <> $ $ $ $ ] ==><!== 23 ==> <!== [ / INSERTED <> $ $ $ $ ] ==>
* Update Replaced Code = <!== [ REPLACED <> $ $ $ $ ] ==><!== 25 ==> <!== [ / REPLACED <> $ $ $ $ ] ==>
*
* ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* @ var array
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2020-03-28 13:34:14 +00:00
*/
protected $customCodePlaceholders
= array (
1 => 'REPLACE<>$$$$]' ,
2 => 'INSERT<>$$$$]' ,
3 => 'REPLACED<>$$$$]' ,
4 => 'INSERTED<>$$$$]'
);
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* The custom code to be added
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode' ) -> active
2017-02-01 13:17:04 +00:00
*/
public $customCode ;
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* The custom code to be added
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2017-02-13 23:24:38 +00:00
*/
protected $customCodeData = array ();
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* The function name memory ids
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode' ) -> functionNameMemory
2017-02-13 23:24:38 +00:00
*/
public $functionNameMemory = array ();
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* The custom code for local memory
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode' ) -> memory
2017-02-13 23:24:38 +00:00
*/
public $customCodeMemory = array ();
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
2018-01-31 13:35:54 +00:00
* The custom code in local files that already exist in system
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
* @ var array
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
protected $existingCustomCode = array ();
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* The custom code in local files this are new
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
* @ var array
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
protected $newCustomCode = array ();
2017-12-14 23:10:47 +00:00
2017-02-09 16:11:10 +00:00
/**
* The index of code already loaded
2020-03-28 13:34:14 +00:00
*
2017-02-09 16:11:10 +00:00
* @ var array
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-09 16:11:10 +00:00
*/
2017-12-14 23:10:47 +00:00
protected $codeAreadyDone = array ();
2018-01-31 13:35:54 +00:00
/**
2018-02-03 00:13:48 +00:00
* The external code / string to be added
2020-03-28 13:34:14 +00:00
*
2018-01-31 13:35:54 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2018-01-31 13:35:54 +00:00
*/
2018-02-03 00:13:48 +00:00
protected $externalCodeString = array ();
2018-01-31 13:35:54 +00:00
2021-12-21 14:44:50 +00:00
/**
* The external code / string cutter
*
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2021-12-21 14:44:50 +00:00
*/
protected $externalCodeCutter = array ();
2017-02-13 23:24:38 +00:00
/*
* The line numbers Switch
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var boolean
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> debug_line_nr ;
2017-02-13 23:24:38 +00:00
*/
2017-12-14 23:10:47 +00:00
public $debugLinenr = false ;
2017-04-06 08:47:51 +00:00
/*
* The percentage when a language should be added
2020-03-28 13:34:14 +00:00
*
2017-04-06 08:47:51 +00:00
* @ var boolean
*/
public $percentageLanguageAdd = 0 ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2017-04-05 13:21:10 +00:00
* The Placholder Language prefix
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> lang_prefix ;
2016-02-26 00:20:09 +00:00
*/
2017-04-05 13:21:10 +00:00
public $langPrefix ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Language content
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public $langContent = array ();
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* The Languages bucket
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
* @ var array
*/
2020-03-28 13:34:14 +00:00
public $languages
= array ( 'components' => array (), 'modules' => array (),
'plugins' => array ());
2018-04-19 23:36:21 +00:00
/**
* The Main Languages
2020-03-28 13:34:14 +00:00
*
2018-04-19 23:36:21 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> lang_tag ;
2018-04-19 23:36:21 +00:00
*/
public $langTag = 'en-GB' ;
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* The Multi Languages bucket
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
* @ var array
*/
public $multiLangString = array ();
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* The new lang to add
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
* @ var array
*/
protected $newLangStrings = array ();
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* The existing lang to update
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
* @ var array
*/
protected $existingLangStrings = array ();
2017-12-14 23:10:47 +00:00
2017-12-14 13:30:21 +00:00
/**
* The Language JS matching check
2020-03-28 13:34:14 +00:00
*
2017-12-14 13:30:21 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Language.Extractor' ) -> langMismatch ;
2017-12-14 13:30:21 +00:00
*/
public $langMismatch = array ();
2017-12-14 23:10:47 +00:00
2017-12-14 13:30:21 +00:00
/**
* The Language SC matching check
2020-03-28 13:34:14 +00:00
*
2017-12-14 13:30:21 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Language.Extractor' ) -> langMatch ;
2017-12-14 13:30:21 +00:00
*/
public $langMatch = array ();
2017-12-14 23:10:47 +00:00
2017-12-14 13:30:21 +00:00
/**
* The Language string targets
2020-03-28 13:34:14 +00:00
*
2017-12-14 13:30:21 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> lang_string_targets ;
2017-12-14 13:30:21 +00:00
*/
2020-03-28 13:34:14 +00:00
public $langStringTargets
= array (
'Joomla' . '.JText._(' ,
'JText:' . ':script(' ,
2020-07-07 15:13:04 +00:00
'Text:' . ':_(' , // namespace and J version will be found
'Text:' . ':sprintf(' , // namespace and J version will be found
2020-03-28 13:34:14 +00:00
'JustTEXT:' . ':_('
);
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Component Code Name
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> component_code_name ;
2016-02-26 00:20:09 +00:00
*/
public $componentCodeName ;
2017-12-14 23:10:47 +00:00
2022-08-21 17:21:03 +00:00
/**
* The Component Context
*
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> component_context ;
2022-08-21 17:21:03 +00:00
*/
public $componentContext ;
2020-12-10 01:24:29 +00:00
/**
* The Component Code Name Length
*
* @ var int
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> component_code_name_length ;
2020-12-10 01:24:29 +00:00
*/
public $componentCodeNameLength ;
2017-02-13 23:24:38 +00:00
/**
* The Component ID
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var int
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> component_id ;
2017-02-13 23:24:38 +00:00
*/
public $componentID ;
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* The current user
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
*/
public $user ;
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* The database object
2020-03-28 13:34:14 +00:00
*
2017-02-13 23:24:38 +00:00
* @ var array
*/
public $db ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Component version
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> component_version ;
2016-02-26 00:20:09 +00:00
*/
public $component_version ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The UIKIT Switch
2020-03-28 13:34:14 +00:00
*
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> uikit ;
2016-02-26 00:20:09 +00:00
*/
2017-11-11 04:33:51 +00:00
public $uikit = 0 ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The UIKIT component checker
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.uikit_comp' );
2016-02-26 00:20:09 +00:00
*/
public $uikitComp = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The FOOTABLE Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> footable ;
2016-02-26 00:20:09 +00:00
*/
public $footable = false ;
2017-12-14 23:10:47 +00:00
2016-04-22 12:03:43 +00:00
/**
* The FOOTABLE Version
2020-03-28 13:34:14 +00:00
*
2016-04-22 12:03:43 +00:00
* @ var int
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> footable_version ;
2016-04-22 12:03:43 +00:00
*/
public $footableVersion ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Google Chart Switch per view
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.google_chart' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $googleChart = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Google Chart Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> google_chart ;
2016-02-26 00:20:09 +00:00
*/
public $googlechart = false ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Import & Export Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_eximport ;
2016-02-26 00:20:09 +00:00
*/
public $addEximport = false ;
2017-12-14 23:10:47 +00:00
2020-04-19 00:48:23 +00:00
/**
* The Import & Export View
*
* @ var array
*/
public $eximportView = array ();
/**
* The Import & Export Custom Script
*
* @ var array
*/
public $importCustomScripts = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Tag & History Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> set_tag_history ;
2016-02-26 00:20:09 +00:00
*/
public $setTagHistory = false ;
2017-12-14 23:10:47 +00:00
2018-08-23 01:37:42 +00:00
/**
* The Joomla Fields Switch
2020-03-28 13:34:14 +00:00
*
2018-08-23 01:37:42 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> set_joomla_fields ;
2018-08-23 01:37:42 +00:00
*/
public $setJoomlaFields = false ;
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The site edit views
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.site_edit_view' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $siteEditView = [];
2017-12-14 23:10:47 +00:00
2020-11-17 04:06:34 +00:00
/**
* The admin list view filter type
*
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.admin_filter_type' );
2020-11-17 04:06:34 +00:00
*/
public $adminFilterType = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Language target
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> lang_target ;
2016-02-26 00:20:09 +00:00
*/
public $lang = 'admin' ;
2017-12-14 23:10:47 +00:00
2019-09-11 14:50:42 +00:00
/**
* The lang keys for extentions
2020-03-28 13:34:14 +00:00
*
2019-09-11 14:50:42 +00:00
* @ var array
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Language.Extractor' ) -> langKeys ;
2019-09-11 14:50:42 +00:00
*/
public $langKeys = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Build target Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> build_target ;
2016-02-26 00:20:09 +00:00
*/
public $target ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The unique codes
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
2016-02-26 13:57:30 +00:00
public $uniquecodes = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 13:57:30 +00:00
* The unique keys
2020-03-28 13:34:14 +00:00
*
2016-02-26 13:57:30 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3
2016-02-26 13:57:30 +00:00
*/
public $uniquekeys = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2023-01-15 08:42:19 +00:00
* The Add contributors Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> add_contributors ;
2016-02-26 00:20:09 +00:00
*/
public $addContributors = false ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Custom Script Builder
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-08-31 11:49:01 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Dispenser' ) -> hub ;
2016-02-26 00:20:09 +00:00
*/
public $customScriptBuilder = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Footable Script Builder
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.footable_scripts' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $footableScripts = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The pathe to the bom file to be used
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> bom_path ;
2016-02-26 00:20:09 +00:00
*/
public $bomPath ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The SQL Tweak of admin views
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.sql_tweak' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $sqlTweak = [];
2017-12-14 23:10:47 +00:00
2018-03-27 09:57:16 +00:00
/**
* The validation rules that should be added
2020-03-28 13:34:14 +00:00
*
2018-03-27 09:57:16 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'validation.rules' );
2018-03-27 09:57:16 +00:00
*/
public $validationRules = array ();
2019-08-22 01:54:47 +00:00
/**
* The validation linked to fields
2020-03-28 13:34:14 +00:00
*
2019-08-22 01:54:47 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked' );
2019-08-22 01:54:47 +00:00
*/
public $validationLinkedFields = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The admin views data array
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
private $_adminViewData = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The field data array
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
private $_fieldData = array ();
2017-12-14 23:10:47 +00:00
2018-03-28 09:46:14 +00:00
/**
* The custom alias builder
2020-03-28 13:34:14 +00:00
*
2018-03-28 09:46:14 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.custom_alias' );
2018-03-28 09:46:14 +00:00
*/
2023-01-15 08:42:19 +00:00
public $customAliasBuilder = [];
2018-03-28 09:46:14 +00:00
2018-03-18 04:28:54 +00:00
/**
* The field builder type
2020-03-28 13:34:14 +00:00
*
2018-03-18 04:28:54 +00:00
* 1 = StringManipulation
* 2 = SimpleXMLElement
2020-03-28 13:34:14 +00:00
*
2018-03-18 04:28:54 +00:00
* @ var int
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> field_builder_type ;
2018-03-18 04:28:54 +00:00
*/
public $fieldBuilderType ;
2018-03-11 02:44:43 +00:00
/**
* Set unique Names
2020-03-28 13:34:14 +00:00
*
2018-03-11 02:44:43 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'unique.names' );
2018-03-11 02:44:43 +00:00
*/
public $uniqueNames = array ();
/**
* Set unique Names
2020-03-28 13:34:14 +00:00
*
2018-03-11 02:44:43 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated
2018-03-11 02:44:43 +00:00
*/
protected $uniqueFieldNames = array ();
/**
* Category other name bucket
2020-03-28 13:34:14 +00:00
*
2018-03-11 02:44:43 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'category.other.name' );
2018-03-11 02:44:43 +00:00
*/
public $catOtherName = array ();
2018-05-24 13:56:56 +00:00
/**
* The field relations values
2020-03-28 13:34:14 +00:00
*
2018-05-24 13:56:56 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.field_relations' );
2018-05-24 13:56:56 +00:00
*/
public $fieldRelations = array ();
2020-05-21 23:38:20 +00:00
/**
* The views default ordering
*
* @ var array
*/
public $viewsDefaultOrdering = array ();
2018-07-12 16:35:38 +00:00
/**
* Default Fields
2020-03-28 13:34:14 +00:00
*
2018-07-12 16:35:38 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> default_fields ;
2018-07-12 16:35:38 +00:00
*/
2020-03-28 13:34:14 +00:00
public $defaultFields
= array ( 'created' , 'created_by' , 'modified' , 'modified_by' , 'published' ,
2021-12-21 14:44:50 +00:00
'ordering' , 'access' , 'version' , 'hits' , 'id' );
2018-07-12 16:35:38 +00:00
2018-05-24 13:56:56 +00:00
/**
* The list join fields
2020-03-28 13:34:14 +00:00
*
2018-05-24 13:56:56 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.list_join' );
2018-05-24 13:56:56 +00:00
*/
public $listJoinBuilder = array ();
2018-05-29 03:45:16 +00:00
/**
* The list head over ride
2020-03-28 13:34:14 +00:00
*
2018-05-29 03:45:16 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.list_head_override' );
2018-05-29 03:45:16 +00:00
*/
public $listHeadOverRide = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The linked admin view tabs
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.linked_admin_views' );
2016-02-26 00:20:09 +00:00
*/
public $linkedAdminViews = array ();
2017-12-14 23:10:47 +00:00
2018-08-24 21:46:41 +00:00
/**
* The custom admin view tabs
2020-03-28 13:34:14 +00:00
*
2018-08-24 21:46:41 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.custom_tabs' );
2018-08-24 21:46:41 +00:00
*/
public $customTabs = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Add Ajax Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Config' ) -> add_ajax
2016-02-26 00:20:09 +00:00
*/
public $addAjax = false ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Add Site Ajax Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Config' ) -> add_site_ajax ;
2016-02-26 00:20:09 +00:00
*/
public $addSiteAjax = false ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The get Module Script Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.get_module' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $getModule = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The template data
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.template_data' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $templateData = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The layout data
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.layout_data' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $layoutData = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2018-03-06 02:28:44 +00:00
* The Encryption Types
2020-03-28 13:34:14 +00:00
*
2018-03-06 02:28:44 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> cryption_types ;
2018-03-06 02:28:44 +00:00
*/
2019-10-16 20:34:36 +00:00
public $cryptionTypes = array ( 'basic' , 'medium' , 'whmcs' , 'expert' );
2018-03-06 02:28:44 +00:00
/**
* The WHMCS Encryption Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> whmcs_encryption ;
2016-02-26 00:20:09 +00:00
*/
2018-03-06 02:28:44 +00:00
public $whmcsEncryption = false ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Basic Encryption Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> basic_encryption ;
2016-02-26 00:20:09 +00:00
*/
public $basicEncryption = false ;
2017-12-14 23:10:47 +00:00
2018-03-06 02:28:44 +00:00
/**
* The Medium Encryption Switch
2020-03-28 13:34:14 +00:00
*
2018-03-06 02:28:44 +00:00
* @ var boolean
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> medium_encryption ;
2018-03-06 02:28:44 +00:00
*/
public $mediumEncryption = false ;
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The Custom field Switch per view
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public $customFieldScript = array ();
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The site main get
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.site_main_get' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $siteMainGet = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The site dynamic get
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.site_dynamic_get' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $siteDynamicGet = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The get AS lookup
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.get_as_lookup' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $getAsLookup = [];
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The site fields
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.site_fields' );
2016-02-26 00:20:09 +00:00
*/
2023-01-15 08:42:19 +00:00
public $siteFields = [];
2017-12-14 23:10:47 +00:00
2017-06-16 12:38:06 +00:00
/**
* The add SQL
2020-03-28 13:34:14 +00:00
*
2017-06-16 12:38:06 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.add_sql' );
2017-06-16 12:38:06 +00:00
*/
2023-01-15 08:42:19 +00:00
public $addSQL = [];
2017-12-14 23:10:47 +00:00
2017-06-16 12:38:06 +00:00
/**
* The update SQL
2020-03-28 13:34:14 +00:00
*
2017-06-16 12:38:06 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.update_sql' );
2017-06-16 12:38:06 +00:00
*/
2023-01-15 08:42:19 +00:00
public $updateSQL = [];
2017-12-14 23:10:47 +00:00
2020-12-31 11:18:52 +00:00
/**
* The data by alias keys
*
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.data_with_alias_keys' );
2020-12-31 11:18:52 +00:00
*/
2023-01-15 08:42:19 +00:00
protected $dataWithAliasKeys = [];
2020-12-31 11:18:52 +00:00
2017-12-03 18:09:04 +00:00
/**
* The Library Manager
2020-03-28 13:34:14 +00:00
*
2017-12-03 18:09:04 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecate 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.library_manager' );
2017-12-03 18:09:04 +00:00
*/
2023-01-15 08:42:19 +00:00
public $libManager = [];
2017-12-14 23:10:47 +00:00
2017-12-03 18:09:04 +00:00
/**
* The Libraries
2020-03-28 13:34:14 +00:00
*
2017-12-03 18:09:04 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.libraries' );
2017-12-03 18:09:04 +00:00
*/
2023-01-15 08:42:19 +00:00
public $libraries = [];
2017-12-14 23:10:47 +00:00
2018-04-18 19:11:14 +00:00
/**
* Is minify Enabled
2020-03-28 13:34:14 +00:00
*
2018-04-18 19:11:14 +00:00
* @ var int
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> minify ;
2018-04-18 19:11:14 +00:00
*/
public $minify = 0 ;
2017-12-12 22:17:02 +00:00
/**
* Is Tidy Enabled
2020-03-28 13:34:14 +00:00
*
2017-12-12 22:17:02 +00:00
* @ var bool
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> tidy ;
2017-12-12 22:17:02 +00:00
*/
public $tidy = false ;
2017-12-14 23:10:47 +00:00
2017-12-12 22:17:02 +00:00
/**
* Set Tidy warning once switch
2020-03-28 13:34:14 +00:00
*
2017-12-12 22:17:02 +00:00
* @ var bool
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> set_tidy_warning ;
2017-12-12 22:17:02 +00:00
*/
public $setTidyWarning = false ;
2016-02-26 00:20:09 +00:00
2018-09-25 20:02:48 +00:00
/**
* mysql table setting keys
2020-03-28 13:34:14 +00:00
*
2018-09-25 20:02:48 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Config' ) -> mysql_table_keys ;
2018-09-25 20:02:48 +00:00
*/
2020-03-28 13:34:14 +00:00
public $mysqlTableKeys
= array (
'engine' => array ( 'default' => 'MyISAM' ),
'charset' => array ( 'default' => 'utf8' ),
'collate' => array ( 'default' => 'utf8_general_ci' ),
'row_format' => array ( 'default' => '' )
2018-09-25 20:02:48 +00:00
);
/**
* mysql table settings
2020-03-28 13:34:14 +00:00
*
2018-09-25 20:02:48 +00:00
* @ var array
2023-01-15 08:42:19 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'builder.mysql_table_setting' );
2018-09-25 20:02:48 +00:00
*/
2023-01-15 08:42:19 +00:00
public $mysqlTableSetting = [];
2018-09-25 20:02:48 +00:00
2018-05-26 10:03:08 +00:00
/**
2016-02-26 00:20:09 +00:00
* Constructor
*/
2022-08-30 15:28:41 +00:00
public function __construct ()
2016-02-26 00:20:09 +00:00
{
2022-08-21 17:21:03 +00:00
// we do not yet have this set as an option
$config [ 'remove_line_breaks' ]
= 2 ; // 2 is global (use the components value)
// load application
$this -> app = JFactory :: getApplication ();
// Set the params
$this -> params = JComponentHelper :: getParams ( 'com_componentbuilder' );
// Trigger Event: jcb_ce_onBeforeGet
2022-09-10 08:16:44 +00:00
CFactory :: _ ( 'Event' ) -> trigger ( 'jcb_ce_onBeforeGet' , array ( & $config , & $this ));
2022-08-21 17:21:03 +00:00
// set the Joomla version @deprecated
2022-08-30 15:28:41 +00:00
$this -> joomlaVersion = CFactory :: _ ( 'Config' ) -> joomla_version ;
2022-08-21 17:21:03 +00:00
// set the minfy switch of the JavaScript @deprecated
2022-08-30 15:28:41 +00:00
$this -> minify = CFactory :: _ ( 'Config' ) -> get ( 'minify' , 0 );
2022-08-21 17:21:03 +00:00
// set the global language @deprecated @deprecated
2022-08-30 15:28:41 +00:00
$this -> langTag = CFactory :: _ ( 'Config' ) -> get ( 'lang_tag' , 'en-GB' );
2022-08-21 17:21:03 +00:00
// also set the helper class langTag (for safeStrings)
2022-08-30 15:28:41 +00:00
ComponentbuilderHelper :: $langTag = CFactory :: _ ( 'Config' ) -> get ( 'lang_tag' , 'en-GB' );
2022-08-21 17:21:03 +00:00
// setup the main language array
2022-08-30 15:28:41 +00:00
$this -> languages [ 'components' ][ CFactory :: _ ( 'Config' ) -> get ( 'lang_tag' , 'en-GB' )] = array ();
2022-08-21 17:21:03 +00:00
// check if we have Tidy enabled @deprecated
2022-08-30 15:28:41 +00:00
$this -> tidy = CFactory :: _ ( 'Config' ) -> get ( 'tidy' , false );
2022-08-21 17:21:03 +00:00
// set the field type builder @deprecated
2022-08-30 15:28:41 +00:00
$this -> fieldBuilderType = CFactory :: _ ( 'Config' ) -> get ( 'field_builder_type' , 2 );
2022-08-21 17:21:03 +00:00
// check the field builder type logic
2022-08-30 15:28:41 +00:00
if ( ! CFactory :: _ ( 'Config' ) -> get ( 'tidy' , false ) && CFactory :: _ ( 'Config' ) -> get ( 'field_builder_type' , 2 ) == 2 )
2022-08-21 17:21:03 +00:00
{
// we do not have the tidy extension set fall back to StringManipulation
$this -> fieldBuilderType = 1 ;
// load the sugestion to use string manipulation
$this -> app -> enqueueMessage (
JText :: _ ( '<hr /><h3>Field Notice</h3>' ), 'Notice'
2020-03-28 13:34:14 +00:00
);
2022-08-21 17:21:03 +00:00
$this -> app -> enqueueMessage (
JText :: _ (
'Since you do not have <b>Tidy</b> extentsion setup on your system, we could not use the SimpleXMLElement class. We instead used <b>string manipulation</b> to build all your fields, this is a faster method, you must inspect the xml files in your component package to see if you are satisfied with the result.<br />You can make this method your default by opening the global options of JCB and under the <b>Global</b> tab set the <b>Field Builder Type</b> to string manipulation.'
), 'Notice'
);
}
2022-08-30 15:28:41 +00:00
CFactory :: _ ( 'Config' ) -> set ( 'field_builder_type' , $this -> fieldBuilderType );
2022-08-21 17:21:03 +00:00
// load the compiler path @deprecated
2022-08-30 15:28:41 +00:00
$this -> compilerPath = CFactory :: _ ( 'Config' ) -> get ( 'compiler_path' , JPATH_COMPONENT_ADMINISTRATOR . '/compiler' );
2022-08-21 17:21:03 +00:00
// load the jcb powers path @deprecated
2022-08-30 15:28:41 +00:00
$this -> jcbPowersPath = CFactory :: _ ( 'Config' ) -> get ( 'jcb_powers_path' , 'libraries/jcb_powers' );
2022-08-21 17:21:03 +00:00
// set the component ID @deprecated
2022-08-30 15:28:41 +00:00
$this -> componentID = CFactory :: _ ( 'Config' ) -> component_id ;
2022-08-21 17:21:03 +00:00
// set lang prefix @deprecated
2022-08-30 15:28:41 +00:00
$this -> langPrefix = CFactory :: _ ( 'Config' ) -> lang_prefix ;
2022-08-21 17:21:03 +00:00
// set component code name @deprecated
2022-08-30 15:28:41 +00:00
$this -> componentCodeName = CFactory :: _ ( 'Config' ) -> component_code_name ;
2022-08-21 17:21:03 +00:00
// set component context @deprecated
2022-08-30 15:28:41 +00:00
$this -> componentContext = CFactory :: _ ( 'Config' ) -> component_context ;
2022-08-21 17:21:03 +00:00
// set the component name length @deprecated
2022-08-30 15:28:41 +00:00
$this -> componentCodeNameLength = CFactory :: _ ( 'Config' ) -> component_code_name_length ;
2022-08-21 17:21:03 +00:00
// add assets table fix @deprecated
2022-08-30 15:28:41 +00:00
$this -> addAssetsTableFix = CFactory :: _ ( 'Config' ) -> add_assets_table_fix ;
2022-08-21 17:21:03 +00:00
// set if language strings line breaks should be removed @deprecated
2022-08-30 15:28:41 +00:00
$this -> removeLineBreaks = CFactory :: _ ( 'Config' ) -> remove_line_breaks ;
2022-08-21 17:21:03 +00:00
// set if placeholders should be added to customcode @deprecated
2022-08-30 15:28:41 +00:00
$this -> addPlaceholders = CFactory :: _ ( 'Config' ) -> get ( 'add_placeholders' , false );
2022-08-21 17:21:03 +00:00
// set if line numbers should be added to comments @deprecated
2022-08-30 15:28:41 +00:00
$this -> debugLinenr = CFactory :: _ ( 'Config' ) -> get ( 'debug_line_nr' , false );
2022-08-21 17:21:03 +00:00
// set if powers should be added to component (default is true) @deprecated
2022-08-30 15:28:41 +00:00
$this -> addPower = CFactory :: _ ( 'Config' ) -> get ( 'add_power' , true );
2022-08-21 17:21:03 +00:00
// set the current user
$this -> user = JFactory :: getUser ();
// Get a db connection.
$this -> db = JFactory :: getDbo ();
2022-08-30 15:28:41 +00:00
// get global placeholders @deprecated
$this -> globalPlaceholders = CFactory :: _ ( 'Component.Placeholder' ) -> get ();
2022-09-02 05:51:08 +00:00
// get the custom code from installed files
CFactory :: _ ( 'Customcode.Extractor' ) -> run ();
2023-01-15 08:42:19 +00:00
// for plugin event TODO change event api signatures
$component_context = CFactory :: _ ( 'Config' ) -> component_context ;
2022-08-21 17:21:03 +00:00
// Trigger Event: jcb_ce_onBeforeGetComponentData
2022-09-10 08:16:44 +00:00
CFactory :: _ ( 'Event' ) -> trigger (
2022-08-21 17:21:03 +00:00
'jcb_ce_onBeforeGetComponentData' ,
2023-01-15 08:42:19 +00:00
array ( & $component_context , & $this )
2022-08-21 17:21:03 +00:00
);
2023-01-22 00:38:21 +00:00
// get the component data @deprecated
$this -> componentData = CFactory :: _ ( 'Component' );
2022-08-21 17:21:03 +00:00
// Trigger Event: jcb_ce_onAfterGetComponentData
2022-09-10 08:16:44 +00:00
CFactory :: _ ( 'Event' ) -> trigger (
2022-08-21 17:21:03 +00:00
'jcb_ce_onAfterGetComponentData' ,
2023-01-15 08:42:19 +00:00
array ( & $component_context , & $this )
2022-08-21 17:21:03 +00:00
);
2023-01-22 00:38:21 +00:00
2022-08-21 17:21:03 +00:00
// make sure we have a version
2023-01-22 00:38:21 +00:00
if ( strpos (( string ) CFactory :: _ ( 'Component' ) -> component_version , '.' )
2022-08-21 17:21:03 +00:00
=== false )
{
2023-01-22 00:38:21 +00:00
CFactory :: _ ( 'Component' ) -> set ( 'component_version ' , '1.0.0' );
2022-08-21 17:21:03 +00:00
}
// update the version
2023-01-22 00:38:21 +00:00
if ( ! CFactory :: _ ( 'Component' ) -> exists ( 'old_component_version' )
2023-01-15 08:42:19 +00:00
&& ( CFactory :: _ ( 'Registry' ) -> get ( 'builder.add_sql' , null )
|| CFactory :: _ ( 'Registry' ) -> get ( 'builder.update_sql' , null )))
2022-08-21 17:21:03 +00:00
{
// set the new version
$version = ( array ) explode (
2023-01-22 00:38:21 +00:00
'.' , ( string ) CFactory :: _ ( 'Component' ) -> component_version
2022-08-21 17:21:03 +00:00
);
// get last key
end ( $version );
$key = key ( $version );
// just increment the last
$version [ $key ] ++ ;
// set the old version
2023-01-22 00:38:21 +00:00
CFactory :: _ ( 'Component' ) -> set ( 'old_component_version' , CFactory :: _ ( 'Component' ) -> component_version );
2022-08-21 17:21:03 +00:00
// set the new version, and set update switch
2023-01-22 00:38:21 +00:00
CFactory :: _ ( 'Component' ) -> set ( 'component_version ' , implode (
2022-08-21 17:21:03 +00:00
'.' , $version
2023-01-22 00:38:21 +00:00
));
2016-02-26 00:20:09 +00:00
}
2023-01-22 00:38:21 +00:00
2022-08-21 17:21:03 +00:00
// get powers *+*+*+*+*+*+*+*PRO
2022-08-30 15:28:41 +00:00
CFactory :: _ ( 'Power' ) -> load ( $this -> linkedPowers );
2022-08-21 17:21:03 +00:00
// set the percentage when a language can be added
$this -> percentageLanguageAdd = ( int ) $this -> params -> get (
'percentagelanguageadd' , 50
);
2020-03-28 13:34:14 +00:00
2022-08-21 17:21:03 +00:00
// Trigger Event: jcb_ce_onBeforeGet
2022-09-10 08:16:44 +00:00
CFactory :: _ ( 'Event' ) -> trigger (
2023-01-15 08:42:19 +00:00
'jcb_ce_onAfterGet' , array ( & $component_context , & $this )
2022-08-21 17:21:03 +00:00
);
return true ;
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2018-05-26 10:03:08 +00:00
/**
* Set the tab / space
2020-03-28 13:34:14 +00:00
*
* @ param int $nr The number of tag / space
*
2018-05-26 10:03:08 +00:00
* @ return string
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use Indent :: _ ( $nr );
2018-05-26 10:03:08 +00:00
*/
public function _t ( $nr )
{
2019-09-04 11:52:31 +00:00
// use global method for conformity
2022-09-10 08:16:44 +00:00
return Indent :: _ ( $nr );
2018-05-26 10:03:08 +00:00
}
2019-06-22 10:43:26 +00:00
/**
* Trigger events
2020-03-28 13:34:14 +00:00
*
* @ param string $event The event to trigger
* @ param mix $data The values to pass to the event / plugin
*
2020-03-24 01:11:43 +00:00
* @ return void
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Event' ) -> trigger ( $event , $data );
2019-06-22 10:43:26 +00:00
*/
public function triggerEvent ( $event , $data )
{
2022-09-10 08:16:44 +00:00
return CFactory :: _ ( 'Event' ) -> trigger ( $event , $data );
2019-06-22 10:43:26 +00:00
}
2019-02-15 22:03:21 +00:00
/**
* get all System Placeholders
*
* @ return array The global placeholders
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Placeholder' ) -> get ();
2019-02-15 22:03:21 +00:00
*/
public function getGlobalPlaceholders ()
{
2022-08-30 15:28:41 +00:00
return CFactory :: _ ( 'Component.Placeholder' ) -> get ();
2019-02-15 22:03:21 +00:00
}
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* get all Component Data
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ return oject The component data
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component' );
2016-02-26 00:20:09 +00:00
*/
2017-02-13 23:24:38 +00:00
public function getComponentData ()
2016-02-26 00:20:09 +00:00
{
2023-01-22 00:38:21 +00:00
return CFactory :: _ ( 'Component' );
}
2019-06-22 10:43:26 +00:00
2023-01-22 00:38:21 +00:00
/**
* set the language content values to language content array
*
* @ param string $target The target area for the language string
* @ param string $language The language key string
* @ param string $string The language string
* @ 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
)
{
CFactory :: _ ( 'Language' ) -> set ( $target , $language , $string , $addPrefix );
}
2016-02-26 00:20:09 +00:00
2023-01-22 00:38:21 +00:00
/**
* We need to remove all text breaks from all language strings
*
* @ param string $string The language string
*
* @ return string
* @ deprecated 3.3
*/
public function fixLangString ( & $string )
{
if ( CFactory :: _ ( 'Config' ) -> remove_line_breaks )
{
return trim ( str_replace ( array ( PHP_EOL , " \r " , " \n " ), '' , $string ));
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
return trim ( $string );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* Get all Admin View Data
*
* @ param int $id The view ID
*
* @ return oject The view data
* @ deprecated 3.3 Use CFactory :: _ ( 'Adminview.Data' ) -> get ( $id );
*/
public function getAdminViewData ( $id )
{
return CFactory :: _ ( 'Adminview.Data' ) -> get ( $id );
}
2019-02-15 22:03:21 +00:00
2023-01-22 00:38:21 +00:00
/**
* Get all Custom View Data
*
* @ param int $id The view ID
* @ param string $table The view table
*
* @ return oject The view data
* @ deprecated 3.3 Use CFactory :: _ ( 'Customview.Data' ) -> get ( $id , $table );
*/
public function getCustomViewData ( $id , $table = 'site_view' )
{
return CFactory :: _ ( 'Customview.Data' ) -> get ( $id , $table );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* Get all Field Data
*
* @ param int $id The field ID
* @ param string $name_single The view edit or single name
* @ param string $name_list The view list name
*
* @ return oject The field data
* @ deprecated 3.3 Use CFactory :: _ ( 'Field.Data' ) -> get ( $id , $name_single , $name_list );
*/
public function getFieldData ( $id , $name_single = null , $name_list = null )
{
return CFactory :: _ ( 'Field.Data' ) -> get ( $id , $name_single , $name_list );
}
2020-04-03 18:45:48 +00:00
2023-01-22 00:38:21 +00:00
/**
* set Field details
*
* @ param object $field The field object
* @ param string $singleViewName The single view name
* @ param string $listViewName The list view name
* @ param string $amicably The peaceful resolve
*
* @ return void
* @ deprecated 3.3 Use CFactory :: _ ( 'Field' ) -> set ( $field , $singleViewName , $listViewName , $amicably );
*/
public function setFieldDetails ( & $field , $singleViewName = null , $listViewName = null , $amicably = '' )
{
CFactory :: _ ( 'Field' ) -> set ( $field , $singleViewName , $listViewName , $amicably );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* get the list default ordering values
*
* @ param string $nameListCode The list view name
*
* @ return array
*
*/
public function getListViewDefaultOrdering ( & $nameListCode )
{
if ( isset ( $this -> viewsDefaultOrdering [ $nameListCode ])
&& $this -> viewsDefaultOrdering [ $nameListCode ][ 'add_admin_ordering' ]
== 1 )
2016-02-26 00:20:09 +00:00
{
2023-01-22 00:38:21 +00:00
foreach (
$this -> viewsDefaultOrdering [ $nameListCode ][ 'admin_ordering_fields' ]
as $order_field
)
2020-03-28 13:34:14 +00:00
{
2023-01-22 00:38:21 +00:00
if (( $order_field_name = CFactory :: _ ( 'Field.Database.Name' ) -> get (
$nameListCode , $order_field [ 'field' ]
)) !== false )
2018-02-16 21:53:43 +00:00
{
2023-01-22 00:38:21 +00:00
// just the first field is the based ordering state
return array (
'name' => $order_field_name ,
'direction' => $order_field [ 'direction' ]
2020-03-28 13:34:14 +00:00
);
2018-02-16 21:53:43 +00:00
}
}
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
// the default
return array (
'name' => 'a.id' ,
'direction' => 'DESC'
);
}
2018-07-08 20:18:32 +00:00
2023-01-22 00:38:21 +00:00
/**
* get the field database name and AS prefix
*
* @ param string $nameListCode The list view name
* @ param int $fieldId The field ID
* @ param string $targetArea The area being targeted
*
* @ return string
* @ deprecated 3.3 Use CFactory :: _ ( 'Field.Database.Name' ) -> get ( $nameListCode , $fieldId , $targetArea );
*/
public function getFieldDatabaseName ( $nameListCode , int $fieldId , $targetArea = 'builder.list' )
{
return CFactory :: _ ( 'Field.Database.Name' ) -> get ( $nameListCode , $fieldId , $targetArea );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* Get the field ' s actual type
*
* @ param object $field The field object
*
* @ return string Success returns field type
* @ deprecated 3.3 Use CFactory :: _ ( 'Field.Type.Name' ) -> get ( $field );
*/
public function getFieldType ( & $field )
{
return CFactory :: _ ( 'Field.Type.Name' ) -> get ( $field );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* Get the field ' s actual name
*
* @ param object $field The field object
* @ param string $listViewName The list view name
* @ param string $amicably The peaceful resolve ( for fields in subforms in same view : )
*
* @ return string Success returns field name
* @ deprecated 3.3 Use CFactory :: _ ( 'Field.Name' ) -> get ( $field , $listViewName , $amicably );
*/
public function getFieldName ( & $field , $listViewName = null , $amicably = '' )
{
return CFactory :: _ ( 'Field.Name' ) -> get ( $field , $listViewName , $amicably );
}
2020-03-28 13:34:14 +00:00
2023-01-22 00:38:21 +00:00
/**
* Count how many times the same field is used per view
*
* @ param string $name The name of the field
* @ param string $view The name of the view
*
* @ return void
* @ deprecated Use CFactory :: _ ( 'Field.Unique.Name' ) -> set ( $name , $view );
*/
protected function setUniqueNameCounter ( $name , $view )
{
CFactory :: _ ( 'Field.Unique.Name' ) -> set ( $name , $view );
}
2017-12-14 23:10:47 +00:00
2023-01-22 00:38:21 +00:00
/**
* Naming each field with an unique name
*
* @ param string $name The name of the field
* @ param string $view The name of the view
*
* @ return string the name
* @ deprecated
*/
protected function uniqueName ( $name , $view )
{
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
}
2020-03-28 13:34:14 +00:00
2023-01-22 00:38:21 +00:00
/**
* Set get Data
*
* @ param array $ids The ids of the dynamic get
* @ param string $view_code The view code name
* @ param string $context The context for events
*
* @ return oject the get dynamicGet data
* @ deprecated Use CFactory :: _ ( 'Dynamicget.Data' ) -> get ( $ids , $view_code , $context );
*/
public function setGetData ( $ids , $view_code , $context )
{
return CFactory :: _ ( 'Dynamicget.Data' ) -> get ( $ids , $view_code , $context );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2019-07-28 21:48:42 +00:00
/**
2022-08-31 11:49:01 +00:00
* Set the script for the customcode dispenser
2019-07-28 21:48:42 +00:00
*
2022-08-31 11:49:01 +00:00
* @ param string $script The script
* @ param string $first The first key
* @ param string | null $second The second key ( if not set we use only first key )
* @ param string | null $third The third key ( if not set we use only first and second key )
* @ param array $config The config options
* @ param bool $base64 The switch to decode base64 the script
* default : true
* @ param bool $dynamic The switch to dynamic update the script
* default : true
* @ param bool $add The switch to add to exiting instead of replace
* default : false
*
* @ return bool true on success
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Dispenser' ) -> set ( $script , $first , $second , $third , $config , $base64 , $dynamic , $add );
*/
public function setCustomScriptBuilder (
& $script ,
string $first ,
? string $second = null ,
? string $third = null ,
array $config = array (),
bool $base64 = true ,
bool $dynamic = true ,
bool $add = false
) : bool
2021-12-21 14:44:50 +00:00
{
2022-08-31 11:49:01 +00:00
return CFactory :: _ ( 'Customcode.Dispenser' ) -> set ( $script , $first , $second , $third , $config , $base64 , $dynamic , $add );
2019-07-28 21:48:42 +00:00
}
2020-12-05 06:17:54 +00:00
/**
* get the a script from the custom script builder
*
* @ param string $first The first key
* @ param string $second The second key
* @ param string $prefix The prefix to add in front of the script if found
* @ param string $note The switch / note to add to the script
* @ param bool $unset The switch to unset the value if found
* @ param string $default The switch / string to use as default return if script not found
* @ param string $sufix The sufix to add after the script if found
*
* @ return mix The string / script if found or the default value if not found
2022-08-31 11:49:01 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Dispenser' ) -> get ( $first , $second , $prefix , $note , $unset , $default , $sufix );
2020-12-05 06:17:54 +00:00
*/
public function getCustomScriptBuilder ( $first , $second , $prefix = '' ,
2023-01-15 08:42:19 +00:00
$note = null , $unset = null , $default = null , $sufix = ''
2021-12-21 14:44:50 +00:00
)
{
2022-08-31 11:49:01 +00:00
return CFactory :: _ ( 'Customcode.Dispenser' ) -> get ( $first , $second , $prefix , $note , $unset , $default , $sufix );
2020-12-05 06:17:54 +00:00
}
2017-10-29 11:03:06 +00:00
/**
* To limit the SQL Demo date build in the views
2020-03-28 13:34:14 +00:00
*
* @ param array $settings Tweaking array .
2017-10-29 11:03:06 +00:00
*
* @ return void
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-12-14 23:10:47 +00:00
*/
2017-10-29 11:03:06 +00:00
public function setSqlTweaking ( $settings )
{
2023-01-22 00:38:21 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2017-10-29 11:03:06 +00:00
}
2017-12-14 23:10:47 +00:00
2017-06-16 12:38:06 +00:00
/**
* check if an update SQL is needed
2020-03-28 13:34:14 +00:00
*
* @ param mix $old The old values
* @ param mix $new The new values
* @ param string $type The type of values
* @ param int $key The id / key where values changed
* @ param array $ignore The ids to ignore
2017-06-16 12:38:06 +00:00
*
* @ return void
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Model.Updatesql' ) -> set ( $old , $new , $type , $key , $ignore );
2017-06-16 12:38:06 +00:00
*/
2020-03-28 13:34:14 +00:00
protected function setUpdateSQL ( $old , $new , $type , $key = null ,
2021-12-21 14:44:50 +00:00
$ignore = null
)
{
2023-01-22 00:38:21 +00:00
CFactory :: _ ( 'Model.Updatesql' ) -> set ( $old , $new , $type , $key , $ignore );
2017-06-16 12:38:06 +00:00
}
2017-12-14 23:10:47 +00:00
2017-10-12 23:14:17 +00:00
/**
* Set the add sql
2020-03-28 13:34:14 +00:00
*
2023-01-15 08:42:19 +00:00
* @ param string $type The type of values
* @ param int $item The item id to add
* @ param int | null $key The id / key where values changed
2020-03-28 13:34:14 +00:00
*
2017-10-12 23:14:17 +00:00
* @ return void
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-10-12 23:14:17 +00:00
*/
2023-01-15 08:42:19 +00:00
protected function setAddSQL ( string $type , int $item , ? int $key = null )
2017-10-12 23:14:17 +00:00
{
// add key if found
if ( $key )
{
2023-01-15 08:42:19 +00:00
CFactory :: _ ( 'Registry' ) -> set ( 'builder.add_sql.' . $type . '.' . $key . '.' . $item , $item );
2017-10-12 23:14:17 +00:00
}
else
{
// convert adminview id to name
if ( 'adminview' === $type )
{
2023-01-15 08:42:19 +00:00
CFactory :: _ ( 'Registry' ) -> set ( 'builder.add_sql.' . $type , StringHelper :: safe (
2020-03-28 13:34:14 +00:00
$this -> getAdminViewData ( $item ) -> name_single
2023-01-15 08:42:19 +00:00
));
2017-10-12 23:14:17 +00:00
}
else
{
2023-01-15 08:42:19 +00:00
CFactory :: _ ( 'Registry' ) -> set ( 'builder.add_sql.' . $type , $item );
2017-10-12 23:14:17 +00:00
}
}
}
2017-12-14 23:10:47 +00:00
2017-06-16 12:38:06 +00:00
/**
* Get Item History values
2020-03-28 13:34:14 +00:00
*
* @ param string $type The type of item
* @ param int $id The item ID
2017-06-16 12:38:06 +00:00
*
2022-09-10 08:16:44 +00:00
* @ return object The history
* @ deprecated 3.3 Use CFactory :: _ ( 'History' ) -> get ( $type , $id );
2017-06-16 12:38:06 +00:00
*/
protected function getHistoryWatch ( $type , $id )
{
2022-09-10 08:16:44 +00:00
return CFactory :: _ ( 'History' ) -> get ( $type , $id );
2017-06-16 12:38:06 +00:00
}
2017-12-14 23:10:47 +00:00
2017-06-16 12:38:06 +00:00
/**
* Set Item History Watch
2020-03-28 13:34:14 +00:00
*
* @ param Object $object The history object
* @ param int $action The action to take
* 0 = remove watch
* 1 = add watch
* @ param string $type The type of item
2017-06-16 12:38:06 +00:00
*
* @ return bool
2022-09-10 08:16:44 +00:00
* @ deprecated 3.3
2017-06-16 12:38:06 +00:00
*/
protected function setHistoryWatch ( $object , $action )
{
2022-09-10 08:16:44 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
2023-01-22 00:38:21 +00:00
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
}
2020-12-31 11:18:52 +00:00
2023-01-22 00:38:21 +00:00
/**
* Set Template and Layout Data
*
* @ param string $default The content to check
* @ param string $view The view code name
* @ param boolean $found The proof that something was found
* @ param array $templates The option to pass templates keys ( to avoid search )
* @ param array $layouts The option to pass layout keys ( to avoid search )
*
* @ return boolean if something was found true
* @ deprecated 3.3 Use CFactory :: _ ( 'Templatelayout.Data' ) -> set ( $default , $view , $found , $templates , $layouts );
*/
public function setTemplateAndLayoutData ( $default , $view , $found = false ,
$templates = array (), $layouts = array ()
)
{
return CFactory :: _ ( 'Templatelayout.Data' ) -> set ( $default , $view , $found , $templates , $layouts );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Get Data With Alias
2020-03-28 13:34:14 +00:00
*
* @ param string $n_ame The alias name
* @ param string $table The table where to find the alias
* @ param string $view The view code name
2016-02-26 00:20:09 +00:00
*
* @ return array The data found with the alias
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Alias.Data' ) -> get ( $n_ame , $table , $view );
2016-02-26 00:20:09 +00:00
*/
2020-12-27 11:54:51 +00:00
protected function getDataWithAlias ( $n_ame , $table , $view )
2016-02-26 00:20:09 +00:00
{
2023-01-22 00:38:21 +00:00
return CFactory :: _ ( 'Alias.Data' ) -> get ( $n_ame , $table , $view );
2020-12-31 11:18:52 +00:00
}
/**
* set Data With Alias Keys
*
* @ param string $table The table where to find the alias
*
* @ return void
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2020-12-31 11:18:52 +00:00
*/
protected function setDataWithAliasKeys ( $table )
{
2023-01-22 00:38:21 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2017-12-03 18:09:04 +00:00
/**
2019-10-16 20:34:36 +00:00
* Get Media Library Data and store globally
2020-03-28 13:34:14 +00:00
*
* @ param string $id the library id
2017-12-03 18:09:04 +00:00
*
* @ return bool true on success
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Library.Data' ) -> get ( $id );
2017-12-03 18:09:04 +00:00
*/
2019-10-16 20:34:36 +00:00
protected function getMediaLibrary ( $id )
2017-12-03 18:09:04 +00:00
{
2023-01-22 00:38:21 +00:00
return CFactory :: _ ( 'Library.Data' ) -> get ( $id );
2017-12-03 18:09:04 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2017-02-13 23:24:38 +00:00
* Set Language Place Holders
2018-04-08 06:12:18 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param string $content The content
2016-02-26 00:20:09 +00:00
*
* @ return string The content with the updated Language place holder
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Language.Extractor' ) -> engine ( $content )
*/
public function setLangStrings ( $content )
{
return CFactory :: _ ( 'Language.Extractor' ) -> engine ( $content );
}
2020-11-29 00:00:20 +00:00
2023-01-22 00:38:21 +00:00
/**
* Set the language String
*
* @ 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 )
{
return CFactory :: _ ( 'Language' ) -> key ( $string );
}
/**
* Set Data Selection of the dynamic get
*
* @ param string $method_key The method unique key
* @ param string $view_code The code name of the view
* @ param string $string The data string
* @ param string $asset The asset in question
* @ param string $as The as string
* @ param int $row_type The row type
* @ param string $type The target type ( db || view )
*
* @ return array the select query
* @ deprecated 3.3 Use CFactory :: _ ( 'Dynamicget.Selection' ) -> get ( $method_key , $view_code , $string , $asset , $as , $type , $row_type );
*/
public function setDataSelection ( $method_key , $view_code , $string , $asset ,
$as , $row_type , $type
)
{
return CFactory :: _ ( 'Dynamicget.Selection' ) -> get (
$method_key , $view_code , $string , $asset ,
$as , $type , $row_type );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Get the View Table Name
2020-03-28 13:34:14 +00:00
*
* @ param int $id The admin view in
2016-02-26 00:20:09 +00:00
*
* @ return string view code name
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public function getViewTableName ( $id )
{
// Create a new query object.
2017-02-13 23:24:38 +00:00
$query = $this -> db -> getQuery ( true );
$query -> select ( $this -> db -> quoteName ( array ( 'a.name_single' )));
2020-03-28 13:34:14 +00:00
$query -> from (
$this -> db -> quoteName ( '#__componentbuilder_admin_view' , 'a' )
);
2017-12-14 23:10:47 +00:00
$query -> where ( $this -> db -> quoteName ( 'a.id' ) . ' = ' . ( int ) $id );
2017-02-13 23:24:38 +00:00
$this -> db -> setQuery ( $query );
2020-03-28 13:34:14 +00:00
2022-03-09 23:46:45 +00:00
return StringHelper :: safe ( $this -> db -> loadResult ());
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Build the SQL dump String for a view
2020-03-28 13:34:14 +00:00
*
* @ param string $tables The tables to use in build
* @ param string $view The target view / table to dump in
* @ param int $view_id The id of the target view
2016-02-26 00:20:09 +00:00
*
* @ return string on success with the Dump SQL
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Model.Sqldump' ) -> key ( $tables , $view , $view_id );
2016-02-26 00:20:09 +00:00
*/
2017-10-12 00:50:14 +00:00
public function buildSqlDump ( $tables , $view , $view_id )
2016-02-26 00:20:09 +00:00
{
2023-01-22 00:38:21 +00:00
return CFactory :: _ ( 'Model.Sqldump' ) -> key ( $tables , $view , $view_id );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Escape the values for a SQL dump
2020-03-28 13:34:14 +00:00
*
* @ param string $value the value to escape
2016-02-26 00:20:09 +00:00
*
* @ return string on success with escaped string
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public function mysql_escape ( $value )
{
2023-01-22 00:38:21 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Creating an uniqueCode
2020-03-28 13:34:14 +00:00
*
* @ param string $code The planed code
2016-02-26 00:20:09 +00:00
*
* @ return string The unique code
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 use Unique :: code ( $code );
2016-02-26 00:20:09 +00:00
*/
public function uniqueCode ( $code )
{
2023-01-22 00:38:21 +00:00
return Unique :: code ( $code );
2016-02-26 13:57:30 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 13:57:30 +00:00
* Creating an unique local key
2020-03-28 13:34:14 +00:00
*
* @ param int $size The key size
2016-02-26 13:57:30 +00:00
*
* @ return string The unique localkey
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 use Unique :: get ( $size );
2016-02-26 13:57:30 +00:00
*/
2020-03-28 13:34:14 +00:00
public function uniquekey ( $size , $random = false ,
2021-12-21 14:44:50 +00:00
$newBag = " vvvvvvvvvvvvvvvvvvv "
)
{
2023-01-22 00:38:21 +00:00
return Unique :: get ( $size );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Check for footable scripts
2020-03-28 13:34:14 +00:00
*
* @ param string $content The content to check
2016-02-26 00:20:09 +00:00
*
* @ return boolean True if found
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public function getFootableScripts ( $content )
{
2017-12-14 23:10:47 +00:00
if ( strpos ( $content , 'footable' ) !== false )
2016-02-26 00:20:09 +00:00
{
return true ;
}
2020-03-28 13:34:14 +00:00
2016-02-26 00:20:09 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Check for getModules script
2020-03-28 13:34:14 +00:00
*
* @ param string $content The content to check
2016-02-26 00:20:09 +00:00
*
* @ return boolean True if found
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public function getGetModule ( $content )
{
2017-12-14 23:10:47 +00:00
if ( strpos ( $content , 'this->getModules(' ) !== false )
2016-02-26 00:20:09 +00:00
{
return true ;
}
2020-03-28 13:34:14 +00:00
2016-02-26 00:20:09 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2017-12-03 18:09:04 +00:00
* Check for get Google Chart script
2020-03-28 13:34:14 +00:00
*
* @ param string $content The content to check
2016-02-26 00:20:09 +00:00
*
* @ return boolean True if found
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
public function getGoogleChart ( $content )
{
2017-12-14 23:10:47 +00:00
if ( strpos ( $content , 'Chartbuilder(' ) !== false )
2016-02-26 00:20:09 +00:00
{
return true ;
}
2020-03-28 13:34:14 +00:00
2016-02-26 00:20:09 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Set the dynamic values in strings here
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param int $debug The switch to debug the update
* We can now at any time debug the
* dynamic build values if it gets broken
2017-02-13 23:24:38 +00:00
*
* @ return string
2022-09-03 10:48:53 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode' ) -> update ( $string , $debug );
2017-02-13 23:24:38 +00:00
*/
2018-08-02 05:36:47 +00:00
public function setDynamicValues ( $string , $debug = 0 )
2017-02-13 23:24:38 +00:00
{
2022-09-03 10:48:53 +00:00
return CFactory :: _ ( 'Customcode' ) -> update ( $string , $debug );
2017-02-13 23:24:38 +00:00
}
2018-03-18 04:52:07 +00:00
2018-01-31 13:35:54 +00:00
/**
2018-02-03 00:13:48 +00:00
* Set the external code string & load it in to string
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param int $debug The switch to debug the update
2018-01-31 13:35:54 +00:00
*
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.External' ) -> set ( $string , $debug );
2018-01-31 13:35:54 +00:00
*/
2018-08-02 05:36:47 +00:00
public function setExternalCodeString ( $string , $debug = 0 )
2018-01-31 13:35:54 +00:00
{
2022-08-30 15:28:41 +00:00
return CFactory :: _ ( 'Customcode.External' ) -> set ( $string , $debug );
2018-01-31 13:35:54 +00:00
}
2018-03-18 04:52:07 +00:00
2018-02-02 17:36:22 +00:00
/**
2018-02-03 00:13:48 +00:00
* Get the External Code / String
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param array $bucket The Placeholders bucket
2018-02-02 17:36:22 +00:00
*
* @ return void
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2018-02-02 17:36:22 +00:00
*/
2018-02-03 00:13:48 +00:00
protected function getExternalCodeString ( $target , & $bucket )
2018-02-02 17:36:22 +00:00
{
2022-08-30 15:28:41 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
2022-08-30 15:28:41 +00:00
);
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
2022-08-30 15:28:41 +00:00
), 'Error'
);
2018-02-02 17:36:22 +00:00
}
2018-03-18 04:52:07 +00:00
2021-12-21 14:44:50 +00:00
/**
* Cut the External Code / String
*
* @ param string $string The content to cut
* @ param string $sequence The cutting sequence
* @ param string $key The content key
*
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2021-12-21 14:44:50 +00:00
*/
protected function cutExternalCodeString ( $string , $sequence , $key )
{
2022-08-30 15:28:41 +00:00
// set notice that we could not get a valid string from the target
2021-12-21 14:44:50 +00:00
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
2021-12-21 14:44:50 +00:00
);
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
2021-12-21 14:44:50 +00:00
), 'Error'
);
return '' ;
}
2017-02-13 23:24:38 +00:00
/**
* We start set the custom code data & can load it in to string
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param int $debug The switch to debug the update
2017-02-13 23:24:38 +00:00
*
2018-01-31 13:35:54 +00:00
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode' ) -> set ( $string , $debug , $not );
2017-02-13 23:24:38 +00:00
*/
2018-11-27 13:05:47 +00:00
public function setCustomCodeData ( $string , $debug = 0 , $not = null )
2017-02-13 23:24:38 +00:00
{
2022-08-30 15:28:41 +00:00
return CFactory :: _ ( 'Customcode' ) -> set ( $string , $debug , $not );
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Insert the custom code into the string
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param int $debug The switch to debug the update
2017-02-13 23:24:38 +00:00
*
* @ return string on success
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2017-02-13 23:24:38 +00:00
*/
2019-01-21 22:58:22 +00:00
protected function insertCustomCode ( $ids , $string , $debug = 0 )
2017-02-13 23:24:38 +00:00
{
2022-08-30 15:28:41 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
2022-08-30 15:28:41 +00:00
);
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
2022-08-30 15:28:41 +00:00
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-08-30 15:28:41 +00:00
return '' ;
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Insert the custom code into the string
2020-03-28 13:34:14 +00:00
*
* @ param string $string The content to check
* @ param int $debug The switch to debug the update
2017-02-13 23:24:38 +00:00
*
* @ return string on success
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2017-12-14 23:10:47 +00:00
*/
2018-08-02 05:36:47 +00:00
protected function buildCustomCodePlaceholders ( $item , & $code , $debug = 0 )
2017-02-13 23:24:38 +00:00
{
2022-08-30 15:28:41 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
2022-08-30 15:28:41 +00:00
);
$this -> app -> enqueueMessage (
2022-09-02 05:51:08 +00:00
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
2022-08-30 15:28:41 +00:00
), 'Error'
);
return '' ;
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Set a type of placeholder with set of values
2020-03-28 13:34:14 +00:00
*
* @ param string $key The main string for placeholder key
* @ param array $values The values to add
2017-02-13 23:24:38 +00:00
*
* @ return void
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder' ) -> setType ( $key , $values );
2017-02-13 23:24:38 +00:00
*/
public function setThesePlaceHolders ( $key , $values )
{
2022-08-30 15:28:41 +00:00
// use the new container class
CFactory :: _ ( 'Placeholder' ) -> setType ( $key , $values );
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Remove a type of placeholder by main string
2020-03-28 13:34:14 +00:00
*
* @ param string $like The main string for placeholder key
2017-02-13 23:24:38 +00:00
*
* @ return void
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder' ) -> clearType ( $key );
2017-02-13 23:24:38 +00:00
*/
public function clearFromPlaceHolders ( $like )
{
2022-08-30 15:28:41 +00:00
// use the new container class
CFactory :: _ ( 'Placeholder' ) -> clearType ( $like );
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* to unset stuff that are private or protected
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
*/
public function unsetNow ( $remove )
{
unset ( $this -> $remove );
}
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* Get the other languages
2020-03-28 13:34:14 +00:00
*
* @ param array $values The lang strings to get
*
2017-04-05 13:21:10 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
*/
public function getMultiLangStrings ( $values )
{
// Create a new query object.
$query = $this -> db -> getQuery ( true );
2020-03-28 13:34:14 +00:00
$query -> from (
$this -> db -> quoteName (
'#__componentbuilder_language_translation' , 'a'
)
);
2022-03-09 23:46:45 +00:00
if ( ArrayHelper :: check ( $values ))
2017-04-05 13:21:10 +00:00
{
2020-03-28 13:34:14 +00:00
$query -> select (
$this -> db -> quoteName (
array ( 'a.id' , 'a.translation' , 'a.source' , 'a.components' ,
2021-12-21 14:44:50 +00:00
'a.modules' , 'a.plugins' , 'a.published' )
2020-03-28 13:34:14 +00:00
)
);
$query -> where (
$this -> db -> quoteName ( 'a.source' ) . ' IN (' . implode (
',' , array_map (
2023-01-22 00:38:21 +00:00
fn ( $a ) => $this -> db -> quote ( $a ), $values
2020-03-28 13:34:14 +00:00
)
) . ')'
);
2017-04-05 13:21:10 +00:00
$this -> db -> setQuery ( $query );
$this -> db -> execute ();
if ( $this -> db -> getNumRows ())
{
2018-04-19 23:36:21 +00:00
return $this -> db -> loadAssocList ( 'source' );
2017-04-05 13:21:10 +00:00
}
}
2020-03-28 13:34:14 +00:00
2017-04-05 13:21:10 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* Set the Current language values to DB
2020-03-24 01:11:43 +00:00
*
2017-04-05 13:21:10 +00:00
*
* @ return void
2020-03-24 01:11:43 +00:00
*
2017-04-05 13:21:10 +00:00
*/
2020-03-28 13:34:14 +00:00
public function setLangPlaceholders ( $strings , int $target_id ,
2021-12-21 14:44:50 +00:00
$target = 'components'
)
{
2017-04-05 13:21:10 +00:00
$counterInsert = 0 ;
$counterUpdate = 0 ;
2020-03-28 13:34:14 +00:00
$today = JFactory :: getDate () -> toSql ();
foreach (
2022-08-30 15:28:41 +00:00
$this -> languages [ $target ][ CFactory :: _ ( 'Config' ) -> get ( 'lang_tag' , 'en-GB' )] as $area => $placeholders
2020-03-28 13:34:14 +00:00
)
2017-04-05 13:21:10 +00:00
{
foreach ( $placeholders as $placeholder => $string )
{
// to keep or remove
$remove = false ;
2020-03-24 01:11:43 +00:00
// build the translations
2022-03-09 23:46:45 +00:00
if ( StringHelper :: check ( $string )
2020-03-28 13:34:14 +00:00
&& isset ( $this -> multiLangString [ $string ]))
2017-04-05 13:21:10 +00:00
{
// make sure we have converted the string to array
2020-03-28 13:34:14 +00:00
if ( isset ( $this -> multiLangString [ $string ][ 'translation' ])
2022-03-09 23:46:45 +00:00
&& JsonHelper :: check (
2020-03-28 13:34:14 +00:00
$this -> multiLangString [ $string ][ 'translation' ]
))
{
$this -> multiLangString [ $string ][ 'translation' ]
= json_decode (
2023-01-01 02:11:34 +00:00
( string ) $this -> multiLangString [ $string ][ 'translation' ], true
2020-03-28 13:34:14 +00:00
);
2017-04-05 13:21:10 +00:00
}
// if we have an array continue
2020-03-28 13:34:14 +00:00
if ( isset ( $this -> multiLangString [ $string ][ 'translation' ])
2022-03-09 23:46:45 +00:00
&& ArrayHelper :: check (
2020-03-28 13:34:14 +00:00
$this -> multiLangString [ $string ][ 'translation' ]
))
2017-04-05 13:21:10 +00:00
{
// great lets build the multi languages strings
2020-03-28 13:34:14 +00:00
foreach (
$this -> multiLangString [ $string ][ 'translation' ] as
$translations
)
2017-04-05 13:21:10 +00:00
{
2020-03-28 13:34:14 +00:00
if ( isset ( $translations [ 'language' ])
&& isset ( $translations [ 'translation' ]))
2017-04-05 13:21:10 +00:00
{
2017-09-18 00:18:23 +00:00
// build arrays
2020-03-28 13:34:14 +00:00
if ( ! isset ( $this -> languages [ $target ][ $translations [ 'language' ]]))
2017-09-18 00:18:23 +00:00
{
2020-03-28 13:34:14 +00:00
$this -> languages [ $target ][ $translations [ 'language' ]]
= array ();
2017-09-18 00:18:23 +00:00
}
2020-03-28 13:34:14 +00:00
if ( ! isset ( $this -> languages [ $target ][ $translations [ 'language' ]][ $area ]))
2017-09-18 00:18:23 +00:00
{
2020-03-28 13:34:14 +00:00
$this -> languages [ $target ][ $translations [ 'language' ]][ $area ]
= array ();
2017-09-18 00:18:23 +00:00
}
2020-03-28 13:34:14 +00:00
$this -> languages [ $target ][ $translations [ 'language' ]][ $area ][ $placeholder ]
= $translations [ 'translation' ];
2017-04-05 13:21:10 +00:00
}
}
}
else
{
// remove this string not to be checked again
$remove = true ;
}
}
2020-03-24 01:11:43 +00:00
// do the database management
2022-03-09 23:46:45 +00:00
if ( StringHelper :: check ( $string )
2020-03-28 13:34:14 +00:00
&& ( $key = array_search ( $string , $strings )) !== false )
2017-04-05 13:21:10 +00:00
{
if ( isset ( $this -> multiLangString [ $string ]))
{
// update the existing placeholder in db
$id = $this -> multiLangString [ $string ][ 'id' ];
2022-03-09 23:46:45 +00:00
if ( JsonHelper :: check (
2020-03-28 13:34:14 +00:00
$this -> multiLangString [ $string ][ $target ]
))
2017-04-05 13:21:10 +00:00
{
2020-03-28 13:34:14 +00:00
$targets = ( array ) json_decode (
2023-01-01 02:11:34 +00:00
( string ) $this -> multiLangString [ $string ][ $target ], true
2020-03-28 13:34:14 +00:00
);
2020-03-24 01:11:43 +00:00
// check if we should add the target ID
if ( in_array ( $target_id , $targets ))
2017-04-05 13:21:10 +00:00
{
2020-03-28 13:34:14 +00:00
// only skip the update if the string is published and has the target ID
if ( $this -> multiLangString [ $string ][ 'published' ]
== 1 )
2017-04-07 20:33:35 +00:00
{
continue ;
}
2017-04-05 13:21:10 +00:00
}
else
{
2020-03-24 01:11:43 +00:00
$targets [] = $target_id ;
2017-04-05 13:21:10 +00:00
}
}
else
{
2020-03-24 01:11:43 +00:00
$targets = array ( $target_id );
2017-04-05 13:21:10 +00:00
}
// start the bucket for this lang
2020-03-28 13:34:14 +00:00
$this -> setUpdateExistingLangStrings (
$id , $target , $targets , 1 , $today , $counterUpdate
);
2017-04-05 13:21:10 +00:00
$counterUpdate ++ ;
2020-03-24 01:11:43 +00:00
// load to db
2017-04-05 13:21:10 +00:00
$this -> setExistingLangStrings ( 50 );
// remove string if needed
if ( $remove )
{
unset ( $this -> multiLangString [ $string ]);
}
}
else
{
// add the new lang placeholder to the db
2020-03-24 01:11:43 +00:00
if ( ! isset ( $this -> newLangStrings [ $target ]))
{
$this -> newLangStrings [ $target ] = array ();
}
2020-03-28 13:34:14 +00:00
$this -> newLangStrings [ $target ][ $counterInsert ]
= array ();
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
json_encode ( array ( $target_id ))
); // 'target'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
$string
); // 'source'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
1
); // 'published'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
$today
); // 'created'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
( int ) $this -> user -> id
); // 'created_by'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
1
); // 'version'
$this -> newLangStrings [ $target ][ $counterInsert ][]
= $this -> db -> quote (
1
); // 'access'
2017-04-05 13:21:10 +00:00
$counterInsert ++ ;
2020-03-24 01:11:43 +00:00
// load to db
$this -> setNewLangStrings ( $target , 100 );
2017-04-05 13:21:10 +00:00
}
// only set the string once
unset ( $strings [ $key ]);
}
}
}
// just to make sure all is done
$this -> setExistingLangStrings ();
2020-03-24 01:11:43 +00:00
$this -> setNewLangStrings ( $target );
2017-04-05 13:21:10 +00:00
}
2017-12-14 23:10:47 +00:00
2017-04-05 13:21:10 +00:00
/**
* store the language placeholders
2020-03-24 01:11:43 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param string $target The target extention type
* @ param int $when To set when to update
2017-04-05 13:21:10 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
*/
2020-03-24 01:11:43 +00:00
protected function setNewLangStrings ( $target , $when = 1 )
2017-04-05 13:21:10 +00:00
{
2020-03-28 13:34:14 +00:00
if ( isset ( $this -> newLangStrings [ $target ])
&& count (
( array ) $this -> newLangStrings [ $target ]
) >= $when )
2017-04-05 13:21:10 +00:00
{
// Create a new query object.
2020-03-28 13:34:14 +00:00
$query = $this -> db -> getQuery ( true );
2017-04-05 13:21:10 +00:00
$continue = false ;
// Insert columns.
2020-03-28 13:34:14 +00:00
$columns = array ( $target , 'source' , 'published' , 'created' ,
2021-12-21 14:44:50 +00:00
'created_by' , 'version' , 'access' );
2017-04-05 13:21:10 +00:00
// Prepare the insert query.
2020-03-28 13:34:14 +00:00
$query -> insert (
$this -> db -> quoteName ( '#__componentbuilder_language_translation' )
);
2017-04-05 13:21:10 +00:00
$query -> columns ( $this -> db -> quoteName ( $columns ));
2020-03-24 01:11:43 +00:00
foreach ( $this -> newLangStrings [ $target ] as $values )
2017-04-05 13:21:10 +00:00
{
2019-09-05 21:12:56 +00:00
if ( count (( array ) $values ) == 7 )
2017-04-05 13:21:10 +00:00
{
$query -> values ( implode ( ',' , $values ));
$continue = true ;
}
else
{
// TODO line mismatch... should not happen
}
}
// clear the values array
2020-03-24 01:11:43 +00:00
$this -> newLangStrings [ $target ] = array ();
2017-04-05 13:21:10 +00:00
if ( ! $continue )
{
return false ; // insure we dont continue if no values were loaded
}
// Set the query using our newly populated query object and execute it.
$this -> db -> setQuery ( $query );
$this -> db -> execute ();
}
2017-12-14 23:10:47 +00:00
}
2017-04-05 13:21:10 +00:00
/**
* update the language placeholders
2020-03-28 13:34:14 +00:00
*
* @ param int $when To set when to update
2017-04-05 13:21:10 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-05 13:21:10 +00:00
*/
protected function setExistingLangStrings ( $when = 1 )
{
2019-09-05 21:12:56 +00:00
if ( count (( array ) $this -> existingLangStrings ) >= $when )
2017-04-05 13:21:10 +00:00
{
2017-12-14 23:10:47 +00:00
foreach ( $this -> existingLangStrings as $values )
2017-04-05 13:21:10 +00:00
{
// Create a new query object.
$query = $this -> db -> getQuery ( true );
// Prepare the update query.
2020-03-28 13:34:14 +00:00
$query -> update (
$this -> db -> quoteName (
'#__componentbuilder_language_translation'
)
) -> set ( $values [ 'fields' ]) -> where ( $values [ 'conditions' ]);
2017-04-05 13:21:10 +00:00
// Set the query using our newly populated query object and execute it.
$this -> db -> setQuery ( $query );
$this -> db -> execute ();
}
// clear the values array
2017-12-14 23:10:47 +00:00
$this -> existingLangStrings = array ();
2017-04-05 13:21:10 +00:00
}
2017-12-14 23:10:47 +00:00
}
2017-04-07 20:33:35 +00:00
/**
* Remove exiting language translation stings
2020-03-28 13:34:14 +00:00
*
* @ param int $id To string ID to remove
2017-04-07 20:33:35 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-07 20:33:35 +00:00
*/
protected function removeExitingLangString ( $id )
{
// Create a new query object.
$query = $this -> db -> getQuery ( true );
2017-12-14 23:10:47 +00:00
2017-04-07 20:33:35 +00:00
// delete all custom keys for user 1001.
$conditions = array (
2017-12-14 23:10:47 +00:00
$this -> db -> quoteName ( 'id' ) . ' = ' . ( int ) $id
2017-04-07 20:33:35 +00:00
);
2020-03-28 13:34:14 +00:00
$query -> delete (
$this -> db -> quoteName ( '#__componentbuilder_language_translation' )
);
2017-04-07 20:33:35 +00:00
$query -> where ( $conditions );
$this -> db -> setQuery ( $query );
$this -> db -> execute ();
}
2017-12-14 23:10:47 +00:00
2017-04-07 20:33:35 +00:00
/**
* Function to purge the unused languge strings
2020-03-28 13:34:14 +00:00
*
* @ param string $values the active strings
2017-04-07 20:33:35 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-07 20:33:35 +00:00
*/
2020-03-28 13:34:14 +00:00
public function purgeLanuageStrings ( $values , $target_id ,
2021-12-21 14:44:50 +00:00
$target = 'components'
)
{
2020-03-24 01:11:43 +00:00
// the target types are
2020-03-28 13:34:14 +00:00
$target_types = array ( 'components' => 'components' ,
'modules' => 'modules' ,
'plugins' => 'plugins' );
// make sure we only work with preset targets
if ( isset ( $target_types [ $target ]))
{
// remove the current target
unset ( $target_types [ $target ]);
// Create a new query object.
$query = $this -> db -> getQuery ( true );
$query -> from (
$this -> db -> quoteName (
'#__componentbuilder_language_translation' , 'a'
)
);
$query -> select (
$this -> db -> quoteName (
array ( 'a.id' , 'a.translation' , 'a.components' , 'a.modules' ,
2021-12-21 14:44:50 +00:00
'a.plugins' )
2020-03-28 13:34:14 +00:00
)
);
// get all string that are not linked to this component
$query -> where (
$this -> db -> quoteName ( 'a.source' ) . ' NOT IN (' . implode (
',' , array_map (
2023-01-22 00:38:21 +00:00
fn ( $a ) => $this -> db -> quote ( $a ), $values
2020-03-28 13:34:14 +00:00
)
) . ')'
);
$query -> where ( $this -> db -> quoteName ( 'a.published' ) . ' = 1' );
$this -> db -> setQuery ( $query );
$this -> db -> execute ();
if ( $this -> db -> getNumRows ())
2017-04-07 20:33:35 +00:00
{
2020-03-28 13:34:14 +00:00
$counterUpdate = 0 ;
$otherStrings = $this -> db -> loadAssocList ();
$today = JFactory :: getDate () -> toSql ();
foreach ( $otherStrings as $item )
2017-04-07 20:33:35 +00:00
{
2022-03-09 23:46:45 +00:00
if ( JsonHelper :: check ( $item [ $target ]))
2017-04-07 20:33:35 +00:00
{
2023-01-01 02:11:34 +00:00
$targets = ( array ) json_decode (( string ) $item [ $target ], true );
2020-03-28 13:34:14 +00:00
// if component is not found ignore this string, and do nothing
if (( $key = array_search ( $target_id , $targets ))
!== false )
2017-04-07 20:33:35 +00:00
{
2020-03-28 13:34:14 +00:00
// first remove the component from the string
unset ( $targets [ $key ]);
// check if there are more components
2022-03-09 23:46:45 +00:00
if ( ArrayHelper :: check ( $targets ))
2020-03-28 13:34:14 +00:00
{
// just update the string to unlink the current component
$this -> setUpdateExistingLangStrings (
$item [ 'id' ], $target , $targets , 1 , $today ,
$counterUpdate
);
2017-04-07 20:33:35 +00:00
2020-03-28 13:34:14 +00:00
$counterUpdate ++ ;
2017-04-07 20:33:35 +00:00
2020-03-28 13:34:14 +00:00
// load to db
$this -> setExistingLangStrings ( 50 );
}
// check if this string has been worked on or is linked to other extensions
else
2017-04-07 20:33:35 +00:00
{
2020-03-28 13:34:14 +00:00
// the action (1 = remove, 2 = archive, 0 = do nothing)
$action_with_string = 1 ;
// now check if it is linked to other extensions
foreach ( $target_types as $other_target )
2020-03-24 01:11:43 +00:00
{
2020-03-28 13:34:14 +00:00
// just one linked extension type is enough to stop the search
if ( $action_with_string
2022-03-09 23:46:45 +00:00
&& JsonHelper :: check (
2020-03-28 13:34:14 +00:00
$item [ $other_target ]
))
2020-03-24 01:11:43 +00:00
{
2020-03-28 13:34:14 +00:00
$other_targets = ( array ) json_decode (
2023-01-01 02:11:34 +00:00
( string ) $item [ $other_target ], true
2020-03-28 13:34:14 +00:00
);
// check if linked to other extensions
2022-03-09 23:46:45 +00:00
if ( ArrayHelper :: check (
2020-03-28 13:34:14 +00:00
$other_targets
))
{
$action_with_string
= 0 ; // do nothing
}
2020-03-24 01:11:43 +00:00
}
}
2020-03-28 13:34:14 +00:00
// check we should just archive or remove string
if ( $action_with_string
2022-03-09 23:46:45 +00:00
&& JsonHelper :: check (
2020-03-28 13:34:14 +00:00
$item [ 'translation' ]
))
2020-03-24 01:11:43 +00:00
{
2020-03-28 13:34:14 +00:00
$translation = json_decode (
2023-01-01 02:11:34 +00:00
( string ) $item [ 'translation' ], true
2020-03-28 13:34:14 +00:00
);
2022-03-09 23:46:45 +00:00
if ( ArrayHelper :: check (
2020-03-28 13:34:14 +00:00
$translation
))
{
// only archive the item and update the string to unlink the current component
$this -> setUpdateExistingLangStrings (
$item [ 'id' ], $target , $targets , 2 ,
$today , $counterUpdate
);
2017-04-07 20:33:35 +00:00
2020-03-28 13:34:14 +00:00
$counterUpdate ++ ;
2017-04-07 20:33:35 +00:00
2020-03-28 13:34:14 +00:00
// load to db
$this -> setExistingLangStrings ( 50 );
2020-03-24 01:11:43 +00:00
2020-03-28 13:34:14 +00:00
$action_with_string
= 2 ; // we archived it
}
}
// remove the string since no translation found and not linked to any other extensions
if ( $action_with_string == 1 )
{
$this -> removeExitingLangString ( $item [ 'id' ]);
2020-03-24 01:11:43 +00:00
}
2017-04-07 20:33:35 +00:00
}
}
}
}
2020-03-28 13:34:14 +00:00
// load to db
$this -> setExistingLangStrings ();
2017-04-07 20:33:35 +00:00
}
}
}
2017-12-14 23:10:47 +00:00
2017-04-07 20:33:35 +00:00
/**
* just to add lang string to the existing Lang Strings array
2020-03-28 13:34:14 +00:00
*
2017-04-07 20:33:35 +00:00
* @ return void
2020-03-28 13:34:14 +00:00
*
2017-04-07 20:33:35 +00:00
*/
2020-03-28 13:34:14 +00:00
protected function setUpdateExistingLangStrings ( $id , $target , $targets ,
2021-12-21 14:44:50 +00:00
$published , $today , $counterUpdate
)
{
2017-04-07 20:33:35 +00:00
// start the bucket for this lang
2020-03-28 13:34:14 +00:00
$this -> existingLangStrings [ $counterUpdate ] = array ();
$this -> existingLangStrings [ $counterUpdate ][ 'id' ] = ( int ) $id ;
2017-12-14 23:10:47 +00:00
$this -> existingLangStrings [ $counterUpdate ][ 'conditions' ] = array ();
2020-03-28 13:34:14 +00:00
$this -> existingLangStrings [ $counterUpdate ][ 'conditions' ][]
= $this -> db -> quoteName (
'id'
) . ' = ' . $this -> db -> quote ( $id );
$this -> existingLangStrings [ $counterUpdate ][ 'fields' ] = array ();
$this -> existingLangStrings [ $counterUpdate ][ 'fields' ][]
= $this -> db -> quoteName (
$target
) . ' = ' . $this -> db -> quote ( json_encode ( $targets ));
$this -> existingLangStrings [ $counterUpdate ][ 'fields' ][]
= $this -> db -> quoteName (
'published'
) . ' = ' . $this -> db -> quote ( $published );
$this -> existingLangStrings [ $counterUpdate ][ 'fields' ][]
= $this -> db -> quoteName (
'modified'
) . ' = ' . $this -> db -> quote ( $today );
$this -> existingLangStrings [ $counterUpdate ][ 'fields' ][]
= $this -> db -> quoteName (
'modified_by'
) . ' = ' . $this -> db -> quote (( int ) $this -> user -> id );
2017-04-05 13:21:10 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* get the custom code from the system
2020-03-28 13:34:14 +00:00
*
2022-08-30 15:28:41 +00:00
* @ param array | null $ids The custom code ides if known
2023-01-22 00:38:21 +00:00
* @ 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' ) -> get ( $ids , $setLang , $debug );
*/
public function getCustomCode ( ? array $ids = null , bool $setLang = true , int $debug = 0 )
{
CFactory :: _ ( 'Customcode' ) -> get ( $ids , $setLang , $debug );
2020-03-13 02:45:08 +00:00
}
2019-12-06 05:31:32 +00:00
/**
2023-01-22 00:38:21 +00:00
* check if we already have these ids in local memory
2019-12-06 05:31:32 +00:00
*
2023-01-22 00:38:21 +00:00
* @ return void
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2019-12-06 05:31:32 +00:00
*/
2023-01-22 00:38:21 +00:00
protected function checkCustomCodeMemory ( $ids )
2019-12-06 05:31:32 +00:00
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2019-12-06 05:31:32 +00:00
}
/**
2023-01-22 00:38:21 +00:00
* get all the powers linkd to this component
2019-12-06 05:31:32 +00:00
*
2023-01-22 00:38:21 +00:00
* @ return void
* @ deprecated 3.3 Use CFactory :: _ ( 'Power' ) -> load ( $guids );
2019-12-06 05:31:32 +00:00
*/
2023-01-22 00:38:21 +00:00
protected function getPowers ( $guids )
2019-12-06 05:31:32 +00:00
{
2023-01-22 00:38:21 +00:00
CFactory :: _ ( 'Power' ) -> load ( $guids );
}
2020-03-28 13:34:14 +00:00
2023-01-22 00:38:21 +00:00
/**
* get a power linkd to this component
*
* @ return mixed
* @ deprecated 3.3 Use CFactory :: _ ( 'Power' ) -> get ( $guid , $build );
*/
public function getPower ( $guid , $build = 0 )
{
CFactory :: _ ( 'Power' ) -> get ( $guid , $build );
}
/**
* set a power linkd to this component
*
* @ return bool
* @ deprecated 3.3
*/
protected function setPower ( $guid )
{
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2019-12-06 05:31:32 +00:00
2023-01-22 00:38:21 +00:00
return false ;
}
2019-12-06 05:31:32 +00:00
2023-01-22 00:38:21 +00:00
/**
* get the Joomla module path
*
* @ return string of module path and target site area on success
* @ deprecated 3.3
*/
protected function getModulePath ( $id )
{
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2019-12-06 05:31:32 +00:00
2023-01-22 00:38:21 +00:00
return '' ;
}
2019-12-06 05:31:32 +00:00
2023-01-22 00:38:21 +00:00
/**
* get the Joomla Modules IDs
*
* @ return array of IDs on success
* @ deprecated 3.3
*/
protected function getModuleIDs ()
{
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2023-01-22 00:38:21 +00:00
return [];
}
/**
* set the Joomla modules
*
* @ return true
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlamodule.Data' ) -> set ( $id );
*/
public function setJoomlaModule ( $id , & $component )
{
return CFactory :: _ ( 'Joomlamodule.Data' ) -> set ( $id );
2019-12-06 05:31:32 +00:00
}
/**
* get the module xml template
*
* @ return string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3
2019-12-06 05:31:32 +00:00
*/
public function getModuleXMLTemplate ( & $module )
{
2023-01-29 20:12:42 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2019-12-06 05:31:32 +00:00
}
2020-12-05 06:17:54 +00:00
/**
* get the module admin custom script field
*
* @ return string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3
2020-12-05 06:17:54 +00:00
*/
public function getModAdminVvvvvvvdm ( $fieldScriptBucket )
{
2023-01-29 20:12:42 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-12-05 06:17:54 +00:00
}
2019-09-11 14:50:42 +00:00
/**
* get the Joomla plugins IDs
2020-03-28 13:34:14 +00:00
*
2019-09-11 14:50:42 +00:00
* @ return array of IDs on success
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2019-09-11 14:50:42 +00:00
*/
protected function getPluginIDs ()
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-09-02 05:51:08 +00:00
return [];
2019-09-11 14:50:42 +00:00
}
/**
* get the Joomla plugin path
2020-03-28 13:34:14 +00:00
*
2019-09-11 14:50:42 +00:00
* @ return string of plugin path on success
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2019-09-11 14:50:42 +00:00
*/
protected function getPluginPath ( $id )
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-09-02 05:51:08 +00:00
return '' ;
2019-09-11 14:50:42 +00:00
}
2019-07-28 21:48:42 +00:00
/**
2019-08-22 01:54:47 +00:00
* set the Joomla plugins
2020-03-28 13:34:14 +00:00
*
2019-08-22 01:54:47 +00:00
* @ return true
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlamodule.Data' ) -> set ( $id );
2019-07-28 21:48:42 +00:00
*/
2019-08-22 01:54:47 +00:00
public function setJoomlaPlugin ( $id , & $component )
2019-07-28 21:48:42 +00:00
{
2023-01-22 00:38:21 +00:00
return CFactory :: _ ( 'Joomlaplugin.Data' ) -> set ( $id );
2019-07-28 21:48:42 +00:00
}
2019-08-04 22:38:53 +00:00
/**
* get the plugin xml template
2020-03-28 13:34:14 +00:00
*
2019-08-04 22:38:53 +00:00
* @ return string
2020-03-28 13:34:14 +00:00
*
2019-08-04 22:38:53 +00:00
*/
public function getPluginXMLTemplate ( & $plugin )
{
$xml = '<?xml version="1.0" encoding="utf-8"?>' ;
2021-12-21 14:44:50 +00:00
$xml .= PHP_EOL . '<extension type="plugin" version="'
2023-01-29 20:12:42 +00:00
. CFactory :: _ ( 'Config' ) -> joomla_versions [ CFactory :: _ ( 'Config' ) -> joomla_version ][ 'xml_version' ] . '" group="'
2023-01-01 02:11:34 +00:00
. strtolower (( string ) $plugin -> group ) . '" method="upgrade">' ;
2022-08-30 15:28:41 +00:00
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<name>' . $plugin -> lang_prefix
2020-03-28 13:34:14 +00:00
. '</name>' ;
2022-08-30 15:28:41 +00:00
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<creationDate>' . Placefix :: _h ( 'BUILDDATE' ) . '</creationDate>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<author>' . Placefix :: _h ( 'AUTHOR' ) . '</author>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<authorEmail>' . Placefix :: _h ( 'AUTHOREMAIL' ) . '</authorEmail>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<authorUrl>' . Placefix :: _h ( 'AUTHORWEBSITE' ) . '</authorUrl>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<copyright>' . Placefix :: _h ( 'COPYRIGHT' ) . '</copyright>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<license>' . Placefix :: _h ( 'LICENSE' ) . '</license>' ;
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<version>' . $plugin -> plugin_version
2020-03-28 13:34:14 +00:00
. '</version>' ;
2022-08-30 15:28:41 +00:00
$xml .= PHP_EOL . Indent :: _ ( 1 ) . '<description>' . $plugin -> lang_prefix
2020-03-28 13:34:14 +00:00
. '_XML_DESCRIPTION</description>' ;
2022-08-30 15:28:41 +00:00
$xml .= Placefix :: _h ( 'MAINXML' );
2019-08-04 22:38:53 +00:00
$xml .= PHP_EOL . '</extension>' ;
return $xml ;
}
2017-02-01 13:17:04 +00:00
/**
* store the code
2020-03-28 13:34:14 +00:00
*
* @ param int $when To set when to update
2017-02-01 13:17:04 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
2017-02-13 23:24:38 +00:00
protected function setNewCustomCode ( $when = 1 )
2017-02-01 13:17:04 +00:00
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2017-02-01 13:17:04 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* store the code
2020-03-28 13:34:14 +00:00
*
* @ param int $when To set when to update
2017-02-01 13:17:04 +00:00
*
* @ return void
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
2017-02-13 23:24:38 +00:00
protected function setExistingCustomCode ( $when = 1 )
2017-02-01 13:17:04 +00:00
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2017-02-01 13:17:04 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* get the custom code from the local files
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
* @ param array $paths The local paths to parse
* @ param string $today The date for today
*
* @ return void
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Extractor' ) -> run ();
2017-02-01 13:17:04 +00:00
*/
2017-02-13 23:24:38 +00:00
protected function customCodeFactory ( & $paths , & $today )
2017-02-01 13:17:04 +00:00
{
2022-09-02 05:51:08 +00:00
CFactory :: _ ( 'Customcode.Extractor' ) -> run ();
2017-02-01 13:17:04 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* search a file for placeholders and store result
2020-03-28 13:34:14 +00:00
*
* @ param array $counter The counter for the arrays
* @ param string $file The file path to search
* @ param array $searchArray The values to search for
* @ param array $placeholders The values to replace in the code being stored
* @ param string $today The date for today
2017-02-01 13:17:04 +00:00
*
* @ return array on success
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
2020-03-28 13:34:14 +00:00
protected function searchFileContent ( & $counter , & $file , & $target ,
2021-12-21 14:44:50 +00:00
& $searchArray , & $placeholders , & $today
)
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
return [];
2017-02-01 13:17:04 +00:00
}
2020-06-25 19:22:30 +00:00
2021-02-19 00:35:54 +00:00
/**
* Set a hash of a file and / or string
*
* @ param string $string The code string
*
* @ return string
2022-08-31 11:49:01 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Hash' ) -> set ( $script );
2021-02-19 00:35:54 +00:00
*/
protected function setDynamicHASHING ( $script )
{
2022-09-02 05:51:08 +00:00
return CFactory :: _ ( 'Customcode.Hash' ) -> set ( $script );
2021-02-19 00:35:54 +00:00
}
2020-06-25 19:22:30 +00:00
/**
* Lock a string with bsae64 ( basic )
*
* @ param string $string The code string
*
* @ return string
2022-08-31 11:49:01 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.LockBase' ) -> set ( $script );
2020-06-25 19:22:30 +00:00
*/
protected function setBase64LOCK ( $script )
{
2022-09-02 05:51:08 +00:00
return CFactory :: _ ( 'Customcode.LockBase' ) -> set ( $script );
2020-06-25 19:22:30 +00:00
}
2017-12-14 23:10:47 +00:00
2019-07-28 21:48:42 +00:00
/**
* Set the JCB GUI code placeholder
2020-03-28 13:34:14 +00:00
*
* @ param string $string The code string
* @ param array $config The placeholder config values
2019-07-28 21:48:42 +00:00
*
2019-12-03 02:17:35 +00:00
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Gui' ) -> set ( $string , $config );
2019-07-28 21:48:42 +00:00
*/
public function setGuiCodePlaceholder ( $string , $config )
{
2022-08-30 15:28:41 +00:00
return CFactory :: _ ( 'Customcode.Gui' ) -> set ( $string , $config );
2019-07-28 21:48:42 +00:00
}
/**
2020-03-28 13:34:14 +00:00
* search a code to see if there is already any custom
2019-07-28 21:48:42 +00:00
* code or other reasons not to add the GUI code placeholders
2020-03-28 13:34:14 +00:00
*
* @ param string $code The code to check
2019-07-28 21:48:42 +00:00
*
* @ return boolean true if GUI code placeholders can be added
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3
2019-07-28 21:48:42 +00:00
*/
protected function canAddGuiCodePlaceholder ( & $code )
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-09-02 05:51:08 +00:00
return false ;
2019-07-28 21:48:42 +00:00
}
/**
* search a file for gui code blocks that were updated in the IDE
2020-03-28 13:34:14 +00:00
*
* @ param string $file The file path to search
* @ param array $placeholders The values to replace in the code being stored
* @ param string $today The date for today
* @ param string $target The target path type
2019-07-28 21:48:42 +00:00
*
* @ return void
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Customcode.Gui' ) -> search ( $file , $placeholders , $today , $target );
2019-07-28 21:48:42 +00:00
*/
2019-09-11 14:50:42 +00:00
protected function guiCodeSearch ( & $file , & $placeholders , & $today , & $target )
2019-07-28 21:48:42 +00:00
{
2022-08-30 15:28:41 +00:00
CFactory :: _ ( 'Customcode.Gui' ) -> search ( $file , $placeholders , $today , $target );
2019-07-28 21:48:42 +00:00
}
2017-02-13 23:24:38 +00:00
/**
* Check if this line should be added
2020-03-28 13:34:14 +00:00
*
* @ param string $replaceKey The key to remove from line
* @ param int $type The line type
* @ param string $lineContent The line to check
2017-02-13 23:24:38 +00:00
*
* @ return bool true on success
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-13 23:24:38 +00:00
*/
protected function addLineChecker ( $replaceKey , $type , $lineContent )
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2017-02-13 23:24:38 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
2018-04-19 15:52:47 +00:00
* set the start replace placeholder
2020-03-28 13:34:14 +00:00
*
* @ param int $id The comment id
* @ param int $commentType The comment type
* @ param string $startReplace The main replace string
2017-02-13 23:24:38 +00:00
*
* @ return array on success
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-13 23:24:38 +00:00
*/
protected function setStartReplace ( $id , $commentType , $startReplace )
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-09-02 05:51:08 +00:00
return [];
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* search for the system id in the line given
2020-03-28 13:34:14 +00:00
*
* @ param string $lineContent The file path to search
* @ param string $placeholders The values to search for
* @ param int $commentType The comment type
2017-02-01 13:17:04 +00:00
*
2022-09-02 05:51:08 +00:00
* @ return int on success
2020-03-28 13:34:14 +00:00
*
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
2017-02-13 23:24:38 +00:00
protected function getSystemID ( & $lineContent , $placeholders , $commentType )
2017-02-01 13:17:04 +00:00
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
2020-03-28 13:34:14 +00:00
);
2022-09-02 05:51:08 +00:00
return null ;
2017-02-01 13:17:04 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-11 02:24:26 +00:00
/**
2018-04-19 15:52:47 +00:00
* Reverse Engineer the dynamic placeholders ( TODO hmmmm this is not ideal )
2020-03-28 13:34:14 +00:00
*
* @ param string $string The string to revers
* @ param array $placeholders The values to search for
* @ param string $target The target path type
* @ param int $id The custom code id
* @ param string $field The field name
* @ param string $table The table name
2017-02-11 02:24:26 +00:00
*
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder.Reverse' ) -> engine ( $string , $placeholders , $target , $id , $field , $table );
2017-02-11 02:24:26 +00:00
*/
2020-03-28 13:34:14 +00:00
protected function reversePlaceholders ( $string , & $placeholders , & $target ,
2021-12-21 14:44:50 +00:00
$id = null , $field = 'code' , $table = 'custom_code'
)
{
2022-08-30 15:28:41 +00:00
// use the new container class
CFactory :: _ ( 'Placeholder.Reverse' ) -> engine ( $string , $placeholders , $target , $id , $field , $table );
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
2019-09-11 14:50:42 +00:00
* Set the langs strings for the reveres process
2020-03-28 13:34:14 +00:00
*
* @ param string $updateString The string to update
* @ param string $string The string to use lang update
* @ param string $target The target path type
2017-02-13 23:24:38 +00:00
*
2019-05-20 12:14:43 +00:00
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 See $this -> reversePlaceholders ();
2017-02-13 23:24:38 +00:00
*/
2020-03-28 13:34:14 +00:00
protected function setReverseLangPlaceholders ( $updateString , $string ,
2021-12-21 14:44:50 +00:00
& $target
)
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
2020-03-28 13:34:14 +00:00
);
2022-09-02 05:51:08 +00:00
return '' ;
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* Update the data with the placeholders
2020-03-28 13:34:14 +00:00
*
* @ param string $data The actual data
* @ param array $placeholder The placeholders
* @ param int $action The action to use
*
2017-02-13 23:24:38 +00:00
* THE ACTION OPTIONS ARE
* 1 -> Just replace ( default )
* 2 -> Check if data string has placeholders
* 3 -> Remove placeholders not in data string
*
* @ return string
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder' ) -> update ( $data , $placeholder , $action );
2017-02-13 23:24:38 +00:00
*/
2018-03-20 02:35:48 +00:00
public function setPlaceholders ( $data , & $placeholder , $action = 1 )
2017-02-13 23:24:38 +00:00
{
2022-08-30 15:28:41 +00:00
// use the new container class
CFactory :: _ ( 'Placeholder' ) -> update ( $data , $placeholder , $action );
2017-02-11 02:24:26 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
2018-04-19 15:52:47 +00:00
* return the placeholders for inserted and replaced code
2020-03-28 13:34:14 +00:00
*
* @ param int $type The type of placement
* @ param int $id The code id in the system
2017-02-01 13:17:04 +00:00
*
* @ return array on success
2022-08-30 15:28:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Placeholder' ) -> keys ( $type , $id );
2017-02-01 13:17:04 +00:00
*/
2017-02-11 02:24:26 +00:00
public function getPlaceHolder ( $type , $id )
2017-02-01 13:17:04 +00:00
{
2022-08-30 15:28:41 +00:00
return CFactory :: _ ( 'Placeholder' ) -> keys ( $type , $id );
2017-02-01 13:17:04 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-13 23:24:38 +00:00
/**
* get the local installed path of this component
*
* @ return array of paths on success
2022-09-02 05:51:08 +00:00
* @ deprecated 3.3
2017-02-13 23:24:38 +00:00
*/
protected function getLocalInstallPaths ()
{
2022-09-02 05:51:08 +00:00
// set notice that we could not get a valid string from the target
$this -> app -> enqueueMessage (
JText :: sprintf ( '<hr /><h3>%s Warning</h3>' , __CLASS__ ), 'Error'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'Use of a deprecated method (%s)!' , __METHOD__
), 'Error'
);
2020-03-28 13:34:14 +00:00
2022-09-02 05:51:08 +00:00
return [];
2017-02-13 23:24:38 +00:00
}
2017-12-14 23:10:47 +00:00
2016-02-26 00:20:09 +00:00
}