Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

maximage settings, alignment changes & EDITOR access for Site Pages

  • Loading branch information...
commit 8e59a67a6837da69f6887b8d7c54acb9b474b723 1 parent 12089aa
@barbie authored
View
6 Changes
@@ -1,5 +1,11 @@
Changes for the Labyrinth Core Plugins
+5.10 24/01/2012
+ - config settings maximagewidth & maximageheight used to set default
+ size (Articles).
+ - Alignment changes as per fixes in Labyrinth-5.12.
+ - base access reset to EDITOR (Articles/Site).
+
5.09 31/12/2011
- added link titles
- fixed image href saving.
View
32 META.json
@@ -1,6 +1,6 @@
{
"name": "Labyrinth::Plugin::Core",
- "version": "5.09",
+ "version": "5.10",
"abstract": "Labyrinth Website Management Framework Core Plugins",
"author": [
"Barbie (BARBIE) <barbie@cpan.org>"
@@ -34,7 +34,7 @@
},
"runtime" : {
"requires" : {
- "Labyrinth": "5.09",
+ "Labyrinth": "5.12",
"Clone": "0",
"Config::IniFiles": "0",
@@ -51,59 +51,59 @@
"provides": {
"Labyrinth::Plugin::Articles": {
"file": "lib/Labyrinth/Plugin/Articles.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Articles::Sections": {
"file": "lib/Labyrinth/Plugin/Articles/Sections.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Articles::Site": {
"file": "lib/Labyrinth/plugin/Articles/Site.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Content": {
"file": "lib/Labyrinth/Plugin/Content.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Core": {
"file": "lib/Labyrinth/Plugin/Core.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Folders": {
"file": "lib/Labyrinth/Plugin/Folders.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Groups": {
"file": "lib/Labyrinth/Plugin/Groups.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Hits": {
"file": "lib/Labyrinth/Plugin/Hits.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Images": {
"file": "lib/Labyrinth/Plugin/Images.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Inbox": {
"file": "lib/Labyrinth/Plugin/Inbox.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Menus": {
"file": "lib/Labyrinth/Plugin/Menus.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::News": {
"file": "lib/Labyrinth/Plugin/News.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Users": {
"file": "lib/Labyrinth/Plugin/Users.pm",
- "version": "5.09"
+ "version": "5.10"
},
"Labyrinth::Plugin::Users::Info": {
"file": "lib/Labyrinth/Plugin/Users/Info.pm",
- "version": "5.09"
+ "version": "5.10"
}
},
"no_index": {
View
32 META.yml
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Labyrinth::Plugin::Core
-version: 5.09
+version: 5.10
abstract: Labyrinth Website Management Framework Core Plugins
author:
- Barbie <barbie@cpan.org>
@@ -10,7 +10,7 @@ distribution_type: module
installdirs: site
requires:
- Labyrinth: 5.09
+ Labyrinth: 5.12
Clone: 0
Time::Local: 0
Image::Size: 0
@@ -31,46 +31,46 @@ build_requires:
provides:
Labyrinth::Plugin::Articles:
file: lib/Labyrinth/Plugin/Articles.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Articles::Sections:
file: lib/Labyrinth/Plugin/Articles/Sections.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Articles::Site:
file: lib/Labyrinth/Plugin/Articles/Site.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Content:
file: lib/Labyrinth/Plugin/Content.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Core:
file: lib/Labyrinth/Plugin/Core.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Folders:
file: lib/Labyrinth/Plugin/Folders.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Groups:
file: lib/Labyrinth/Plugin/Groups.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Hits:
file: lib/Labyrinth/Plugin/Hits.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Images:
file: lib/Labyrinth/Plugin/Images.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Inbox:
file: lib/Labyrinth/Plugin/Inbox.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Menus:
file: lib/Labyrinth/Plugin/Menus.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::News:
file: lib/Labyrinth/Plugin/News.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Users:
file: lib/Labyrinth/Plugin/Users.pm
- version: 5.09
+ version: 5.10
Labyrinth::Plugin::Users::Info:
file: lib/Labyrinth/Plugin/Users/Info.pm
- version: 5.09
+ version: 5.10
no_index:
directory:
View
2  Makefile.PL
@@ -4,7 +4,7 @@ WriteMakefile(
NAME => 'Labyrinth::Plugin::Core',
VERSION_FROM => 'lib/Labyrinth/Plugin/Core.pm',
PREREQ_PM => {
- 'Labyrinth' => '5.09',
+ 'Labyrinth' => '5.12',
'Clone' => 0,
'Time::Local' => 0,
View
54 lib/Labyrinth/Plugin/Articles.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Articles;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -293,6 +293,9 @@ sub Item {
my $name = $cgiparams{'name'} || undef;
my $naid = $cgiparams{articleid} || undef;
+ my $maximagewidth = $settings{maximagewidth} || MaxArticleWidth;
+ my $maximageheight = $settings{maximageheight} || MaxArticleHeight;
+
unless($name || $naid) {
$tvars{errcode} = 'ERROR';
return;
@@ -319,12 +322,12 @@ sub Item {
foreach my $body (@body) {
if($body->{type} == IMAGE) {
my @rows = $dbi->GetQuery('hash','GetImageByID',$body->{imageid});
- $body->{link} = $rows[0]->{link};
- $body->{align} = Alignment($body->{align});
+ $body->{link} = $rows[0]->{link};
+ $body->{alignclass} = AlignClass($body->{align});
($body->{tag},$body->{width},$body->{height}) = split(qr/\|/,$body->{body})
if($body->{body});
- ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},MaxArticleWidth,MaxArticleHeight);
+ ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},$maximagewidth,$maximageheight);
#LogDebug(sprintf "%d/%s [%d x %d]", ($body->{imageid}||0),($body->{link}||'-'),($body->{width}||0),($body->{height}||0));
} elsif($body->{type} == PARA) {
@@ -502,6 +505,9 @@ sub Edit {
return unless AuthorCheck($GETSQL,$INDEXKEY,$LEVEL);
$tvars{primary} = $tvars{data}->{quickname} || 'draft' . $tvars{data}->{articleid};
+ my $maximagewidth = $settings{maximagewidth} || MaxArticleWidth;
+ my $maximageheight = $settings{maximageheight} || MaxArticleHeight;
+
# article content
my @blocks;
my $orderno = 1;
@@ -514,11 +520,11 @@ sub Edit {
my @rows = $dbi->GetQuery('hash','GetImageByID',$body->{imageid});
$rows[0]->{body} ||= '';
($body->{tag},$body->{width},$body->{height}) = split(qr/\|/,$body->{body});
- $body->{link} = $rows[0]->{link};
- $body->{ddalign} = AlignSelect($body->{align},$orderno);
- $body->{align} = Alignment($body->{align});
+ $body->{link} = $rows[0]->{link};
+ $body->{ddalign} = AlignSelect($body->{align},$orderno);
+ $body->{alignclass} = AlignClass($body->{align});
- ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},MaxArticleWidth,MaxArticleHeight);
+ ($body->{width},$body->{height}) = GetImageSize($body->{link},$rows[0]->{dimensions},$body->{width},$body->{height},$maximagewidth,$maximageheight);
LogDebug("$body->{imageid}/$body->{link} [$body->{width} x $body->{height}]");
}
@@ -531,6 +537,9 @@ sub Edit {
body => \@body,
};
EditAmendments();
+
+ $tvars{dimensions}->{width} = $settings{maximagewidth} || MaxArticleWidth;
+ $tvars{dimensions}->{height} = $settings{maximageheight} || MaxArticleHeight;
}
sub AddParagraph {
@@ -593,6 +602,9 @@ sub LoadContent {
my (@body,@ordernos);
my @blocks = $cgiparams{'list'} ? split(",", $cgiparams{'list'}) : ();
+ my $maximagewidth = $settings{maximagewidth} || MaxArticleWidth;
+ my $maximageheight = $settings{maximageheight} || MaxArticleHeight;
+
for my $block (@blocks) {
my ($type,$paraid) = split(",", $cgiparams{"BLOCK$block"});
push @ordernos, $block;
@@ -607,8 +619,8 @@ sub LoadContent {
$body[$block]->{href} = $cgiparams{"IMAGEHREF$block"};
$body[$block]->{align} = $cgiparams{"ALIGN$block"};
my $tag = $cgiparams{"IMAGETAG$block"};
- my $width = $cgiparams{"width$block"} || MaxArticleWidth;
- my $height = $cgiparams{"height$block"} || MaxArticleHeight;
+ my $width = $cgiparams{"width$block"} || $maximagewidth;
+ my $height = $cgiparams{"height$block"} || $maximageheight;
# uploaded own image
if(defined $cgiparams{"IMAGEUPLOAD$block"} && $cgiparams{"IMAGEUPLOAD$block"}) {
@@ -632,8 +644,8 @@ sub LoadContent {
}
$tag ||= '';
- $width = $cgiparams{"width$block"} ? ($cgiparams{"width$block"} > MaxArticleWidth ? MaxArticleWidth : $cgiparams{"width$block"}) : '';
- $height = $cgiparams{"height$block"} ? ($cgiparams{"height$block"} > MaxArticleHeight ? MaxArticleHeight : $cgiparams{"height$block"}) : '';
+ $width = $cgiparams{"width$block"} ? ($cgiparams{"width$block"} > $maximagewidth ? $maximagewidth : $cgiparams{"width$block"}) : '';
+ $height = $cgiparams{"height$block"} ? ($cgiparams{"height$block"} > $maximageheight ? $maximageheight : $cgiparams{"height$block"}) : '';
$body[$block]->{body} = "$tag|$width|$height";
$body[$block]->{tag} = $tag;
$body[$block]->{width} = $width;
@@ -810,14 +822,18 @@ sub Save {
}
}
- # save image if one supplied
+ # save master image, if one supplied
$data->{imageid} ||= 0;
if(defined $cgiparams{"IMAGEUPLOAD0"}) {
- ($data->{imageid}) = SaveImageFile(
- param => "IMAGEUPLOAD0",
- stock => 'Special',
- width => MaxArticleWidth,
- height => MaxArticleHeight);
+ my $maximagewidth = $settings{maximagewidth} || MaxArticleWidth;
+ my $maximageheight = $settings{maximageheight} || MaxArticleHeight;
+ ($data->{imageid}) =
+ SaveImageFile(
+ param => "IMAGEUPLOAD0",
+ stock => 'Special',
+ width => $maximagewidth,
+ height => $maximageheight
+ );
}
# save article metadata
@@ -939,7 +955,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Articles/Sections.pm
@@ -4,7 +4,7 @@ use warnings;
use strict;
use vars qw($VERSION $ALLSQL $SECTIONID);
-$VERSION = '5.09';
+$VERSION = '5.10';
=head1 NAME
@@ -168,7 +168,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
16 lib/Labyrinth/Plugin/Articles/Site.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Articles::Site;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -169,16 +169,16 @@ Delete a site page.
=cut
-sub Access { Authorised(MASTER) }
+sub Access { Authorised(EDITOR) }
sub Admin {
- return unless AccessUser(MASTER);
+ return unless AccessUser(EDITOR);
$cgiparams{sectionid} = $SECTIONID;
shift->SUPER::Admin();
}
sub Add {
- return unless AccessUser(MASTER);
+ return unless AccessUser(EDITOR);
$cgiparams{sectionid} = $SECTIONID;
my $self = shift;
$self->SUPER::Add();
@@ -186,7 +186,7 @@ sub Add {
}
sub Edit {
- return unless AccessUser(MASTER);
+ return unless AccessUser(EDITOR);
$cgiparams{sectionid} = $SECTIONID;
my $self = shift;
$self->SUPER::Edit();
@@ -194,14 +194,14 @@ sub Edit {
}
sub Save {
- return unless AccessUser(MASTER);
+ return unless AccessUser(EDITOR);
$cgiparams{sectionid} = $SECTIONID;
$cgiparams{quickname} ||= formatDate(0);
shift->SUPER::Save();
}
sub Delete {
- return unless AccessUser(MASTER);
+ return unless AccessUser(EDITOR);
$cgiparams{sectionid} = $SECTIONID;
shift->SUPER::Delete();
}
@@ -221,7 +221,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Content.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Content;
use strict;
use warnings;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -113,7 +113,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Core.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Core;
use warnings;
use strict;
-our $VERSION = '5.09';
+our $VERSION = '5.10';
1;
@@ -67,7 +67,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Folders.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Folders;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -171,7 +171,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Groups.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Groups;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -318,7 +318,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Hits.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Hits;
use strict;
use warnings;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -282,7 +282,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Images.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Images;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -342,7 +342,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Inbox.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Inbox;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -96,7 +96,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Menus.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Menus;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -464,7 +464,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
12 lib/Labyrinth/Plugin/News.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::News;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -113,7 +113,7 @@ sub Front {
for my $row (@rows) {
$row->{name} = UserName($row->{userid});
$row->{postdate} = formatDate(3,$row->{createdate});
- $row->{alignment} = Alignment($row->{align});
+ $row->{alignment} = AlignClass($row->{align});
}
$tvars{frontnews} = \@rows if(@rows);
}
@@ -129,7 +129,7 @@ sub Main {
if($main) {
$row->{name} = UserName($row->{userid});
$row->{postdate} = formatDate(3,$row->{createdate});
- $row->{alignment} = Alignment($row->{align});
+ $row->{alignment} = AlignClass($row->{align});
push @mainnews, $row;
$main--;
next;
@@ -163,7 +163,7 @@ sub Item {
if(@rows) {
$rows[0]->{name} = UserName($rows[0]->{userid});
$rows[0]->{postdate} = formatDate(3,$rows[0]->{createdate});
- $rows[0]->{alignment} = Alignment($rows[0]->{align});
+ $rows[0]->{alignment} = AlignClass($rows[0]->{align});
$tvars{news}{item} = $rows[0];
}
}
@@ -298,7 +298,7 @@ sub Copy {
sub EditAmendments {
$tvars{data}->{align} = $cgiparams{ALIGN0} if $cgiparams{ALIGN0};
- $tvars{data}->{alignment} = Alignment($tvars{data}->{align});
+ $tvars{data}->{alignment} = AlignClass($tvars{data}->{align});
$tvars{data}->{ddalign} = AlignSelect($tvars{data}->{align});
$tvars{data}->{ddpublish} = PublishSelect($tvars{data}->{publish});
$tvars{data}->{name} = UserName($tvars{data}->{userid});
@@ -411,7 +411,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Users.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Users;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -629,7 +629,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
View
4 lib/Labyrinth/Plugin/Users/Info.pm
@@ -3,7 +3,7 @@ package Labyrinth::Plugin::Users::Info;
use warnings;
use strict;
-my $VERSION = '5.09';
+my $VERSION = '5.10';
=head1 NAME
@@ -175,7 +175,7 @@ Miss Barbell Productions, L<http://www.missbarbell.co.uk/>
=head1 COPYRIGHT & LICENSE
- Copyright (C) 2002-2011 Barbie for Miss Barbell Productions
+ Copyright (C) 2002-2012 Barbie for Miss Barbell Productions
All Rights Reserved.
This module is free software; you can redistribute it and/or
Please sign in to comment.
Something went wrong with that request. Please try again.