Permission 1.0 Approval Form
The approval form allows designated admins to approve batches of members who have requested access to a permission point. You can wrap this form inside a separate permission check tag to control access to the approval process.
Parameters
There are several parameters available for the approval_form tag.
approved =
approved = "yes|no"
Use the 'approved' parameter to filter a list of members by those who have been approved or not for a given permission point.
form_id =
form_id = "this_form_id"
The 'form_id' parameter allows you to declare the id of the form in order to control it with Javascript.
form_name =
form_name = "this_form"
The 'form_name' parameter allows you to declare the name of the form in order to control it with Javascript.
limit =
limit = "10"
Use the 'limit' parameter to limit the number of members that show up for approval in the form. See the 'members' variable pair below.
name =
name = "permission_point_name"
Use the 'name' parameter to indicate which permission point members will be approved for.
onsubmit =
onsubmit = "some_javascript()"
The 'onsubmit' parameter allows you to execute Javascript functions at form submission.
return =
return = "template_group/template"
The 'return' parameter allows you to control the landing page where users are taken once they submit your form.
template =
template = "template_group/template"
The 'template' parameter helps you take advantage of a new method being used in Solspace modules. When you indicate a template, the module will use that template as the formatting model for error messages issued during the request action. This gives you greater control of your user interface and makes it easier to build AJAX interfaces. Use the conditional if_success to show a success message and if_failure to show a failure message. You can also call the native module message using the 'message' variable.
Variables
Inside the 'members' variable pair you can invoke any standard member variable as well as any custom member field. As well, you can call the 'permission_label' and 'permission_name' variables to indicate the permission point label and name respectively.
Additionally you can call the 'checked' and 'selected' variables to preselect form fields based on whether a given member has been approved for a given permission point.
If you use this function inside of another Permission module function you might find a conflict with the {approved} variable. You can resolve this conflict by using the {member_approved} variable. This variable allows you to show the member approval status for each member as you loop through a list of members created by this function.
Variable Pairs
members
{members}your code{/members}
This variable pair is what you use to indicate the formatting of the member list you will create in your form for the sake of approving batches of members.
Conditionals
You can run conditionals on any standard or custom member field inside the 'members' variable pair.
You can also run conditionals on the approval state of a given member. Use approved == 'y' or approved == 'n'.
Form Fields
approve
<input type="checkbox" name="approve[]" value="{member_id}" />
You will be submitting an array of approved members when you submit the approval form. Create a checkbox for each requesting member with the help of the 'members' variable pair.
delete
<input type="checkbox" name="delete" value="yes" />
When you check the delete box, those requests that you do not approve will be deleted from the system. If you don't want a member to request permission more than once, leave them in the system and the permission module will prevent them from requesting multiple times.
Examples
{exp:permission:approval_form name=“permission_point_name” form_name=“form_name” form_id=“form_id” return=“template_group/template”}
The following knuckleheads want to be approved to {label}.
{members}
<input type=“checkbox” name=“approve[]“ value=“{member_id}“ /> {screen_name}<br />
{/members}
<input type=“checkbox” name=“delete” value=“yes” /> Delete<br />
<input type=“submit” />
{/exp:permission:approval_form}