Jump to content

Hide page buttons


Manol
 Share

Recommended Posts

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:

post-1191-0-87085000-1388676292_thumb.pn

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.

Link to comment
Share on other sites

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;
}
  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...