1
Mamba
Tip: Including URL when creating XoopsGroupPermForm in Permissions
  • 2012/12/20 21:30

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Just a tip for Module developers, to make our modules more "user-friendly"

Some of the older modules don't use URL as one of the passed variables when they create XoopsGroupPermForm, resulting in redirecting to the main index.php file after changing permissions.

When you want to change several permissions, it is annoying, because you have to go back to the Permissions Tab again and again after each change

The constructor of XoopsGroupPermForm has place for URL

Quote:
function XoopsGroupPermForm($title, $modid, $permname, $permdesc, $url = '', $anonymous = true)


so it's always good to include the "permissions" URL, because the constructor uses the URL to assign redirection:

if ($url != "") {
    
$this->addElement(new XoopsFormHidden('redirect_url'$url));
}


For example, I've added it in XoopsTube:

Quote:
$permform = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/permissions.php');


and now when I change any permissions, it will stay there, in the Permissions Tab.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Login

Who's Online

168 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 168


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits