Made to Order Software Corporation Logo

MO Button: mo_button.pages.inc File Reference

Implementation of the MO Button pages. More...

Functions

 mo_button_replace ($matches)
 Replace the button tags with the button.

 mo_button_process ($text, $format)
 Process the mo_button tags.


Detailed Description

The MO Button pages is the filter. It parses tags in the form:

[mo_button:<name> <params...>]

where parameters are writte as: name="\<value>"

The name or identifier of the button is the name as defined while creating and editing the button.

Copyright (c) 2009-2011 Made to Order Software Corp.

http://www.m2osw.com/mo_button contact@m2osw.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Function Documentation

mo_button_process ( text,
format 
)

This function replaces the mo_button tags with the corresponding button. Note that if the button is marked as inactive, the tag is replaced by a standard link.

Parameters:
[in] $text The text to be filtered
[in] $format The format used to filter the text, this number is used to access the format specific settings.
Returns:
The processed input text

Referenced by mo_button_filter().

mo_button_replace ( matches  ) 

This function is called for each match of a button tag found in the input text. It replaces the tag with either a button (active) or a standard link (inactive).

The button tag can have the following parameters:

  • title--The title of the link (i.e. the title="..." parameter in the link), if no label, use as the label as well
  • label--The label of the link (what the users see on the screen), if no title, use the label as the title too
  • url--The URL to the destination page the button is used for
  • target--The link target parameter, name of a frame or a special target such as _blank
  • query--The URL can include a query string, use this variable to specify the query string (you CANNOT add the query string in the url variable)
  • align--The button alignment, it can be left, right or center
Parameters:
[in] $matches The matches from the [mo_button:...] tag
Returns:
The HTML of the button or standard link.

References mo_button_get_path(), and mo_button_load().

Documentation generated by Doxygen on Sat Mar 12 16:05:23 2011