2016-02-26 00:20:09 +00:00
< ? php
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' );
2021-03-07 21:40:55 +00:00
use Joomla\CMS\Filesystem\File ;
2022-03-09 23:46:45 +00:00
use VDM\Joomla\Utilities\ArrayHelper ;
2022-04-04 15:35:08 +00:00
use VDM\Joomla\Utilities\GetHelper ;
use VDM\Joomla\Utilities\FileHelper ;
2022-08-30 15:28:41 +00:00
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory ;
2021-03-07 21:40:55 +00:00
2016-02-26 00:20:09 +00:00
/**
* Structure class
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
class Structure extends Get
2017-12-14 23:10:47 +00:00
{
2016-03-04 00:01:43 +00:00
/**
2019-06-29 21:11:37 +00:00
* The folder counter
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var int
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Counter' ) -> folder ;
2016-02-26 00:20:09 +00:00
*/
public $folderCount = 0 ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2019-06-29 21:11:37 +00:00
* The file counter
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var int
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Counter' ) -> file ;
2016-02-26 00:20:09 +00:00
*/
public $fileCount = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The page counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $pageCount = 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 line counter
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Counter' ) -> line ;
2016-02-26 00:20:09 +00:00
*/
public $lineCount = 0 ;
2017-12-14 23:10:47 +00:00
2017-12-14 13:30:21 +00:00
/**
* The field counter
2020-03-28 13:34:14 +00:00
*
2017-12-14 13:30:21 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-12-14 13:30:21 +00:00
*/
public $fieldCount = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The seconds counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $seconds = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The actual seconds counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $actualSeconds = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The folder seconds counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $folderSeconds = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The file seconds counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $fileSeconds = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The line seconds counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $lineSeconds = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The seconds debugging counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $secondsDebugging = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The seconds planning counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $secondsPlanning = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The seconds mapping counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $secondsMapping = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The seconds office counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $secondsOffice = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The total hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $totalHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The debugging hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $debuggingHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The planning hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $planningHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The mapping hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $mappingHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The office hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $officeHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The actual Total Hours counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $actualTotalHours = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The actual hours spent counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $actualHoursSpent = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The actual days spent counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $actualDaysSpent = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The total days counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $totalDays = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The actual Total Days counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $actualTotalDays = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The project week time counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $projectWeekTime = 0 ;
2017-12-14 23:10:47 +00:00
2017-03-03 21:53:18 +00:00
/**
* The project month time counter
2020-03-28 13:34:14 +00:00
*
2017-03-03 21:53:18 +00:00
* @ var int
2023-01-22 00:38:21 +00:00
* @ deprecated 3.3
2017-03-03 21:53:18 +00:00
*/
public $projectMonthTime = 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 template path
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> template_path ;
2016-02-26 00:20:09 +00:00
*/
public $templatePath ;
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 template path
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> template_path_custom ;
2016-02-26 00:20:09 +00:00
*/
public $templatePathCustom ;
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 Joomla Version Data
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var object
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Settings' )
2016-02-26 00:20:09 +00:00
*/
public $joomlaVersionData ;
2017-12-14 23:10:47 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Static File Content
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-12-04 09:23:43 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Content' ) -> active
2016-02-26 00:20:09 +00:00
*/
public $fileContentStatic = array ();
2017-12-14 23:10:47 +00:00
2020-01-25 22:24:42 +00:00
/**
* Extention Custom Fields
*
* @ var array
*/
public $extentionCustomfields = array ();
2020-02-13 12:24:13 +00:00
/**
* Extention Tracking Files Moved
*
* @ var array
*/
public $extentionTrackingFilesMoved = array ();
2018-09-25 20:02:48 +00:00
/**
* The standard folders
2020-03-28 13:34:14 +00:00
*
2018-09-25 20:02:48 +00:00
* @ var array
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3
2018-09-25 20:02:48 +00:00
*/
public $stdFolders = array ( 'site' , 'admin' , 'media' );
2019-08-08 15:35:58 +00:00
/**
* The standard root files
2020-03-28 13:34:14 +00:00
*
2019-08-08 15:35:58 +00:00
* @ var array
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3
2019-08-08 15:35:58 +00:00
*/
2020-03-28 13:34:14 +00:00
public $stdRootFiles
= array ( 'access.xml' , 'config.xml' , 'controller.php' , 'index.html' ,
2021-12-21 14:44:50 +00:00
'README.txt' );
2019-08-08 15:35:58 +00:00
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Dynamic File Content
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2022-12-04 09:23:43 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Content' ) -> _active
2016-02-26 00:20:09 +00:00
*/
public $fileContentDynamic = 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 Component Sales name
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> component_sales_name ;
2016-02-26 00:20:09 +00:00
*/
public $componentSalesName ;
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 Backup name
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> component_backup_name ;
2016-02-26 00:20:09 +00:00
*/
public $componentBackupName ;
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 Folder name
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> component_folder_name ;
2016-02-26 00:20:09 +00:00
*/
public $componentFolderName ;
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 path
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var string
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Paths' ) -> component_path ;
2016-02-26 00:20:09 +00:00
*/
public $componentPath ;
2017-12-14 23:10:47 +00:00
2019-08-04 22:38:53 +00:00
/**
* The Dynamic paths
2020-03-28 13:34:14 +00:00
*
2019-08-04 22:38:53 +00:00
* @ var array
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'dynamic_paths' );
2019-08-04 22:38:53 +00:00
*/
public $dynamicPaths = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The not new static items
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'files.not.new' , []);
2016-02-26 00:20:09 +00:00
*/
public $notNew = array ();
2017-12-14 23:10:47 +00:00
2018-09-25 20:02:48 +00:00
/**
* Update the file content
2020-03-28 13:34:14 +00:00
*
2018-09-25 20:02:48 +00:00
* @ var array
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'update.file.content' );
2018-09-25 20:02:48 +00:00
*/
public $updateFileContent = array ();
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* The new files
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var array
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Files' );
2016-02-26 00:20:09 +00:00
*/
public $newFiles = 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 Checkin Switch
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ var boolean
*/
public $addCheckin = false ;
2017-12-14 23:10:47 +00:00
2018-02-28 02:27:03 +00:00
/**
* The Move Folders Switch
2020-03-28 13:34:14 +00:00
*
2018-02-28 02:27:03 +00:00
* @ var boolean
*/
public $setMoveFolders = false ;
2017-02-01 13:17:04 +00:00
/**
* The array of last modified dates
2020-03-28 13:34:14 +00:00
*
2017-02-01 13:17:04 +00:00
* @ var array
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3
2017-02-01 13:17:04 +00:00
*/
protected $lastModifiedDate = array ();
2017-12-14 23:10:47 +00:00
2018-03-09 03:26:44 +00:00
/**
* The default view switch
2020-03-28 13:34:14 +00:00
*
2018-03-09 03:26:44 +00:00
* @ var bool / string
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'build.dashboard' );
2018-03-09 03:26:44 +00:00
*/
public $dynamicDashboard = false ;
2020-04-23 21:15:07 +00:00
/**
* The default view type
*
* @ var string
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Registry' ) -> get ( 'build.dashboard.type' );
2020-04-23 21:15:07 +00:00
*/
public $dynamicDashboardType ;
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
{
2023-01-22 00:38:21 +00:00
// first we run the parent constructor
2022-08-30 15:28:41 +00:00
if ( parent :: __construct ())
2017-10-12 00:50:14 +00:00
{
2018-09-25 20:02:48 +00:00
// set incase no extra admin folder are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_ADMIN_FOLDERS' , '' );
2018-09-25 20:02:48 +00:00
// set incase no extra site folder are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_SITE_FOLDERS' , '' );
2018-09-25 20:02:48 +00:00
// set incase no extra media folder are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_MEDIA_FOLDERS' , '' );
2018-09-25 20:02:48 +00:00
// set incase no extra admin files are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_ADMIN_FILES' , '' );
2018-09-25 20:02:48 +00:00
// set incase no extra site files are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_SITE_FILES' , '' );
2018-09-25 20:02:48 +00:00
// set incase no extra media files are loaded
2022-12-04 09:23:43 +00:00
CFactory :: _ ( 'Content' ) -> set ( 'EXSTRA_MEDIA_FILES' , '' );
2016-02-26 00:20:09 +00:00
// make sure there is no old build
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.Folder' ) -> remove ( CFactory :: _ ( 'Utilities.Paths' ) -> component_path );
2017-12-12 00:28:35 +00:00
// load the libraries files/folders and url's
2023-02-12 19:15:41 +00:00
CFactory :: _ ( 'Library.Structure' ) -> build ();
2021-12-21 14:44:50 +00:00
// load the powers files/folders
2023-02-12 19:15:41 +00:00
CFactory :: _ ( 'Power.Structure' ) -> build ();
2019-12-06 05:31:32 +00:00
// load the module files/folders and url's
2023-02-12 19:15:41 +00:00
CFactory :: _ ( 'Joomlamodule.Structure' ) -> build ();
2019-08-04 22:38:53 +00:00
// load the plugin files/folders and url's
2023-02-12 19:15:41 +00:00
CFactory :: _ ( 'Joomlaplugin.Structure' ) -> build ();
2018-03-09 03:26:44 +00:00
// set the dashboard
2023-02-12 19:15:41 +00:00
CFactory :: _ ( 'Component.Dashboard' ) -> set ();
// set the component base structure
if ( ! CFactory :: _ ( 'Component.Structure' ) -> build ())
2016-02-26 00:20:09 +00:00
{
return false ;
}
2023-02-12 19:15:41 +00:00
// set all single instance folders and files
if ( ! CFactory :: _ ( 'Component.Structure.Single' ) -> build ())
2016-02-26 00:20:09 +00:00
{
return false ;
}
2023-02-12 19:15:41 +00:00
2016-02-26 00:20:09 +00:00
// set all the dynamic folders and files
2023-02-12 19:15:41 +00:00
if ( ! CFactory :: _ ( 'Component.Structure.Multiple' ) -> build ())
2016-02-26 00:20:09 +00:00
{
return false ;
}
2020-03-28 13:34:14 +00:00
2016-02-26 00:20:09 +00:00
return true ;
}
2020-03-28 13:34:14 +00:00
2016-02-26 00:20:09 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2021-12-21 14:44:50 +00:00
/**
* Build the Powers files , folders
*
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Power.Structure' ) -> build ();
2021-12-21 14:44:50 +00:00
*/
private function buildPowers ()
{
2023-02-12 19:15:41 +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'
);
2021-12-21 14:44:50 +00:00
}
2019-12-06 05:31:32 +00:00
/**
* Build the Modules files , folders , url ' s and config
*
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlamodule.Structure' ) -> build ();
2019-12-06 05:31:32 +00:00
*/
private function buildModules ()
{
2023-02-12 19:15:41 +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
}
2019-08-04 22:38:53 +00:00
/**
* Build the Plugins files , folders , url ' s and config
2020-03-28 13:34:14 +00:00
*
2019-08-04 22:38:53 +00:00
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Joomlaplugin.Structure' ) -> build ();
2019-08-04 22:38:53 +00:00
*/
2019-08-22 01:54:47 +00:00
private function buildPlugins ()
2019-08-04 22:38:53 +00:00
{
2023-02-12 19:15:41 +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-08-04 22:38:53 +00:00
}
2020-12-05 06:17:54 +00:00
/**
* Create Path if not exist
*
* @ return void
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Folder' ) -> create ( $path );
2020-12-05 06:17:54 +00:00
*/
private function createFolder ( $path )
{
2023-02-12 19:15:41 +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
}
2017-12-10 19:17:26 +00:00
/**
* Build the Libraries files , folders , url ' s and config
2020-03-28 13:34:14 +00:00
*
2017-12-10 19:17:26 +00:00
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Library.Structure' ) -> build ();
2017-12-10 19:17:26 +00:00
*/
2019-08-04 22:38:53 +00:00
private function setLibraries ()
2017-12-10 19:17:26 +00:00
{
2023-02-12 19:15:41 +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-12-10 19:17:26 +00:00
}
2017-12-14 23:10:47 +00:00
2018-03-09 03:26:44 +00:00
/**
* set the dynamic dashboard if set
2020-03-28 13:34:14 +00:00
*
2018-03-09 03:26:44 +00:00
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Dashboard' ) -> set ();
2018-03-09 03:26:44 +00:00
*/
private function setDynamicDashboard ()
{
2023-02-12 19:15:41 +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'
);
2018-03-09 03:26:44 +00:00
}
2017-12-10 19:17:26 +00:00
/**
* Write data to file
2020-03-28 13:34:14 +00:00
*
2017-12-10 19:17:26 +00:00
* @ return bool true on success
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3
2017-12-10 19:17:26 +00:00
*/
public function writeFile ( $path , $data )
{
2022-04-04 15:35:08 +00:00
return FileHelper :: write ( $path , $data );
2017-12-10 19:17:26 +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 Initial Folders
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ return void
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Structure' ) -> build ();
2016-02-26 00:20:09 +00:00
*/
private function setFolders ()
{
2023-02-12 19:15:41 +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
* Set the Static File & Folder
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ return boolean
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Structure.Single' ) -> build ();
2016-02-26 00:20:09 +00:00
*/
private function setStatic ()
{
2023-02-12 19:15:41 +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
* Set the Dynamic File & Folder
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
* @ return boolean
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Component.Structure.Multiple' ) -> build ();
2020-03-28 13:34:14 +00:00
*
2016-02-26 00:20:09 +00:00
*/
private function setDynamique ()
{
2023-02-12 19:15:41 +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
2016-02-26 00:20:09 +00:00
return false ;
}
2017-12-14 23:10:47 +00:00
2019-08-22 01:54:47 +00:00
/**
* move the fields and Rules
*
* @ param array $field The field data
* @ param string $path The path to move to
*
* @ return void
*
*/
public function moveFieldsRules ( $field , $path )
{
2020-05-21 23:38:20 +00:00
// check if we have a subform or repeatable field
2020-06-25 19:22:30 +00:00
if ( $field [ 'type_name' ] === 'subform'
|| $field [ 'type_name' ] === 'repeatable' )
2019-08-22 01:54:47 +00:00
{
2020-05-21 23:38:20 +00:00
// since we could have a custom field or rule inside
$this -> moveMultiFieldsRules ( $field , $path );
}
else
{
// check if this is a custom field that should be moved
if ( isset ( $this -> extentionCustomfields [ $field [ 'type_name' ]]))
2019-08-22 01:54:47 +00:00
{
2020-05-21 23:38:20 +00:00
$check = md5 ( $path . 'type' . $field [ 'type_name' ]);
// lets check if we already moved this
if ( ! isset ( $this -> extentionTrackingFilesMoved [ $check ]))
2020-02-13 12:24:13 +00:00
{
2020-05-21 23:38:20 +00:00
// check files exist
2021-03-07 21:40:55 +00:00
if ( File :: exists (
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.Paths' ) -> component_path . '/admin/models/fields/'
2020-05-21 23:38:20 +00:00
. $field [ 'type_name' ] . '.php'
))
{
// copy the custom field
2021-03-07 21:40:55 +00:00
File :: copy (
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.Paths' ) -> component_path . '/admin/models/fields/'
2020-05-21 23:38:20 +00:00
. $field [ 'type_name' ] . '.php' ,
$path . '/fields/' . $field [ 'type_name' ] . '.php'
);
}
// stop from doing this again.
$this -> extentionTrackingFilesMoved [ $check ] = true ;
2020-02-13 12:24:13 +00:00
}
2019-08-22 01:54:47 +00:00
}
2020-05-21 23:38:20 +00:00
// check if this has validation that should be moved
2022-09-10 08:16:44 +00:00
if ( CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked.' . $field [ 'field' ]) !== null )
2019-08-22 01:54:47 +00:00
{
2020-05-21 23:38:20 +00:00
$check = md5 (
$path . 'rule'
2022-09-10 08:16:44 +00:00
. CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked.' . $field [ 'field' ])
2020-05-21 23:38:20 +00:00
);
// lets check if we already moved this
if ( ! isset ( $this -> extentionTrackingFilesMoved [ $check ]))
2020-02-13 12:24:13 +00:00
{
2020-05-21 23:38:20 +00:00
// check files exist
2021-03-07 21:40:55 +00:00
if ( File :: exists (
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.Paths' ) -> component_path . '/admin/models/rules/'
2022-09-10 08:16:44 +00:00
. CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked.' . $field [ 'field' ])
2020-03-28 13:34:14 +00:00
. '.php'
2020-05-21 23:38:20 +00:00
))
{
// copy the custom field
2021-03-07 21:40:55 +00:00
File :: copy (
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.Paths' ) -> component_path . '/admin/models/rules/'
2022-09-10 08:16:44 +00:00
. CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked.' . $field [ 'field' ])
2020-05-21 23:38:20 +00:00
. '.php' , $path . '/rules/'
2022-09-10 08:16:44 +00:00
. CFactory :: _ ( 'Registry' ) -> get ( 'validation.linked.' . $field [ 'field' ])
2020-05-21 23:38:20 +00:00
. '.php'
);
}
// stop from doing this again.
$this -> extentionTrackingFilesMoved [ $check ] = true ;
2020-02-13 12:24:13 +00:00
}
2020-05-21 23:38:20 +00:00
}
}
}
/**
* move the fields and Rules of multi fields
*
* @ param array $multi_field The field data
2020-06-25 19:22:30 +00:00
* @ param string $path The path to move to
2020-05-21 23:38:20 +00:00
*
* @ return void
*
*/
protected function moveMultiFieldsRules ( $multi_field , $path )
{
// get the fields ids
2020-06-25 19:22:30 +00:00
$ids = array_map (
2020-11-29 00:00:20 +00:00
'trim' ,
explode (
',' ,
2023-01-01 02:11:34 +00:00
( string ) GetHelper :: between (
2020-11-29 00:00:20 +00:00
$multi_field [ 'settings' ] -> xml , 'fields="' , '"'
)
)
2020-06-25 19:22:30 +00:00
);
2022-03-09 23:46:45 +00:00
if ( ArrayHelper :: check ( $ids ))
2020-05-21 23:38:20 +00:00
{
foreach ( $ids as $id )
{
// setup the field
2020-06-25 19:22:30 +00:00
$field = array ();
2020-05-21 23:38:20 +00:00
$field [ 'field' ] = $id ;
2022-09-10 08:16:44 +00:00
CFactory :: _ ( 'Field' ) -> set ( $field );
2020-05-21 23:38:20 +00:00
// move field and rules if needed
$this -> moveFieldsRules ( $field , $path );
2019-08-22 01:54:47 +00:00
}
}
}
2017-02-02 11:54:07 +00:00
/**
* get the created date of the ( view )
2019-08-22 01:54:47 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param array $view The view values
2019-08-22 01:54:47 +00:00
*
2017-02-02 11:54:07 +00:00
* @ return string Last Modified Date
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Model.Createdate' ) -> get ( $view );
2017-02-02 11:54:07 +00:00
*/
public function getCreatedDate ( $view )
2017-12-14 23:10:47 +00:00
{
2023-02-12 19:15:41 +00:00
return CFactory :: _ ( 'Model.Createdate' ) -> get ( $view );
2017-02-02 11:54:07 +00:00
}
2017-12-14 23:10:47 +00:00
2017-02-01 13:17:04 +00:00
/**
* get the last modified date of a MVC ( view )
2019-08-22 01:54:47 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param array $view The view values
2019-08-22 01:54:47 +00:00
*
2017-02-01 13:17:04 +00:00
* @ return string Last Modified Date
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Model.Modifieddate' ) -> get ( $view );
2017-02-01 13:17:04 +00:00
*/
public function getLastModifiedDate ( $view )
{
2023-02-12 19:15:41 +00:00
return CFactory :: _ ( 'Model.Modifieddate' ) -> get ( $view );
2017-02-01 13:17:04 +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
* Set the Static File & Folder
2017-09-18 00:18:23 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param array $target The main target and name
* @ param string $type The type in the target
* @ param string $fileName The custom file name
* @ param array $cofig to add more data to the files info
2017-09-18 00:18:23 +00:00
*
2016-02-26 00:20:09 +00:00
* @ return boolean
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Structure' ) -> build ( $target , $type , $fileName , $config );
2016-02-26 00:20:09 +00:00
*/
2023-02-12 19:15:41 +00:00
public function buildDynamique ( $target , $type , $fileName = null , $config = null )
2021-12-21 14:44:50 +00:00
{
2023-02-12 19:15:41 +00:00
return CFactory :: _ ( 'Utilities.Structure' ) -> build ( $target , $type , $fileName , $config );
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
* set the Joomla Version Data
*
2020-12-03 00:13:49 +00:00
* @ return object The version data
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3
2016-02-26 00:20:09 +00:00
*/
private function setJoomlaVersionData ()
{
2023-02-12 19:15:41 +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
2022-06-02 12:05:34 +00:00
/**
* Add the dynamic folders
*/
protected function setDynamicFolders ()
{
// check if we should add the dynamic folder moving script to the installer script
2023-01-29 20:12:42 +00:00
if ( ! CFactory :: _ ( 'Registry' ) -> get ( 'set_move_folders_install_script' ))
2022-06-02 12:05:34 +00:00
{
// add the setDynamicF0ld3rs() method to the install scipt.php file
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Registry' ) -> set ( 'set_move_folders_install_script' , true );
2022-06-02 12:05:34 +00:00
// set message that this was done (will still add a tutorial link later)
$this -> app -> enqueueMessage (
JText :: _ (
'<hr /><h3>Dynamic folder(s) were detected.</h3>'
), 'Notice'
);
$this -> app -> enqueueMessage (
JText :: sprintf (
'A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder(s) are copied into the correct place when this component is installed!'
), 'Notice'
);
}
}
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* set the index . html file in a folder path
2019-08-22 01:54:47 +00:00
*
2020-03-28 13:34:14 +00:00
* @ param string $path The path to place the index . html file in
2016-02-26 00:20:09 +00:00
*
* @ return void
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.File' ) -> write ( $path , $root );
2019-08-22 01:54:47 +00:00
*
2016-02-26 00:20:09 +00:00
*/
2019-08-04 22:38:53 +00:00
private function indexHTML ( $path , $root = 'component' )
2016-02-26 00:20:09 +00:00
{
2023-01-29 20:12:42 +00:00
CFactory :: _ ( 'Utilities.File' ) -> write ( $path , $root );
2016-02-26 00:20:09 +00:00
}
2017-12-14 23:10:47 +00:00
2018-02-28 02:27:03 +00:00
/**
* Update paths with real value
2020-03-28 13:34:14 +00:00
*
* @ param string $path The full path
2018-02-28 02:27:03 +00:00
*
* @ return string The updated path
2023-02-12 19:15:41 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Dynamicpath' ) -> update ( $path );
2018-02-28 02:27:03 +00:00
*/
protected function updateDynamicPath ( $path )
{
2023-02-12 19:15:41 +00:00
return CFactory :: _ ( 'Utilities.Dynamicpath' ) -> update ( $path );
2018-02-28 02:27:03 +00:00
}
2016-03-04 00:01:43 +00:00
/**
2016-02-26 00:20:09 +00:00
* Remove folders with files
2020-03-28 13:34:14 +00:00
*
2017-09-18 00:18:23 +00:00
* @ param string $dir The path to folder to remove
* @ param boolean $ignore The files and folders to ignore
2016-02-26 00:20:09 +00:00
*
2017-03-20 22:07:14 +00:00
* @ return boolean True if all is removed
2023-01-29 20:12:42 +00:00
* @ deprecated 3.3 Use CFactory :: _ ( 'Utilities.Folder' ) -> remove ( $dir , $ignore );
2016-02-26 00:20:09 +00:00
*/
2017-09-18 00:18:23 +00:00
protected function removeFolder ( $dir , $ignore = false )
2016-02-26 00:20:09 +00:00
{
2023-01-29 20:12:42 +00:00
return CFactory :: _ ( 'Utilities.Folder' ) -> remove ( $dir , $ignore );
2016-02-26 00:20:09 +00:00
}
2018-03-18 04:52:07 +00:00
2016-02-26 00:20:09 +00:00
}