Manol Posted January 2, 2014 Posted January 2, 2014 Hello. Following Soma's instructions I have removed some tabs for a page, now I would like to hide some buttons in the following image: for the tabs it was $this->addHookAfter("ProcessPageEdit::buildForm", $this, "removeTabs"); ... $fieldset = $form->find("id=ProcessPageEditSettings")->first(); $form->remove($fieldset); what would be the hook and how do I get the buttons I wish? Thank you.
Martijn Geerts Posted January 2, 2014 Posted January 2, 2014 Actually I think it's better to disallow those features for a certain role. Then those buttons will also be gone. Here I assume that the role is named member. public function init() { // only for member if(!$this->user->hasRole('member')) return; // several hooks $this->addHookAfter('Page::sortable', $this, 'hookPageSortable'); $this->addHookAfter('Page::deleteable', $this, 'hookPageDeleteable'); $this->addHookAfter('Page::moveable', $this, 'hookPageMoveable'); $this->addHookAfter('Page::editable', $this, 'hookPageEditable'); $this->addHookAfter('Page::addable', $this, 'hookPageAddable'); } Here a methode, to give you some start: public function hookPageSortable( HookEvent $event) { $event->return = false; return; } 3
Manol Posted January 2, 2014 Author Posted January 2, 2014 Thank you Martijn, more info here, it might be usefull for somebody. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now