merged with SVN HEAD
This commit is contained in:
commit
5222ad6be1
74 changed files with 10757 additions and 434 deletions
|
|
@ -14,6 +14,8 @@ package WebGUI::Asset;
|
|||
|
||||
=cut
|
||||
|
||||
use Carp qw( croak confess );
|
||||
|
||||
use WebGUI::AssetBranch;
|
||||
use WebGUI::AssetClipboard;
|
||||
use WebGUI::AssetExportHtml;
|
||||
|
|
@ -1337,12 +1339,12 @@ Loads an asset module if it's not already in memory. This is a class method. Ret
|
|||
|
||||
sub loadModule {
|
||||
my ($class, $session, $className) = @_;
|
||||
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
||||
(my $module = $className . '.pm') =~ s{::|'}{/}g;
|
||||
if (eval { require $module; 1 }) {
|
||||
return $className;
|
||||
}
|
||||
$session->errorHandler->error("Couldn't compile asset package: ".$className.". Root cause: ".$@);
|
||||
return;
|
||||
$session->errorHandler->error("Couldn't compile asset package: ".$className.". Root cause: ".$@);
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1753,6 +1755,7 @@ A specific revision date for the asset to retrieve. If not specified, the most r
|
|||
sub newByDynamicClass {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
confess "newByDynamicClass requires WebGUI::Session" unless $session;
|
||||
my $assetId = shift;
|
||||
my $revisionDate = shift;
|
||||
return unless defined $assetId;
|
||||
|
|
@ -1896,6 +1899,7 @@ sub processPropertiesFromFormPost {
|
|||
$self->session->db->beginTransaction;
|
||||
$self->update(\%data);
|
||||
$self->session->db->commit;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1984,6 +1988,16 @@ sub publish {
|
|||
$cache->deleteChunk(["asset",$id]);
|
||||
}
|
||||
$self->{_properties}{state} = "published";
|
||||
|
||||
# Also publish any shortcuts to this asset that are in the trash
|
||||
my $shortcuts
|
||||
= WebGUI::Asset::Shortcut->getShortcutsForAssetId($self->session, $self->getId, {
|
||||
returnObjects => 1,
|
||||
statesToInclude => ['trash','trash-limbo'],
|
||||
});
|
||||
for my $shortcut ( @$shortcuts ) {
|
||||
$shortcut->publish;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2073,6 +2087,9 @@ Updates the properties of an existing revision. If you want to create a new revi
|
|||
|
||||
Hash reference of properties and values to set.
|
||||
|
||||
NOTE: C<keywords> is a special property that uses the WebGUI::Keyword API
|
||||
to set the keywords for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub update {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Asset::File;
|
|||
|
||||
use strict;
|
||||
use base 'WebGUI::Asset';
|
||||
use Carp;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::SQL;
|
||||
|
|
@ -54,17 +55,17 @@ Override the default method in order to deal with attachments.
|
|||
=cut
|
||||
|
||||
sub addRevision {
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
|
||||
if ($self->get("storageId") ne "") {
|
||||
my $newStorage = WebGUI::Storage->get($self->session,$self->get("storageId"))->copy;
|
||||
$properties->{storageId} = $newStorage->getId;
|
||||
}
|
||||
|
||||
my $newSelf = $self->SUPER::addRevision($properties);
|
||||
|
||||
return $newSelf;
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
|
||||
if ($self->get("storageId") ne "") {
|
||||
my $newStorage = $self->getStorageClass->get($self->session,$self->get("storageId"))->copy;
|
||||
$properties->{storageId} = $newStorage->getId;
|
||||
}
|
||||
|
||||
my $newSelf = $self->SUPER::addRevision($properties, @_);
|
||||
|
||||
return $newSelf;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -172,23 +173,50 @@ Returns the TabForm object that will be used in generating the edit page for thi
|
|||
=cut
|
||||
|
||||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_File');
|
||||
if ($self->get("filename") ne "") {
|
||||
$tabform->getTab("properties")->readOnly(
|
||||
-label=>$i18n->get('current file'),
|
||||
-hoverHelp=>$i18n->get('current file description', 'Asset_File'),
|
||||
-value=>'<p style="display:inline;vertical-align:middle;"><a href="'.$self->getFileUrl.'"><img src="'.$self->getFileIconUrl.'" alt="'.$self->get("filename").'" style="border-style:none;vertical-align:middle;" /> '.$self->get("filename").'</a></p>'
|
||||
);
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_File');
|
||||
|
||||
}
|
||||
$tabform->getTab("properties")->file(
|
||||
-name => 'newFile',
|
||||
-label => $i18n->get('new file'),
|
||||
-hoverHelp => $i18n->get('new file description'),
|
||||
);
|
||||
return $tabform;
|
||||
$tabform->getTab("properties")->raw(
|
||||
'<tr><td>'.$i18n->get('new file').'<td colspan="2">'
|
||||
. $self->getEditFormUploadControl
|
||||
. '</td></tr>'
|
||||
);
|
||||
|
||||
return $tabform;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getEditFormUploadControl
|
||||
|
||||
Returns the HTML to render the upload box and link to delete the existing
|
||||
file, if necessary.
|
||||
|
||||
=cut
|
||||
|
||||
sub getEditFormUploadControl {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new($session, 'Asset_File');
|
||||
my $html = '';
|
||||
|
||||
if ($self->get("filename") ne "") {
|
||||
$html .= WebGUI::Form::readOnly( $session, {
|
||||
label => $i18n->get('current file'),
|
||||
hoverHelp => $i18n->get('current file description', 'Asset_File'),
|
||||
value => '<p style="display:inline;vertical-align:middle;"><a href="'.$self->getFileUrl.'"><img src="'.$self->getFileIconUrl.'" alt="'.$self->get("filename").'" style="border-style:none;vertical-align:middle;" /> '.$self->get("filename").'</a></p>'
|
||||
});
|
||||
}
|
||||
|
||||
# Control to upload a new file
|
||||
$html .= WebGUI::Form::file( $session, {
|
||||
name => 'newFile',
|
||||
label => $i18n->get('new file'),
|
||||
hoverHelp => $i18n->get('new file description'),
|
||||
});
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -199,10 +227,10 @@ sub getFileUrl {
|
|||
return $self->getStorageLocation->getUrl($self->get("filename"));
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub getFileIconUrl {
|
||||
my $self = shift;
|
||||
return unless $self->get("filename"); ## Why do I have to do this when creating new Files?
|
||||
return $self->getStorageLocation->getFileIconUrl($self->get("filename"));
|
||||
}
|
||||
|
||||
|
|
@ -221,20 +249,32 @@ sub getIcon {
|
|||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getStorageClass
|
||||
|
||||
Get the full classname of the WebGUI::Storage we should use for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getStorageClass {
|
||||
return 'WebGUI::Storage';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getStorageFromPost
|
||||
|
||||
We have to wrap this operation because WebGUI::Asset::File::Image calls SUPER processPropertiesFormFormPost,
|
||||
which gives it the wrong type of Storage object.
|
||||
Get the storage location created by the form post.
|
||||
|
||||
=cut
|
||||
|
||||
sub getStorageFromPost {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $storageId = shift;
|
||||
my $fileStorageId = WebGUI::Form::File->new($self->session, {name => 'newFile', value=>$storageId })->getValueFromPost;
|
||||
return WebGUI::Storage->get($self->session, $fileStorageId);
|
||||
$self->session->errorHandler->info( "File Storage Id: $fileStorageId" );
|
||||
return $self->getStorageClass->get($self->session, $fileStorageId);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -283,41 +323,21 @@ sub prepareView {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub processPropertiesFromFormPost {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
$self->SUPER::processPropertiesFromFormPost;
|
||||
|
||||
#Get the storage location out of memory. If you call getStorageLocation you risk creating another one.
|
||||
my $storageLocation = $self->{_storageLocation};
|
||||
my $storageId = undef;
|
||||
$storageId = $storageLocation->getId if(defined $storageLocation);
|
||||
|
||||
#Now remove the storage location to prevent wierd caching stuff.
|
||||
delete $self->{_storageLocation};
|
||||
|
||||
#Clear the storage location if a file was uploaded.
|
||||
if($session->form->get("newFile_file") ne "") {
|
||||
$storageLocation->clear();
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
my $errors = $self->SUPER::processPropertiesFromFormPost;
|
||||
return $errors if $errors;
|
||||
|
||||
if (my $storageId = $session->form->get('newFile','File')) {
|
||||
$session->errorHandler->info("Got a new file for asset " . $self->getId);
|
||||
my $storage = $self->getStorageClass->get( $session, $storageId);
|
||||
my $filePath = $storage->getPath( $storage->getFiles->[0] );
|
||||
$self->setFile( $filePath );
|
||||
$storage->delete;
|
||||
}
|
||||
|
||||
#Pass in the storage Id to prevent another one from being created.
|
||||
my $storage = $self->getStorageFromPost($storageId);
|
||||
|
||||
if (defined $storage) {
|
||||
my $filename = $storage->getFiles()->[0];
|
||||
|
||||
if (defined $filename) {
|
||||
my %data;
|
||||
$data{filename} = $filename;
|
||||
$data{storageId} = $storage->getId;
|
||||
$data{title} = $filename unless ($session->form->process("title"));
|
||||
$data{menuTitle} = $filename unless ($session->form->process("menuTitle"));
|
||||
$data{url} = $self->getParent->get('url').'/'.$filename unless ($session->form->process("url"));
|
||||
$self->setStorageLocation($storage);
|
||||
$self->update(\%data);
|
||||
}
|
||||
}
|
||||
$self->applyConstraints;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -327,7 +347,7 @@ sub purge {
|
|||
my $self = shift;
|
||||
my $sth = $self->session->db->read("select storageId from FileAsset where assetId=".$self->session->db->quote($self->getId));
|
||||
while (my ($storageId) = $sth->array) {
|
||||
WebGUI::Storage->get($self->session,$storageId)->delete;
|
||||
$self->getStorageClass->get($self->session,$storageId)->delete;
|
||||
}
|
||||
$sth->finish;
|
||||
return $self->SUPER::purge;
|
||||
|
|
@ -355,34 +375,68 @@ sub purgeRevision {
|
|||
return $self->SUPER::purgeRevision;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 setFile ( filename )
|
||||
|
||||
Set the file being handled by this storage location with a file from the
|
||||
system.
|
||||
|
||||
=cut
|
||||
|
||||
sub setFile {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $storage = $self->getStorageLocation;
|
||||
|
||||
# Clear the old file if any
|
||||
$storage->clear;
|
||||
|
||||
$storage->addFileFromFilesystem($filename)
|
||||
|| croak "Couldn't setFile: " . join(", ",@{ $storage->getErrors });
|
||||
# NOTE: We should not croak here, the WebGUI::Storage should croak for us.
|
||||
|
||||
$self->updatePropertiesFromStorage;
|
||||
$self->applyConstraints;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setSize ( fileSize )
|
||||
|
||||
Set the size of this asset by including all the files in its storage
|
||||
location. C<fileSize> is an integer of additional bytes to include in
|
||||
the asset size.
|
||||
|
||||
=cut
|
||||
|
||||
sub setSize {
|
||||
my $self = shift;
|
||||
my $fileSize = shift || 0;
|
||||
my $storage = $self->getStorageLocation;
|
||||
if (defined $storage) {
|
||||
foreach my $file (@{$storage->getFiles}) {
|
||||
$fileSize += $storage->getFileSize($file);
|
||||
}
|
||||
}
|
||||
return $self->SUPER::setSize($fileSize);
|
||||
my $self = shift;
|
||||
my $fileSize = shift || 0;
|
||||
my $storage = $self->getStorageLocation;
|
||||
if (defined $storage) {
|
||||
foreach my $file (@{$storage->getFiles}) {
|
||||
$fileSize += $storage->getFileSize($file);
|
||||
}
|
||||
}
|
||||
return $self->SUPER::setSize($fileSize);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub setStorageLocation {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $storage = shift;
|
||||
if (defined $storage) {
|
||||
if (defined $storage) {
|
||||
$self->{_storageLocation} = $storage;
|
||||
}
|
||||
elsif ($self->get("storageId") eq "") {
|
||||
$self->{_storageLocation} = WebGUI::Storage->create($self->session);
|
||||
$self->update({storageId=>$self->{_storageLocation}->getId});
|
||||
}
|
||||
}
|
||||
elsif ($self->get("storageId") eq "") {
|
||||
$self->{_storageLocation} = $self->getStorageClass->create($self->session);
|
||||
$self->update({storageId=>$self->{_storageLocation}->getId});
|
||||
}
|
||||
else {
|
||||
$self->{_storageLocation} = WebGUI::Storage->get($self->session,$self->get("storageId"));
|
||||
}
|
||||
$self->{_storageLocation} = $self->getStorageClass->get($self->session,$self->get("storageId"));
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -411,6 +465,27 @@ sub update {
|
|||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 updatePropertiesFromStorage ( )
|
||||
|
||||
Updates the asset properties from the file tracked by this asset. Should be
|
||||
called every time the file is changed to ensure the correct filename is
|
||||
in the asset properties.
|
||||
|
||||
=cut
|
||||
|
||||
sub updatePropertiesFromStorage {
|
||||
my $self = shift;
|
||||
my $storage = $self->getStorageLocation;
|
||||
my $filename = $storage->getFiles->[0];
|
||||
$self->session->errorHandler->info("Updating file asset filename to $filename");
|
||||
$self->update({
|
||||
filename => $filename,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
|
|
|
|||
|
|
@ -15,16 +15,12 @@ package WebGUI::Asset::File::Image;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset::File;
|
||||
use base 'WebGUI::Asset::File';
|
||||
use WebGUI::Storage::Image;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Form::Image;
|
||||
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::File);
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Asset::File::Image
|
||||
|
|
@ -98,27 +94,27 @@ A hash reference passed in from a subclass definition.
|
|||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Image");
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
tableName=>'ImageAsset',
|
||||
className=>'WebGUI::Asset::File::Image',
|
||||
icon=>'image.gif',
|
||||
properties=>{
|
||||
thumbnailSize=>{
|
||||
fieldType=>'integer',
|
||||
defaultValue=>$session->setting->get("thumbnailSize")
|
||||
},
|
||||
parameters=>{
|
||||
fieldType=>'textarea',
|
||||
defaultValue=>'style="border-style:none;"'
|
||||
}
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_Image");
|
||||
push @{$definition}, {
|
||||
assetName => $i18n->get('assetName'),
|
||||
tableName => 'ImageAsset',
|
||||
className => 'WebGUI::Asset::File::Image',
|
||||
icon => 'image.gif',
|
||||
properties => {
|
||||
thumbnailSize => {
|
||||
fieldType => 'integer',
|
||||
defaultValue => $session->setting->get("thumbnailSize"),
|
||||
},
|
||||
parameters => {
|
||||
fieldType => 'textarea',
|
||||
defaultValue => 'style="border-style:none;"',
|
||||
},
|
||||
},
|
||||
};
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -184,37 +180,16 @@ sub getEditForm {
|
|||
return $tabform;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getStorageClass
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getStorageFromPost
|
||||
|
||||
Sub class this method from WebGUI::Asset::File so the storage object is the correct type.
|
||||
Returns the class name of the WebGUI::Storage we should use for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getStorageFromPost {
|
||||
my $self = shift;
|
||||
my $storageId = shift;
|
||||
my $fileStorageId = WebGUI::Form::Image->new($self->session, {name => 'newFile', value=>$storageId })->getValueFromPost;
|
||||
return WebGUI::Storage::Image->get($self->session, $fileStorageId);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub getStorageLocation {
|
||||
my $self = shift;
|
||||
unless (exists $self->{_storageLocation}) {
|
||||
if ($self->get("storageId") eq "") {
|
||||
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
|
||||
$self->update({storageId=>$self->{_storageLocation}->getId});
|
||||
} else {
|
||||
$self->{_storageLocation} = WebGUI::Storage::Image->get($self->session,$self->get("storageId"));
|
||||
}
|
||||
}
|
||||
return $self->{_storageLocation};
|
||||
sub getStorageClass {
|
||||
return 'WebGUI::Storage::Image';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -253,31 +228,6 @@ sub prepareView {
|
|||
$self->{_viewTemplate} = $template;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub processPropertiesFromFormPost {
|
||||
my $self = shift;
|
||||
$self->SUPER::processPropertiesFromFormPost;
|
||||
$self->applyConstraints;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub setStorageLocation {
|
||||
my $self = shift;
|
||||
my $storage = shift;
|
||||
if (defined $storage) {
|
||||
$self->{_storageLocation} = $storage;
|
||||
}
|
||||
elsif ($self->get("storageId") eq "") {
|
||||
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
|
||||
$self->update({storageId=>$self->{_storageLocation}->getId});
|
||||
}
|
||||
else {
|
||||
$self->{_storageLocation} = WebGUI::Storage::Image->get($self->session,$self->get("storageId"));
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub view {
|
||||
my $self = shift;
|
||||
|
|
@ -297,6 +247,20 @@ sub view {
|
|||
return $out;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 setFile ( filename )
|
||||
|
||||
Extend the superclass setFile to automatically generate thumbnails.
|
||||
|
||||
=cut
|
||||
|
||||
sub setFile {
|
||||
my $self = shift;
|
||||
$self->SUPER::setFile(@_);
|
||||
$self->generateThumbnail;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
|
|
|
|||
1020
lib/WebGUI/Asset/File/Image/Photo.pm
Normal file
1020
lib/WebGUI/Asset/File/Image/Photo.pm
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -11,6 +11,7 @@ package WebGUI::Asset::Shortcut;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Carp;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::International;
|
||||
|
|
@ -605,6 +606,26 @@ sub getPrefFieldsToImport {
|
|||
return split("\n",$self->getValue("prefFieldsToImport"));
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getTemplateVars
|
||||
|
||||
Gets the template vars for this shortcut.
|
||||
|
||||
=cut
|
||||
|
||||
sub getTemplateVars {
|
||||
my $self = shift;
|
||||
|
||||
my $shortcut = $self->getShortcut;
|
||||
if ( $shortcut->can('getTemplateVars') ) {
|
||||
return $shortcut->getTemplateVars;
|
||||
}
|
||||
else {
|
||||
return $shortcut->get;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub isDashlet {
|
||||
my $self = shift;
|
||||
|
|
@ -648,6 +669,34 @@ sub processPropertiesFromFormPost {
|
|||
$self->uncacheOverrides;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 setOverride ( overrides )
|
||||
|
||||
Set this shortcut's overrides. C<overrides> is a hash reference of overrides
|
||||
to set.
|
||||
|
||||
=cut
|
||||
|
||||
sub setOverride {
|
||||
my $self = shift;
|
||||
my $override = shift;
|
||||
|
||||
croak "Shortcut->setOverride - first argument must be hash reference"
|
||||
unless $override && ref $override eq "HASH";
|
||||
|
||||
for my $key ( %$override ) {
|
||||
$self->session->db->write(
|
||||
"DELETE FROM Shortcut_overrides WHERE assetId=? AND fieldName=?",
|
||||
[$self->getId, $key],
|
||||
);
|
||||
$self->session->db->write(
|
||||
"INSERT INTO Shortcut_overrides VALUES (?,?,?)",
|
||||
[$self->getId, $key, $override->{$key}],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub purge {
|
||||
my $self = shift;
|
||||
|
|
@ -880,23 +929,23 @@ sub www_editOverride {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_saveOverride {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
my $fieldName = $self->session->form->process("overrideFieldName");
|
||||
my %overrides = $self->getOverrides;
|
||||
my $output = '';
|
||||
my %props;
|
||||
foreach my $def (@{$self->getShortcutOriginal->definition($self->session)}) {
|
||||
%props = (%props,%{$def->{properties}});
|
||||
}
|
||||
my $fieldType = $props{$fieldName}{fieldType};
|
||||
my $value = $self->session->form->process($fieldName,$fieldType);
|
||||
$value = $self->session->form->process("newOverrideValueText") || $value;
|
||||
$self->session->db->write("delete from Shortcut_overrides where assetId=".$self->session->db->quote($self->getId)." and fieldName=".$self->session->db->quote($fieldName));
|
||||
$self->session->db->write("insert into Shortcut_overrides values (".$self->session->db->quote($self->getId).",".$self->session->db->quote($fieldName).",".$self->session->db->quote($value).")");
|
||||
$self->uncacheOverrides;
|
||||
$self->getShortcutOriginal->purgeCache();
|
||||
return $self->www_manageOverrides;
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
my $fieldName = $self->session->form->process("overrideFieldName");
|
||||
my %overrides = $self->getOverrides;
|
||||
my $output = '';
|
||||
my %props;
|
||||
foreach my $def (@{$self->getShortcutOriginal->definition($self->session)}) {
|
||||
%props = (%props,%{$def->{properties}});
|
||||
}
|
||||
my $fieldType = $props{$fieldName}{fieldType};
|
||||
my $value = $self->session->form->process($fieldName,$fieldType);
|
||||
$value = $self->session->form->process("newOverrideValueText") || $value;
|
||||
$self->session->db->write("delete from Shortcut_overrides where assetId=".$self->session->db->quote($self->getId)." and fieldName=".$self->session->db->quote($fieldName));
|
||||
$self->session->db->write("insert into Shortcut_overrides values (".$self->session->db->quote($self->getId).",".$self->session->db->quote($fieldName).",".$self->session->db->quote($value).")");
|
||||
$self->uncacheOverrides;
|
||||
$self->getShortcutOriginal->purgeCache();
|
||||
return $self->www_manageOverrides;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -928,5 +977,43 @@ sub www_view {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head1 STATIC METHODS
|
||||
|
||||
These methods are called using CLASS->method
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getShortcutsForAssetId ( session, assetId [, properties] )
|
||||
|
||||
Get an arrayref of assetIds of all the shortcuts for the passed-in assetId.
|
||||
|
||||
"properties" is a hash reference of properties to give to getLineage.
|
||||
Probably the only useful key will be "returnObjects".
|
||||
|
||||
=cut
|
||||
|
||||
sub getShortcutsForAssetId {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $assetId = shift;
|
||||
my $properties = shift || {};
|
||||
|
||||
croak "First argument to getShortcutsForAssetId must be WebGUI::Session"
|
||||
unless $session && $session->isa("WebGUI::Session");
|
||||
croak "Second argument to getShortcutsForAssetId must be assetId"
|
||||
unless $assetId;
|
||||
croak "Third argument to getShortcutsForAssetId must be hash reference"
|
||||
if $properties && !ref $properties eq "HASH";
|
||||
|
||||
my $db = $session->db;
|
||||
|
||||
$properties->{ joinClass } = 'WebGUI::Asset::Shortcut';
|
||||
$properties->{ whereClause } = 'Shortcut.shortcutToAssetId = ' . $db->quote($assetId);
|
||||
|
||||
return WebGUI::Asset->getRoot($session)->getLineage(['descendants'], $properties);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
1024
lib/WebGUI/Asset/Wobject/Gallery.pm
Normal file
1024
lib/WebGUI/Asset/Wobject/Gallery.pm
Normal file
File diff suppressed because it is too large
Load diff
882
lib/WebGUI/Asset/Wobject/GalleryAlbum.pm
Normal file
882
lib/WebGUI/Asset/Wobject/GalleryAlbum.pm
Normal file
|
|
@ -0,0 +1,882 @@
|
|||
package WebGUI::Asset::Wobject::GalleryAlbum;
|
||||
|
||||
$VERSION = "1.0.0";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use base 'WebGUI::Asset::Wobject';
|
||||
use Carp qw( croak );
|
||||
use File::Find;
|
||||
use File::Spec;
|
||||
use File::Temp qw{ tempdir };
|
||||
use Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
|
||||
use Archive::Any;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
=head1 DIAGNOSTICS
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( )
|
||||
|
||||
Define wobject properties for new GalleryAlbum wobjects.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = __PACKAGE__->i18n($session);
|
||||
|
||||
tie my %properties, 'Tie::IxHash', (
|
||||
allowComments => {
|
||||
fieldType => "yesNo",
|
||||
defaultValue => 1,
|
||||
},
|
||||
othersCanAdd => {
|
||||
fieldType => "yesNo",
|
||||
defaultValue => 0,
|
||||
},
|
||||
assetIdThumbnail => {
|
||||
fieldType => "asset",
|
||||
defaultValue => undef,
|
||||
},
|
||||
);
|
||||
|
||||
push @{$definition}, {
|
||||
assetName => $i18n->get('assetName'),
|
||||
autoGenerateForms => 0,
|
||||
icon => 'newWobject.gif',
|
||||
tableName => 'GalleryAlbum',
|
||||
className => __PACKAGE__,
|
||||
properties => \%properties,
|
||||
};
|
||||
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 addArchive ( filename, properties )
|
||||
|
||||
Add an archive of Files to this Album. C<filename> is the full path of the
|
||||
archive. C<properties> is a hash reference of properties to assign to the
|
||||
photos in the archive.
|
||||
|
||||
Will croak if cannot read the archive or if the archive will extract itself to
|
||||
a directory outside of the storage location.
|
||||
|
||||
Will only handle file types handled by the parent Gallery.
|
||||
|
||||
=cut
|
||||
|
||||
sub addArchive {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $properties = shift;
|
||||
my $gallery = $self->getParent;
|
||||
|
||||
my $archive = Archive::Any->new( $filename );
|
||||
|
||||
croak "Archive will extract to directory outside of storage location!"
|
||||
if $archive->is_naughty;
|
||||
|
||||
my $tempdirName = tempdir( "WebGUI-Gallery-XXXXXXXX", TMPDIR => 1, CLEANUP => 1);
|
||||
$archive->extract( $tempdirName );
|
||||
|
||||
# Get all the files in the archive
|
||||
my @files;
|
||||
my $wanted = sub { push @files, $File::Find::name };
|
||||
find( {
|
||||
wanted => $wanted,
|
||||
}, $tempdirName );
|
||||
|
||||
for my $filePath (@files) {
|
||||
my ($volume, $directory, $filename) = File::Spec->splitpath( $filePath );
|
||||
$self->session->errorHandler->info( "trying $filename" );
|
||||
next if $filename =~ m{^[.]};
|
||||
my $class = $gallery->getAssetClassForFile( $filePath );
|
||||
next unless $class; # class is undef for those files the Gallery can't handle
|
||||
|
||||
$self->session->errorHandler->info( "Adding $filename to album!" );
|
||||
$properties->{ className } = $class;
|
||||
$properties->{ menuTitle } = $filename;
|
||||
$properties->{ title } = $filename;
|
||||
$properties->{ url } = $self->getUrl . "/" . $filename;
|
||||
|
||||
my $asset = $self->addChild( $properties, undef, undef, { skipAutoCommitWorkflows => 1 } );
|
||||
$asset->setFile( $filePath );
|
||||
}
|
||||
|
||||
my $versionTag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
$versionTag->set({
|
||||
"workflowId" => $self->getParent->get("workflowIdCommit"),
|
||||
});
|
||||
$versionTag->requestCommit;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 appendTemplateVarsFileLoop ( vars, assetIds )
|
||||
|
||||
Append template vars for a file loop for the specified assetIds. C<vars> is
|
||||
a hash reference to add the file loop to. C<assetIds> is an array reference
|
||||
of assetIds for the loop.
|
||||
|
||||
Returns the hash reference for convenience.
|
||||
|
||||
=cut
|
||||
|
||||
sub appendTemplateVarsFileLoop {
|
||||
my $self = shift;
|
||||
my $var = shift;
|
||||
my $assetIds = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
for my $assetId (@$assetIds) {
|
||||
push @{$var->{file_loop}},
|
||||
WebGUI::Asset->newByDynamicClass($session, $assetId)->getTemplateVars;
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canAddFile ( [userId] )
|
||||
|
||||
Returns true if the user can add a file to this album. C<userId> is a WebGUI
|
||||
user ID. If no userId is passed, will check the current user.
|
||||
|
||||
Users can add files to this album if they are the owner, or if
|
||||
C<othersCanAdd> is true and the Gallery allows them to add files.
|
||||
|
||||
=cut
|
||||
|
||||
sub canAddFile {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
my $gallery = $self->getParent;
|
||||
|
||||
return 1 if $userId eq $self->get("ownerUserId");
|
||||
return 1 if $self->get("othersCanAdd") && $gallery->canAddFile( $userId );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canComment ( [userId] )
|
||||
|
||||
Returns true if the user is allowed to comment on files in this Album.
|
||||
C<userId> is a WebGUI user ID. If no userId is passed, will check the current
|
||||
user.
|
||||
|
||||
Users can comment on files if C<allowComments> is true and the parent Gallery
|
||||
allows comments.
|
||||
|
||||
=cut
|
||||
|
||||
sub canComment {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
my $gallery = $self->getParent;
|
||||
|
||||
return 0 if !$self->get("allowComments");
|
||||
|
||||
return $gallery->canComment( $userId );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canEdit ( [userId] )
|
||||
|
||||
Returns true if the user can edit this asset. C<userId> is a WebGUI user ID.
|
||||
If no userId is passed, check the current user.
|
||||
|
||||
Users can edit this GalleryAlbum if they are the owner, or if they can edit
|
||||
the Gallery parent.
|
||||
|
||||
Also handles adding of child assets by calling C<canAddFile>.
|
||||
|
||||
=cut
|
||||
|
||||
sub canEdit {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
my $gallery = $self->getParent;
|
||||
my $form = $self->session->form;
|
||||
|
||||
# Handle adding a photo
|
||||
if ( $form->get("func") eq "add" ) {
|
||||
return $self->canAddFile;
|
||||
}
|
||||
elsif ( $form->get("func") eq "editSave" && $form->get("className") eq __PACKAGE__ ) {
|
||||
return $self->canAddFile;
|
||||
}
|
||||
else {
|
||||
return 1 if $userId eq $self->get("ownerUserId");
|
||||
|
||||
return $gallery->canEdit($userId);
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canView ( [userId] )
|
||||
|
||||
Returns true if the user can view this asset. C<userId> is a WebGUI user ID.
|
||||
If no userId is given, checks the current user.
|
||||
|
||||
Users can view this album if they can view the containing Gallery.
|
||||
|
||||
NOTE: It may be possible to view a GalleryAlbum that has no public files. In
|
||||
such cases, the GalleryAlbum will appear empty to unprivileged users. This is
|
||||
not a bug.
|
||||
|
||||
=cut
|
||||
|
||||
sub canView {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
return $self->getParent->canView($userId);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 i18n ( session )
|
||||
|
||||
Get a WebGUI::International object for this class.
|
||||
|
||||
Can be called as a class method, in which case a WebGUI::Session object
|
||||
must be passed in.
|
||||
|
||||
NOTE: This method can NOT be inherited, due to a current limitation
|
||||
in the i18n system. You must ALWAYS call this with C<__PACKAGE__>
|
||||
|
||||
=cut
|
||||
|
||||
sub i18n {
|
||||
my $self = shift;
|
||||
my $session = shift;
|
||||
|
||||
return WebGUI::International->new($session, "Asset_GalleryAlbum");
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getAutoCommitWorkflowId ( )
|
||||
|
||||
Returns the workflowId of the Gallery's approval workflow.
|
||||
|
||||
=cut
|
||||
|
||||
sub getAutoCommitWorkflowId {
|
||||
my $self = shift;
|
||||
return $self->getParent->get("workflowIdCommit");
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getFileIds ( )
|
||||
|
||||
Gets an array reference of asset IDs for all the files in this album.
|
||||
|
||||
=cut
|
||||
|
||||
sub getFileIds {
|
||||
my $self = shift;
|
||||
my $gallery = $self->getParent;
|
||||
|
||||
return $self->getLineage( ['descendants'], { } );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getFilePaginator ( paginatorUrl )
|
||||
|
||||
Gets a WebGUI::Paginator for the files in this album. C<paginatorUrl> is the
|
||||
url to the current page that will be given to the paginator.
|
||||
|
||||
=cut
|
||||
|
||||
sub getFilePaginator {
|
||||
my $self = shift;
|
||||
my $url = shift || $self->getUrl;
|
||||
|
||||
my $p = WebGUI::Paginator->new( $self->session, $url );
|
||||
$p->setDataByArrayRef( $self->getFileIds );
|
||||
|
||||
return $p;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getTemplateVars ( )
|
||||
|
||||
Gets template vars common to all views.
|
||||
|
||||
=cut
|
||||
|
||||
sub getTemplateVars {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $gallery = $self->getParent;
|
||||
my $var = $self->get;
|
||||
my $owner = WebGUI::User->new( $session, $self->get("ownerUserId") );
|
||||
|
||||
# Permissions
|
||||
$var->{ canAddFile } = $self->canAddFile;
|
||||
$var->{ canEdit } = $self->canEdit;
|
||||
|
||||
# Add some common template vars from Gallery
|
||||
$gallery->appendTemplateVarsSearchForm( $var );
|
||||
$var->{ url_listAlbums } = $gallery->getUrl('func=listAlbums');
|
||||
$var->{ url_listAlbumsRss } = $gallery->getUrl('func=listAlbumsRss');
|
||||
$var->{ url_listFilesForCurrentUser } = $gallery->getUrl('func=listFilesForUser');
|
||||
$var->{ url_search } = $gallery->getUrl('func=search');
|
||||
|
||||
# Friendly URLs
|
||||
$var->{ url } = $self->getUrl;
|
||||
$var->{ url_addArchive } = $self->getUrl('func=addArchive');
|
||||
$var->{ url_addPhoto } = $self->getUrl("func=add;class=WebGUI::Asset::File::Image::Photo");
|
||||
$var->{ url_addNoClass } = $self->getUrl("func=add");
|
||||
$var->{ url_delete } = $self->getUrl("func=delete");
|
||||
$var->{ url_edit } = $self->getUrl("func=edit");
|
||||
$var->{ url_listFilesForOwner } = $gallery->getUrl("func=listFilesForUser;userId=".$var->{ownerUserId});
|
||||
$var->{ url_viewRss } = $self->getUrl("func=viewRss");
|
||||
$var->{ url_slideshow } = $self->getUrl("func=slideshow");
|
||||
$var->{ url_thumbnails } = $self->getUrl("func=thumbnails");
|
||||
|
||||
$var->{ fileCount } = $self->getChildCount;
|
||||
$var->{ ownerUsername } = $owner->username;
|
||||
$var->{ thumbnailUrl } = $self->getThumbnailUrl;
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 getThumbnailUrl ( )
|
||||
|
||||
Gets the URL for the thumbnail for this asset. If no asset is set, gets the
|
||||
first child.
|
||||
|
||||
NOTE: If the asset does not have a getThumbnailUrl method, this method will
|
||||
return undef.
|
||||
|
||||
=cut
|
||||
|
||||
sub getThumbnailUrl {
|
||||
my $self = shift;
|
||||
my $asset = undef;
|
||||
|
||||
if ( $self->get("assetIdThumbnail") ) {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $self->session, $self->get("assetIdThumbnail") );
|
||||
}
|
||||
elsif ( $self->getFirstChild ) {
|
||||
$asset = $self->getFirstChild;
|
||||
}
|
||||
else {
|
||||
return undef;
|
||||
}
|
||||
|
||||
if ( $asset->can("getThumbnailUrl") ) {
|
||||
return $asset->getThumbnailUrl;
|
||||
}
|
||||
else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 othersCanAdd ( )
|
||||
|
||||
Returns true if people other than the owner can add files to this album.
|
||||
|
||||
=cut
|
||||
|
||||
sub othersCanAdd {
|
||||
my $self = shift;
|
||||
return $self->get("othersCanAdd");
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 prepareView ( )
|
||||
|
||||
See WebGUI::Asset::prepareView() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub prepareView {
|
||||
my $self = shift;
|
||||
$self->SUPER::prepareView();
|
||||
|
||||
my $templateId = $self->getParent->get("templateIdViewAlbum");
|
||||
|
||||
my $template
|
||||
= WebGUI::Asset::Template->new($self->session, $templateId);
|
||||
$template->prepare;
|
||||
|
||||
$self->{_viewTemplate} = $template;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 processStyle ( )
|
||||
|
||||
Gets the parent Gallery's style template
|
||||
|
||||
=cut
|
||||
|
||||
sub processStyle {
|
||||
my $self = shift;
|
||||
return $self->getParent->processStyle(@_);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 processPropertiesFromFormPost ( )
|
||||
|
||||
Process the form to save the asset. Request approval from the Gallery's
|
||||
approval workflow.
|
||||
|
||||
=cut
|
||||
|
||||
sub processPropertiesFromFormPost {
|
||||
my $self = shift;
|
||||
my $errors = $self->SUPER::processPropertiesFromFormPost || [];
|
||||
|
||||
# Return if error
|
||||
return $errors if @$errors;
|
||||
|
||||
# Passes all checks
|
||||
$self->requestAutoCommit;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the www_view method. Returns a processed template
|
||||
to be displayed within the page style.
|
||||
|
||||
=cut
|
||||
|
||||
sub view {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $var = $self->getTemplateVars;
|
||||
|
||||
my $p = $self->getFilePaginator;
|
||||
$p->appendTemplateVars( $var );
|
||||
$self->appendTemplateVarsFileLoop( $var, $p->getPageData );
|
||||
|
||||
return $self->processTemplate($var, undef, $self->{_viewTemplate});
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 view_slideshow ( )
|
||||
|
||||
method called by the www_slideshow method. Returns a processed template to be
|
||||
displayed within the page style.
|
||||
|
||||
Show a slideshow of the GalleryAlbum's files.
|
||||
|
||||
=cut
|
||||
|
||||
sub view_slideshow {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $var = $self->getTemplateVars;
|
||||
|
||||
$self->appendTemplateVarsFileLoop( $var, $self->getFileIds );
|
||||
|
||||
return $self->processTemplate($var, $self->getParent->get("templateIdViewSlideshow"));
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 view_thumbnails ( )
|
||||
|
||||
method called by the www_thumbnails method. Returns a processed template to be
|
||||
displayed within the page style.
|
||||
|
||||
Shows all the thumbnails for this GalleryAlbum. In addition, shows details
|
||||
about a specific thumbnail.
|
||||
|
||||
=cut
|
||||
|
||||
sub view_thumbnails {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $var = $self->getTemplateVars;
|
||||
|
||||
my $fileId = $session->form->get("fileId");
|
||||
|
||||
$self->appendTemplateVarsFileLoop( $var, $self->getFileIds );
|
||||
|
||||
# Process the file loop to add an additional URL
|
||||
for my $file ( @{ $var->{file_loop} } ) {
|
||||
$file->{ url_albumViewThumbnails }
|
||||
= $self->getUrl('func=thumbnails;fileId=' . $file->{assetId});
|
||||
}
|
||||
|
||||
# Add direct vars for the requested file
|
||||
my $asset;
|
||||
if ($fileId) {
|
||||
$asset = WebGUI::Asset->newByDynamicClass( $session, $fileId );
|
||||
}
|
||||
# If no fileId given or fileId does not exist
|
||||
if (!$asset) {
|
||||
$asset = $self->getFirstChild;
|
||||
}
|
||||
my %assetVars = %{ $asset->getTemplateVars };
|
||||
for my $key ( keys %assetVars ) {
|
||||
$var->{ 'file_' . $key } = $assetVars{ $key };
|
||||
}
|
||||
|
||||
return $self->processTemplate($var, $self->getParent->get("templateIdViewThumbnails"));
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_addArchive ( )
|
||||
|
||||
Show the form to add an archive of files to this gallery.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_addArchive {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canAddFile;
|
||||
|
||||
my $session = $self->session;
|
||||
my $form = $self->session->form;
|
||||
my $var = $self->getTemplateVars;
|
||||
|
||||
$var->{ form_start }
|
||||
= WebGUI::Form::formHeader( $session, {
|
||||
action => $self->getUrl('func=addArchiveSave'),
|
||||
});
|
||||
$var->{ form_end }
|
||||
= WebGUI::Form::formFooter( $session );
|
||||
|
||||
$var->{ form_submit }
|
||||
= WebGUI::Form::submit( $session, {
|
||||
name => "submit",
|
||||
value => "Submit",
|
||||
});
|
||||
|
||||
$var->{ form_archive }
|
||||
= WebGUI::Form::File( $session, {
|
||||
name => "archive",
|
||||
maxAttachments => 1,
|
||||
value => ( $form->get("archive") ),
|
||||
});
|
||||
|
||||
$var->{ form_keywords }
|
||||
= WebGUI::Form::text( $session, {
|
||||
name => "keywords",
|
||||
value => ( $form->get("keywords") ),
|
||||
});
|
||||
|
||||
$var->{ form_friendsOnly }
|
||||
= WebGUI::Form::yesNo( $session, {
|
||||
name => "friendsOnly",
|
||||
value => ( $form->get("friendsOnly") ),
|
||||
});
|
||||
|
||||
return $self->processStyle(
|
||||
$self->processTemplate($var, $self->getParent->get("templateIdAddArchive"))
|
||||
);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_addArchiveSave ( )
|
||||
|
||||
Process the form for adding an archive.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_addArchiveSave {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canAddFile;
|
||||
|
||||
my $session = $self->session;
|
||||
my $form = $self->session->form;
|
||||
my $i18n = __PACKAGE__->i18n( $session );
|
||||
my $properties = {
|
||||
keywords => $form->get("keywords"),
|
||||
friendsOnly => $form->get("friendsOnly"),
|
||||
};
|
||||
|
||||
my $storageId = $form->get("archive", "File");
|
||||
my $storage = WebGUI::Storage->get( $session, $storageId );
|
||||
my $filename = $storage->getPath( $storage->getFiles->[0] );
|
||||
|
||||
$self->addArchive( $filename, $properties );
|
||||
|
||||
$storage->delete;
|
||||
|
||||
return $self->processStyle(
|
||||
sprintf $i18n->get('addArchive message'), $self->getUrl,
|
||||
);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_delete ( )
|
||||
|
||||
Show the form to confirm deleting this album and all files inside of it.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_delete {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canEdit;
|
||||
|
||||
my $var = $self->getTemplateVars;
|
||||
$var->{ url_yes } = $self->getUrl("func=deleteConfirm");
|
||||
|
||||
return $self->processStyle(
|
||||
$self->processTemplate( $var, $self->getParent->get("templateIdDeleteAlbum") )
|
||||
);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_deleteConfirm ( )
|
||||
|
||||
Confirm deleting this album and all files inside of it.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_deleteConfirm {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canEdit;
|
||||
|
||||
my $gallery = $self->getParent;
|
||||
|
||||
$self->purge;
|
||||
|
||||
return $gallery->www_view;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_edit ( )
|
||||
|
||||
Show the form to add / edit a GalleryAlbum asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $form = $self->session->form;
|
||||
my $var = $self->getTemplateVars;
|
||||
my $i18n = __PACKAGE__->i18n($session);
|
||||
|
||||
# Generate the form
|
||||
if ($form->get("func") eq "add") {
|
||||
$var->{ form_start }
|
||||
= WebGUI::Form::formHeader( $session, {
|
||||
action => $self->getParent->getUrl('func=editSave;assetId=new;class='.__PACKAGE__),
|
||||
});
|
||||
}
|
||||
else {
|
||||
$var->{ form_start }
|
||||
= WebGUI::Form::formHeader( $session, {
|
||||
action => $self->getUrl('func=editSave'),
|
||||
});
|
||||
}
|
||||
$var->{ form_start }
|
||||
.= WebGUI::Form::hidden( $session, {
|
||||
name => "proceed",
|
||||
value => "showConfirmation",
|
||||
});
|
||||
|
||||
$var->{ form_end }
|
||||
= WebGUI::Form::formFooter( $session );
|
||||
|
||||
$var->{ form_cancel }
|
||||
= WebGUI::Form::button( $session, {
|
||||
name => "cancel",
|
||||
value => $i18n->get("cancel"),
|
||||
extras => 'onclick="history.go(-1)"',
|
||||
});
|
||||
|
||||
$var->{ form_submit }
|
||||
= WebGUI::Form::submit( $session, {
|
||||
name => "save",
|
||||
value => $i18n->get("save"),
|
||||
});
|
||||
|
||||
$var->{ form_title }
|
||||
= WebGUI::Form::text( $session, {
|
||||
name => "title",
|
||||
value => $form->get("title") || $self->get("title"),
|
||||
});
|
||||
|
||||
$var->{ form_description }
|
||||
= WebGUI::Form::HTMLArea( $session, {
|
||||
name => "description",
|
||||
value => $form->get("description") || $self->get("description"),
|
||||
});
|
||||
|
||||
# Generate the file loop
|
||||
my $thumbnailUrl = $self->getThumbnailUrl;
|
||||
$self->appendTemplateVarsFileLoop( $var, $self->getFileIds );
|
||||
for my $file ( @{ $var->{file_loop} } ) {
|
||||
if ( $thumbnailUrl eq $file->{thumbnailUrl} ) {
|
||||
$file->{ isAlbumThumbnail } = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $self->processStyle(
|
||||
$self->processTemplate( $var, $self->getParent->get("templateIdEditAlbum") )
|
||||
);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_editSave ( )
|
||||
|
||||
Save the asset edit form. Overridden to give a nice message when a photo or
|
||||
album is added
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editSave {
|
||||
my $self = shift;
|
||||
my $form = $self->session->form;
|
||||
my $i18n = __PACKAGE__->i18n($self->session);
|
||||
$self->SUPER::www_editSave;
|
||||
|
||||
if ( $form->get("assetId") eq "new" ) {
|
||||
return sprintf $i18n->get("addFile message"), $self->getUrl,
|
||||
}
|
||||
else {
|
||||
return sprintf $i18n->get("save message"), $self->getUrl,
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_showConfirmation ( )
|
||||
|
||||
Shows the confirmation message after adding / editing a gallery album.
|
||||
Provides links to view the album.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_showConfirmation {
|
||||
my $self = shift;
|
||||
my $i18n = __PACKAGE__->i18n( $self->session );
|
||||
|
||||
my $output = sprintf $i18n->get('save message'), $self->getUrl;
|
||||
|
||||
return $self->processStyle(
|
||||
$output
|
||||
);
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_slideshow ( )
|
||||
|
||||
Show a slideshow-type view of this album. The slideshow itself is powered by
|
||||
a javascript application in the template.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_slideshow {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canView;
|
||||
|
||||
return $self->processStyle( $self->view_slideshow );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_thumbnails ( )
|
||||
|
||||
Show the thumbnails for the album.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_thumbnails {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canView;
|
||||
|
||||
return $self->processStyle( $self->view_thumbnails );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewRss ( )
|
||||
|
||||
Display an RSS feed for this album.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewRss {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->insufficient unless $self->canView;
|
||||
|
||||
my $var = $self->getTemplateVars;
|
||||
$self->appendTemplateVarsFileLoop( $var, $self->getFileIds );
|
||||
|
||||
# Fix URLs to be full URLs
|
||||
for my $key ( qw( url url_viewRss ) ) {
|
||||
$var->{ $key } = $self->session->url->getSiteURL . $var->{ $key };
|
||||
}
|
||||
|
||||
# Process the file loop to add additional params
|
||||
for my $file ( @{ $var->{file_loop} } ) {
|
||||
# Fix URLs to be full URLs
|
||||
for my $key ( qw( url ) ) {
|
||||
$file->{ $key } = $self->session->url->getSiteURL . $file->{$key};
|
||||
}
|
||||
|
||||
$file->{ rssDate }
|
||||
= $self->session->datetime->epochToMail( $file->{creationDate} );
|
||||
}
|
||||
|
||||
$self->session->http->setMimeType('text/xml');
|
||||
return $self->processTemplate( $var, $self->getParent->get('templateIdViewAlbumRss') );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -15,6 +15,7 @@ package WebGUI::Asset;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Carp qw( croak );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -82,9 +83,9 @@ sub addChild {
|
|||
$self->session->db->commit;
|
||||
$properties->{assetId} = $id;
|
||||
$properties->{parentId} = $self->getId;
|
||||
my $temp = WebGUI::Asset->newByPropertyHashRef($self->session,$properties);
|
||||
my $temp = WebGUI::Asset->newByPropertyHashRef($self->session,$properties) || croak "Couldn't create a new $properties->{className} asset!";
|
||||
$temp->{_parent} = $self;
|
||||
my $newAsset = $temp->addRevision($properties,$now, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}});
|
||||
my $newAsset = $temp->addRevision($properties, $now, $options);
|
||||
$self->updateHistory("added child ".$id);
|
||||
$self->session->http->setStatus(201,"Asset Creation Successful");
|
||||
return $newAsset;
|
||||
|
|
|
|||
|
|
@ -125,12 +125,16 @@ A hash reference containing the exported data.
|
|||
=cut
|
||||
|
||||
sub importAssetData {
|
||||
my $self = shift;
|
||||
my $data = shift;
|
||||
my $error = $self->session->errorHandler;
|
||||
my $id = $data->{properties}{assetId};
|
||||
my $class = $data->{properties}{className};
|
||||
my $version = $data->{properties}{revisionDate};
|
||||
my $self = shift;
|
||||
my $data = shift;
|
||||
my $error = $self->session->errorHandler;
|
||||
my $id = $data->{properties}{assetId};
|
||||
my $class = $data->{properties}{className};
|
||||
my $version = $data->{properties}{revisionDate};
|
||||
|
||||
# Load the class
|
||||
WebGUI::Asset->loadModule( $self->session, $class );
|
||||
|
||||
my $asset;
|
||||
my $assetExists = WebGUI::Asset->assetExists($self->session, $id, $class, $version);
|
||||
if ($assetExists) { # update an existing revision
|
||||
|
|
@ -194,40 +198,40 @@ A reference to a WebGUI::Storage object that contains a webgui package file.
|
|||
=cut
|
||||
|
||||
sub importPackage {
|
||||
my $self = shift;
|
||||
my $storage = shift;
|
||||
my $decompressed = $storage->untar($storage->getFiles->[0]);
|
||||
my %assets = ();
|
||||
my $error = $self->session->errorHandler;
|
||||
$error->info("Importing package.");
|
||||
foreach my $file (sort(@{$decompressed->getFiles})) {
|
||||
next unless ($decompressed->getFileExtension($file) eq "json");
|
||||
$error->info("Found data file $file");
|
||||
my $data = eval{
|
||||
my $self = shift;
|
||||
my $storage = shift;
|
||||
my $decompressed = $storage->untar($storage->getFiles->[0]);
|
||||
my %assets = ();
|
||||
my $error = $self->session->errorHandler;
|
||||
$error->info("Importing package.");
|
||||
foreach my $file (sort(@{$decompressed->getFiles})) {
|
||||
next unless ($decompressed->getFileExtension($file) eq "json");
|
||||
$error->info("Found data file $file");
|
||||
my $data = eval{
|
||||
local $JSON::UnMapping = 1;
|
||||
JSON::jsonToObj($decompressed->getFileContentsAsScalar($file))
|
||||
};
|
||||
if ($@ || $data->{properties}{assetId} eq "" || $data->{properties}{className} eq "" || $data->{properties}{revisionDate} eq "") {
|
||||
$error->error("package corruption: ".$@) if ($@);
|
||||
return "corrupt";
|
||||
}
|
||||
$error->info("Data file $file is valid and represents asset ".$data->{properties}{assetId});
|
||||
foreach my $storageId (@{$data->{storage}}) {
|
||||
my $assetStorage = WebGUI::Storage->get($self->session, $storageId);
|
||||
$decompressed->untar($storageId.".storage", $assetStorage);
|
||||
}
|
||||
my $asset = $assets{$data->{properties}{parentId}} || $self;
|
||||
my $newAsset = $asset->importAssetData($data);
|
||||
if ($@ || $data->{properties}{assetId} eq "" || $data->{properties}{className} eq "" || $data->{properties}{revisionDate} eq "") {
|
||||
$error->error("package corruption: ".$@) if ($@);
|
||||
return "corrupt";
|
||||
}
|
||||
$error->info("Data file $file is valid and represents asset ".$data->{properties}{assetId});
|
||||
foreach my $storageId (@{$data->{storage}}) {
|
||||
my $assetStorage = WebGUI::Storage->get($self->session, $storageId);
|
||||
$decompressed->untar($storageId.".storage", $assetStorage);
|
||||
}
|
||||
my $asset = $assets{$data->{properties}{parentId}} || $self;
|
||||
my $newAsset = $asset->importAssetData($data);
|
||||
$newAsset->importAssetCollateralData($data);
|
||||
$assets{$newAsset->getId} = $newAsset;
|
||||
}
|
||||
if ($self->session->setting->get("autoRequestCommit")) {
|
||||
$assets{$newAsset->getId} = $newAsset;
|
||||
}
|
||||
if ($self->session->setting->get("autoRequestCommit")) {
|
||||
if ($self->session->setting->get("skipCommitComments")) {
|
||||
WebGUI::VersionTag->getWorking($self->session)->requestCommit;
|
||||
} else {
|
||||
$self->session->http->setRedirect($self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
|
||||
$self->session->http->setRedirect($self->getUrl("op=commitVersionTag;tagId=".WebGUI::VersionTag->getWorking($self->session)->getId));
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Asset;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use WebGUI::Asset::Shortcut;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -146,6 +147,16 @@ sub purge {
|
|||
}
|
||||
}
|
||||
|
||||
# Delete shortcuts to this asset
|
||||
# Also publish any shortcuts to this asset that are in the trash
|
||||
my $shortcuts
|
||||
= WebGUI::Asset::Shortcut->getShortcutsForAssetId($self->session, $self->getId, {
|
||||
returnObjects => 1,
|
||||
});
|
||||
for my $shortcut ( @$shortcuts ) {
|
||||
$shortcut->purge;
|
||||
}
|
||||
|
||||
# gotta delete stuff we've exported
|
||||
unless ($options->{skipExported}) {
|
||||
$self->_invokeWorkflowOnExportedFiles($self->session->setting->get('purgeWorkflow'), 1);
|
||||
|
|
@ -190,29 +201,40 @@ sub purge {
|
|||
|
||||
=head2 trash ( )
|
||||
|
||||
Removes asset from lineage, places it in trash state. The "gap" in the lineage is changed in state to trash-limbo.
|
||||
Removes asset from lineage, places it in trash state. The "gap" in the
|
||||
lineage is changed in state to trash-limbo.
|
||||
|
||||
=cut
|
||||
|
||||
sub trash {
|
||||
my $self = shift;
|
||||
return if ($self->getId eq $self->session->setting->get("defaultPage") || $self->getId eq $self->session->setting->get("notFoundPage"));
|
||||
foreach my $asset ($self, @{$self->getLineage(['descendants'], {returnObjects => 1})}) {
|
||||
$asset->_invokeWorkflowOnExportedFiles($self->session->setting->get('trashWorkflow'), 1);
|
||||
}
|
||||
my $self = shift;
|
||||
return if ($self->getId eq $self->session->setting->get("defaultPage") || $self->getId eq $self->session->setting->get("notFoundPage"));
|
||||
foreach my $asset ($self, @{$self->getLineage(['descendants'], {returnObjects => 1})}) {
|
||||
$asset->_invokeWorkflowOnExportedFiles($self->session->setting->get('trashWorkflow'), 1);
|
||||
}
|
||||
|
||||
my $db = $self->session->db;
|
||||
$db->beginTransaction;
|
||||
my $sth = $db->read("select assetId from asset where lineage like ?",[$self->get("lineage").'%']);
|
||||
while (my ($id) = $sth->array) {
|
||||
$db->write("delete from assetIndex where assetId=?",[$id]);
|
||||
}
|
||||
$db->write("update asset set state='trash-limbo' where lineage like ?",[$self->get("lineage").'%']);
|
||||
$db->write("update asset set state='trash', stateChangedBy=?, stateChanged=? where assetId=?",[$self->session->user->userId, $self->session->datetime->time(), $self->getId]);
|
||||
$db->commit;
|
||||
$self->{_properties}{state} = "trash";
|
||||
$self->updateHistory("trashed");
|
||||
$self->purgeCache;
|
||||
# Trash any shortcuts to this asset
|
||||
my $shortcuts
|
||||
= WebGUI::Asset::Shortcut->getShortcutsForAssetId($self->session, $self->getId, { returnObjects => 1});
|
||||
for my $shortcut ( @$shortcuts ) {
|
||||
$shortcut->trash;
|
||||
}
|
||||
|
||||
# Raw database work is more efficient than $asset->update
|
||||
my $db = $self->session->db;
|
||||
$db->beginTransaction;
|
||||
my $sth = $db->read("select assetId from asset where lineage like ?",[$self->get("lineage").'%']);
|
||||
while (my ($id) = $sth->array) {
|
||||
$db->write("delete from assetIndex where assetId=?",[$id]);
|
||||
}
|
||||
$db->write("update asset set state='trash-limbo' where lineage like ?",[$self->get("lineage").'%']);
|
||||
$db->write("update asset set state='trash', stateChangedBy=?, stateChanged=? where assetId=?",[$self->session->user->userId, $self->session->datetime->time(), $self->getId]);
|
||||
$db->commit;
|
||||
|
||||
# Update ourselves since we didn't use update()
|
||||
$self->{_properties}{state} = "trash";
|
||||
$self->updateHistory("trashed");
|
||||
$self->purgeCache;
|
||||
}
|
||||
|
||||
require WebGUI::Workflow::Activity::DeleteExportedFiles;
|
||||
|
|
|
|||
|
|
@ -87,12 +87,12 @@ Posts) will know not to send them under certain conditions.
|
|||
sub addRevision {
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
my $now = shift || $self->session->datetime->time();
|
||||
my $options = shift;
|
||||
|
||||
my $now = shift || $self->session->datetime->time();
|
||||
my $options = shift;
|
||||
|
||||
my $autoCommitId = $self->getAutoCommitWorkflowId() unless ($options->{skipAutoCommitWorkflows});
|
||||
|
||||
my $workingTag
|
||||
|
||||
my $workingTag
|
||||
= ($autoCommitId)
|
||||
? WebGUI::VersionTag->create($self->session, {groupToUse=>'12', workflowId=>$autoCommitId})
|
||||
: WebGUI::VersionTag->getWorking($self->session)
|
||||
|
|
@ -112,8 +112,7 @@ sub addRevision {
|
|||
$self->session->user->userId,
|
||||
$workingTag->getId,
|
||||
$self->getId,
|
||||
]
|
||||
);
|
||||
]);
|
||||
|
||||
foreach my $definition (@{$self->definition($self->session)}) {
|
||||
unless ($definition->{tableName} eq "assetData") {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ package WebGUI::Form;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Carp qw( croak );
|
||||
use Scalar::Util qw( blessed );
|
||||
use Tie::IxHash;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Asset::RichEdit;
|
||||
|
|
@ -92,7 +94,7 @@ sub formFooter {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 formHeader ( session, hashRef )
|
||||
=head2 formHeader ( session, options )
|
||||
|
||||
Returns a form header.
|
||||
|
||||
|
|
@ -100,7 +102,7 @@ Returns a form header.
|
|||
|
||||
A reference to the current session.
|
||||
|
||||
=head3 hashRef
|
||||
=head3 options
|
||||
|
||||
A hash reference that contains one or more of the following parameters.
|
||||
|
||||
|
|
@ -108,6 +110,9 @@ A hash reference that contains one or more of the following parameters.
|
|||
|
||||
The form action. Defaults to the current page.
|
||||
|
||||
NOTE: If the C<action> contains a query string (?param=value), C<formHeader>
|
||||
will translate the parameters into hidden form elements automatically.
|
||||
|
||||
=head4 method
|
||||
|
||||
The form method. Defaults to "post".
|
||||
|
|
@ -118,28 +123,36 @@ The form enctype. Defaults to "multipart/form-data".
|
|||
|
||||
=head4 extras
|
||||
|
||||
If you want to add anything special to the form header like javascript actions or stylesheet info, then use this.
|
||||
If you want to add anything special to the form header like javascript
|
||||
actions or stylesheet info, then use this.
|
||||
|
||||
=cut
|
||||
|
||||
sub formHeader {
|
||||
my $session = shift;
|
||||
my $params = shift;
|
||||
my $action = $params->{action} || $session->url->page();
|
||||
my $hidden;
|
||||
if ($action =~ /\?/) {
|
||||
my ($path,$query) = split(/\?/,$action);
|
||||
$action = $path;
|
||||
my @params = split(/\;/,$query);
|
||||
foreach my $param (@params) {
|
||||
$param =~ s/amp;(.*)/$1/;
|
||||
my ($name,$value) = split(/\=/,$param);
|
||||
$hidden .= hidden($session,{name=>$name,value=>$value});
|
||||
}
|
||||
}
|
||||
my $method = $params->{method} || "post";
|
||||
my $enctype = $params->{enctype} || "multipart/form-data";
|
||||
return '<form action="'.$action.'" enctype="'.$enctype.'" method="'.$method.'" '.$params->{extras}.'><div class="formContents">'.$hidden;
|
||||
my $session = shift;
|
||||
my $params = shift || {};
|
||||
|
||||
croak "First parameter must be WebGUI::Session object"
|
||||
unless blessed $session && $session->isa( "WebGUI::Session" );
|
||||
croak "Second parameter must be hash reference"
|
||||
if ref $params ne "HASH";
|
||||
|
||||
my $action = exists $params->{ action } ? $params->{ action } : $session->url->page();
|
||||
my $method = exists $params->{ method } ? $params->{ method } : "post";
|
||||
my $enctype = exists $params->{ enctype } ? $params->{ enctype } : "multipart/form-data";
|
||||
|
||||
# Fix a query string in the action URL
|
||||
my $hidden;
|
||||
if ($action =~ /\?/) {
|
||||
($action, my $query) = split /\?/, $action, 2;
|
||||
my @params = split /[&;]/, $query;
|
||||
foreach my $param ( @params ) {
|
||||
my ($name, $value) = split /=/, $param;
|
||||
$hidden .= hidden( $session, { name => $name, value => $value } );
|
||||
}
|
||||
}
|
||||
|
||||
return '<form action="'.$action.'" enctype="'.$enctype.'" method="'.$method.'" '.$params->{extras}.'><div class="formContents">'.$hidden;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
101
lib/WebGUI/Form/SelectRichEditor.pm
Normal file
101
lib/WebGUI/Form/SelectRichEditor.pm
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
package WebGUI::Form::SelectRichEditor;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use base 'WebGUI::Form::SelectBox';
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
WebGUI::Form::SelectRichEditor
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Creates a select box to choose a Rich Text Editor asset.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
This is a subclass of WebGUI::Form::SelectBox.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
The following methods are specifically available from this class. Check the superclass for additional methods.
|
||||
|
||||
=cut
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( [ additionalTerms ] )
|
||||
|
||||
See the super class for additional details.
|
||||
|
||||
=head3 additionalTerms
|
||||
|
||||
The following additional parameters have been added via this sub class.
|
||||
|
||||
=head4 defaultValue
|
||||
|
||||
Defaults to the Post Rich Editor, the least-featured Rich Text Editor and the
|
||||
one most likely to be selected by users of this form control.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift || [];
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
push @{$definition}, {
|
||||
formName => {
|
||||
defaultValue => $i18n->get("475"),
|
||||
},
|
||||
defaultValue => {
|
||||
defaultValue => '',
|
||||
},
|
||||
};
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 new
|
||||
|
||||
Create a new WebGUI::Form::SelectRichEditor object and populate it with all
|
||||
the available Rich Text Editor assets.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = $class->SUPER::new(@_);
|
||||
|
||||
# Get all the RTEs available to this site
|
||||
my $options
|
||||
= $self->session->db->buildHashRef( q{
|
||||
SELECT DISTINCT(assetData.assetId), assetData.title
|
||||
FROM asset, assetData
|
||||
WHERE asset.className='WebGUI::Asset::RichEdit'
|
||||
AND asset.assetId=assetData.assetId
|
||||
ORDER BY assetData.title
|
||||
});
|
||||
|
||||
$self->set( "options", $options );
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ sub sendMessage {
|
|||
userId => $userId,
|
||||
sentBy => $myId,
|
||||
status => 'unread',
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
229
lib/WebGUI/Help/Asset_Gallery.pm
Normal file
229
lib/WebGUI/Help/Asset_Gallery.pm
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
package WebGUI::Help::Asset_Gallery;
|
||||
|
||||
our $HELP = {
|
||||
'help searchForm' => {
|
||||
title => 'help searchForm title',
|
||||
body => 'help searchForm body',
|
||||
variables => [
|
||||
{
|
||||
name => 'searchForm_start',
|
||||
description => 'helpvar searchForm_start',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_end',
|
||||
description => 'helpvar searchForm_end',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_basicSearch',
|
||||
description => 'helpvar searchForm_basicSearch',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_title',
|
||||
description => 'helpvar searchForm_title',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_description',
|
||||
description => 'helpvar searchForm_description',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_keywords',
|
||||
description => 'helpvar searchForm_keywords',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_className',
|
||||
description => 'helpvar searchForm_className',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_creationDate_after',
|
||||
description => 'helpvar searchForm_creationDate_after',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_creationDate_before',
|
||||
description => 'helpvar searchForm_creationDate_before',
|
||||
},
|
||||
{
|
||||
name => 'searchForm_submit',
|
||||
description => 'helpvar searchForm_submit',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help common' => {
|
||||
title => 'help common title',
|
||||
body => 'help common body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help searchForm',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'url_addAlbum',
|
||||
description => 'helpvar url_addAlbum',
|
||||
},
|
||||
{
|
||||
name => 'url_listAlbums',
|
||||
description => 'helpvar url_listAlbums',
|
||||
},
|
||||
{
|
||||
name => 'url_listAlbumsRss',
|
||||
description => 'helpvar url_listAlbumsRss',
|
||||
},
|
||||
{
|
||||
name => 'url_listFilesForCurrentUser',
|
||||
description => 'helpvar url_listFilesForCurrentUser',
|
||||
},
|
||||
{
|
||||
name => 'url_search',
|
||||
description => 'helpvar url_search',
|
||||
},
|
||||
{
|
||||
name => 'canEdit',
|
||||
description => 'helpvar canEdit',
|
||||
},
|
||||
{
|
||||
name => 'canAddFile',
|
||||
description => 'helpvar canAddFile',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help listAlbums' => {
|
||||
title => 'help listAlbums title',
|
||||
body => 'help listAlbums body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'albums',
|
||||
description => 'helpvar albums',
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help listAlbumsRss' => {
|
||||
title => 'help listAlbumsRss title',
|
||||
body => 'help listAlbumsRss body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'albums',
|
||||
description => 'helpvar albums rss',
|
||||
variables => [
|
||||
{
|
||||
name => 'rssDate',
|
||||
description => 'helpvar rssDate',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help search' => {
|
||||
title => 'help search title',
|
||||
body => 'help search body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'search_results',
|
||||
description => 'helpvar search_results',
|
||||
},
|
||||
],
|
||||
# All classes that can be found by a Gallery search go in here
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help listFilesForUser' => {
|
||||
title => 'help listFilesForUser title',
|
||||
body => 'help listFilesForUser body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'user_albums',
|
||||
description => 'helpvar user_albums',
|
||||
},
|
||||
{
|
||||
name => 'user_files',
|
||||
description => 'helpvar user_files',
|
||||
},
|
||||
{
|
||||
name => 'userId',
|
||||
description => 'helpvar userId',
|
||||
},
|
||||
{
|
||||
name => 'url_rss',
|
||||
description => 'helpvar url_rss',
|
||||
},
|
||||
{
|
||||
name => 'username',
|
||||
description => 'helpvar username',
|
||||
},
|
||||
],
|
||||
# All classes that can be found by a Gallery search go in here
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help listFilesForUserRss' => {
|
||||
title => 'help listFilesForUserRss title',
|
||||
body => 'help listFilesForUserRss body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help listFilesForUser',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
309
lib/WebGUI/Help/Asset_GalleryAlbum.pm
Normal file
309
lib/WebGUI/Help/Asset_GalleryAlbum.pm
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
package WebGUI::Help::Asset_GalleryAlbum;
|
||||
|
||||
our $HELP = {
|
||||
|
||||
'help common' => {
|
||||
title => 'help common title',
|
||||
body => 'help common body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help searchForm',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'canAddFile',
|
||||
description => 'helpvar canAddFile',
|
||||
},
|
||||
{
|
||||
name => 'canEdit',
|
||||
description => 'helpvar canEdit',
|
||||
},
|
||||
{
|
||||
name => 'url_listAlbums',
|
||||
description => 'helpvar url_listAlbums',
|
||||
},
|
||||
{
|
||||
name => 'url_listAlbumsRss',
|
||||
description => 'helpvar url_listAlbumsRss',
|
||||
},
|
||||
{
|
||||
name => 'url_listFilesForCurrentUser',
|
||||
description => 'helpvar url_listFilesForCurrentUser',
|
||||
},
|
||||
{
|
||||
name => 'url_search',
|
||||
description => 'helpvar url_search',
|
||||
},
|
||||
{
|
||||
name => 'url_addArchive',
|
||||
description => 'helpvar url_addArchive',
|
||||
},
|
||||
{
|
||||
name => 'url_addPhoto',
|
||||
description => 'helpvar url_addPhoto',
|
||||
},
|
||||
{
|
||||
name => 'url_addNoClass',
|
||||
description => 'helpvar url_addNoClass',
|
||||
},
|
||||
{
|
||||
name => 'url_delete',
|
||||
description => 'helpvar url_delete',
|
||||
},
|
||||
{
|
||||
name => 'url_edit',
|
||||
description => 'helpvar url_edit',
|
||||
},
|
||||
{
|
||||
name => 'url_listFilesForOwner',
|
||||
description => 'helpvar url_listFilesForOwner',
|
||||
},
|
||||
{
|
||||
name => 'url_viewRss',
|
||||
description => 'helpvar url_viewRss',
|
||||
},
|
||||
{
|
||||
name => 'url_slideshow',
|
||||
description => 'helpvar url_slideshow',
|
||||
},
|
||||
{
|
||||
name => 'url_thumbnails',
|
||||
description => 'helpvar url_thumbnails',
|
||||
},
|
||||
{
|
||||
name => 'fileCount',
|
||||
description => 'helpvar fileCount',
|
||||
},
|
||||
{
|
||||
name => 'ownerUsername',
|
||||
description => 'helpvar ownerUsername',
|
||||
},
|
||||
{
|
||||
name => 'thumbnailUrl',
|
||||
description => 'helpvar thumbnailUrl',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help fileLoop' => {
|
||||
title => 'help fileLoop title',
|
||||
body => 'help fileLoop body',
|
||||
variables => [
|
||||
{
|
||||
name => 'file_loop',
|
||||
description => 'helpvar file_loop',
|
||||
},
|
||||
],
|
||||
|
||||
# ADD ALL GalleryAlbum FILE CLASSES HERE!!!
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help view' => {
|
||||
title => 'help view title',
|
||||
body => 'help view body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help fileLoop',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help slideshow' => {
|
||||
title => 'help slideshow title',
|
||||
body => 'help slideshow body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help fileLoop',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help thumbnails' => {
|
||||
title => 'help thumbnails title',
|
||||
body => 'help thumbnails body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help fileLoop',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
|
||||
variables => [
|
||||
{
|
||||
name => 'file_*',
|
||||
description => 'helpvar file_*',
|
||||
},
|
||||
],
|
||||
|
||||
# PUT ALL GalleryAlbum FILE CLASSES HERE ALSO!!!
|
||||
related => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help addArchive' => {
|
||||
title => 'help addArchive title',
|
||||
body => 'help addArchive body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
variables => {
|
||||
{
|
||||
name => 'form_start',
|
||||
description => 'helpvar form_start',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_end',
|
||||
description => 'helpvar form_end',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_submit',
|
||||
description => 'helpvar form_submit',
|
||||
},
|
||||
{
|
||||
name => 'form_archive',
|
||||
description => 'helpvar form_archive',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_keywords',
|
||||
description => 'helpvar form_keywords',
|
||||
},
|
||||
{
|
||||
name => 'form_friendsOnly',
|
||||
description => 'helpvar form_friendsOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
'help delete' => {
|
||||
title => 'help delete title',
|
||||
body => 'help delete body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'url_yes',
|
||||
description => 'helpvar url_yes',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help edit' => {
|
||||
title => 'help edit title',
|
||||
body => 'help edit body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help fileLoop',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'form_start',
|
||||
description => 'helpvar form_start',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_end',
|
||||
description => 'helpvar form_end',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_cancel',
|
||||
description => 'helpvar form_cancel',
|
||||
},
|
||||
{
|
||||
name => 'form_submit',
|
||||
description => 'helpvar form_submit',
|
||||
},
|
||||
{
|
||||
name => 'form_title',
|
||||
description => 'helpvar form_title',
|
||||
},
|
||||
{
|
||||
name => 'form_description',
|
||||
description => 'helpvar form_description',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'file_loop',
|
||||
description => 'helpvar file_loop edit',
|
||||
variables => [
|
||||
{
|
||||
name => 'isAlbumThumbnail',
|
||||
description => 'helpvar isAlbumThumbnail',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help viewRss' => {
|
||||
title => 'help viewRss title',
|
||||
body => 'help viewRss body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
{
|
||||
tag => 'help fileLoop',
|
||||
namespace => 'Asset_GalleryAlbum',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'file_loop',
|
||||
description => 'helpvar file_loop viewRss',
|
||||
variables => [
|
||||
{
|
||||
name => 'rssDate',
|
||||
description => 'helpvar rssDate',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
258
lib/WebGUI/Help/Asset_Photo.pm
Normal file
258
lib/WebGUI/Help/Asset_Photo.pm
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
package WebGUI::Help::Asset_Photo;
|
||||
|
||||
our $HELP = {
|
||||
'help commentForm' => {
|
||||
title => 'help commentForm title',
|
||||
body => 'help commentForm body',
|
||||
variables => [
|
||||
{
|
||||
name => 'commentForm_start',
|
||||
description => 'helpvar commentForm_start',
|
||||
},
|
||||
{
|
||||
name => 'commentForm_end',
|
||||
description => 'helpvar commentForm_end',
|
||||
},
|
||||
{
|
||||
name => 'commentForm_bodyText',
|
||||
description => 'helpvar commentForm_bodyText',
|
||||
},
|
||||
{
|
||||
name => 'commentForm_submit',
|
||||
description => 'helpvar commentForm_submit',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help common' => {
|
||||
title => 'help common title',
|
||||
body => 'help common body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help searchForm',
|
||||
namespace => 'Asset_Gallery',
|
||||
},
|
||||
{
|
||||
tag => 'help commentForm',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'canComment',
|
||||
description => 'helpvar canComment',
|
||||
},
|
||||
{
|
||||
name => 'canEdit',
|
||||
description => 'helpvar canEdit',
|
||||
},
|
||||
{
|
||||
name => 'fileUrl',
|
||||
description => 'helpvar fileUrl',
|
||||
},
|
||||
{
|
||||
name => 'numberOfComments',
|
||||
description => 'helpvar numberOfComments',
|
||||
},
|
||||
{
|
||||
name => 'ownerUsername',
|
||||
description => 'helpvar ownerUsername',
|
||||
},
|
||||
{
|
||||
name => 'thumbnailUrl',
|
||||
description => 'helpvar thumbnailUrl',
|
||||
},
|
||||
{
|
||||
name => 'url_delete',
|
||||
description => 'helpvar url_delete',
|
||||
},
|
||||
{
|
||||
name => 'url_demote',
|
||||
description => 'helpvar url_demote',
|
||||
},
|
||||
{
|
||||
name => 'url_edit',
|
||||
description => 'helpvar url_edit',
|
||||
},
|
||||
{
|
||||
name => 'url_gallery',
|
||||
description => 'helpvar url_gallery',
|
||||
},
|
||||
{
|
||||
name => 'url_makeShortcut',
|
||||
description => 'helpvar url_makeShortcut',
|
||||
},
|
||||
{
|
||||
name => 'url_listFilesForOwner',
|
||||
description => 'helpvar url_listFilesForOwner',
|
||||
},
|
||||
{
|
||||
name => 'url_promote',
|
||||
description => 'helpvar url_promote',
|
||||
},
|
||||
{
|
||||
name => 'resolutions_loop',
|
||||
description => 'helpvar resolutions_loop',
|
||||
variables => [
|
||||
{
|
||||
name => 'url_download',
|
||||
description => 'helpvar resolutions_loop url_download',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name => 'exif_*',
|
||||
description => 'helpvar exif_*',
|
||||
},
|
||||
{
|
||||
name => 'exifLoop',
|
||||
description => 'helpvar exifLoop',
|
||||
variables => [
|
||||
{
|
||||
name => 'tag',
|
||||
description => 'helpvar exifLoop tag',
|
||||
},
|
||||
{
|
||||
name => 'value',
|
||||
description => 'helpvar exifLoop value',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help delete' => {
|
||||
title => 'help delete title',
|
||||
body => 'help delete body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'url_yes',
|
||||
description => 'helpvar url_yes',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help edit' => {
|
||||
title => 'help edit title',
|
||||
body => 'htlp edit body',
|
||||
variables => [
|
||||
{
|
||||
name => 'url_addArchive',
|
||||
description => 'helpvar url_addArchive',
|
||||
},
|
||||
{
|
||||
name => 'form_start',
|
||||
description => 'helpvar form_start',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_end',
|
||||
description => 'helpvar form_end',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_submit',
|
||||
description => 'helpvar form_submit',
|
||||
},
|
||||
{
|
||||
name => 'form_title',
|
||||
description => 'helpvar form_title',
|
||||
},
|
||||
{
|
||||
name => 'form_synopsis',
|
||||
description => 'helpvar form_synopsis',
|
||||
},
|
||||
{
|
||||
name => 'form_photo',
|
||||
description => 'helpvar form_photo',
|
||||
},
|
||||
{
|
||||
name => 'form_keywords',
|
||||
description => 'helpvar form_keywords',
|
||||
},
|
||||
{
|
||||
name => 'form_location',
|
||||
description => 'helpvar form_location',
|
||||
},
|
||||
{
|
||||
name => 'form_friendsOnly',
|
||||
description => 'helpvar form_friendsOnly',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
'help makeShortcut' => {
|
||||
title => 'help makeShortcut title',
|
||||
body => 'htlp makeShortcut body',
|
||||
variables => [
|
||||
{
|
||||
name => 'form_start',
|
||||
description => 'helpvar form_start',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_end',
|
||||
description => 'helpvar form_end',
|
||||
required => 1,
|
||||
},
|
||||
{
|
||||
name => 'form_parentId',
|
||||
description => 'helpvar form_parentId',
|
||||
required => 1,
|
||||
},
|
||||
],
|
||||
}
|
||||
'help view' => {
|
||||
title => 'help view title',
|
||||
body => 'help view body',
|
||||
isa => [
|
||||
{
|
||||
tag => 'help common',
|
||||
namespace => 'Asset_Photo',
|
||||
},
|
||||
],
|
||||
variables => [
|
||||
{
|
||||
name => 'commentLoop',
|
||||
description => 'helpvar commentLoop',
|
||||
variables => [
|
||||
{
|
||||
name => 'userId',
|
||||
description => 'helpvar commentLoop userId',
|
||||
},
|
||||
{
|
||||
name => 'visitorIp',
|
||||
description => 'helpvar commentLoop visitorIp',
|
||||
},
|
||||
{
|
||||
name => 'creationDate',
|
||||
description => 'helpvar commentLoop creationDate',
|
||||
},
|
||||
{
|
||||
name => 'bodyText',
|
||||
description => 'helpvar commentLoop bodyText',
|
||||
},
|
||||
{
|
||||
name => 'username',
|
||||
description => 'helpvar commentLoop username',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name => 'commentLoop_pageBar',
|
||||
description => 'helpvar commentLoop_pageBar',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -27,6 +27,9 @@ Package WebGUI::Keyword
|
|||
|
||||
This package provides an API to create and modify keywords used by the asset sysetm.
|
||||
|
||||
Assets can use the C<keywords> property to set keywords automatically. See
|
||||
WebGUI::Asset::update() for more details.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Keyword;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Search;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Carp qw( croak );
|
||||
use WebGUI::Asset;
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -329,6 +330,9 @@ This rule allows for an array reference of table join clauses.
|
|||
|
||||
join => 'join assetData on assetId = assetData.assetId'
|
||||
|
||||
NOTE: This rule is deprecated and will be removed in a future release. Use
|
||||
joinClass instead.
|
||||
|
||||
=head4 columns
|
||||
|
||||
This rule allows for additional columns to be returned by getResultSet().
|
||||
|
|
@ -344,6 +348,11 @@ placeholders and parameters.
|
|||
sub search {
|
||||
my $self = shift;
|
||||
my $rules = shift;
|
||||
|
||||
# Send the rules through some sanity checks
|
||||
croak "'lineage' rule must be array reference"
|
||||
if ( $rules->{lineage} && ref $rules->{lineage} ne "ARRAY" );
|
||||
|
||||
my @params = ();
|
||||
my $query = "";
|
||||
my @clauses = ();
|
||||
|
|
@ -410,10 +419,31 @@ sub search {
|
|||
if ($rules->{where}) {
|
||||
push(@clauses, $rules->{where});
|
||||
}
|
||||
if ($rules->{join}) { # This join happens in _getQuery
|
||||
$rules->{join} = [$rules->{join}]
|
||||
unless (ref $rules->{join} eq "ARRAY");
|
||||
$self->{_join} = $rules->{join};
|
||||
# deal with custom joined tables if we must
|
||||
if (exists $rules->{joinClass}) {
|
||||
my $join = [ "left join assetData on assetIndex.assetId=assetData.assetId" ];
|
||||
for my $className ( @{ $rules->{ joinClass } } ) {
|
||||
my $cmd = "use " . $className;
|
||||
eval { $cmd };
|
||||
$self->session->errorHandler->fatal("Couldn't compile asset package: ".$className.". Root cause: ".$@) if ($@);
|
||||
foreach my $definition (@{$className->definition($self->session)}) {
|
||||
unless ($definition->{tableName} eq "asset") {
|
||||
my $tableName = $definition->{tableName};
|
||||
push @$join,
|
||||
"left join $tableName on assetData.assetId=".$tableName.".assetId and assetData.revisionDate=".$tableName.".revisionDate";
|
||||
}
|
||||
last;
|
||||
}
|
||||
}
|
||||
# Get only the latest revision
|
||||
push @clauses, "assetData.revisionDate = (SELECT MAX(revisionDate) FROM assetData ad WHERE ad.assetId = assetData.assetId)";
|
||||
# Join happens in _getQuery
|
||||
$self->{_join} = $join;
|
||||
}
|
||||
elsif ($rules->{join}) { # This join happens in _getQuery
|
||||
$rules->{join} = [$rules->{join}]
|
||||
unless (ref $rules->{join} eq "ARRAY");
|
||||
$self->{_join} = $rules->{join};
|
||||
}
|
||||
if ($rules->{columns}) {
|
||||
$rules->{columns} = [$rules->{columns}]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ package WebGUI::Storage;
|
|||
=cut
|
||||
|
||||
use Archive::Tar;
|
||||
use Carp qw( croak );
|
||||
use Cwd;
|
||||
use File::Copy qw(cp);
|
||||
use FileHandle;
|
||||
use File::Find;
|
||||
|
|
@ -24,7 +26,6 @@ use Storable qw(nstore retrieve);
|
|||
use strict;
|
||||
use warnings;
|
||||
use WebGUI::Utility;
|
||||
use Carp;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -64,6 +65,7 @@ This package provides a mechanism for storing and retrieving files that are not
|
|||
$newstore = $store->untar($filename);
|
||||
|
||||
|
||||
$store->copyFile($filename, $newFilename);
|
||||
$store->delete;
|
||||
$store->deleteFile($filename);
|
||||
$store->rename($filename, $newFilename);
|
||||
|
|
@ -202,6 +204,7 @@ sub addFileFromFormPost {
|
|||
my $filename;
|
||||
my $attachmentCount = 1;
|
||||
foreach my $upload ($self->session->request->upload($formVariableName)) {
|
||||
$self->session->errorHandler->info("Trying to get " . $upload->filename);
|
||||
return $filename if $attachmentCount > $attachmentLimit;
|
||||
my $tempFilename = $upload->filename();
|
||||
next unless $tempFilename;
|
||||
|
|
@ -225,6 +228,7 @@ sub addFileFromFormPost {
|
|||
print $file $buffer;
|
||||
}
|
||||
close($file);
|
||||
$self->session->errorHandler->info("Got ".$upload->filename);
|
||||
} else {
|
||||
$self->_addError("Couldn't open file ".$self->getPath($filename)." for writing due to error: ".$!);
|
||||
return;
|
||||
|
|
@ -343,6 +347,31 @@ sub copy {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 copyFile ( filename, newFilename )
|
||||
|
||||
Copy a file in this storage location. C<filename> is the file to copy.
|
||||
C<newFilename> is the new file to create.
|
||||
|
||||
=cut
|
||||
|
||||
sub copyFile {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $newFilename = shift;
|
||||
|
||||
croak "Can't find '$filename' in storage location " . $self->getId
|
||||
unless -e $self->getPath($filename);
|
||||
croak "Second argument must be a filename"
|
||||
unless $newFilename;
|
||||
|
||||
cp( $self->getPath($filename), $self->getPath($newFilename) )
|
||||
|| croak "Couldn't copy '$filename' to '$newFilename': $!";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 create ( session )
|
||||
|
||||
Creates a new storage location on the file system.
|
||||
|
|
@ -354,9 +383,9 @@ A reference to the current session;
|
|||
=cut
|
||||
|
||||
sub create {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $id = $session->id->generate();
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $id = $session->id->generate();
|
||||
|
||||
#Determine whether or not to use case insensitive files
|
||||
my $config = $session->config;
|
||||
|
|
@ -365,14 +394,16 @@ sub create {
|
|||
|
||||
#$session->errorHandler->warn($caseInsensitive.": $id\n".Carp::longmess()."\n");
|
||||
#For case insensitive operating systems, convert guid to hex
|
||||
if($caseInsensitive) {
|
||||
if ($caseInsensitive) {
|
||||
my $hexId = $session->id->toHex($id);
|
||||
$db->write("insert into storageTranslation (guidValue,hexValue) values (?,?)",[$id,$hexId]);
|
||||
}
|
||||
|
||||
my $self = $class->get($session,$id);
|
||||
$self->_makePath;
|
||||
return $self;
|
||||
$self->_makePath;
|
||||
|
||||
$session->errorHandler->info("Created storage location $id as a $class");
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -446,6 +477,7 @@ sub delete {
|
|||
$db->write("delete from storageTranslation where guidValue=?",[$self->getId]);
|
||||
}
|
||||
}
|
||||
$self->session->errorHandler->info("Deleted storage ".$self->getId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -753,6 +785,8 @@ Returns a full path to this storage location.
|
|||
|
||||
If specified, we'll return a path to the file rather than the storage location.
|
||||
|
||||
NOTE: Does not check if the file exists. This is a feature.
|
||||
|
||||
=cut
|
||||
|
||||
sub getPath {
|
||||
|
|
@ -898,21 +932,22 @@ Pass in a storage location object to create the tar file in, instead of having a
|
|||
=cut
|
||||
|
||||
sub tar {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $temp = shift || WebGUI::Storage->createTemp($self->session);
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $temp = shift || WebGUI::Storage->createTemp($self->session);
|
||||
chdir $self->getPath or croak 'Unable to chdir to ' . $self->getPath . ": $!";
|
||||
my @files = ();
|
||||
find(sub { push(@files, $File::Find::name)}, ".");
|
||||
if ($Archive::Tar::VERSION eq '0.072') {
|
||||
my $tar = Archive::Tar->new();
|
||||
$tar->add_files(@files);
|
||||
$tar->write($temp->getPath($filename),1);
|
||||
|
||||
} else {
|
||||
Archive::Tar->create_archive($temp->getPath($filename),1,@files);
|
||||
}
|
||||
return $temp;
|
||||
my @files = ();
|
||||
find(sub { push(@files, $File::Find::name)}, ".");
|
||||
if ($Archive::Tar::VERSION eq '0.072') {
|
||||
my $tar = Archive::Tar->new();
|
||||
$tar->add_files(@files);
|
||||
$tar->write($temp->getPath($filename),1);
|
||||
|
||||
}
|
||||
else {
|
||||
Archive::Tar->create_archive($temp->getPath($filename),1,@files);
|
||||
}
|
||||
return $temp;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -932,12 +967,17 @@ Pass in a storage location object to extract the contents to, instead of having
|
|||
=cut
|
||||
|
||||
sub untar {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $temp = shift || WebGUI::Storage->createTemp($self->session);
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $temp = shift || WebGUI::Storage->createTemp($self->session);
|
||||
|
||||
my $originalDir = cwd;
|
||||
chdir $temp->getPath;
|
||||
|
||||
Archive::Tar->extract_archive($self->getPath($filename),1);
|
||||
$self->_addError(Archive::Tar->error) if (Archive::Tar->error);
|
||||
|
||||
chdir $originalDir;
|
||||
return $temp;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@ use WebGUI::Storage::Image;
|
|||
|
||||
These methods are available from this class:
|
||||
|
||||
my $boolean = $self->generateThumbnail($filename);
|
||||
my $url = $self->getThumbnailUrl($filename);
|
||||
my $boolean = $self->isImage($filename);
|
||||
my ($captchaFile, $challenge) = $self->addFileFromCaptcha;
|
||||
$self->resize($imageFile, $width, $height);
|
||||
my $boolean = $self->generateThumbnail($filename);
|
||||
my $url = $self->getThumbnailUrl($filename);
|
||||
my $boolean = $self->isImage($filename);
|
||||
my ($captchaFile, $challenge) = $self->addFileFromCaptcha;
|
||||
$self->resize($imageFile, $width, $height);
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ sub getThumbnailUrl {
|
|||
return '';
|
||||
}
|
||||
if (! isIn($filename, @{ $self->getFiles() })) {
|
||||
$self->session->errorHandler->error("Can't make a thumbnail for a file that is not in my storage location.");
|
||||
$self->session->errorHandler->error("Can't make a thumbnail for a file named '$filename' that is not in my storage location.");
|
||||
return '';
|
||||
}
|
||||
return $self->getUrl("thumb-".$filename);
|
||||
|
|
@ -360,41 +360,42 @@ The new height of the image in pixels.
|
|||
=cut
|
||||
|
||||
sub resize {
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $width = shift;
|
||||
my $height = shift;
|
||||
unless (defined $filename) {
|
||||
$self->session->errorHandler->error("Can't resize when you haven't specified a file.");
|
||||
return 0;
|
||||
}
|
||||
unless ($self->isImage($filename)) {
|
||||
$self->session->errorHandler->error("Can't resize something that's not an image.");
|
||||
return 0;
|
||||
}
|
||||
unless ($width || $height) {
|
||||
$self->session->errorHandler->error("Can't resize with no resizing parameters.");
|
||||
return 0;
|
||||
}
|
||||
my $image = $graphicsPackage->new;
|
||||
my $error = $image->Read($self->getPath($filename));
|
||||
if ($error) {
|
||||
$self->session->errorHandler->error("Couldn't read image for resizing: ".$error);
|
||||
return 0;
|
||||
}
|
||||
my ($x, $y) = $image->Get('width','height');
|
||||
if ($width && !$height) { # proportional scale by width
|
||||
$height = $width / $x * $y;
|
||||
} elsif (!$width && $height) { # proportional scale by height
|
||||
$width = $height * $x / $y;
|
||||
}
|
||||
$image->Scale(width=>$width, height=>$height);
|
||||
$error = $image->Write($self->getPath($filename));
|
||||
if ($error) {
|
||||
$self->session->errorHandler->error("Couldn't create thumbnail: ".$error);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $width = shift;
|
||||
my $height = shift;
|
||||
unless (defined $filename) {
|
||||
$self->session->errorHandler->error("Can't resize when you haven't specified a file.");
|
||||
return 0;
|
||||
}
|
||||
unless ($self->isImage($filename)) {
|
||||
$self->session->errorHandler->error("Can't resize something that's not an image.");
|
||||
return 0;
|
||||
}
|
||||
unless ($width || $height) {
|
||||
$self->session->errorHandler->error("Can't resize with no resizing parameters.");
|
||||
return 0;
|
||||
}
|
||||
my $image = $graphicsPackage->new;
|
||||
my $error = $image->Read($self->getPath($filename));
|
||||
if ($error) {
|
||||
$self->session->errorHandler->error("Couldn't read image for resizing: ".$error);
|
||||
return 0;
|
||||
}
|
||||
my $geometry;
|
||||
if (!$width || !$height) {
|
||||
$geometry = $width || $height;
|
||||
}
|
||||
else {
|
||||
$geometry = $width . "x" . $height;
|
||||
}
|
||||
$image->Resize( geometry => $geometry, filter => "lanczos" );
|
||||
$error = $image->Write($self->getPath($filename));
|
||||
if ($error) {
|
||||
$self->session->errorHandler->error("Couldn't resize image: ".$error);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
558
lib/WebGUI/i18n/English/Asset_Gallery.pm
Normal file
558
lib/WebGUI/i18n/English/Asset_Gallery.pm
Normal file
|
|
@ -0,0 +1,558 @@
|
|||
package WebGUI::i18n::English::Asset_Gallery;
|
||||
|
||||
our $I18N = {
|
||||
'assetName' => {
|
||||
message => 'Gallery',
|
||||
lastUpdated => 1131394072,
|
||||
},
|
||||
"groupIdAddComment label" => {
|
||||
message => "Group to Add Comments",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"groupIdAddComment description" => {
|
||||
message => "The group that is allowed to add comments to files.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"groupIdAddFile label" => {
|
||||
message => "Group to Add Files",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"groupIdAddFile description" => {
|
||||
message => "The group that is allowed to add files and albums to this gallery",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"groupIdModerator label" => {
|
||||
message => "Group to Moderate Comments",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"groupIdModerator description" => {
|
||||
message => "The group that is allowed to edit / delete comments in this gallery",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageResolutions label" => {
|
||||
message => "Image Resolutions",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageResolutions description" => {
|
||||
message => "The sizes of images available for download.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageViewSize label" => {
|
||||
message => "Image View Size",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageViewSize description" => {
|
||||
message => "The size for images in the gallery. Will default to the Image Size
|
||||
in the site settings.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageThumbnailSize label" => {
|
||||
message => "Image Thumbnail Size",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"imageThumbnailSize description" => {
|
||||
message => "The size for thumbnails of images in the gallery. Will default to the
|
||||
Thumbnail Size in the site settings.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"maxSpacePerUser label" => {
|
||||
message => "Max Disk Space Per User",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"maxSpacePerUser description" => {
|
||||
message => "The maximum amount of disk space a user is allowed to use in this Gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"richEditIdFileComment label" => {
|
||||
message => "Rich Editor for Comments",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"richEditIdFileComment description" => {
|
||||
message => "The Rich Text Editor to use for comments",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
'search class galleryalbum' => {
|
||||
message => 'Album',
|
||||
lastUpdated => 0,
|
||||
context => 'Asset name for WebGUI::Asset::Wobject::GalleryAlbum',
|
||||
},
|
||||
'search class any' => {
|
||||
message => 'Any',
|
||||
lastUpdated => 0,
|
||||
context => 'Label to not restrict gallery search by class',
|
||||
},
|
||||
'search class photo' => {
|
||||
message => "Photo",
|
||||
lastUpdated => 0,
|
||||
context => 'Asset name for WebGUI::Asset::File::Image::Photo class',
|
||||
},
|
||||
"search submit" => {
|
||||
message => "Search",
|
||||
lastUpdated => 0,
|
||||
context => 'Label for button to submit search form',
|
||||
},
|
||||
"templateIdAddArchive label" => {
|
||||
message => "Template to Add Multiple",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdAddArchive description" => {
|
||||
message => "Display the form to add an archive of files to the gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdDeleteAlbum label" => {
|
||||
message => "Template to Delete Albums",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdDeleteAlbum description" => {
|
||||
message => "Display the confirmation to delete an album from the gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdDeleteFile label" => {
|
||||
message => "Template to Delete Files",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdDeleteFile description" => {
|
||||
message => "Display the confirmation to delete a file from the gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdEditAlbum label" => {
|
||||
message => "Template to Edit Albums",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdEditAlbum description" => {
|
||||
message => "The template to add / edit an album.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdEditFile label" => {
|
||||
message => "Template to Edit Files",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdEditFile description" => {
|
||||
message => "The template to add / edit a file.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListAlbums label" => {
|
||||
message => "Template to List Albums",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListAlbums description" => {
|
||||
message => "Template to show a list of albums in the gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListAlbumsRss label" => {
|
||||
message => "Template to List Albums RSS",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListAlbumsRss description" => {
|
||||
message => "Template to show an RSS feed of the albums in this gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdMakeShortcut label" => {
|
||||
message => "Template to Cross Post Files",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdMakeShortcut description" => {
|
||||
message => "Display the form to copy an image to another album.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdSearch label" => {
|
||||
message => "Template to Search",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdSearch description" => {
|
||||
message => "Display the form to search the gallery. Display search results.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewSlideshow label" => {
|
||||
message => "Template for Slideshow",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewSlideshow description" => {
|
||||
message => "Display all the images in an album as a slideshow.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewThumbnails label" => {
|
||||
message => "Template for Thumbnails",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewThumbnails description" => {
|
||||
message => "Display all the images in an album as their thumbnails",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListFilesForUser label" => {
|
||||
message => "Template to List Files for User",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListFilesForUser description" => {
|
||||
message => "Display all the files and albums for a specific user.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListFilesForUserRss label" => {
|
||||
message => "Template to List Files for User RSS",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdListFilesForUserRss description" => {
|
||||
message => "RSS feed for all the files for a specific user.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewAlbum label" => {
|
||||
message => "Template to View Album",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewAlbum description" => {
|
||||
message => "Default view for albums",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewAlbumRss label" => {
|
||||
message => "Template to View Album RSS",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewAlbumRss description" => {
|
||||
message => "RSS feed for a single album",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewFile label" => {
|
||||
message => "Template to View a File",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"templateIdViewFile description" => {
|
||||
message => "Show the details and comments for a specific file",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewDefault label" => {
|
||||
message => "Default View",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewDefault description" => {
|
||||
message => "Select the default view when a user enters the gallery.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewDefault option list" => {
|
||||
message => "List Albums",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewDefault option album" => {
|
||||
message => "Single Album",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewAlbumAssetId label" => {
|
||||
message => "Default View Album",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewAlbumAssetId description" => {
|
||||
message => "The album to view when the default view is 'Album'",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderBy label" => {
|
||||
message => "List Albums Order By",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderBy description" => {
|
||||
message => "The field to order the album list by",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderBy option creationDate" => {
|
||||
message => "Creation Date",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderBy option lineage" => {
|
||||
message => "Sequence Number",
|
||||
lastUpdated => 0,
|
||||
context => 'Label to order by sequence (as in asset manager)',
|
||||
},
|
||||
"viewListOrderBy option revisionDate" => {
|
||||
message => "Revision Date",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderBy option title" => {
|
||||
message => "Title",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderDirection label" => {
|
||||
message => "List Albums Direction",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderDirection description" => {
|
||||
message => "The direction to order the album list",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"viewListOrderDirection option asc" => {
|
||||
message => "Ascending",
|
||||
lastUpdated => 0,
|
||||
context => 'Label for sorting in ascending order',
|
||||
},
|
||||
"viewListOrderDirection option desc" => {
|
||||
message => "Descending",
|
||||
lastUpdated => 0,
|
||||
context => 'Label for sorting in descending order',
|
||||
},
|
||||
"workflowIdCommit label" => {
|
||||
message => "Approval Workflow",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
"workflowIdCommit description" => {
|
||||
message => "Workflow to approve new Files.",
|
||||
lastUpdated => 0,
|
||||
context => '',
|
||||
},
|
||||
|
||||
'helpvar searchForm_start' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_end' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_basicSearch' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_description' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_keywords' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_className' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_creationDate_after' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_creationDate_before' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar searchForm_submit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_addAlbum' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listAlbums' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listAlbumsRss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listFilesForCurrentUser' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_search' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canEdit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canAddFile' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar albums' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar albums rss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar rssDate' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar search_results' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar user_albums' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar user_files' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar userId' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_rss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar username' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help searchForm title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help searchForm body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listAlbums title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listAlbums body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listAlbumsRss title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help search body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help search title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listFilesForUser title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listFilesForUser body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listFilesForUserRss title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help listFilesForUserRss body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
299
lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm
Normal file
299
lib/WebGUI/i18n/English/Asset_GalleryAlbum.pm
Normal file
|
|
@ -0,0 +1,299 @@
|
|||
package WebGUI::i18n::English::Asset_GalleryAlbum;
|
||||
|
||||
our $I18N = {
|
||||
'addArchive message' => {
|
||||
message => 'Your files have been submitted for approval and commit. <a href="%s">Return to Album</a>',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'assetName' => {
|
||||
message => 'Gallery Album',
|
||||
lastUpdated => 1131394072,
|
||||
},
|
||||
'cancel' => {
|
||||
message => "Cancel",
|
||||
lastUpdated => 0,
|
||||
context => "Label for Cancel button",
|
||||
},
|
||||
'save' => {
|
||||
message => "Save",
|
||||
lastUpdated => 0,
|
||||
context => "Label for Save button",
|
||||
},
|
||||
'save message' => {
|
||||
message => 'Album settings saved. <a href="%s">Return to Album</a>',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help fileLoop title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help fileLoop body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help view title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help view body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help slideshow title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help slideshow body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help thumbnails title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help thumbnails body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help addArchive title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help addArchive body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help delete title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help delete body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help edit title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help viewRss title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help viewRss body' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canAddFile' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canEdit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listAlbums' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listAlbumsRss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listFilesForCurrentUser' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_search' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_addArchive' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_addPhoto' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_addNoClass' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_delete' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_edit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listFilesForOwner' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_viewRss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_slideshow' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_thumbnails' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar fileCount' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar ownerUsername' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar thumbnailUrl' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar file_loop' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar file_*' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_start' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_end' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_submit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_archive' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_keywords' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_friendsOnly' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_yes' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_start' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_end' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_cancel' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_submit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_description' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar file_loop edit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar isAlbumThumbnail' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar file_loop viewRss' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar rssDate' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
291
lib/WebGUI/i18n/English/Asset_Photo.pm
Normal file
291
lib/WebGUI/i18n/English/Asset_Photo.pm
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
package WebGUI::i18n::English::Asset_Photo;
|
||||
|
||||
our $I18N = {
|
||||
'assetName' => {
|
||||
message => q{Photo},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'delete message' => {
|
||||
message => q{The photo has been deleted. <a href="%s">Return to Album</a>},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'save message' => {
|
||||
message => q{Your photo has been submitted for approval and commit. <a href="%s">View Photo</a>. <a href="%s">Add another photo</a>.},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help commentForm title' => {
|
||||
message => 'Photo -- Comment Form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help commentForm body' => {
|
||||
message => 'These template variables make up the form to allow users to post comments on Photos',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common title' => {
|
||||
message => 'Photo -- Common',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help common body' => {
|
||||
message => 'These template variables are shared by all views of the Photo asset.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help edit title' => {
|
||||
message => 'Photo -- Edit Form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help edit body' => {
|
||||
message => 'These template variables make up the form to add / edit Photo assets',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help makeShortcut title' => {
|
||||
message => 'Photo -- Make Shortcut Form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help makeShortcut body' => {
|
||||
message => 'These template variables make up the form to cross-post Photo assets',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help view title' => {
|
||||
message => 'Photo -- Normal View',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'help view body' => {
|
||||
message => 'These template variables make up the normal view of Photo assets',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentForm_start' => {
|
||||
message => 'Begin the comment form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentForm_end' => {
|
||||
message => 'End the comment form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentForm_bodyText' => {
|
||||
message => 'The body of the comment. A rich editor as configured by the parent Gallery.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentForm_submit' => {
|
||||
message => 'Submit the comment form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canComment' => {
|
||||
message => 'This is true if the current user can comment on this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar canEdit' => {
|
||||
message => 'This is true if the current user can edit this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar fileUrl' => {
|
||||
message => 'The URL to the normal-sized photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar numberOfComments' => {
|
||||
message => 'The total number of comments on this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar ownerUsername' => {
|
||||
message => 'The username of the user who posted this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar thumbnailUrl' => {
|
||||
message => 'The URL to the thumbnail of this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_delete' => {
|
||||
message => 'The URL to delete this photo.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_demote' => {
|
||||
message => 'The URL to demote this photo in rank. Will return the user directly to the parent GalleryAlbum edit form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_edit' => {
|
||||
message => 'The URL to edit this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_gallery' => {
|
||||
message => 'The URL to the Gallery that contains this photo.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_makeShortcut' => {
|
||||
message => 'The URL to make a shortcut to this photo.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_listFilesForOwner' => {
|
||||
message => 'The URL to list files and albums posted by the owner of this photo',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_promote' => {
|
||||
message => 'The URL to promote this photo in rank. Will return the user directly to the parent GalleryAlbum edit form',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar resolutions_loop' => {
|
||||
message => 'The available resolutions this photo has for download.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar resolutions_loop url_download' => {
|
||||
message => 'The URL to the resolution to download.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar exif_*' => {
|
||||
message => 'Each EXIF tag can be referenced by name.',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar exifLoop' => {
|
||||
message => 'A loop of EXIF tags',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar exifLoop tag' => {
|
||||
message => 'The name of the EXIF tag',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar exifLoop value' => {
|
||||
message => 'The value of the EXIF tag',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_addArchive' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_start' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_end' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_submit' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_title' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_synopsis' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_photo' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_keywords' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_location' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_friendsOnly' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_start' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_end' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar form_parentId' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop userId' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop visitorIp' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop creationDate' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop bodyText' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop username' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar commentLoop_pageBar' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'helpvar url_yes' => {
|
||||
message => '',
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue