From 19026043282ca134b990e09caf6281ede4c685e7 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 2 Mar 2018 04:08:40 +0200 Subject: [PATCH] added some updated notes to the paths area --- README.md | 4 +- admin/README.txt | 4 +- .../en-GB/en-GB.com_componentbuilder.ini | 82 ++++++- .../advance_fullwidth.php | 3 +- .../advance_fullwidth.php | 3 +- admin/models/component_files_folders.php | 94 ++++---- .../models/forms/component_files_folders.xml | 189 ++++++++------- .../forms/library_files_folders_urls.xml | 225 +++++++++--------- admin/models/library_files_folders_urls.php | 84 +++---- 9 files changed, 389 insertions(+), 299 deletions(-) diff --git a/README.md b/README.md index 292f53f63..025918f48 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,8 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.6.17 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **183421** -+ *Field count*: **1641** ++ *Line count*: **183511** ++ *Field count*: **1645** + *File count*: **1169** + *Folder count*: **189** diff --git a/admin/README.txt b/admin/README.txt index 292f53f63..025918f48 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -130,8 +130,8 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.6.17 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **183421** -+ *Field count*: **1641** ++ *Line count*: **183511** ++ *Field count*: **1645** + *File count*: **1169** + *Folder count*: **189** diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index af0813049..03d0f1a0e 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -2001,13 +2001,50 @@ COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_MODIFIED_DATE_DESC="The date this C COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_MODIFIED_DATE_LABEL="Modified Date" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW="A New Component Files & Folders" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FILES_DESCRIPTION="You can add custom files to the component, simply add the files to the administrator/components/com_componentbuilder/custom folder and then select them here." -COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FILES_FULLPATH_DESCRIPTION="You can add any files to the component, by using the full system path. Example: /home/user/folder/file.php (make sure that php has permission to read the file)" +COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FILES_FULLPATH_DESCRIPTION="You can add any files to the component, by using the full system path. Example: /home/user/folder/file.php (make sure that php has permission to read the file)
Please note that you can also use constant paths in your full path (directly without quotes), this is highly recommended to insure portability.
To see a list of constant paths please read the notes below. Example: JPATH_ROOT/file.php or JPATH_ROOT/components/com_yourcomponentname/helpers/file.php" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FILES_FULLPATH_LABEL="Adding Files" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FILES_LABEL="Adding Custom Files" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FOLDERS_DESCRIPTION="You can add custom folders to the component, simply add the folders to the administrator/components/com_componentbuilder/custom folder and then select them here." -COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FOLDERS_FULLPATH_DESCRIPTION="You can any folders to the component, by using the full system path. Example: /home/user/folder (make sure that php has permission to read the folder)" +COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FOLDERS_FULLPATH_DESCRIPTION="You can any folders to the component, by using the full system path. Example: /home/user/folder (make sure that php has permission to read the folder)
Please note that you can also use constant paths in your full path (directly without quotes), this is highly recommended to insure portability.
To see a list of constant paths please read the notes below. Example: JPATH_ROOT/folder or JPATH_ROOT/components/com_yourcomponentname/helpers/folder" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FOLDERS_FULLPATH_LABEL="Adding Folders" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_ADD_FOLDERS_LABEL="Adding Custom Folders" +COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_CONSTANT_PATHS_DESCRIPTION="

// The path to the administrator folder.
+JPATH_ADMINISTRATOR
+// The path to the installed Joomla! site, or JPATH_ROOT/administrator if executed from the backend.
+JPATH_BASE
+// The path to the cache folder.
+JPATH_CACHE
+// The path to the administration folder of the current component being executed.
+JPATH_COMPONENT_ADMINISTRATOR
+// The path to the site folder of the current component being executed.
+JPATH_COMPONENT_SITE
+// The path to the current component being executed.
+JPATH_COMPONENT
+// The path to folder containing the configuration.php file.
+JPATH_CONFIGURATION
+// The path to the installation folder.
+JPATH_INSTALLATION
+// The path to the libraries folder.
+JPATH_LIBRARIES
+// The path to the plugins folder.
+JPATH_PLUGINS
+// The path to the installed Joomla! site.
+JPATH_ROOT
+// The path to the installed Joomla! site.
+JPATH_SITE
+// The path to the templates folder.
+JPATH_THEMES

+ +

JPATH_SITE is meant to represent the root path of the JSite application,
+just as JPATH_ADMINISTRATOR is mean to represent the root path of the JAdministrator application.
+JPATH_BASE is the root path for the current requested application.... so if you are in the administrator application:
+JPATH_BASE == JPATH_ADMINISTRATOR
+If you are in the site application:
+JPATH_BASE == JPATH_SITE
+If you are in the installation application:
+JPATH_BASE == JPATH_INSTALLATION.
+JPATH_ROOT is the root path for the Joomla install and does not depend upon any application.

" +COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTE_CONSTANT_PATHS_LABEL="Constant Paths" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTNEW_DESCRIPTION="Should file be updated." COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NOTNEW_LABEL="Update" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ORDERING_LABEL="Ordering" @@ -5004,15 +5041,52 @@ COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_MODIFIED_DATE_DESC="The date thi COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_MODIFIED_DATE_LABEL="Modified Date" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NEW="A New Library Files, Folders & URLs" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FILES_DESCRIPTION="You can add custom files to the component, simply add the files to the administrator/components/com_componentbuilder/custom folder and then select them here." -COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FILES_FULLPATH_DESCRIPTION="You can add any files to the component, by using the full system path. Example: /home/user/folder/file.php (make sure that php has permission to read the file)" +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FILES_FULLPATH_DESCRIPTION="You can add any files to the component, by using the full system path. Example: /home/user/folder/file.php (make sure that php has permission to read the file)
Please note that you can also use constant paths in your full path (directly without quotes), this is highly recommended to insure portability.
To see a list of constant paths please read the notes below. Example: JPATH_ROOT/file.php or JPATH_ROOT/components/com_yourcomponentname/helpers/file.php" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FILES_FULLPATH_LABEL="Adding Files" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FILES_LABEL="Adding Custom Files" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FOLDERS_DESCRIPTION="You can add custom folders to the component, simply add the folders to the administrator/components/com_componentbuilder/custom folder and then select them here." -COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FOLDERS_FULLPATH_DESCRIPTION="You can any folders to the component, by using the full system path. Example: /home/user/folder (make sure that php has permission to read the folder)" +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FOLDERS_FULLPATH_DESCRIPTION="You can any folders to the component, by using the full system path. Example: /home/user/folder (make sure that php has permission to read the folder)
Please note that you can also use constant paths in your full path (directly without quotes), this is highly recommended to insure portability.
To see a list of constant paths please read the notes below. Example: JPATH_ROOT/folder or JPATH_ROOT/components/com_yourcomponentname/helpers/folder" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FOLDERS_FULLPATH_LABEL="Adding Folders" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_FOLDERS_LABEL="Adding Custom Folders" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_URLS_DESCRIPTION="You can add urls here, and it can be used in three ways. As a direct link (default) or to get the file content and add it to the component (get) or as both local and link (dynamic)" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_ADD_URLS_LABEL="Adding Urls" +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_CONSTANT_PATHS_DESCRIPTION="

// The path to the administrator folder.
+JPATH_ADMINISTRATOR
+// The path to the installed Joomla! site, or JPATH_ROOT/administrator if executed from the backend.
+JPATH_BASE
+// The path to the cache folder.
+JPATH_CACHE
+// The path to the administration folder of the current component being executed.
+JPATH_COMPONENT_ADMINISTRATOR
+// The path to the site folder of the current component being executed.
+JPATH_COMPONENT_SITE
+// The path to the current component being executed.
+JPATH_COMPONENT
+// The path to folder containing the configuration.php file.
+JPATH_CONFIGURATION
+// The path to the installation folder.
+JPATH_INSTALLATION
+// The path to the libraries folder.
+JPATH_LIBRARIES
+// The path to the plugins folder.
+JPATH_PLUGINS
+// The path to the installed Joomla! site.
+JPATH_ROOT
+// The path to the installed Joomla! site.
+JPATH_SITE
+// The path to the templates folder.
+JPATH_THEMES

+ +

JPATH_SITE is meant to represent the root path of the JSite application,
+just as JPATH_ADMINISTRATOR is mean to represent the root path of the JAdministrator application.
+JPATH_BASE is the root path for the current requested application.... so if you are in the administrator application:
+JPATH_BASE == JPATH_ADMINISTRATOR
+If you are in the site application:
+JPATH_BASE == JPATH_SITE
+If you are in the installation application:
+JPATH_BASE == JPATH_INSTALLATION.
+JPATH_ROOT is the root path for the Joomla install and does not depend upon any application.

