Updated 4a. JCB Demo Component Directory, Folders and Files (markdown)

Joseph Geller
2018-09-28 18:09:10 -05:00
parent 2a0dfa26ca
commit 55e525dcb4

@@ -322,10 +322,9 @@ 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 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.
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
* Save and Close
* Close
@@ -341,9 +340,9 @@ If you add more permissions such as Create, two more buttons will appear, Save a
Continuing with the edit functionality:
* Edit the look record in the demo_look table. It is important you understand this is reusing the admin view look, edit look. If you use Chrome Developer tools to view the page source and go to the form tag you will see it is using the admin form in the looks view:
<form action="/comdemo/index.php?option=com_demo&amp;view=looks&amp;Itemid=104" method="post" name="adminForm" id="adminForm">
* The registered user id of the logged in user must match the created_by value for it to display and allow the user to edit the record.
* The registered user id of the logged in user must match the created_by value for it to display and allow the user to edit the record. Use the Published tab in any Joomla! to change this for a Joomla! User for example to ensure they are the creator of a specific look record in the demo_look table.
allows all user types except public and guest user groups to view all looks, whether they created them or not. To restrict the looks view to only list records owned by the specific user, besides the changes to the Joomla! ACL, one must filter the look records in the demo_looks table by the created_by column. Note, these will take effect without compiling the JCB Demo and other components built using it. The reason is the Joomla! ACL or the global options permissions of the JCB Demo component are being changed for Joomla!'s Registered User Group and not individual permissions within the JCB component. The latter allows for granularity but normally should remain at the default value.
The above still allows all user types except public and guest user groups to view all looks, whether they created them or not. To restrict the looks view to only list records owned by a specific user, besides the changes to the Joomla! ACL, one must filter the look records in the demo_looks table by the created_by column. Note, these will take effect without compiling the JCB Demo and other components built using it. The reason is the Joomla! ACL or the global options permissions of the JCB Demo component are being changed for Joomla!'s Registered User Group and not individual permissions within the JCB component. The latter allows for granularity but normally you should use default values whenever possible. As granularity increases so does required maintenance.
* First, login as the registered user and select the looks option from the main menu.
* The site view looks displays with the Name and Description of the registered user's look and an edit toolbar underneath.
@@ -354,16 +353,14 @@ Then, click the edit toolbar and display the admin view look, displaying only th
* Save and Close
* Close
Note, the More button was enabled in the JCB demo to allow entry of additional fields on the form.
The role of libraries should be mentioned at this point since they format the elements seen in all views, templates, and layouts. The code in the JCB Demos's looking view allows one to:
* Look - using the looking site view at a
* Look - using the look site view using
* Looks - which is the site view that lists looks
The role of libraries should be mentioned at this point.
The admin view look allows editing in the admin and site areas. All views use the demo_look table records which stores all look records.
The code in the JCB Demos's looking view allows one to:
* Look (looking site view) at a
* Look (look site view and admin edit view of demo_look table record using
* Looks - Looks site view that lists look records in the demo_look table
It's vital to understand the UIkit library and gain some familiarity with Foo Table and Bootstrap since JCB implements them. UIKit components are used quite a bit in the JCB freely distributed components. To construct a view in JCB, you must familiarize yourself with it. It has a small but powerful footprint. It is suggested to have the following link close by in your browser tabs as you code your site views using its button component as the example.
It's vital to understand the UIkit library and gain some familiarity with [FooTable](https://fooplugins.github.io/FooTable/docs/getting-started.html) and [Bootstrap](https://getbootstrap.com/docs/4.1/getting-started/introduction/) since JCB implements them. UIKit components are used quite a bit in the JCB freely distributed components. To construct a view in JCB, you must familiarize yourself with it. It has a small but powerful footprint. It is suggested to have the following link close by in your browser tabs as you code your site views using its button component as the example.
https://getuikit.com/docs/button