jmartsch

Members
  • Content count

    163
  • Joined

  • Last visited

Community Reputation

81 Excellent

About jmartsch

  • Rank
    Distinguished Member

Contact Methods

  • Website URL
    http://www.jensmartsch.de
  • Skype
    jens.martsch

Profile Information

  • Gender
    Male
  • Location
    Münster, Germany

Recent Profile Visitors

3,067 profile views
  1. Although Robin S´s module might "hide" the menu entry it is still accessible if you know the URL. To restrict non-superusers and redirect them to another page after logging in, you need to do it different. I wrote a module for that case which you can find at https://github.com/jmartsch/ProcessRestrictTreeMenu. It is not configurable yet, but you can change the code in the .module file.
  2. @Nico Knoll Push
  3. @kixe Your solution works perfectly fine. Thank you a thousand times Kudos! Thanks to @adrian as well.
  4. Is there a way to add custom markup to the tab via fields? Then I could do it the way you described.
  5. I want to do this programmatically. Because I want to add custom markup like some buttons. I don´t want to add inputs to the tab.
  6. I want to add a tab to an edit page in the admin via API. I found a code from @kixe here https://processwire.com/talk/topic/15015-tabs-in-module-config-page/?do=findComment&comment=134624 that basically does this, but I can´t get it to work correctly (see screenshot). As you can see the Tab has a weird name and the submit button appears before the fieldset. Also the tab should appear as second, directly after "Inhalt (content)". Maybe I did something wrong when adding the tab to the form? Here is the code that I used: public function ready() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); } public function addButtons($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $tab = new InputfieldWrapper(); $tab->attr('title', 'Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Settings'; $markup->value = '<p>Just a placeholder for some inputfields.</p>'; $tab->add($markup); $inputfields->add($tab); $form->add($inputfields); } }
  7. It would be nice to hide it from superusers as well, because superuser != programmer/developer
  8. The problem seems to be that the button submits the form. If I transform it into a link, the modal works fine, but the links does not look like a button.
  9. @adrian It would be nice if you add an option to hide the "Action Code" fieldset. Maybe make it only visible to superusers. But I think an option to hide it for all users would be better. EDIT: Because it really is not important and irritating to normal users when this is being shown.
  10. I want to load a module or page in the ProcessWire Admin in a modal. Right now, I added a button on the Edit page and gave that button a class of "pw-modal". When I click this button, the modal opens with the provided URL, but then suddenly the browser redirects me to this URL. This is not how it should work. In the screencast you can see what´s happening. Here is the code that I use to add the button to the form: public function ready() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); } /** * Add a button besides "Save", which lets the user accept the application * */ public function addButtons($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $accept = $this->modules->get('InputfieldButton'); $accept->attr('id+name', 'hook_accept_application'); $accept->attr('href', 'http://localhost/winkelmann/www/bewerbertool-talents/admin/page/edit/?id=1479'); $accept->class .= ' ui-priority-secondary head_button_clone pw-modal'; $accept->attr('value', $this->_('Bewerbungsunterlagen anfordern')); $form->append($accept, $form->get("id")); } } 2017-03-21_10-20-51.mp4
  11. @adrian Your addition with the permission "admin-actions-hide-menu" hides the menuitem for the specific role/user, but it also disables the access to the module for this user group. I logged out and in again. If I remove the permission for the role, I can access the module.
  12. @adrianThank you for your help. Your addition works for me But this does not solve the overall question to hide pages from the menu for specific user groups. So if anyone has suggestions... well ... write them.
  13. @adrian Thanks for all your efforts to this point. I love this community. I try to help where I can as well.
  14. You understood it correctly. But how can I move the Lister Pro page? It is not a real page, but a saved Lister. The other problem with this approach is, that if I hide the pages in the Admin > Setup, they are not visible for superusers. But superusers should still see them.
  15. @adrian Hi Adrian, here are two thoughts how to improve this great module. Remove the "<p>The '.$actionName.' action was completed successfully.</p>" in line 250 or only print it, if no custom successMessage was set. Because one may only want to display his own messages. Use ProcessWires $this->message or $this->error function instead of an own messaging function, so it has the "native" ProcessWire behaviour that people are used to