1
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.