Bric::App::Util - A class to house general application functions.
use Bric::App::Util;
Utility functions.
NONE
Add a new warning message to the current list of messages.
Throws:
NONE
Side Effects: Adds the message to the session.
Notes:
NONE
Return warning message number '$num' or if $num is not given return all error messages.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the next warning message in the list. If there are no more messages, it will return undef.
Throws:
NONE
Side Effects:
Notes:
NONE
Returns the current number of warning messages.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Clears out all the error messages remaining. This should be called after all messages have been processed.
Throws:
NONE
Side Effects:
Notes:
NONE
Returns an array reference. If $arg is an anonymous array, it is simply returned. If it's a defined scalar, it's returned as the single value in an anonymous array. If it's undef, an empty anonymous array will be returned.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a preference value.
Throws:
Side Effects: NONE.
Notes: Uses Bric::Util::Pref->lookup_val() internally.
Returns the package name given a short name.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Get/Set/Delete a redirect to happen during the next page load that includes the 'header.mc' header element.
Throws:
NONE
Side Effects:
Notes:
This only works with pages that use the 'header.mc' element.
If there is a redirected set, then redirect the browser, otherwise return.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Redirect to a different location.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
redirect('/');
redirect('/', $cbh);
Uses a JavaScript function call to redirect the browser to a different location. Will not clear out the buffer first, so stuff sent ahead will still draw in the browser. If a Params::Callback object is passed in as the second argument, the Apache request object will be used to send the JavaScript to the Browser and the callback handler object will be used to abort the request. Otherwise, the Mason request object will be used to send the JavaScript to the browser and to abort the request.
Throws: NONE.
Side Effects: Because redirect_onload() executes immediately, if it is called from a callback, note that no further callbacks will be executed, not even post-callback request callbacks.
Notes: NONE.
Sometimes there's a long process executing, and you want to send status messages to the browser so that the user knows what's happening. These functions will do this for you. Call status_msg() each time you want to send a status messages, and it'll take care of the rest for you. The severe_status_msg() will do the same, but convert the message into a red, bold-fased message before sending it to the browser. When you're done sending status messages, you can either redirect to another page, or simply finish drawing the current page. It will draw in below the status messages. This function will work both in callbacks and in Mason UI code.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Log the current URL for historical purposes.
Throws:
NONE
Side Effects:
Populates the history key of the session data.
Notes:
NONE
Grab the $n-th page visited. Argument $n defaults to 1, or the very last page (A $n value of 0 is the current page). Only MAX_HISTORY pages are saved.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Pops the last page visited off of the page history and returns it.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns $section (e.g. admin), $mode (e.g. manager, profile) and $type (e.g. user, media, etc). This is centralized here in case it becomes a complicated thing to do. And, centralizing is nice.
Throws:
NONE
Side Effects:
NONE
Notes:
Was comp/lib/util/parseUri.mc.
Returns a workflow of a particular type in a given site for which the user has a given permission to the documents and/or templates in that workflow. Returns undef if no workflow is found.
Returns the desk in the given workflow for which the user has the permission to access its documents and/or templates. Returns undef if no desk is found.
Returns a list or array reference of sites to which the user has the specified permission.
Returns a hash reference or reference to an array of arrays as returned by the code in $code. If the code just returns a list, it will be converted to a reference of array references, unless it has an odd number of items, in which case an error message will be displayed.
NONE
NONE
NONE
NONE
NONE
Garth Webb