Labyrinth::MLUtils - Markup Language Utilities for Labyrinth.
use Labyrinth::MLUtils;
Returns TRUE or FALSE as to whether the given HTML tag is accepted by the system.
Returns the list of HTML tags that are accepted by the system.
For a given text string, attempts to clean the use of any HTML tags. Any HTML tags found that are not accepted by the system are encoded into HTML entities.
For a given text string, removes all existence of any HTML tag. Mostly used in input text box cleaning.
For a given text string, encodes all HTML tags to HTML entities. Mostly used in input textarea edit preparation.
Attempts to remove known spam style links.
Attempts to remove known profanity words.
Given a XHTML snippet, will look for basic links and add title attributes. Titles are of rhe format 'External Site: $domain', where $domain is the domain used in the link.
Returns a dropdown selection box given a list of numbers. Can optionally pass a option value to be pre-selected. The name of the form element is used as both the element name and id.
Returns a dropdown selection box given a list of strings. Can optionally pass a option value to be pre-selected. The name of the form element is used as both the element name and id.
Returns a dropdown selection box given a list of rows. Can optionally pass a option value to be pre-selected. The name of the form element is used as both the element name and id. The 'index' and 'value' refence the field names within each row hash.
Returns a dropdown selection box given a list of strings. Can optionally pass a option value to be pre-selected. The name of the form element is used as both the element name and id. The 'index' and 'value' refence the field names within each row hash.
Returns a dropdown multi-selection box given a list of strings. The name of the form element is used as both the element name and id. The default number of rows visible is 5, but this can be changed by providing a value for 'count'.
Can optionally pass an option value to be pre-selected. The option can be a comma separated list (as a single string) of values or an arrayref to a list of values.
Returns a dropdown multi-selection box given a list of rows. The name of the form element is used as both the element name and id. The default number of rows visible is 5, but this can be changed by providing a value for 'count'. The 'index' and 'value' refence the field names within each row hash.
Returns the given error string in a HTML span tag, with the configured error class, which by default is called "alert". In your CSS sytle sheet you will need to specify an appropriate class declaration, such as:
.alert { color: red; font-weight: bold; }
Set the value of 'errorclass' in your site config file to change the class name used.
Flags to the system that an error has occured and returns the configured error symbol, which by is the 'empty' symbol '∅', which can then be used as the error field indicator.
Set the value of 'errorsymbol' in your site config file to change the symbol used.
Checks whether any links exist in the given text that could indicate comment spam.
Create inline CSS style sheet block. Key value pairs should match the label (tag, identifier or class patterns) and its contents. For example:
my %css = ( '#label p' => 'font-weight: normal; color: #fff;' );
or
my %css = ( '#label p' => { 'font-weight' => 'normal', 'color' => '#fff' } );
The exception to this is the label 'media', which can be used to specify the medium for which the CSS will be used. Typically these are 'screen' or 'print'.
Given a string, will replace the Microsoft "smart" characters with sensible ACSII versions.
The following functions disassemble and reassemble the HTML code snippets, validating and cleaning the code to fix any errors that may exist between the template and content of the database.
Labyrinth
Barbie, <barbie@missbarbell.co.uk> for Miss Barbell Productions, http://www.missbarbell.co.uk/
Copyright (C) 2002-2015 Barbie for Miss Barbell Productions All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
To install Labyrinth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Labyrinth
CPAN shell
perl -MCPAN -e shell install Labyrinth
For more information on module installation, please visit the detailed CPAN module installation guide.