From SME Server
PythonIcon.png Skill level: Developer
Risk of inconsistencies with Koozali SME Server methodology, upgrades & functionality is high. One must be knowledgeable about how changes impact their Koozali SME Server. Significant risk of irreversible harm.


      CGI::FormMagick::Utils - utility routines for FormMagick

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc CGI::FormMagick::Utils


        use CGI::FormMagick;



The debug method prints out a nicely formatted debug message. It can be called from your script as "$f-"debug_msg($msg)>


get a page given the name attribute. Returns the numeric index of the page, suitable for $wherenext.


Given a page index, return a hashref containing the page’s data. This is just a convenience function.


pops the last page off the stack of pages a user’s visited... used when the user clicks "Previous" removes the last element from the stack (modifying it in place in $self->{page_stack}) and returns the element it removed. eg:

          # if the CGI "pagestack" parameter is "1,2,3,5"...
          my $page = $self->pop_page_stack();
          $self->{page_stack} will be 1,2,3
          $page will be 5


push a new page onto the page stack that keeps track of where a user has been.


parses a Text::Template file and returns the result. Will return undef if the filename is invalid.


Figures out whether or not we’re on the last page. Used by print_buttons() in particular to tell whether to print a Finish button, and to tell whether to do the form post-event.


Figures out whether or not we’re on the first page. Used mostly to figure out whether we want to do the form pre-event.


Like is_first_page, but also checks for the absence of a "page" parameter in the CGI, which would indicate that this is the very first page we’ve looked at.


Figures out whether the user’s finished. This could be because they clicked "Finish" or it could be because they were on the last page and hit enter.

This bears the same relationship to is_last_page as just_starting does to is_first_page.


A weirdness in the HTML spec and/or browser implementations thereof means that hitting "enter" on a single-text-field form will submit the form without any value being passed. Worse yet, at least one browser is reported to automatically choose the first submit button on the form, in our case "Previous", which is just WRONG but I can’t see any way to work around that. So this routine tells you if the user just hit enter. Returns 1 if they did, or 0 otherwise.


Gets the form we’re dealing with. With no args, returns an hashref to the form data structure.


Gets the current page we’re dealing with, as a hashref.


Returns the appropriate encoding type for this page. A page that uses FILE fields must also use the multipart/form-data encoding type. Any other page may use either, but the default is to use the older and more compatible application/x-www-urlencoded.


Clear out the nagivation params Next, Previous, Finish and wherenext. Otherwise they stick around in CGI::Persistent and cause havoc next time you try to navigate.