" +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTE_CONSTANT_PATHS_LABEL="Constant Paths" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTNEW_DESCRIPTION="Should file be updated." COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NOTNEW_LABEL="Update" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ORDERING_LABEL="Ordering" diff --git a/admin/layouts/component_files_folders/advance_fullwidth.php b/admin/layouts/component_files_folders/advance_fullwidth.php index 36f1ccd1e..2fda89c69 100644 --- a/admin/layouts/component_files_folders/advance_fullwidth.php +++ b/admin/layouts/component_files_folders/advance_fullwidth.php @@ -33,7 +33,8 @@ $fields = $displayData->get('fields') ?: array( 'note_add_files_fullpath', 'addfilesfullpath', 'note_add_folders_fullpath', - 'addfoldersfullpath' + 'addfoldersfullpath', + 'note_constant_paths' ); ?> diff --git a/admin/layouts/library_files_folders_urls/advance_fullwidth.php b/admin/layouts/library_files_folders_urls/advance_fullwidth.php index 36f1ccd1e..2fda89c69 100644 --- a/admin/layouts/library_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/library_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,8 @@ $fields = $displayData->get('fields') ?: array( 'note_add_files_fullpath', 'addfilesfullpath', 'note_add_folders_fullpath', - 'addfoldersfullpath' + 'addfoldersfullpath', + 'note_constant_paths' ); ?> diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index fc73d1254..93cd931ee 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -95,20 +95,12 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $item->metadata = $registry->toArray(); } - if (!empty($item->addfiles)) + if (!empty($item->addfoldersfullpath)) { - // Convert the addfiles field to an array. - $addfiles = new Registry; - $addfiles->loadString($item->addfiles); - $item->addfiles = $addfiles->toArray(); - } - - if (!empty($item->addfolders)) - { - // Convert the addfolders field to an array. - $addfolders = new Registry; - $addfolders->loadString($item->addfolders); - $item->addfolders = $addfolders->toArray(); + // Convert the addfoldersfullpath field to an array. + $addfoldersfullpath = new Registry; + $addfoldersfullpath->loadString($item->addfoldersfullpath); + $item->addfoldersfullpath = $addfoldersfullpath->toArray(); } if (!empty($item->addfilesfullpath)) @@ -119,12 +111,20 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $item->addfilesfullpath = $addfilesfullpath->toArray(); } - if (!empty($item->addfoldersfullpath)) + if (!empty($item->addfolders)) { - // Convert the addfoldersfullpath field to an array. - $addfoldersfullpath = new Registry; - $addfoldersfullpath->loadString($item->addfoldersfullpath); - $item->addfoldersfullpath = $addfoldersfullpath->toArray(); + // Convert the addfolders field to an array. + $addfolders = new Registry; + $addfolders->loadString($item->addfolders); + $item->addfolders = $addfolders->toArray(); + } + + if (!empty($item->addfiles)) + { + // Convert the addfiles field to an array. + $addfiles = new Registry; + $addfiles->loadString($item->addfiles); + $item->addfiles = $addfiles->toArray(); } // update the fields @@ -838,30 +838,17 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $data['metadata'] = (string) $metadata; } - // Set the addfiles items to data. - if (isset($data['addfiles']) && is_array($data['addfiles'])) + // Set the addfoldersfullpath items to data. + if (isset($data['addfoldersfullpath']) && is_array($data['addfoldersfullpath'])) { - $addfiles = new JRegistry; - $addfiles->loadArray($data['addfiles']); - $data['addfiles'] = (string) $addfiles; + $addfoldersfullpath = new JRegistry; + $addfoldersfullpath->loadArray($data['addfoldersfullpath']); + $data['addfoldersfullpath'] = (string) $addfoldersfullpath; } - elseif (!isset($data['addfiles'])) + elseif (!isset($data['addfoldersfullpath'])) { - // Set the empty addfiles to data - $data['addfiles'] = ''; - } - - // Set the addfolders items to data. - if (isset($data['addfolders']) && is_array($data['addfolders'])) - { - $addfolders = new JRegistry; - $addfolders->loadArray($data['addfolders']); - $data['addfolders'] = (string) $addfolders; - } - elseif (!isset($data['addfolders'])) - { - // Set the empty addfolders to data - $data['addfolders'] = ''; + // Set the empty addfoldersfullpath to data + $data['addfoldersfullpath'] = ''; } // Set the addfilesfullpath items to data. @@ -877,17 +864,30 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $data['addfilesfullpath'] = ''; } - // Set the addfoldersfullpath items to data. - if (isset($data['addfoldersfullpath']) && is_array($data['addfoldersfullpath'])) + // Set the addfolders items to data. + if (isset($data['addfolders']) && is_array($data['addfolders'])) { - $addfoldersfullpath = new JRegistry; - $addfoldersfullpath->loadArray($data['addfoldersfullpath']); - $data['addfoldersfullpath'] = (string) $addfoldersfullpath; + $addfolders = new JRegistry; + $addfolders->loadArray($data['addfolders']); + $data['addfolders'] = (string) $addfolders; } - elseif (!isset($data['addfoldersfullpath'])) + elseif (!isset($data['addfolders'])) { - // Set the empty addfoldersfullpath to data - $data['addfoldersfullpath'] = ''; + // Set the empty addfolders to data + $data['addfolders'] = ''; + } + + // Set the addfiles items to data. + if (isset($data['addfiles']) && is_array($data['addfiles'])) + { + $addfiles = new JRegistry; + $addfiles->loadArray($data['addfiles']); + $data['addfiles'] = (string) $addfiles; + } + elseif (!isset($data['addfiles'])) + { + // Set the empty addfiles to data + $data['addfiles'] = ''; } // Set the Params Items to data diff --git a/admin/models/forms/component_files_folders.xml b/admin/models/forms/component_files_folders.xml index 6cc00f6a7..704690f7e 100644 --- a/admin/models/forms/component_files_folders.xml +++ b/admin/models/forms/component_files_folders.xml @@ -89,20 +89,53 @@ required="true" readonly="true" button="false" /> - - - - + + +