The Boxes Admin Tool is where you manage boxes. To use this admin tool, you must have the edit_boxes perm (A.12.9) active for your group.
WARNING: any user with permission to edit boxes can run arbitrary code on the server, with Apache's user and group permissions. Be careful when giving this permission to other people.
Boxes are bits of perl code that have full access to all of Scoop's data and subroutines. They range in complexity from the user_box which checks a few permissions to determine which items to display in the user's customized menu, to a set of boxes which handle the payment processing for advertisements and subscriptions and activate those items once they are paid.
Some features exist only in boxes, and likewise, entirely new features can be added using boxes without touching the underlying code. Boxes can also call external programs on the server, as can any perl script; the fortune_box is a simple example of this, and calls the unix `fortune' program to fetch a random quote, then formats it for display. For more information on adding features to Scoop, see section 5.
To edit a box, first select the desired box from the drop-down box labelled ``Box:'' then click the ``Get Box'' button next to it. The fields below will be filled in with the appropriate information.
To create a new box, leave the drop-down box set to ``Select Box'' and fill in the fields below as appropriate.
To save a new box or changes to an existing box, click the ``Save Box'' button at the bottom of the form.
The fields are:
The code in a given box can return either one or two values; the single value, or first of a pair, is placed in the special key `content' in the box template. The second value, if present, is placed in the special key `title' in the box template. If the second value is not present, the contents of the ``Title'' field above is used instead.
You should return the values as an anonymous hash. That is,
return \{ content => \$content, title => '\$title' \}