view release on metacpan or search on metacpan
5.18 2013-10-13
- removed Crypt::RandPasswd from prerequisites.
- added ResizeDimensions for displaying images (Media).
5.17 2013-05-03
- fixed � style entities (MLUtils).
- added Filters.pm a DFV plugin for additional parameter validation.
- fixed missing pre-requisite, Session::Token.
5.16 2013-04-28
- post-processing XHTML content before writing out is now optional,
default is no post-processing. Use 'parsehtml' config setting
(Writer).
- new 'parsetest' configuration setting to allow tests to determine
differences between original and post-processed content (Writer).
- added DumpToFile for parsetest functionality (Audit).
- fixed url validation (Variables).
- improvements to post-processing content (MLUtils).
- Enabled phrasebook caching to reduce disk I/O (Phrasebook).
- switched from Crypt::RandPasswd to Session::Token for password
generation for speed and efficiency (Users).
- moved SetLogFile into Globals and allowed more settings.
- added titles to links, with the ability to provide user mappings.
5.08 2011-06-19
- documentation updates.
- added url mapping for MetaCloud links.
- fixes for GetImageSize.
5.07 2011-06-19
- added GetImageSize & GetGravatar to Media.pm.
- added a cleanup of erroneous XHTML patterns in MLUtils.pm.
- store error message if opening mail pipe fails in Mailer.pm.
5.06 2011-05-19
- abstracted input CGI to Labyrinth::Query::CGI.
- abstracted output CGI to Labyrinth::Writer::Render::CGI.
- abstracted template parser to Labyrinth::Writer::Parser::TT.
- all above in order to allow PSGI packages and other template parsers
to be used.
- documentation updates.
- reworked CookieLib to use new Labyrinth::Query::CGI package.
- comments can be ignored or removed in MLUtils.
- '#' is valid in a URL.
- 'noscript' added to the list of valid tags.
- defaults applied to 'who' when saving IPs.
- added UserID lookup in Users.
4.16 2009-03-06
- fixed DTUtils.pm undefined error.
- simplified Metadata searches and combined photo/page searches into
a single table using nested selects
- updated MLUtils.pm with new XHTML compatibility fixes.
- removed unused Exporter references from several modules.
- removed excessive use of 'use vars' where it wasn't needed.
- reduced unncessary function calls
- reduced unncessary database calls
- added protection for bad image calls (IMDriver.pm/GDDriver.pm)
- moved Plugins management to Plugins.pm
- remove whitespace before </p> in MLUtils.pm
- added demoroniser code to MLUtils.pm
4.15 2008-05-31
- added more entries to %safe_tags (MLUtils.pm)
- improved Metadata.pm interfaces
- removed last remaining forum references
4.05 2007-03-08
- lots of fixes!
4.04 2007-02-21
- created Variables.pm to stop cyclic dependency, simplifying Globals.pm
in the process.
- improved Writer.pm so valid XHTML is correctly parsed out.
- as a result of the above extended MLUtils.pm and fixed several
hidden content bugs in the templates.
- Croak moved to Writer.pm as it's a better fit in the chain.
- removed unnecessary references to Globals.pm, Session.pm & Specific.pm
from plugins that don't use them.
- SafeHTML => CleanTags in several plugins.
- undef body bugfix to images in paragraphs (Articles.pm)
- initialise event types (Events.pm)
4.03 2007-02-04
lib/Labyrinth/Groups.pm view on Meta::CPAN
Checks whether the specified user (or current user) is in the specified group
Returns 1 if true, otherwise 0 for false.
=item UserGroups()
For the current user login, return the list of groups they are associated with.
=item GroupSelect([$opt])
Provides the XHTML code for a single select dropdown box. Pass the id of a
group to pre-select that group.
=item GroupSelectMulti([$opt[,$rows]])
Provides the XHTML code for a multiple select dropdown box. Pass the group id
or an arrayref to a list of group ids to pre-select those groups. By default
the number of rows displayed is 5, although this can be changed by passing the
number of rows you require.
=cut
sub GetGroupID {
my $name = shift || return;
my @rows = $dbi->GetQuery('array','GetGroupID',$name);
return unless(@rows);
lib/Labyrinth/MLUtils.pm view on Meta::CPAN
=item CleanLink
Attempts to remove known spam style links.
=item CleanWords
Attempts to remove known profanity words.
=item LinkTitles
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.
=back
=cut
sub LegalTag {
my $tag = lc shift;
lib/Labyrinth/MLUtils.pm view on Meta::CPAN
use vars qw(%html_entities $html_safe_chars %escape_html_map $escape_html_map);
use vars qw(%safe_tags %safe_style %tag_is_empty %closetag_is_optional
%closetag_is_dependent %force_closetag %transpose_tag
$convert_nl %auto_deinterleave $auto_deinterleave_pattern);
# check the validity of a URL.
sub process_html {
my ($text, $line_breaks, $allow_html) = @_;
# cleanup erroneous XHTML patterns
if($text) {
$text =~ s!</pre><pre>!<br />!gsi;
$text =~ s!<ul>\s*<br />!<ul>!gsi;
$text =~ s!<br />\s*</ul>!</ul>!gsi;
$text =~ s!<ul>\s*</ul>!!gsi;
$text =~ s!<ol>\s*</ol>!!gsi;
}
# clean text of any nasties
#$text =~ s/[\x201A\x2018\x2019`]/'/g; # nasty single quotes
lib/Labyrinth/MLUtils.pm view on Meta::CPAN
return $_;
}
sub cleanup_tag {
my ($tag, $attrs) = @_;
unless (exists $safe_tags->{$tag}) {
return '';
}
# for XHTML conformity
$tag = $transpose_tag{$tag} if($transpose_tag{$tag});
my $html = '';
if($force_closetag{$tag}) {
while (scalar @stack and $force_closetag{$tag}{$stack[0]{NAME}}) {
$html = cleanup_close($stack[0]{NAME});
}
}
my $t = $safe_tags->{$tag};
lib/Labyrinth/MLUtils.pm view on Meta::CPAN
unshift @stack, { NAME => $tag, FULL => $full };
$str = "$html$full";
}
#LogDebug("cleanup_tag: str=$str");
return $str;
}
sub cleanup_close {
my $tag = shift;
# for XHTML conformity
$tag = $transpose_tag{$tag} if($transpose_tag{$tag});
# Ignore a close without an open
unless (grep {$_->{NAME} eq $tag} @stack) {
return '';
}
# Close open tags up to the matching open
my @close = ();
while (scalar @stack and $stack[0]{NAME} ne $tag) {
lib/Labyrinth/Media.pm view on Meta::CPAN
=item StockPath
Return the path for the given stock id.
=item StockType
Return the stock id for the given stock code.
=item StockSelect
Returns an XHTML snippet for a dropdown selection box of stock entries.
=item PathMove
=back
=cut
sub StockName {
my $stock = shift || 1;
_init_stock() unless(%stock);
lib/Labyrinth/Metadata.pm view on Meta::CPAN
=item MetaSave
Records the metadata with the given sqlkey for the name record id.
=item MetaGet
Gets the metadata for the given id.
=item MetaCloud
Returns the XHTML snippet to display a Metadata Tag Cloud.
=item MetaTags
Returns the list of tags attributed to a entry type and section ids.
=back
=cut
sub MetaSearch {
lib/Labyrinth/Support.pm view on Meta::CPAN
=head1 FUNCTIONS
=over 4
=item PublishState
Returns the name of the current publish state, given the numeric state.
=item PublishSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available publishing states.
=item PublishAction
Provides a dropdown selection box, as a XHTML code snippet, of the currently
accessible publishing states.
=cut
my %publishstates = (
1 => {Action => 'Draft', State => 'Draft' },
2 => {Action => 'Submit', State => 'Submitted' },
3 => {Action => 'Publish', State => 'Published' },
4 => {Action => 'Archive', State => 'Archived' },
);
lib/Labyrinth/Support.pm view on Meta::CPAN
=item AlignName
Returns the name of the given alignment type, defaults to 'none'.
=item AlignClass
Returns the class of the given alignment type, defaults to 'nail'.
=item AlignSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available alignment states.
=cut
sub AlignName {
my $opt = shift || 1;
return $alignments{$opt}->{name};
}
sub AlignClass {
lib/Labyrinth/Support.pm view on Meta::CPAN
Default permission level is ADMIN. Returns 1 if permission is granted, 0
otherwise.
=item AccessGroup
Returns whether the current user has access to the given group. Returns 1 if
yes, 0 otherwise.
=item AccessSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available access states.
=item AccessAllFolders
Return list of folders current user has access to.
=item AccessAllAreas
Return list of areas current user has access to.
lib/Labyrinth/Support.pm view on Meta::CPAN
my @areas = map {"'$_->[0]'"} @rows;
return join(',',@areas);
}
=item RealmCheck
Checks whether the given realm is known within the system.
=item RealmSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available realms.
=item RealmName
Returns the name of a realm, given a realm id.
=item RealmID
Returns the id of a realm, given a realm name.
lib/Labyrinth/Support.pm view on Meta::CPAN
=item FolderID
Returns the folder id, given the folder name.
=item FolderName
Returns the name of a folder, given a folder id.
=item FolderSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available folders.
=cut
sub ProfileSelect {
my $opt = shift || 0;
my $name = shift || 'profile';
LoadProfiles();
my @rows = map { { profile => $_ } } sort grep {$_ ne $settings{profiles}{default} } keys %{$settings{profiles}{profiles}};
unshift @rows, { profile => $settings{profiles}{default} } if($settings{profiles}{default});
lib/Labyrinth/Support.pm view on Meta::CPAN
sub FolderSelect {
my $opt = shift || 0;
my $name = shift || 'folderid';
my @rows = $dbi->GetQuery('hash','AllFolders');
DropDownRows($opt,$name,'folderid','foldername',@rows);
}
=item AreaSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
available areas.
=cut
sub AreaSelect {
my $opt = shift;
my @rows = $dbi->GetQuery('hash','AllAreas');
DropDownRows($opt,'area','areaid','title',@rows);
}
lib/Labyrinth/Users.pm view on Meta::CPAN
return 3;
}
=head1 ADMIN INTERFACE METHODS
=over 4
=item UserSelect
Provides a dropdown selection box, as a XHTML code snippet, of the currently
listed users.
By default only users listed as searchable are listed.
=back
=cut
sub UserSelect {
my $opt = shift;