Made to Order Software Corporation Logo

MO Tag: mo_tag.module File Reference

mo_tag.module File Reference

Definition of the MO Tag filter. More...

Enumerations

enum  MO_TAG_VERSION
 

Define the version of the MO Tag module.

More...

Functions

 mo_tag_perm ()
 Set of permissions for the MO Tag filter.

 mo_tag_help ($section)
 Implementation of the hook_help() for the MO Tag filter.

 mo_tag_filter_tips ($delta, $format, $long=FALSE)
 Implementation of hook_filter_tips() for the MO Tag filter.

 mo_tag_filter ($op, $delta=0, $format=-1, $text= '')
 Implementation of hook_filter().

 mo_tag_form_alter (&$form, $form_state, $form_id)
 Form alteration hook.

 _mo_tag_terms_form_submit ($form, &$form_state)
 The terms selection was submitted.


Detailed Description

The MO Tag filter module transforms tags of the form [mo_tag <name>] into a user defined value. For instance, [mo_tag adsense] can be replaced by the current user adsense tags.

It is also possible, when no [mo_tag <name>] is specified, to have the filter automatically add the value of the tag somewhere in the node (in a specific paragraph, or at the very beginning or end of the node.)

Since sometimes it may be of interest not to have the tag included in just a few specific nodes, it is possible to negate the automatic insertion using [mo_tag no <name>].

The special tag named 'off' (i.e. [mo_tag off]) can be used to completely turn off the MO Tag module in a node.

We have internal names defined that output dynamically defined data such as the current date, year, username, etc.

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

http://www.m2osw.com/mo_tag 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.


Enumeration Type Documentation

This variable defines the version of the MO Tag module. This will always be the same as the version defined in Drupal (throught the .info file.)


Function Documentation

_mo_tag_terms_form_submit ( form,
&$  form_state 
)

This function is called whenever a term is saved. We use it to save our MO Tag information in our database.

Parameters:
[in] $form The form being submitted
[in,out] $form_state The current state of the form
mo_tag_filter ( op,
delta = 0,
format = -1,
text = '' 
)

This is the actual filter definition.

Note:
The returned value is as expected by the calling system function.
Parameters:
[in] $op The filter operation
[in] $delta The filter being applied, ignore if $op = "list"
[in] $format The format referencing our filter, -1 if undefined
[in] $text The text to be filtered
Returns:
The returned value depends on the operation.

References _mo_tag_process(), and _mo_tag_settings_form().

mo_tag_filter_tips ( delta,
format,
long = FALSE 
)

Provide the short and long help for the MO Tag filter.

Parameters:
[in] $delta The filter in use.
[in] $format The format that defines this filter.
[in] $long Whether to return the short or long tip.
Returns:
NULL or a short or long tip.
mo_tag_form_alter ( &$  form,
form_state,
form_id 
)

Implementation of hook_form_alter().

This function adds a few entries to the taxonomy form used to edit a vocabulary settings. This lets users select whether a specific taxonomy is to automatically add terms to a node.

Note:
Would be nice to be able to turn off the filter based on a node type. But this cannot work since when the filters are applied we have no clue about the node, block, view, whatnot using the filter. The only thing we know of is the format #... Now, the good thing is that taxonomies can be marked as used by such and such type only. Thus, we get the same functionality through another mean (We'll need to test to make sure that it really works though.)
Parameters:
[in,out] $form The form to alter
[in] $form_state what state the form is in (i.e. submitted?)
[in] $form_id The identifier of this form

References _mo_tag_terms_form().

mo_tag_help ( section  ) 

This function returns help information about the MO Tag filter.

Parameters:
[in] $section The name of the section we return help for.
Returns:
NULL or a help message
mo_tag_perm (  ) 

This function returns an array of permissions used by the MO Tag filter.

Returns:
Array of permissions.
Documentation generated by Doxygen on Sat Mar 12 16:25:23 2011