Labyrinth

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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).

Changes  view on Meta::CPAN

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
        - 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.

Changes  view on Meta::CPAN

240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
        - 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

Changes  view on Meta::CPAN

372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
        - 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

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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

91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
=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

622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
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`]/&#39;/g;   # nasty single quotes

lib/Labyrinth/MLUtils.pm  view on Meta::CPAN

1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
    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

1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
        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

191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
=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

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
=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

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
=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

166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
=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

368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
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

444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
    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

499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
=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

535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
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

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
    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;



( run in 1.759 second using v1.01-cache-2.11-cpan-95122f20152 )