jmartsch

Members
  • Content count

    159
  • Joined

  • Last visited

Community Reputation

79 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

2,986 profile views
  1. @Nico Knoll Push
  2. @kixe Your solution works perfectly fine. Thank you a thousand times Kudos! Thanks to @adrian as well.
  3. Is there a way to add custom markup to the tab via fields? Then I could do it the way you described.
  4. 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.
  5. 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); } }
  6. It would be nice to hide it from superusers as well, because superuser != programmer/developer
  7. 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.
  8. @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.
  9. 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
  10. @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.
  11. @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.
  12. @adrian Thanks for all your efforts to this point. I love this community. I try to help where I can as well.
  13. 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.
  14. @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
  15. @adrian Thank you, I was completely unaware of this option. But it does not solve my first problem with hiding the "pages" menuitem, but showing the Lister Pro menuitem.