From 672138e1138575c2f378a6b54effe832c75e8a71 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Fri, 23 Aug 2019 15:40:25 +0200 Subject: [PATCH] Updated 044 Hello World Component with Joomla Component Builder Creator Extended (markdown) --- ...omla-Component-Builder-Creator-Extended.md | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/044-Hello-World-Component-with-Joomla-Component-Builder-Creator-Extended.md b/044-Hello-World-Component-with-Joomla-Component-Builder-Creator-Extended.md index 8189916..a09c2f8 100644 --- a/044-Hello-World-Component-with-Joomla-Component-Builder-Creator-Extended.md +++ b/044-Hello-World-Component-with-Joomla-Component-Builder-Creator-Extended.md @@ -516,7 +516,30 @@ We are going to get those values by going to the Dynamic Get and make sure that [01:38:57](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h38m57s) -We'll need to add it inside of this(Default View) for each loop since this code is working with the item itself. We've got the code in there, we are calling the user, we also checking the item check_out to the user id. [01:39:21](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h39m21s) Making sure it's 0. We checking whether to check_out user. Let's go get the rest of the code we need. So again in the admin view we going to go with this area here and just copy that(see video). We want to make a few adaptations because in the end of the day the front end is a little different from the back end. [01:39:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h39m54s) The back end only displays an edit view. The front-end displays a read view. We want to make it a little different. You can pause the video to see some of the things I've done here. But in simple terms I basically got the edit here. I'm editing echoing the edit link. I'm adding the item and I'm putting in a little icon which then you can click. I'm checking whether you have permission to edit [01:40:34](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h40m34s) this item. If we were to save this and refresh the homepage, it should not change anything because the public doesn't have permission to edit it at this stage. That icon should be pencil not edit. Let's save this and compile it to see it in action. Install it and we reload the home page and as you can see it doesn't show those little buttons. If we go to the back end [01:41:17](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h41m17s) and we go to options, we change that the public is allowed to edit. Let's just do that they allowed to edit. Let's open the front again. We know see that it shows the edit [01:41:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h41m48s) pencil. Let's click on that and we see it opens the edit area where it can now add the exclamation and click on save. Save and close. It tells us that the message was saved successfully. If we now [01:42:12](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m12s) open that greeting, we see that has the exclamation. Our attempt to integrate or to make our items editable on the front end within the control of permission groups, has worked very effectively. If we again revoke the permissions and [01:42:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m35s) refresh the page, and then suddenly those links are gone. Even if somebody were to try and circumvent the system by having in the URL paste in the link to edit that specific item and it will say that it's not permitted. [01:42:57](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m57s) The permissions structure is armed and will protect the item from being edited by that group. Again we gave the Public Permission to edit but now the question is can we also give it permission to create? +Add it in the 'Default View' for each loop since this code is working with the item itself. With the code in there, the user is called, and check the item 'check_out'. [01:39:21](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h39m21s) Make sure the user 'id' is 0. Check whether to 'check_out' user. To get the rest of the code go to the Admin View to this(follow on video) area and just copy that. A few adaptations is necessary because the front end is a little different from the back end. [01:39:54](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h39m54s) The back end only displays an edit view. The front-end displays a read view. We want to make it a little different. You can pause the video to see some of the things that I have done here. I am editing 'echoing' the edit link.,,,,<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + + + + + + + + + + + + + + + + + + I'm adding the item and I'm putting in a little icon which then you can click. I'm checking whether you have permission to edit [01:40:34](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h40m34s) this item. If we were to save this and refresh the homepage, it should not change anything because the public doesn't have permission to edit it at this stage. That icon should be pencil not edit. Let's save this and compile it to see it in action. Install it and we reload the home page and as you can see it doesn't show those little buttons. If we go to the back end [01:41:17](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h41m17s) and we go to options, we change that the public is allowed to edit. Let's just do that they allowed to edit. Let's open the front again. We know see that it shows the edit [01:41:48](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h41m48s) pencil. Let's click on that and we see it opens the edit area where it can now add the exclamation and click on save. Save and close. It tells us that the message was saved successfully. If we now [01:42:12](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m12s) open that greeting, we see that has the exclamation. Our attempt to integrate or to make our items editable on the front end within the control of permission groups, has worked very effectively. If we again revoke the permissions and [01:42:35](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m35s) refresh the page, and then suddenly those links are gone. Even if somebody were to try and circumvent the system by having in the URL paste in the link to edit that specific item and it will say that it's not permitted. [01:42:57](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=01h42m57s) The permissions structure is armed and will protect the item from being edited by that group. Again we gave the Public Permission to edit but now the question is can we also give it permission to create? ### Add Option To Create