programatically hide button in Toolbar
Permalink
I have in my concrete5 toolbar additional buttons which take me to file manager, sitemap and a manual. But I don't want our editors in the file manager, only administrators. In the controller of the button I simply try make it visible only for admins and superadmin.
I have:
But does not work. Do I have to do it the other way around? Like hiding the button for the editors?
Thanks.
I have:
<?php namespace Concrete\Package\ExtendedToolbar\MenuItem\FilemanagerBtn; class Controller extends \Concrete\Core\Application\UserInterface\Menu\Item\Controller { $u = new user(); $g = Group::getByName('Administrators'); if ($u->inGroup($g)||$u->isSuperUser()) { public function displayItem() { return true; } }
But does not work. Do I have to do it the other way around? Like hiding the button for the editors?
Thanks.
Thank you.
Now I get this error:
"Class 'Concrete\Package\ExtendedToolbar\MenuItem\FilemanagerBtn\user' not found"
I guess I messed up something. The ortic toolbar works probably only as is.
Now I get this error:
"Class 'Concrete\Package\ExtendedToolbar\MenuItem\FilemanagerBtn\user' not found"
I guess I messed up something. The ortic toolbar works probably only as is.
no, the problem is I copied your code as you wrote it and it should be new User() with a capital U not new user()
Same error, - this time with a capital U in user.
Perhaps something with "else" statement?
Perhaps something with "else" statement?
Oh yes sorry, I forgot to tell you to use the resource.
So add one line just after the namespace and before the class name like this
So add one line just after the namespace and before the class name like this
namespace Concrete\Package\ExtendedToolbar\MenuItem\FilemanagerBtn; use Concrete\Core\User\User; class Controller extends \Concrete\Core\Application\UserInterface\Menu\Item\Controller
Nour, thanks for all the the hints.
After adding User to the ressource I got an error again of not finding class of "Group", so I checked the syntax in the API.
Now, I added "Group" to ressource an finally it works.
After adding User to the ressource I got an error again of not finding class of "Group", so I checked the syntax in the API.
Now, I added "Group" to ressource an finally it works.
<?php namespace Concrete\Package\ExtendedToolbar\MenuItem\FilemanagerBtn; use Concrete\Core\User\User; use Concrete\Core\User\Group\Group; class Controller extends \Concrete\Core\Application\UserInterface\Menu\Item\Controller { public function displayItem() { $u = new User(); $g = Group::getByName('Administrators'); if ($u->inGroup($g) || $u->isSuperUser()) { return true; } } }
hi cat,
if this is part of the blinkbox package please share. we don't have the toolbar extension included.
thanks.
if this is part of the blinkbox package please share. we don't have the toolbar extension included.
thanks.
hi,
Its supported in v. 1.0.1 and will work only above concrete5 v.8.2.x
If your installation needs to be updated, please contact us.
The original toolbar package was written by Remo, you can download and adjust it to your needs.
https://github.com/ortic/ortic-button...
Its supported in v. 1.0.1 and will work only above concrete5 v.8.2.x
If your installation needs to be updated, please contact us.
The original toolbar package was written by Remo, you can download and adjust it to your needs.
https://github.com/ortic/ortic-button...
hello blinkers
Toolbar works, but the themename in the upper left corner has dissapeared. What did I do wrong?
stef
Toolbar works, but the themename in the upper left corner has dissapeared. What did I do wrong?
stef
You have to add it in your white_label array as: 'logo' => 'text', and 'name' => 'text'
/application/config/concrete.php
/application/config/concrete.php
Thanks, but unfortunately it's not working. Can you provide the PHP file please.
stef
stef
Your concrete5 v8.2 and theme v.1.0 was originally installed on a bitnami stack, running on linux.
You mentioned that you run it on a website, working with ipad. I guess safari doesn't read 'logo' => 'themename', you have to specify an image, best would be a SVG.
try this:
You mentioned that you run it on a website, working with ipad. I guess safari doesn't read 'logo' => 'themename', you have to specify an image, best would be a SVG.
try this:
stef,
if there are more questions about whitelabelling you should open a separate thread.
since v.8.5 is out, an update to your installation will be done in the coming weeks.
if there are more questions about whitelabelling you should open a separate thread.
since v.8.5 is out, an update to your installation will be done in the coming weeks.