From 008fdcf123bd94d9b627cc73e041643274a7dcf2 Mon Sep 17 00:00:00 2001 From: Joseph Geller Date: Mon, 1 Oct 2018 11:47:09 -0500 Subject: [PATCH] Updated 4a. JCB Demo Component Directory, Folders and Files (markdown) --- ...-Component-Directory,-Folders-and-Files.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md index e12ac6e..fabbb4d 100644 --- a/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md +++ b/4a.-JCB-Demo-Component-Directory,-Folders-and-Files.md @@ -278,11 +278,20 @@ Always keep in mind, JCB is doing most of the tasks related to items below refer Some of the links below and seen previously in this document may be outdated and many Joomla! classes in use have early origins and are stated as such in the documentation. Locations of class files vary by release, and finding them and reviewing the code within each is made a bit more elusive with Joomla! 4 namespace changes but the standardization is worth it. There is current backwards compatibility and hence, lists of aliases do exist as seen next. -There is a class map of aliases for classes that do not conform to Joomla 4! namespace naming convention. The file at \libraries\classmap.php should be consulted when writing your own components. The path on the right has the current locations along with the new standard naming convention aliased to it on the left. There are a few more areas where this occurs that is included below the list. Be aware that if for example, if the class method is indicated as JLoader::registerAlias('JControllerLegacy', '\\Joomla\\CMS\\MVC\\Controller\\BaseController', '5.0'), the physical path in Joomal! version 3.8.12 is \libraries\src\Application\BaseController.php. The Joomla! class in the file in this example is named BaseController which extends JObject. +There is a class map of aliases for classes that do not conform to Joomla 4! namespace naming convention. When writing your own components, this file should be looked at: +* \libraries\classmap.php + +The path on the right has the current locations along with the new standard naming convention aliased to it on the left. There are a few more areas where this occurs that is included below the list. Take a look at this example that calls a class method: +* JLoader::registerAlias('JControllerLegacy', '\\Joomla\\CMS\\MVC\\Controller\\BaseController', '5.0') + +The physical path in Joomal! version 3.8.12 is: +* \libraries\src\Application\BaseController.php + +The Joomla! class in the file in this example is named BaseController which extends JObject. *** Note, the following applies in general for any component: **index.html** -File containing one line of HTML that blocks directory view. Must be in root of each folder. +File containing one line of HTML that causes the background of the page to be white which blocks the directory view. Must be in root of each folder. **All Joomla class files must begin with this code:** // No direct access to this file @@ -322,7 +331,14 @@ Be sure to add a filter using the admin area of the site, main menu option by se Components - Component Builder - Dynamic Gets - Looks - Tweak * Where Table Key a.created_by equal = $this->user->id -This Tweak to the Dynamic Get in JCB for the Demo component site view looks - Dynamic Get - getListQuery, extends it to only include records from the table that were created by the user having the same id as the current user. This is available from the site view looks - $this variable - user id form element. The change takes effect once you use JCB to compile the component and install it again using the Joomla! extension installer. The same Tweak is required in Site view looking - Dynamic Get - getItem. +This Tweak is applied to to the Dynamic Get in JCB for the Demo component: +* Site view looks - Dynamic Get - getListQuery + +It extends it to only include records from the table that were created by the user having the same id as the current user. This is available from: +* Site view looks - $this variable - user id form element + +The change takes effect once you use JCB to compile the component and install it again using the Joomla! extension installer. The same Tweak is required in: +* Site view looking - Dynamic Get - getItem. Doing the above also ensures only certain actions are allowed for certain users. In our case, a Registered User should only be allowed to: * Save