Updated 4a. JCB Demo Component Directory, Folders and Files (markdown)
@@ -340,6 +340,7 @@ If you add more permissions such as Create, two more buttons will appear, Save a
|
|||||||
Continuing with the edit functionality:
|
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:
|
* 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&view=looks&Itemid=104" method="post" name="adminForm" id="adminForm">
|
<form action="/comdemo/index.php?option=com_demo&view=looks&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. 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.
|
* 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.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
@@ -374,7 +375,6 @@ A button is called a component in the UIkit and there are many others that encap
|
|||||||
* \media\com_componentbuilder\uikit-v2\css\uikit.css
|
* \media\com_componentbuilder\uikit-v2\css\uikit.css
|
||||||
|
|
||||||
JCB adds this and other classes by adding the uiKit files to \media\com_demo\uikit-v2 in the Joomla! Demo installation package. For details see the link and list of uiKit components and code required to implement them as was done below in the area in JCB labeled Site View's Default View. Much of the code is straightforward PHP. Use the view's $this reference to the current object to get the value of an element on the page. For example, the template for the JCB Demo component exposes the logged in user's id in $this. The value of the id is obtained using $this->user->id and a good explanation of what $this is can be found [here ](http://www.php.net/manual/en/language.oop5.basic.php). Other values are also available and Observe the code reuse of Joomla! API classes, plus standard HTML. ComponentHelper JCB tag below also.
|
JCB adds this and other classes by adding the uiKit files to \media\com_demo\uikit-v2 in the Joomla! Demo installation package. For details see the link and list of uiKit components and code required to implement them as was done below in the area in JCB labeled Site View's Default View. Much of the code is straightforward PHP. Use the view's $this reference to the current object to get the value of an element on the page. For example, the template for the JCB Demo component exposes the logged in user's id in $this. The value of the id is obtained using $this->user->id and a good explanation of what $this is can be found [here ](http://www.php.net/manual/en/language.oop5.basic.php). Other values are also available and Observe the code reuse of Joomla! API classes, plus standard HTML. ComponentHelper JCB tag below also.
|
||||||
|
|
||||||
* Looking Site View
|
* Looking Site View
|
||||||
|
|
||||||
The code to do this is located in JCB in the view prefaced by:
|
The code to do this is located in JCB in the view prefaced by:
|
||||||
|
Reference in New Issue
Block a user