Fixing stuff
This commit is contained in:
parent
38c78e3c62
commit
684f08649d
27 changed files with 672 additions and 414 deletions
|
|
@ -39,7 +39,6 @@ containing related items. An asset setting will set the launch point of the arc
|
|||
|
||||
use WebGUI::Asset::ZipArchive;
|
||||
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
|
@ -48,36 +47,37 @@ These methods are available from this class:
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub unzip {
|
||||
my $self = shift;
|
||||
my $storage = $_[0];
|
||||
my $filename = $_[1];
|
||||
my $self = shift;
|
||||
my $storage = shift;
|
||||
my $filename = shift;
|
||||
|
||||
my $filepath = $storage->getPath();
|
||||
chdir $filepath;
|
||||
my $filepath = $storage->getPath();
|
||||
chdir $filepath;
|
||||
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_ZipArchive");
|
||||
if($filename =~ m/\.zip/i){
|
||||
my $zip = Archive::Zip->new();
|
||||
unless ($zip->read($filename) == $zip->AZ_OK){
|
||||
$self->session->errorHandler->warn($i18n->get("zip_error"));
|
||||
return 0;
|
||||
}
|
||||
$zip->extractTree();
|
||||
} elsif($filename =~ m/\.tar/i){
|
||||
Archive::Tar->extract_archive($filepath.'/'.$filename,1);
|
||||
if (Archive::Tar->error){
|
||||
$self->session->errorHandler->warn(Archive::Tar->error);
|
||||
return 0;
|
||||
}
|
||||
} else{
|
||||
$self->session->errorHandler->warn($i18n->get("bad_archive"));
|
||||
}
|
||||
|
||||
return 1;
|
||||
if ($filename =~ m/\.zip/i) {
|
||||
my $zip = Archive::Zip->new();
|
||||
unless ($zip->read($filename) == $zip->AZ_OK){
|
||||
$self->session->errorHandler->warn($i18n->get("zip_error"));
|
||||
return 0;
|
||||
}
|
||||
$zip->extractTree();
|
||||
} elsif ($filename =~ m/\.tar/i) {
|
||||
Archive::Tar->extract_archive($filepath.'/'.$filename,1);
|
||||
if (Archive::Tar->error) {
|
||||
$self->session->errorHandler->warn(Archive::Tar->error);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$self->session->errorHandler->warn($i18n->get("bad_archive"));
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 addRevision
|
||||
|
||||
=head2 addRevision ( )
|
||||
|
||||
This method exists for demonstration purposes only. The superclass
|
||||
handles revisions to ZipArchive Assets.
|
||||
|
|
@ -91,6 +91,7 @@ sub addRevision {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( definition )
|
||||
|
||||
Defines the properties of this asset.
|
||||
|
|
@ -102,32 +103,33 @@ A hash reference passed in from a subclass definition.
|
|||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_ZipArchive");
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
tableName=>'ZipArchiveAsset',
|
||||
icon=>'ziparchive.gif',
|
||||
className=>'WebGUI::Asset::File::ZipArchive',
|
||||
properties=>{
|
||||
showPage=>{
|
||||
fieldType=>'text',
|
||||
defaultValue=>'index.html'
|
||||
},
|
||||
templateId=>{
|
||||
fieldType=>'template',
|
||||
defaultValue=>''
|
||||
},
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
push(@{$definition}, {
|
||||
assetName=>$i18n->get('assetName'),
|
||||
tableName=>'ZipArchiveAsset',
|
||||
icon=>'ziparchive.gif',
|
||||
className=>'WebGUI::Asset::File::ZipArchive',
|
||||
properties=>{
|
||||
showPage=>{
|
||||
fieldType=>'text',
|
||||
defaultValue=>'index.html'
|
||||
},
|
||||
templateId=>{
|
||||
fieldType=>'template',
|
||||
defaultValue=>''
|
||||
},
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 duplicate
|
||||
|
||||
=head2 duplicate ( )
|
||||
|
||||
This method exists for demonstration purposes only. The superclass
|
||||
handles duplicating ZipArchive Assets. This method will be called
|
||||
|
|
@ -143,31 +145,31 @@ sub duplicate {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getEditForm ()
|
||||
|
||||
=head2 getEditForm ( )
|
||||
|
||||
Returns the TabForm object that will be used in generating the edit page for this asset.
|
||||
|
||||
=cut
|
||||
|
||||
sub getEditForm {
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $self = shift;
|
||||
my $tabform = $self->SUPER::getEditForm();
|
||||
my $i18n = WebGUI::International->new($self->session,"Asset_ZipArchive");
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue("templateId"),
|
||||
-label=>$i18n->get('template label'),
|
||||
-namespace=>"ZipArchiveAsset"
|
||||
);
|
||||
$tabform->getTab("properties")->text (
|
||||
-name=>"showPage",
|
||||
-label=>$i18n->get('show page'),
|
||||
-value=>$self->getValue("showPage"),
|
||||
-hoverHelp=>$i18n->get('show page description'),
|
||||
);
|
||||
return $tabform;
|
||||
$tabform->getTab("display")->template(
|
||||
-value=>$self->getValue("templateId"),
|
||||
-label=>$i18n->get('template label'),
|
||||
-namespace=>"ZipArchiveAsset"
|
||||
);
|
||||
$tabform->getTab("properties")->text (
|
||||
-name=>"showPage",
|
||||
-label=>$i18n->get('show page'),
|
||||
-value=>$self->getValue("showPage"),
|
||||
-hoverHelp=>$i18n->get('show page description'),
|
||||
);
|
||||
return $tabform;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 prepareView ( )
|
||||
|
|
@ -186,6 +188,7 @@ sub prepareView {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processPropertiesFromFormPost ( )
|
||||
|
||||
Used to process properties from the form posted. In this asset, we use
|
||||
|
|
@ -203,30 +206,31 @@ sub processPropertiesFromFormPost {
|
|||
|
||||
#return unless $file;
|
||||
my $i18n = WebGUI::International->new($self->session, 'Asset_ZipArchive');
|
||||
unless($self->session->form->process("showPage")) {
|
||||
$storage->delete;
|
||||
$self->session->db->write("update FileAsset set filename=NULL where assetId=".$self->session->db->quote($self->getId));
|
||||
$self->session->scratch->set("za_error",$i18n->get("za_show_error"));
|
||||
return;
|
||||
unless ($self->session->form->process("showPage")) {
|
||||
$storage->delete;
|
||||
$self->session->db->write("update FileAsset set filename=NULL where assetId=".$self->session->db->quote($self->getId));
|
||||
$self->session->scratch->set("za_error",$i18n->get("za_show_error"));
|
||||
return;
|
||||
}
|
||||
|
||||
unless($file =~ m/\.tar/i || $file =~ m/\.zip/i) {
|
||||
$storage->delete;
|
||||
$self->session->db->write("update FileAsset set filename=NULL where assetId=".$self->session->db->quote($self->getId));
|
||||
$self->session->scratch->set("za_error",$i18n->get("za_error"));
|
||||
return;
|
||||
unless ($file =~ m/\.tar/i || $file =~ m/\.zip/i) {
|
||||
$storage->delete;
|
||||
$self->session->db->write("update FileAsset set filename=NULL where assetId=".$self->session->db->quote($self->getId));
|
||||
$self->session->scratch->set("za_error",$i18n->get("za_error"));
|
||||
return;
|
||||
}
|
||||
|
||||
unless ($self->unzip($storage,$self->get("filename"))) {
|
||||
$self->session->errorHandler->warn($i18n->get("unzip_error"));
|
||||
$self->session->errorHandler->warn($i18n->get("unzip_error"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the container www_view method. In this asset, this is
|
||||
Method called by the container www_view method. In this asset, this is
|
||||
used to show the file to administrators.
|
||||
|
||||
=cut
|
||||
|
|
@ -261,6 +265,7 @@ sub view {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_edit ( )
|
||||
|
||||
Web facing method which is the default edit page
|
||||
|
|
@ -277,6 +282,7 @@ sub www_edit {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view ( )
|
||||
|
||||
Web facing method which is the default view page. This method does a
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use WebGUI::International;
|
|||
use WebGUI::Paginator;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Asset::Wobject;
|
||||
use Data::Dumper;
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition
|
||||
|
||||
defines wobject properties for MultiSearch instances
|
||||
|
|
@ -98,7 +99,7 @@ sub prepareView {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
=head2 purgeCache ( )
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
|
|
@ -111,6 +112,7 @@ sub purgeCache {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the www_view method. Returns a processed template
|
||||
|
|
@ -139,10 +141,9 @@ sub view {
|
|||
return $out;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view ()
|
||||
=head2 www_view ( )
|
||||
|
||||
See WebGUI::Asset::Wobject::www_view() for details.
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@ use Tie::IxHash;
|
|||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Asset::Wobject::SQLForm
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# This hash contains the allowed database field types. Keys indicate the MySQL name of the field type and
|
||||
# the values are the the way they are showed in the form.
|
||||
|
|
@ -476,9 +482,15 @@ my $typeFunctions = {
|
|||
list => 'switchListField',
|
||||
};
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _canAlterTable
|
||||
|
||||
=head2 _canAlterTable ( )
|
||||
|
||||
Returns a boolean indicating whether the user is allowed to change (alter) the table structure. Ie. manage field etc.
|
||||
|
||||
|
|
@ -491,7 +503,8 @@ sub _canAlterTable {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _canEditRecord
|
||||
|
||||
=head2 _canEditRecord ( )
|
||||
|
||||
Returns a boolean indicating whether the user is allowed to edit, delete and restore records.
|
||||
|
||||
|
|
@ -504,7 +517,8 @@ sub _canEditRecord {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _canPurge
|
||||
|
||||
=head2 _canPurge ( )
|
||||
|
||||
Returns a boolean indictating whether the user is allowed to purge deleted records.
|
||||
|
||||
|
|
@ -517,11 +531,12 @@ sub _canPurge {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _constructColumnType ( fieldProperties )
|
||||
|
||||
=head2 _constructColumnType ( fieldProperties )
|
||||
|
||||
Will construct a MySQL column definition string from the field properties passed as argument.
|
||||
|
||||
=head2 fieldProperties
|
||||
=head3 fieldProperties
|
||||
|
||||
A hashref containing the properties of the field for which this column definition is made. Properties
|
||||
taken into account are:
|
||||
|
|
@ -562,15 +577,16 @@ sub _constructColumnType {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _createFieldType ( dbFieldType, formFieldType )
|
||||
|
||||
=head2 _createFieldType ( dbFieldType, formFieldType )
|
||||
|
||||
Inserts a new field type into the SQLForm_fieldTypes table.
|
||||
|
||||
=head2 dbFieldType
|
||||
=head3 dbFieldType
|
||||
|
||||
The column type connected to this field type.
|
||||
|
||||
=head2 formFieldType
|
||||
=head3 formFieldType
|
||||
|
||||
The form element to be used for this field type.
|
||||
|
||||
|
|
@ -590,7 +606,8 @@ sub _createFieldType {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getDbLink
|
||||
|
||||
=head2 _getDbLink ( )
|
||||
|
||||
Returns a WebGUI::DatabaseLink object for the database the SQLForm table is in.
|
||||
|
||||
|
|
@ -603,11 +620,12 @@ sub _getDbLink {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getFieldProperties ( fieldId )
|
||||
|
||||
=head2 _getFieldProperties ( fieldId )
|
||||
|
||||
Returns a hashref containing the properties of the field indicated by fieldId.
|
||||
|
||||
=head2 fieldId
|
||||
=head3 fieldId
|
||||
|
||||
The id of the field of which the properties should be returned.
|
||||
|
||||
|
|
@ -665,7 +683,8 @@ my $sth = $dbLink->db->unconditionalRead($definition{sqlQuery}." order by ".$de
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getDatabaseInfo
|
||||
|
||||
=head2 _getDatabaseInfo ( )
|
||||
|
||||
Returns a hashref containing all tables and columns including column properties in the database in which the SQLForm
|
||||
resides.
|
||||
|
|
@ -702,7 +721,8 @@ sub _getDatabaseInfo {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getManagementLinks
|
||||
|
||||
=head2 _getManagementLinks ( )
|
||||
|
||||
Returns a string containg all of the management function the user is allowed to use.
|
||||
|
||||
|
|
@ -724,16 +744,17 @@ sub _getManagementLinks {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _matchField ( string, regexId )
|
||||
|
||||
=head2 _matchField ( string, regexId )
|
||||
|
||||
Excutes the regex identified by regexId on the string passed as first argument and return a boolean indicating
|
||||
whether it is a match or not. Will return true if no regex id or a non-existing regex id is passed.
|
||||
|
||||
=head2 string
|
||||
=head3 string
|
||||
|
||||
The string to be matched.
|
||||
|
||||
=head2 regexId
|
||||
=head3 regexId
|
||||
|
||||
The id of the regex to used.
|
||||
|
||||
|
|
@ -758,11 +779,12 @@ sub _matchField {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _resolveFieldConstraintType ( type ) {
|
||||
|
||||
=head2 _resolveFieldConstraintType ( type )
|
||||
|
||||
Translates the numerical value used in field constraint types to a perl operator.
|
||||
|
||||
=head2 type
|
||||
=head3 type
|
||||
|
||||
The numerical id for the operator. If omitted this method will return a hasref containing
|
||||
all numerical <-> operator mappings.
|
||||
|
|
@ -782,7 +804,8 @@ sub _resolveFieldConstraintType {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 definition
|
||||
|
||||
=head2 definition ( )
|
||||
|
||||
The asset definition of the SQLForm.
|
||||
|
||||
|
|
@ -848,7 +871,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 uiLevel
|
||||
|
||||
=head2 uiLevel ( )
|
||||
|
||||
The uiLevel of the SQLForm asset. It is a power tool so the uiLevel is set to 9.
|
||||
|
||||
|
|
@ -859,7 +883,8 @@ sub uiLevel {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getAdminConsoleWithSubmenu
|
||||
|
||||
=head2 getAdminConsoleWithSubmenu ( )
|
||||
|
||||
Return the adminconsole but adds three submenu items for manage fields/field types/regexes.
|
||||
|
||||
|
|
@ -879,7 +904,8 @@ sub getAdminConsoleWithSubmenu {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getEditForm
|
||||
|
||||
=head2 getEditForm ( )
|
||||
|
||||
Creates the edit form of the SQLForm asset.
|
||||
|
||||
|
|
@ -996,7 +1022,8 @@ sub getEditForm {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getIndexerParams
|
||||
|
||||
=head2 getIndexerParams ( )
|
||||
|
||||
Should index the data in the table of this SQLForm. Not functional in 6.8.x due to a crippled
|
||||
search framework.
|
||||
|
|
@ -1044,7 +1071,8 @@ sub getIndexerParams {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getName
|
||||
|
||||
=head2 getName ( )
|
||||
|
||||
Return the internationalized name of the SQLForm.
|
||||
|
||||
|
|
@ -1057,7 +1085,8 @@ sub getName {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 processPropertiesFromFormPost
|
||||
|
||||
=head2 processPropertiesFromFormPost ( )
|
||||
|
||||
Processes the data in the edit form of the SQLForm asset. In WebGUI 6.8.x there's no way to feed back any errors on
|
||||
asset addition. Therefore if something is wrong this method will use die to stop the processing. This will heave the
|
||||
|
|
@ -1171,7 +1200,7 @@ sub processPropertiesFromFormPost {
|
|||
# __recordId and __revision are always unique and hence the pk.
|
||||
my %dropKeys;
|
||||
my $hasPrimaryKey = 0;
|
||||
my $sth = $dbLink->db->read("show keys from $tableName");
|
||||
$sth = $dbLink->db->read("show keys from $tableName");
|
||||
while (my %row = $sth->hash) {
|
||||
if ($row{Key_name} eq 'PRIMARY') {
|
||||
$hasPrimaryKey = 1;
|
||||
|
|
@ -1257,7 +1286,8 @@ my $hasPrimaryKey = 0;
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 purge
|
||||
|
||||
=head2 purge ( )
|
||||
|
||||
This method purges the Asset completely from the WebGUI instance.
|
||||
|
||||
|
|
@ -1273,7 +1303,8 @@ sub purge {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 view
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
The view function of the Asset.
|
||||
|
||||
|
|
@ -1291,7 +1322,8 @@ sub view {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_deleteFieldType
|
||||
|
||||
=head2 www_deleteFieldType ( )
|
||||
|
||||
This will delete the field type with the id that is passed in a form param called 'ftid'.
|
||||
|
||||
|
|
@ -1318,7 +1350,8 @@ sub www_deleteFieldType {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_deleteRecord
|
||||
|
||||
=head2 www_deleteRecord ( )
|
||||
|
||||
Will put the record with the id given by the form param 'rid', in the trash of the SQLForm.
|
||||
|
||||
|
|
@ -1342,7 +1375,8 @@ sub www_deleteRecord {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_deleteRegex
|
||||
|
||||
=head2 www_deleteRegex ( )
|
||||
|
||||
Deletes the regex with the id given in the form param 'regexId'.
|
||||
|
||||
|
|
@ -1363,7 +1397,8 @@ sub www_deleteRegex {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_disableField
|
||||
|
||||
=head2 www_disableField ( )
|
||||
|
||||
Will mark the field indicated by the id given by the form param 'fid' as deleted. This means
|
||||
that the field is not included in searches and edits. No data is actually purged though.
|
||||
|
|
@ -1385,7 +1420,8 @@ sub www_disableField {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_enableField
|
||||
|
||||
=head2 www_enableField ( )
|
||||
|
||||
Will mark the 'deleted' field identified by the id given in the form param 'fid' as normal again.
|
||||
|
||||
|
|
@ -1401,7 +1437,8 @@ sub www_enableField {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editField
|
||||
|
||||
=head2 www_editField ( )
|
||||
|
||||
Returns the 'edit field properties' form of the field attached to the id given in form param 'fid'. If fid is set
|
||||
to 'new' it will add a new field. The form generated relies heavily on three javascript files included in the
|
||||
|
|
@ -1471,7 +1508,7 @@ my %fieldTypes = $self->session->db->buildHash('select fieldTypeId, concat(formF
|
|||
);
|
||||
}
|
||||
|
||||
my $tabForm = WebGUI::TabForm->new($self->session, undef, undef, $self->getUrl('func=listFields'));
|
||||
$tabForm = WebGUI::TabForm->new($self->session, undef, undef, $self->getUrl('func=listFields'));
|
||||
$tabForm->hidden({
|
||||
name => 'func',
|
||||
value => 'editFieldSave'
|
||||
|
|
@ -1756,7 +1793,8 @@ my $js = "<script type=\"text/javascript\">\n";
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editFieldSave
|
||||
|
||||
=head2 www_editFieldSave ( )
|
||||
|
||||
Processes and stores the field properties, and will alter the table according to these properties.
|
||||
|
||||
|
|
@ -2028,7 +2066,8 @@ my $regexName = $self->session->form->process("regex_name") || 'untitled';
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editFieldType
|
||||
|
||||
=head2 www_editFieldType ( )
|
||||
|
||||
Returns the form for editing field types. Only allows editing of field types that are not in use by
|
||||
any SQLForm asset withing the instance. Pass the field type id through the form param 'ftid'. Pass
|
||||
|
|
@ -2104,7 +2143,8 @@ sub www_editFieldType {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editFieldTypeSave
|
||||
|
||||
=head2 www_editFieldTypeSave ( )
|
||||
|
||||
Saves the field type properties entered in the form returned by www_editFieldType to the database. The form
|
||||
param 'ftid' is used to pass the field type id. Setting the id to 'new' will create a new field type.
|
||||
|
|
@ -2127,21 +2167,22 @@ sub www_editFieldTypeSave {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getFieldValue ( field, recordValues, readOnly )
|
||||
|
||||
=head2 _getFieldValue ( field, recordValues, readOnly )
|
||||
|
||||
Returns the the value for the field represented by the field hashref for the current record, If the record
|
||||
has no value for this field it will return the default value. The returned value has the correct data type
|
||||
for the for element that belongs to the field.
|
||||
|
||||
=head2 field
|
||||
=head3 field
|
||||
|
||||
A hashref containing the field properties of this field.
|
||||
|
||||
=head2 recordValues
|
||||
=head3 recordValues
|
||||
|
||||
A hasref containg the values of this record.
|
||||
|
||||
=head2
|
||||
=head3 readOnly
|
||||
|
||||
A boolean indicating the value should be outputted in read only mode.
|
||||
|
||||
|
|
@ -2187,28 +2228,27 @@ sub _getFieldValue {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _getFormElement ( field, recordValues, readOnly )
|
||||
|
||||
=head2 _getFormElement ( field, recordValues, readOnly )
|
||||
|
||||
Returns the for element tied to this field.
|
||||
|
||||
=head2 field
|
||||
=head3 field
|
||||
|
||||
A hashref containing the field properties of this field.
|
||||
|
||||
=head2 recordValues
|
||||
=head3 recordValues
|
||||
|
||||
A hasref containg the values of this record.
|
||||
|
||||
=head2
|
||||
=head3 readOnly
|
||||
|
||||
A boolean indicating the value should be outputted in read only mode.
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub _getFormElement {
|
||||
my ($fieldValue, $readOnly, $fieldParameters, $maxLength, $fieldType, $formElement, $cmd, $i18n);
|
||||
my ($fieldValue, $fieldParameters, $maxLength, $fieldType, $formElement, $cmd, $i18n);
|
||||
my $self = shift;
|
||||
my $field = shift;
|
||||
my $recordValues = shift;
|
||||
|
|
@ -2279,7 +2319,8 @@ sub _getFormElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editRecord
|
||||
|
||||
=head2 www_editRecord ( )
|
||||
|
||||
Generates the record edit form for the record with the id given by the form param 'rid'. Setting rid to 'new' will
|
||||
cause a new record to be added. If the user is not allowed to edit but can view, this method will output in view
|
||||
|
|
@ -2404,7 +2445,8 @@ sub www_editRecord {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editRecordSave
|
||||
|
||||
=head2 www_editRecordSave ( )
|
||||
|
||||
Will process and save the record data inputted in the form generated by www_editRecord. In errors occur they will
|
||||
be fed back to www_editRecord. Set the record id using the form param 'rid', and use 'new' as id to add a new
|
||||
|
|
@ -2608,7 +2650,8 @@ my $cmd = '$result = 0 if ($fieldValueCompare '.$self->_resolveFieldConstrai
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editRegex
|
||||
|
||||
=head2 www_editRegex ( )
|
||||
|
||||
Returns the form for editing regexes. Pass the id of the regex you want to edit in the form param 'regexId'. To
|
||||
add a new regex pass 'new' for the regex id.
|
||||
|
|
@ -2676,7 +2719,8 @@ sub www_editRegex {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_editRegexSave
|
||||
|
||||
=head2 www_editRegexSave ( )
|
||||
|
||||
Saves the regex properties entered in the form generated by www_editRegex to the database. Pass the regex id
|
||||
in the form param 'regexId'. Set the id to 'new' to add a regex.
|
||||
|
|
@ -2710,7 +2754,8 @@ sub www_editRegexSave {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_listFields
|
||||
|
||||
=head2 www_listFields ( )
|
||||
|
||||
Shows the list of fields, including edit and delete buttons.
|
||||
|
||||
|
|
@ -2763,7 +2808,8 @@ sub www_listFields {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_listFieldTypes
|
||||
|
||||
=head2 www_listFieldTypes ( )
|
||||
|
||||
Shows the list of field types.
|
||||
|
||||
|
|
@ -2840,7 +2886,8 @@ my $currentRow = '<tr align="left" bgcolor="#bbbbbb">';
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_listRegexes
|
||||
|
||||
=head2 www_listRegexes ( )
|
||||
|
||||
Displays the list of regexes.
|
||||
|
||||
|
|
@ -2917,7 +2964,8 @@ my $currentRow = '<tr align="left" bgcolor="#bbbbbb">';
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_moveFieldDown
|
||||
|
||||
=head2 www_moveFieldDown ( )
|
||||
|
||||
Moves the field one position to the end in the field ordering. The field id should be passed in the form param 'fid'.
|
||||
|
||||
|
|
@ -2948,7 +2996,8 @@ sub www_moveFieldDown {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_moveFieldUp
|
||||
|
||||
=head2 www_moveFieldUp ( )
|
||||
|
||||
Moves the field one position to the beginning in the field ordering. The field id should be passed in the form param 'fid'.
|
||||
|
||||
|
|
@ -2979,7 +3028,8 @@ sub www_moveFieldUp {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_purgeRecord
|
||||
|
||||
=head2 www_purgeRecord ( )
|
||||
|
||||
Will purge a record from the record trash. The id of the record must be passed in form param 'rid'.
|
||||
|
||||
|
|
@ -3002,11 +3052,13 @@ sub www_purgeRecord {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_purgeTrash
|
||||
|
||||
=head2 www_purgeTrash ( )
|
||||
|
||||
Purges every record that is in the record trash.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_purgeTrash {
|
||||
my $self = shift;
|
||||
|
||||
|
|
@ -3020,7 +3072,8 @@ sub www_purgeTrash {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_viewHistory
|
||||
|
||||
=head2 www_viewHistory ( )
|
||||
|
||||
Shows the history of a record. The record id should be passed through the form param 'rid'.
|
||||
|
||||
|
|
@ -3082,7 +3135,8 @@ sub www_viewHistory {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_viewFile
|
||||
|
||||
=head2 www_viewFile ( )
|
||||
|
||||
Returns the file saved in a file upolad field, and sets the mime-type to the correct value. Pass the record id
|
||||
via form param 'rid' and the field id of the upload field through form param 'fid'. Optionally you can pass the
|
||||
|
|
@ -3126,7 +3180,8 @@ sub www_viewFile {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_restoreRecord
|
||||
|
||||
=head2 www_restoreRecord ( )
|
||||
|
||||
Restores a record in the record trash. Pass the record id through for param 'rid'.
|
||||
|
||||
|
|
@ -3154,7 +3209,8 @@ sub www_restoreRecord {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_search
|
||||
|
||||
=head2 www_search ( )
|
||||
|
||||
Generates the normal search form.
|
||||
|
||||
|
|
@ -3368,7 +3424,8 @@ my $sql = $self->_constructSearchQuery(\@searchIn, \@showFields, \%fieldPropert
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_processAjaxRequest
|
||||
|
||||
=head2 www_processAjaxRequest ( )
|
||||
|
||||
Returns an XML string containing database information, depending on the form params passed. If you pass a database
|
||||
name in form param 'dbName' only, this method will return an XML string containing the tables available within that
|
||||
|
|
@ -3426,15 +3483,16 @@ my @zut;
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _constructSearchForm ( fieldList, fieldProperties )
|
||||
|
||||
=head2 _constructSearchForm ( fieldList, fieldProperties )
|
||||
|
||||
Returns the form for super search.
|
||||
|
||||
=head2 fieldList
|
||||
=head3 fieldList
|
||||
|
||||
Arrayref containing the field that should be included in the search.
|
||||
|
||||
=head2 fieldProperties
|
||||
=head3 fieldProperties
|
||||
|
||||
Hashref containing the properties of the fields that are in the search.
|
||||
|
||||
|
|
@ -3596,19 +3654,20 @@ my $cmd = "WebGUI::Form::$searchElement".'($self->session, $parameters)';
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _constructSearchQuery ( searchInFields, showFields, fieldProperties )
|
||||
|
||||
=head2 _constructSearchQuery ( searchInFields, showFields, fieldProperties )
|
||||
|
||||
Constructs an SQL query from the search query
|
||||
|
||||
=head2 searchInFields
|
||||
=head3 searchInFields
|
||||
|
||||
Arrayref containing the field id's that should be included in the search.
|
||||
|
||||
=head2 showFields
|
||||
=head3 showFields
|
||||
|
||||
List of field id's that should be shown in the results.
|
||||
|
||||
=head2 fieldProperties
|
||||
=head3 fieldProperties
|
||||
|
||||
Hashref containing the properties of the fields that are in the search.
|
||||
|
||||
|
|
@ -3766,19 +3825,20 @@ my $sortAscending = $self->session->form->process("sortAscending");
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 _processSearchQuery ( sth, showFields, fieldProperties )
|
||||
|
||||
=head2 _processSearchQuery ( sth, showFields, fieldProperties )
|
||||
|
||||
Processes the results of a search query and returns an arrayref suitable for use as a template loop.
|
||||
|
||||
=head2 sth
|
||||
=head3 sth
|
||||
|
||||
Statement handle of the executed query.
|
||||
|
||||
=head2 showFields
|
||||
=head3 showFields
|
||||
|
||||
List of field id's that should be shown in the results.
|
||||
|
||||
=head2 fieldProperties
|
||||
=head3 fieldProperties
|
||||
|
||||
Hashref containing the properties of the fields that are in the search.
|
||||
|
||||
|
|
@ -3862,7 +3922,8 @@ my $value;
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 www_superSearch
|
||||
|
||||
=head2 www_superSearch
|
||||
|
||||
Returns the super search.
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use Finance::Quote;
|
|||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _appendStockVars ( hash, data, symbol )
|
||||
|
||||
Appends stock variables for the symbol passed in to the hash passed in
|
||||
|
|
@ -91,7 +92,8 @@ sub _appendStockVars {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _na( string )
|
||||
|
||||
=head2 _na ( string )
|
||||
|
||||
If string passed in is empty, returns N/A
|
||||
|
||||
|
|
@ -110,7 +112,8 @@ sub _na {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _appendZero( intger )
|
||||
|
||||
=head2 _appendZero( integer )
|
||||
|
||||
Appends a zero to an integer if it is 0-9
|
||||
|
||||
|
|
@ -130,7 +133,8 @@ sub _appendZero {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _convertToEpoch (date,time)
|
||||
|
||||
=head2 _convertToEpoch ( date, time )
|
||||
|
||||
Converts the date and time returned by Finance::Quote to an epoch
|
||||
|
||||
|
|
@ -163,13 +167,14 @@ sub _convertToEpoch {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _getStocks ( stocks )
|
||||
|
||||
Private method which retrieves stock information from the Finance::Quote package
|
||||
|
||||
=head3 stocks
|
||||
|
||||
list of stock symbols to find passed in as an array reference. stock symbols should all be uppercase
|
||||
List of stock symbols to find passed in as an array reference. Stock symbols should all be uppercase.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -187,6 +192,7 @@ sub _getStocks {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _getStockSources ( )
|
||||
|
||||
Private method which retrieves the list of available stock sources from Finance::Quote package
|
||||
|
|
@ -211,9 +217,10 @@ sub _getStockSources {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _submenu
|
||||
|
||||
renders the admin console view
|
||||
Renders the admin console view
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -229,9 +236,10 @@ sub _submenu {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _trim (str)
|
||||
|
||||
Trims whitespace form front and end of a string
|
||||
=head2 _trim ( str )
|
||||
|
||||
Trims whitespace form front and end of a string
|
||||
|
||||
=head3 str
|
||||
|
||||
|
|
@ -248,7 +256,8 @@ sub _trim {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 definition
|
||||
|
||||
=head2 definition ( )
|
||||
|
||||
defines wobject properties for Stock Data instances
|
||||
|
||||
|
|
@ -292,9 +301,10 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getEditForm
|
||||
|
||||
returns the tabform object that will be used in generating the edit page for Stock Lists
|
||||
Returns the tabform object that will be used in generating the edit page for Stock Lists
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -362,6 +372,7 @@ sub prepareView {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purge ( )
|
||||
|
||||
removes collateral data associated with a StockData when the system
|
||||
|
|
@ -375,6 +386,7 @@ sub purge {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the www_view method. Returns a processed template
|
||||
|
|
@ -424,6 +436,7 @@ sub view {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_displayStock ( )
|
||||
|
||||
Web facing method which allows users to view details about their stocks
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ Displays items and channels from RSS feeds.
|
|||
|
||||
use WebGUI::Asset::Wobject::SyndicatedWobject;
|
||||
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
|
@ -144,7 +143,7 @@ sub definition {
|
|||
|
||||
sub _strip_html {
|
||||
#my ($data) = @_;
|
||||
|
||||
|
||||
if (ref($_[0]) eq 'HASH') {
|
||||
keys(%{$_[0]});
|
||||
while (my ($name, $val) = each (%{$_[0]})) {
|
||||
|
|
@ -164,7 +163,7 @@ sub _strip_html {
|
|||
$_[0] =~ s/\&(?=(#[0-9]+|#x[0-9a-fA-F]+|\w+);)/&/g;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $_[0];
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +173,7 @@ sub _strip_html {
|
|||
|
||||
sub _find_record {
|
||||
my ($data, $regex) = @_;
|
||||
|
||||
|
||||
if (ref($data) eq 'HASH') {
|
||||
# reset the hash before calling each()
|
||||
keys(%{$data});
|
||||
|
|
@ -212,11 +211,11 @@ sub _find_record {
|
|||
|
||||
sub _normalize_items {
|
||||
#my ($items) = @_;
|
||||
|
||||
|
||||
# max number of words to take from description to fill in an empty
|
||||
# title
|
||||
my $max_words = 10;
|
||||
|
||||
|
||||
for my $item (@{$_[0]}) {
|
||||
if ($item->{guid} && ($item->{guid} =~ /^http:\/\//i)) {
|
||||
$item->{link} = $item->{guid};
|
||||
|
|
@ -230,7 +229,7 @@ sub _normalize_items {
|
|||
' ...';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# IE doesn't recognize '
|
||||
$item->{title} =~ s/'/\'/;
|
||||
$item->{description} =~ s/'/\'/;
|
||||
|
|
@ -241,7 +240,7 @@ sub _normalize_items {
|
|||
sub _get_rss_data {
|
||||
my $session = shift;
|
||||
my $url = shift;
|
||||
|
||||
|
||||
my $cache = WebGUI::Cache->new($session,'url:' . $url, 'RSS');
|
||||
my $rss_serial = $cache->get;
|
||||
my $rss = {};
|
||||
|
|
@ -268,7 +267,7 @@ sub _get_rss_data {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
my $rss_lite = {};
|
||||
eval {
|
||||
XML::RSSLite::parseXML($rss_lite, \$xml);
|
||||
|
|
@ -279,7 +278,7 @@ sub _get_rss_data {
|
|||
#but it SHOULDN'T have a major effect.
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
# make sure that the {channel} points to the channel
|
||||
# description record and that {items} points to the list
|
||||
# of items. without this voodoo, different versions of
|
||||
|
|
@ -295,7 +294,7 @@ sub _get_rss_data {
|
|||
$session->errorHandler->warn("unable to find item info for url $url");
|
||||
$rss->{items} = [];
|
||||
}
|
||||
|
||||
|
||||
_strip_html($rss);
|
||||
$rss->{items} = [ $rss->{items} ] unless (ref $rss->{items} eq 'ARRAY');
|
||||
|
||||
|
|
@ -309,7 +308,7 @@ sub _get_rss_data {
|
|||
#Default to an hour timeout
|
||||
$cache->set(Storable::freeze($rss), 3600);
|
||||
}
|
||||
|
||||
|
||||
return $rss;
|
||||
}
|
||||
|
||||
|
|
@ -321,7 +320,7 @@ sub _get_rss_data {
|
|||
sub _assign_rss_dates {
|
||||
my $session = shift;
|
||||
my ($items) = @_;
|
||||
|
||||
|
||||
for my $item (@{$items}) {
|
||||
my $key = 'dates:' . ($item->{guid} || $item->{title} ||
|
||||
$item->{description} || $item->{link});
|
||||
|
|
@ -343,20 +342,20 @@ sub _assign_rss_dates {
|
|||
# is the order the items are output.
|
||||
|
||||
sub _create_grouped_items{
|
||||
my($items,$rss_feeds,$maxHeadlines,$hasTermsRegex)=@_;
|
||||
|
||||
_create_interleaved_items($items,$rss_feeds,$maxHeadlines,$hasTermsRegex);
|
||||
|
||||
@$items=sort{$a->{'site_title'} cmp $b->{'site_title'}} @$items;
|
||||
|
||||
#Loop through the items and output the "site_
|
||||
my $siteTitleTracker;
|
||||
foreach(@$items){
|
||||
if($siteTitleTracker ne $_->{site_title}){
|
||||
$_->{new_rss_site}=1;
|
||||
my($items,$rss_feeds,$maxHeadlines,$hasTermsRegex)=@_;
|
||||
|
||||
_create_interleaved_items($items,$rss_feeds,$maxHeadlines,$hasTermsRegex);
|
||||
|
||||
@$items=sort{$a->{'site_title'} cmp $b->{'site_title'}} @$items;
|
||||
|
||||
#Loop through the items and output the "site_
|
||||
my $siteTitleTracker;
|
||||
foreach (@$items) {
|
||||
if ($siteTitleTracker ne $_->{site_title}) {
|
||||
$_->{new_rss_site} = 1;
|
||||
}
|
||||
$siteTitleTracker = $_->{site_title};
|
||||
}
|
||||
$siteTitleTracker=$_->{site_title};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -365,7 +364,7 @@ sub _create_grouped_items{
|
|||
# and push in the items in "interleaved mode"
|
||||
# No need to return because we're doing everything by reference.
|
||||
|
||||
sub _create_interleaved_items{
|
||||
sub _create_interleaved_items {
|
||||
my($items,$rss_feeds,$maxHeadlines,$hasTermsRegex)=@_;
|
||||
my $items_remain = 1;
|
||||
while((@$items < $maxHeadlines) && $items_remain){
|
||||
|
|
@ -379,7 +378,7 @@ sub _create_interleaved_items{
|
|||
$item->{site_link}=$rss->{channel}->{link};
|
||||
if(! $hasTermsRegex || _check_hasTerms($item,$hasTermsRegex)){
|
||||
push @{$items},$item;
|
||||
}
|
||||
}
|
||||
if (@{$rss->{items}}) {
|
||||
$items_remain = 1;
|
||||
}
|
||||
|
|
@ -395,20 +394,20 @@ sub _create_interleaved_items{
|
|||
#
|
||||
|
||||
sub _check_hasTerms{
|
||||
my($item,$hasTermsRegex)=@_;
|
||||
my $to_check=$item->{title}.$item->{description};
|
||||
if( $to_check =~ /$hasTermsRegex/gism){
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
my($item,$hasTermsRegex)=@_;
|
||||
my $to_check=$item->{title}.$item->{description};
|
||||
if ($to_check =~ /$hasTermsRegex/gism) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
sub _make_regex{
|
||||
my $terms=shift;
|
||||
my @terms=split(/,/,$terms);
|
||||
return join('|',@terms);
|
||||
my $terms = shift;
|
||||
my @terms = split(/,/,$terms);
|
||||
return join('|',@terms);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -437,7 +436,7 @@ sub _get_items {
|
|||
my $self = shift;
|
||||
my $urls = shift;
|
||||
my $maxHeadlines = shift || $self->getValue('maxHeadlines');
|
||||
|
||||
|
||||
my $displayMode=$self->getValue('displayMode');
|
||||
|
||||
my $hasTermsRegex=_make_regex($self->getValue('hasTerms'));
|
||||
|
|
@ -449,7 +448,7 @@ sub _get_items {
|
|||
my @rss_feeds;
|
||||
if (!$items) {
|
||||
$items = [];
|
||||
|
||||
|
||||
for my $url (@{$urls}) {
|
||||
my $rss_info=_get_rss_data($self->session,$url);
|
||||
push(@rss_feeds, $rss_info) if($rss_info);
|
||||
|
|
@ -463,12 +462,12 @@ sub _get_items {
|
|||
} else {
|
||||
_create_interleaved_items($items,\@rss_feeds,$maxHeadlines,$hasTermsRegex);
|
||||
}
|
||||
|
||||
|
||||
#@{$items} = sort { $b->{date} <=> $a->{date} } @{$items};
|
||||
|
||||
|
||||
$cache->set(Storable::freeze($items), 3600);
|
||||
}
|
||||
|
||||
|
||||
#So return the item loop and the first RSS feed, because
|
||||
#when we're parsing a single feed we can use that feed's title and
|
||||
#description for channel.title, channel.link, and channel.description
|
||||
|
|
@ -495,7 +494,7 @@ sub prepareView {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purgeCache ()
|
||||
=head2 purgeCache ( )
|
||||
|
||||
See WebGUI::Asset::purgeCache() for details.
|
||||
|
||||
|
|
@ -507,8 +506,9 @@ sub purgeCache {
|
|||
$self->SUPER::purgeCache;
|
||||
}
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 view()
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
Returns the rendered output of the wobject.
|
||||
|
||||
|
|
@ -572,14 +572,14 @@ sub view {
|
|||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
sub _constructRSSHeadTitleLink{
|
||||
my $self = shift;
|
||||
my($var,$rssTitle)=@_;
|
||||
my($var,$rssTitle)=@_;
|
||||
my $i18n = WebGUI::International->new($self->session,'Asset_SyndicatedContent');
|
||||
my $rssFeedSuffix=$i18n->get('RSS Feed Title Suffix');
|
||||
my $title = ($rssTitle) ? ($rssTitle." ".$rssFeedSuffix) : $rssFeedSuffix;
|
||||
my $rssFeedSuffix=$i18n->get('RSS Feed Title Suffix');
|
||||
my $title = ($rssTitle) ? ($rssTitle." ".$rssFeedSuffix) : $rssFeedSuffix;
|
||||
$title =~ s/\"/"/g;
|
||||
$self->session->style->setLink($var->{'rss.url'},
|
||||
{ rel=> 'alternate',
|
||||
type=> 'application/rss+xml',
|
||||
$self->session->style->setLink($var->{'rss.url'},
|
||||
{ rel=> 'alternate',
|
||||
type=> 'application/rss+xml',
|
||||
title=> ($rssTitle) ? ($rssTitle." ".$rssFeedSuffix) : $rssFeedSuffix }
|
||||
);
|
||||
}
|
||||
|
|
@ -610,18 +610,18 @@ sub _constructRSS{
|
|||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
sub _createRSSURLs{
|
||||
my $self=shift;
|
||||
my $var=shift;
|
||||
foreach({ver=>'1.0',param=>'10'},{ver=>'0.9',param=>'090'},{ver=>'0.91',param=>'091'},{ver=>'2.0',param=>'20'}){
|
||||
my $self=shift;
|
||||
my $var=shift;
|
||||
foreach({ver=>'1.0',param=>'10'},{ver=>'0.9',param=>'090'},{ver=>'0.91',param=>'091'},{ver=>'2.0',param=>'20'}){
|
||||
$var->{'rss.url.'.$_->{ver}}=$self->getUrl('func=viewRSS'.$_->{param});
|
||||
}
|
||||
$var->{'rss.url'}=$self->getUrl('func=viewRSS20');
|
||||
}
|
||||
$var->{'rss.url'}=$self->getUrl('func=viewRSS20');
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view ()
|
||||
=head2 www_view ( )
|
||||
|
||||
See WebGUI::Asset::Wobject::www_view() for details.
|
||||
|
||||
|
|
@ -633,55 +633,59 @@ sub www_view {
|
|||
$self->SUPER::www_view(@_);
|
||||
}
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 www_viewRSS090()
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewRSS090 ( )
|
||||
|
||||
Emit an RSS 0.9 feed.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewRSS090{
|
||||
sub www_viewRSS090 {
|
||||
my $self=shift;
|
||||
return $self->view('0.9');
|
||||
}
|
||||
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 www_viewRSS091()
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewRSS091 ( )
|
||||
|
||||
Emit an RSS 0.91 feed.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewRSS091{
|
||||
my $self=shift;
|
||||
return $self->view('0.91');
|
||||
sub www_viewRSS091 {
|
||||
my $self=shift;
|
||||
return $self->view('0.91');
|
||||
}
|
||||
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 www_viewRSS10()
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewRSS10 ( )
|
||||
|
||||
Emit an RSS 1.0 feed.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewRSS10{
|
||||
my $self=shift;
|
||||
return $self->view('1.0');
|
||||
sub www_viewRSS10 {
|
||||
my $self=shift;
|
||||
return $self->view('1.0');
|
||||
}
|
||||
|
||||
|
||||
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
=head2 www_viewRSS20()
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewRSS20 ( )
|
||||
|
||||
Emit an RSS 2.0 feed.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewRSS20{
|
||||
my $self=shift;
|
||||
return $self->view('2.0');
|
||||
sub www_viewRSS20 {
|
||||
my $self=shift;
|
||||
return $self->view('2.0');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ sub getSessionVars {
|
|||
return ($session) unless (scalar(@vars) > 0);
|
||||
|
||||
my @list = ();
|
||||
my $session = $self->session;
|
||||
push(@list, $session);
|
||||
|
||||
foreach my $var (@vars) {
|
||||
|
|
@ -713,7 +712,6 @@ sub _buildRow {
|
|||
my $self = shift;
|
||||
my ($session,$dt,$i18n,$eh,$form,$db,$user) = $self->getSessionVars("datetime","i18n","errorHandler","form","db","user");
|
||||
|
||||
my $var = {};
|
||||
my $entry = $_[0] || {};
|
||||
my $rowCount = $_[1];
|
||||
my $daysInWeek = $_[2];
|
||||
|
|
@ -746,7 +744,7 @@ sub _buildRow {
|
|||
});
|
||||
|
||||
my $taskName = "taskId_$rowCount";
|
||||
my $taskId = "taskId_".$rowCount."_formId";
|
||||
$taskId = "taskId_".$rowCount."_formId";
|
||||
$var->{'form.project'} = WebGUI::Form::selectBox($session,{
|
||||
-name=>"projectId_$rowCount",
|
||||
-options=>$projectList,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ our @ISA = qw(WebGUI::Asset::Wobject);
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 definition
|
||||
|
||||
=head2 definition ( )
|
||||
|
||||
defines wobject properties for WeatherData instances
|
||||
|
||||
|
|
@ -73,7 +74,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _getLocationData
|
||||
|
||||
=head2 _getLocationData ( )
|
||||
|
||||
Accepts an array ref of locations, and returns
|
||||
|
||||
|
|
@ -108,6 +110,7 @@ sub _getLocationData {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _chooseWeatherConditionsIcon ( currentSkyConditionsEnglish )
|
||||
|
||||
Accepts a string that represents the current sky conditions. Taken
|
||||
|
|
@ -146,7 +149,8 @@ if (isIn($currCond,'Haze')) {return 'mist';}
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 _na( string )
|
||||
|
||||
=head2 _na ( string )
|
||||
|
||||
If string passed in is empty, returns N/A
|
||||
|
||||
|
|
@ -165,6 +169,7 @@ sub _na {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _trim (str)
|
||||
|
||||
Trims whitespace form front and end of a string
|
||||
|
|
@ -201,6 +206,7 @@ sub prepareView {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the www_view method. Returns a processed template
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ use WebGUI::Utility;
|
|||
use base 'WebGUI::Asset::Wobject';
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 definition
|
||||
|
||||
=head2 definition ( )
|
||||
|
||||
defines wobject properties for New Wobject instances. You absolutely need
|
||||
this method in your new Wobjects. If you choose to "autoGenerateForms", the
|
||||
|
|
@ -70,7 +71,8 @@ sub definition {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 duplicate
|
||||
|
||||
=head2 duplicate ( )
|
||||
|
||||
duplicates a New Wobject. This method is unnecessary, but if you have
|
||||
auxiliary, ancillary, or "collateral" data or files related to your
|
||||
|
|
@ -85,7 +87,8 @@ sub duplicate {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getEditForm
|
||||
|
||||
=head2 getEditForm ( )
|
||||
|
||||
returns the tabform object that will be used in generating the edit page for New Wobjects.
|
||||
This method is optional if you set autoGenerateForms=1 in the definition.
|
||||
|
|
@ -123,6 +126,7 @@ sub prepareView {
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 purge ( )
|
||||
|
||||
removes collateral data associated with a NewWobject when the system
|
||||
|
|
@ -140,6 +144,7 @@ sub purge {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the www_view method. Returns a processed template
|
||||
|
|
@ -163,6 +168,7 @@ sub view {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_edit ( )
|
||||
|
||||
Web facing method which is the default edit page. This method is entirely
|
||||
|
|
|
|||
|
|
@ -205,11 +205,11 @@ sub www_copyList {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_createShortcut ()
|
||||
=head2 www_createShortcut ( )
|
||||
|
||||
=cut
|
||||
|
||||
sub www_createShortcut () {
|
||||
sub www_createShortcut {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(4));
|
||||
my $isOnDashboard = ref $self->getParent eq 'WebGUI::Asset::Wobject::Dashboard';
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ Pad the value to padLength characters by adding zeros in front if necesarry.
|
|||
|
||||
Flag that tells the User Profile system that this is a valid form element in a User Profile
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
|
|
@ -98,7 +97,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getInputElement
|
||||
|
||||
=head2 getInputElement ( )
|
||||
|
||||
Returns the form element used for manual input.
|
||||
|
||||
|
|
@ -116,7 +116,8 @@ sub getInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeInputElement
|
||||
|
||||
=head2 getOnChangeInputElement ( )
|
||||
|
||||
Returns the javascript code to update the slider and other form elements on a
|
||||
change of the imput element.
|
||||
|
|
@ -137,7 +138,8 @@ sub getOnChangeInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeSlider
|
||||
|
||||
=head2 getOnChangeSlider ( )
|
||||
|
||||
Returns the javascript code to update the form on a change of slider position.
|
||||
|
||||
|
|
@ -157,20 +159,22 @@ sub getOnChangeSlider {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMaximum
|
||||
|
||||
Returns the maximum value the slider can be set to in slider units.
|
||||
|
||||
=cut
|
||||
|
||||
sub getSliderMaximum {
|
||||
my $self = shift;
|
||||
|
||||
return scalar(keys %{$self->get('options')}) - 1;
|
||||
}
|
||||
#=head2 getSliderMaximum ( )
|
||||
#
|
||||
#Returns the maximum value the slider can be set to in slider units.
|
||||
#
|
||||
#=cut
|
||||
#
|
||||
#sub getSliderMaximum {
|
||||
# my $self = shift;
|
||||
#
|
||||
# return scalar(keys %{$self->get('options')}) - 1;
|
||||
#}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMaximum
|
||||
|
||||
=head2 getSliderMaximum ( )
|
||||
|
||||
Returns the minimum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -183,7 +187,8 @@ sub getSliderMaximum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMaximum
|
||||
|
||||
=head2 getSliderMinimum ( )
|
||||
|
||||
Returns the minimum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -196,7 +201,8 @@ sub getSliderMinimum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderValue
|
||||
|
||||
=head2 getSliderValue ( )
|
||||
|
||||
Returns the initial position of the slider in slider units.
|
||||
|
||||
|
|
@ -209,6 +215,7 @@ sub getSliderValue {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( )
|
||||
|
||||
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getInputElement
|
||||
|
||||
=head2 getInputElement ( )
|
||||
|
||||
Returns the form element used for manual input.
|
||||
|
||||
|
|
@ -94,7 +95,8 @@ sub getInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeInputElement
|
||||
|
||||
=head2 getOnChangeInputElement ( )
|
||||
|
||||
Returns the javascript code to update the slider and other form elements on a
|
||||
change of the imput element.
|
||||
|
|
@ -109,7 +111,8 @@ sub getOnChangeInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeSlider
|
||||
|
||||
=head2 getOnChangeSlider ( )
|
||||
|
||||
Returns the javascript code to update the form on a change of slider position.
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ sub alignmentSeparator {
|
|||
|
||||
Parse a string for a list of options to present to the user. This method
|
||||
will mainly be called from WebGUI::Form::DynamicField.
|
||||
|
||||
=cut
|
||||
|
||||
sub correctOptions {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getDisplayValue
|
||||
|
||||
=head2 getDisplayValue ( )
|
||||
|
||||
Returns the value that should be displayed initially.
|
||||
|
||||
|
|
@ -72,7 +73,8 @@ sub getDisplayValue {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getInputElement
|
||||
|
||||
=head2 getInputElement ( )
|
||||
|
||||
Returns the form element used for manual input.
|
||||
|
||||
|
|
@ -91,7 +93,8 @@ sub getInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeInputElement
|
||||
|
||||
=head2 getOnChangeInputElement ( )
|
||||
|
||||
Returns the javascript code to update the slider and other form elements on a
|
||||
change of the imput element.
|
||||
|
|
@ -107,7 +110,8 @@ sub getOnChangeInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeSlider
|
||||
|
||||
=head2 getOnChangeSlider ( )
|
||||
|
||||
Returns the javascript code to update the form on a change of slider position.
|
||||
|
||||
|
|
@ -122,7 +126,8 @@ sub getOnChangeSlider {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMaximum
|
||||
|
||||
=head2 getSliderMaximum ( )
|
||||
|
||||
Returns the maximum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -135,7 +140,8 @@ sub getSliderMaximum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMinimum
|
||||
|
||||
=head2 getSliderMinimum ( )
|
||||
|
||||
Returns the minimum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -148,7 +154,8 @@ sub getSliderMinimum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderValue
|
||||
|
||||
=head2 getSliderValue ( )
|
||||
|
||||
Returns the initial position of the slider in slider units.
|
||||
|
||||
|
|
@ -190,6 +197,5 @@ sub getValueFromPost {
|
|||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ sub definition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getDisplayValue
|
||||
|
||||
=head2 getDisplayValue ( )
|
||||
|
||||
Returns the value that should be displayed initially.
|
||||
|
||||
|
|
@ -105,7 +106,8 @@ sub getDisplayValue {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getDisplayVariable
|
||||
|
||||
=head2 getDisplayVariable ( )
|
||||
|
||||
Returns the javascript variable for the td element used for display of the
|
||||
slider value.
|
||||
|
|
@ -122,7 +124,8 @@ sub getDisplayVariable {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getInputElement
|
||||
|
||||
=head2 getInputElement ( )
|
||||
|
||||
Returns the form element used for manual input. You must overload this method.
|
||||
|
||||
|
|
@ -135,7 +138,8 @@ sub getInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getInputVariable
|
||||
|
||||
=head2 getInputVariable ( )
|
||||
|
||||
Returns the javascript variable for the input element tied to the slider.
|
||||
|
||||
|
|
@ -151,7 +155,8 @@ sub getInputVariable {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeInputElement
|
||||
|
||||
=head2 getOnChangeInputElement ( )
|
||||
|
||||
This method should return the javascript code that should be executed on an
|
||||
onchange event of the input element. This should at the very least include
|
||||
|
|
@ -171,7 +176,8 @@ sub getOnChangeInputElement {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getOnChangeSlider
|
||||
|
||||
=head2 getOnChangeSlider ( )
|
||||
|
||||
This method should return the javascript code that should be executed on an
|
||||
onchange event of the slider. This should at the very least include
|
||||
|
|
@ -191,7 +197,8 @@ sub getOnChangeSlider {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMaximum
|
||||
|
||||
=head2 getSliderMaximum ( )
|
||||
|
||||
Returns the maximum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -204,7 +211,8 @@ sub getSliderMaximum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderMinimum
|
||||
|
||||
=head2 getSliderMinimum ( )
|
||||
|
||||
Returns the minimum value the slider can be set to in slider units.
|
||||
|
||||
|
|
@ -217,7 +225,8 @@ sub getSliderMinimum {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderValue
|
||||
|
||||
=head2 getSliderValue ( )
|
||||
|
||||
Returns the initial position of the slider in slider units.
|
||||
|
||||
|
|
@ -230,7 +239,8 @@ sub getSliderValue {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getSliderVariable
|
||||
|
||||
=head2 getSliderVariable ( )
|
||||
|
||||
Returns the javascript variable for the slider.
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ This package provides an object-oriented way of managing WebGUI groups and group
|
|||
$string = $g->name("Nerds");
|
||||
$string = $g->scratchFilter("www_location=International;somesetting=1");
|
||||
$boolean = $g->showInForms(1);
|
||||
|
||||
|
||||
$g->addGroups(\@arr);
|
||||
$g->addUsers(\@arr, $expireOffset);
|
||||
|
|
@ -696,6 +695,7 @@ and in any group that belongs to this group.
|
|||
A boolean that if set true will return the users list minus the expired groupings.
|
||||
|
||||
=cut
|
||||
|
||||
sub getAllUsers {
|
||||
my $self = shift;
|
||||
my $withoutExpired = shift;
|
||||
|
|
@ -742,6 +742,7 @@ like IP address, LDAP, dbQuery or scratchFilter.
|
|||
A boolean that if set true will return the users list minus the expired groupings.
|
||||
|
||||
=cut
|
||||
|
||||
sub getUsers {
|
||||
my $self = shift;
|
||||
my $withoutExpired = shift;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getBackgroundColor
|
||||
|
||||
=head2 getBackgroundColor ( )
|
||||
|
||||
Returns the background color triplet. Defaults to #ffffff (white).
|
||||
|
||||
|
|
@ -38,7 +39,8 @@ sub getBackgroundColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getImageHeight
|
||||
|
||||
=head2 getImageHeight ( )
|
||||
|
||||
Returns the height of the image in pixels.
|
||||
|
||||
|
|
@ -51,7 +53,8 @@ sub getImageHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getImageWidth
|
||||
|
||||
=head2 getImageWidth ( )
|
||||
|
||||
Returns the width in pixels of the image.
|
||||
|
||||
|
|
@ -64,7 +67,8 @@ sub getImageWidth {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPalette
|
||||
|
||||
=head2 getPalette ( )
|
||||
|
||||
Returns the palette object this image is set to. Defaults to the default palette.
|
||||
|
||||
|
|
@ -81,9 +85,10 @@ sub getPalette {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getXOffset
|
||||
|
||||
Returns the horizontal offset of the center, relative to which the image is drawn.
|
||||
=head2 getXOffset ( )
|
||||
|
||||
Returns the horizontal offset of the center, relative to which the image is drawn.
|
||||
Defaults to the physical center of the image.
|
||||
|
||||
=cut
|
||||
|
|
@ -95,7 +100,8 @@ sub getXOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getYOffset
|
||||
|
||||
=head2 getYOffset ( )
|
||||
|
||||
Returns the vertical offset of the center, relative to which the image is drawn.
|
||||
Defaults to the physical center of the image.
|
||||
|
|
@ -109,7 +115,8 @@ sub getYOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 image
|
||||
|
||||
=head2 image ( )
|
||||
|
||||
Returns the imagemagick object containing this image.
|
||||
|
||||
|
|
@ -122,6 +129,7 @@ sub image {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 new ( session, [ width, height ] )
|
||||
|
||||
Constructor for an image. Optionally you can pass the size of the image.
|
||||
|
|
@ -158,7 +166,8 @@ sub new {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 session
|
||||
|
||||
=head2 session ( )
|
||||
|
||||
Returns the the session object.
|
||||
|
||||
|
|
@ -171,6 +180,7 @@ sub session {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setBackgroundColor ( colorTriplet )
|
||||
|
||||
Sets the backgroundcolor. Using this method will erase everything that is
|
||||
|
|
@ -192,7 +202,8 @@ sub setBackgroundColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 setImageHeight ( height)
|
||||
|
||||
=head2 setImageHeight ( height )
|
||||
|
||||
Set the height of the image.
|
||||
|
||||
|
|
@ -213,6 +224,7 @@ sub setImageHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setImageWidth ( width )
|
||||
|
||||
Set the width of the image.
|
||||
|
|
@ -234,6 +246,7 @@ sub setImageWidth {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setPalette ( palette )
|
||||
|
||||
Set the palette object this image will use.
|
||||
|
|
@ -252,7 +265,8 @@ sub setPalette {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 saveToFileSystem ( path, [ filename ] );
|
||||
|
||||
=head2 saveToFileSystem ( path, [ filename ] )
|
||||
|
||||
Saves the image to the specified path and filename.
|
||||
|
||||
|
|
@ -277,7 +291,8 @@ sub saveToFileSystem {
|
|||
|
||||
# This doesn't seem to work...
|
||||
#-------------------------------------------------------------------
|
||||
=head2 saveToScalar
|
||||
|
||||
=head2 saveToScalar ( )
|
||||
|
||||
Returns a scalar containing the image contents.
|
||||
|
||||
|
|
@ -297,6 +312,7 @@ sub saveToScalar {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 saveToStorageLocation ( storage, [ filename ] )
|
||||
|
||||
Save the image to the specified storage location.
|
||||
|
|
@ -321,6 +337,7 @@ sub saveToStorageLocation {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 text ( properties )
|
||||
|
||||
Extend the imagemagick Annotate method so alignment can be controlled better.
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ These methods are available from this class:
|
|||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 canDelete
|
||||
|
||||
=head2 canDelete ( )
|
||||
|
||||
Returns true if this color can be deleted.
|
||||
|
||||
|
|
@ -50,7 +51,8 @@ sub canDelete {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 copy
|
||||
|
||||
=head2 copy ( )
|
||||
|
||||
Returns a new WebGUI::Image::Color object being an exact copy of this color,
|
||||
except for the persistency. This means that the new copy will not be stored in
|
||||
|
|
@ -65,7 +67,8 @@ sub copy {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 darken
|
||||
|
||||
=head2 darken ( )
|
||||
|
||||
Returns a new WebGUI::Image::Color object with the same properties but the
|
||||
colors darkened. This object will not be saved to the database automatically.
|
||||
|
|
@ -87,7 +90,8 @@ sub darken {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 delete
|
||||
|
||||
=head2 delete ( )
|
||||
|
||||
Deletes the color from the database. It will only delete if canDelete returns
|
||||
true.
|
||||
|
|
@ -104,7 +108,8 @@ sub delete {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getFillColor
|
||||
|
||||
=head2 getFillColor ( )
|
||||
|
||||
Returns the the quartet of th fill color. The quartet consists of R, G, B and
|
||||
Alpha values respectively in HTML format: '#rrggbbaa'.
|
||||
|
|
@ -118,7 +123,8 @@ sub getFillColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getFillTriplet
|
||||
|
||||
=head2 getFillTriplet ( )
|
||||
|
||||
Returns the RGB triplet of the fill color in HTML format: '#rrggbb'.
|
||||
|
||||
|
|
@ -131,7 +137,8 @@ sub getFillTriplet {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getFillAlpha
|
||||
|
||||
=head2 getFillAlpha ( )
|
||||
|
||||
Returns the hex value of the Alpha channel in this color.
|
||||
|
||||
|
|
@ -144,7 +151,8 @@ sub getFillAlpha {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getId
|
||||
|
||||
=head2 getId ( )
|
||||
|
||||
Returns the GUID of this color.
|
||||
|
||||
|
|
@ -157,7 +165,8 @@ sub getId {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getName
|
||||
|
||||
=head2 getName ( )
|
||||
|
||||
Returns the name assigned to this color.
|
||||
|
||||
|
|
@ -170,7 +179,8 @@ sub getName {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getStrokeColor
|
||||
|
||||
=head2 getStrokeColor ( )
|
||||
|
||||
Returns the the quartet of the stroke color. The quartet consists of R, G, B and
|
||||
Alpha values respectively in HTML format: '#rrggbbaa'.
|
||||
|
|
@ -184,7 +194,8 @@ sub getStrokeColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getStrokeTriplet
|
||||
|
||||
=head2 getStrokeTriplet ( )
|
||||
|
||||
Returns the RGB triplet of the stroke color in HTML format: '#rrggbb'.
|
||||
|
||||
|
|
@ -197,7 +208,8 @@ sub getStrokeTriplet {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 getStrokeAlpha
|
||||
|
||||
=head2 getStrokeAlpha ( )
|
||||
|
||||
Returns the hex value of the Alpha channel in the stroke color.
|
||||
|
||||
|
|
@ -210,41 +222,42 @@ sub getStrokeAlpha {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 new ( session, colorId, [ properties ] )
|
||||
|
||||
=head2 new ( session, colorId, [ properties ] )
|
||||
|
||||
Constructor for this class.
|
||||
|
||||
=head2 session
|
||||
=head3 session
|
||||
|
||||
A WebGUI::Session object.
|
||||
|
||||
=head2 colorId
|
||||
=head3 colorId
|
||||
|
||||
The id of the color you want to instanciate. If you're creating a new color
|
||||
please use 'new' as id.
|
||||
|
||||
=head2 properties
|
||||
=head3 properties
|
||||
|
||||
A hashref containing configuration options to set this object to. All are also
|
||||
available through methods.
|
||||
|
||||
=head3 name
|
||||
=head4 name
|
||||
|
||||
The color name.
|
||||
|
||||
=head3 fillTriplet
|
||||
=head4 fillTriplet
|
||||
|
||||
The RGB triplet for the fill color. See setFillTriplet.
|
||||
|
||||
=head3 fillAlpha
|
||||
=head4 fillAlpha
|
||||
|
||||
The alpha value for the fill color. See setFillAlpha.
|
||||
|
||||
=head3 strokeTriplet
|
||||
=head4 strokeTriplet
|
||||
|
||||
The RGB triplet for the stroke color. See setStrokeTriplet.
|
||||
|
||||
=head3 strokeAlpha
|
||||
=head4 strokeAlpha
|
||||
|
||||
The alpha value for the stroke color. See setStrokeAlpha.
|
||||
|
||||
|
|
@ -275,16 +288,17 @@ sub new {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 newByPalette ( session, paletteId )
|
||||
|
||||
=head2 newByPalette ( session, paletteId )
|
||||
|
||||
Returns an arrayref containg instanciated WebGUI::Image::Color objects for each
|
||||
color in the sepcified palette.
|
||||
|
||||
=head2 session
|
||||
=head3 session
|
||||
|
||||
A WebGUI::Session object.
|
||||
|
||||
=head2 paletteId
|
||||
=head3 paletteId
|
||||
|
||||
The id of the palette that is to be loaded.
|
||||
|
||||
|
|
@ -309,7 +323,8 @@ sub newByPalette {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 session
|
||||
|
||||
=head2 session ( )
|
||||
|
||||
Returns the WebGUI::Session object;
|
||||
|
||||
|
|
@ -322,11 +337,12 @@ sub session {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setFillColor ( quartet )
|
||||
|
||||
=head2 setFillColor ( quartet )
|
||||
|
||||
Sets the the fill color to the specified quartet.
|
||||
|
||||
=head2 quartet
|
||||
=head3 quartet
|
||||
|
||||
The quartet consists of R, G, B and Alpha values respectively in HTML format: '#rrggbbaa'.
|
||||
|
||||
|
|
@ -345,11 +361,12 @@ sub setFillColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setFillTriplet ( triplet )
|
||||
|
||||
=head2 setFillTriplet ( triplet )
|
||||
|
||||
Sets the RGB triplet of the fill color.
|
||||
|
||||
=head2 triplet
|
||||
=head3 triplet
|
||||
|
||||
The RGB triplet in HTML format: '#rrggbb'.
|
||||
|
||||
|
|
@ -368,11 +385,12 @@ sub setFillTriplet {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setFillAlpha ( alpha )
|
||||
|
||||
=head2 setFillAlpha ( alpha )
|
||||
|
||||
Sets the alpha channel for the fill color.
|
||||
|
||||
=head2 alpha
|
||||
=head3 alpha
|
||||
|
||||
The alpha value in hexadecimal notation: 'ff';
|
||||
|
||||
|
|
@ -391,11 +409,12 @@ sub setFillAlpha {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setName ( name )
|
||||
|
||||
=head2 setName ( name )
|
||||
|
||||
Sets the name of this color.
|
||||
|
||||
=head2 name
|
||||
=head3 name
|
||||
|
||||
A scalar containing the name of this color.
|
||||
|
||||
|
|
@ -410,11 +429,12 @@ sub setName {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setStrokeColor ( quartet )
|
||||
|
||||
=head2 setStrokeColor ( quartet )
|
||||
|
||||
Sets the the stroke color to the specified quartet.
|
||||
|
||||
=head2 quartet
|
||||
=head3 quartet
|
||||
|
||||
The quartet consists of R, G, B and Alpha values respectively in HTML format: '#rrggbbaa'.
|
||||
|
||||
|
|
@ -433,11 +453,12 @@ sub setStrokeColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setStrokeTriplet ( triplet )
|
||||
|
||||
=head2 setStrokeTriplet ( triplet )
|
||||
|
||||
Sets the RGB triplet of the stroke color.
|
||||
|
||||
=head2 triplet
|
||||
=head3 triplet
|
||||
|
||||
The RGB triplet in HTML format: '#rrggbb'.
|
||||
|
||||
|
|
@ -456,11 +477,12 @@ sub setStrokeTriplet {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 setStrokeAlpha ( alpha )
|
||||
|
||||
=head2 setStrokeAlpha ( alpha )
|
||||
|
||||
Sets the alpha channel for the stroke color.
|
||||
|
||||
=head2 alpha
|
||||
=head3 alpha
|
||||
|
||||
The alpha value in hexadecimal notation: 'ff';
|
||||
|
||||
|
|
@ -479,7 +501,8 @@ sub setStrokeAlpha {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 update
|
||||
|
||||
=head2 update ( )
|
||||
|
||||
Will update the database to the current state of the object. If your object has
|
||||
not yet been saved to the database, you must first use the save method, which
|
||||
|
|
@ -501,7 +524,8 @@ sub update {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head1 save
|
||||
|
||||
=head2 save ( )
|
||||
|
||||
Will save the state of the object to the database if the color is not yet in the
|
||||
database. If it already is in the database this method will do exactly the same
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 addDataset ( dataset )
|
||||
|
||||
Adds a dataset to the graph. Please not that not all graph types can handle
|
||||
|
|
@ -53,7 +54,8 @@ sub addDataset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 configurationForm
|
||||
|
||||
=head2 configurationForm ( )
|
||||
|
||||
Returns a hashref containing the form where the properties of your graph type
|
||||
can be set. Your pluging should extend this method by append the form to the
|
||||
|
|
@ -129,6 +131,7 @@ sub configurationForm {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawLabel ( label, [ properties ] )
|
||||
|
||||
Draws a label with your preferred properties. Defaults the font, font size and
|
||||
|
|
@ -160,7 +163,8 @@ sub drawLabel {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 formNamespace
|
||||
|
||||
=head2 formNamespace ( )
|
||||
|
||||
Returns the namespace used in the configuration form. You must extend this
|
||||
method by concatenating an underscore and the last part of your namespace to the
|
||||
|
|
@ -175,7 +179,8 @@ sub formNamespace {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getConfiguration
|
||||
|
||||
=head2 getConfiguration ( )
|
||||
|
||||
Returns the configuration hashref of the plugin. You must extend this method by
|
||||
adding your configuration keys to the hashref returned by the SUPER method. To
|
||||
|
|
@ -205,6 +210,7 @@ sub getConfiguration {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getGraphingTab ( session, [ config ] )
|
||||
|
||||
Returns the contents of the graphing tab you can add to your asset.
|
||||
|
|
@ -332,6 +338,7 @@ EOS
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getDataset ( [ index ] )
|
||||
|
||||
Returns the dataset indicated by index.
|
||||
|
|
@ -356,6 +363,7 @@ sub getDataset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getLabel ( [ index ] )
|
||||
|
||||
Returns the index'th label or an arrayref containing all labels.
|
||||
|
|
@ -376,6 +384,7 @@ sub getLabel {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getLabelColor
|
||||
|
||||
Returns the triplet of the label color. Defaults to '#333333'.
|
||||
|
|
@ -389,6 +398,7 @@ sub getLabelColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getLabelDimensions ( text, [ properties ] )
|
||||
|
||||
Returns a hashref containg the width and height in pixels of the passed text.
|
||||
|
|
@ -423,7 +433,8 @@ sub getLabelDimensions {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getLabelFont
|
||||
|
||||
=head2 getLabelFont ( )
|
||||
|
||||
Returns the WebGUI::Image::Font object this image is set to. Defaults to the
|
||||
default font.
|
||||
|
|
@ -437,7 +448,8 @@ sub getLabelFont {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getLabelFontSize
|
||||
|
||||
=head2 getLabelFontSize ( )
|
||||
|
||||
Returns the font size of the labels. Defaults to 20.
|
||||
|
||||
|
|
@ -450,7 +462,8 @@ sub getLabelFontSize {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getLabelOffset
|
||||
|
||||
=head2 getLabelOffset ( )
|
||||
|
||||
Returns the label offset. This is the distance between the label and the axis.
|
||||
Defaults to 10 pixels.
|
||||
|
|
@ -464,7 +477,8 @@ sub getLabelOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getMaxValueFromDataset
|
||||
|
||||
=head2 getMaxValueFromDataset ( )
|
||||
|
||||
Returns the highest value of all added datasets.
|
||||
|
||||
|
|
@ -496,7 +510,8 @@ sub getMaxValueFromDataset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPluginList
|
||||
|
||||
=head2 getPluginList ( )
|
||||
|
||||
Returns an arrayref containing the namespaces of the enabled graphing plugins.
|
||||
|
||||
|
|
@ -510,6 +525,7 @@ sub getPluginList {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 load ( session, namespace )
|
||||
|
||||
Instanciates an WebGUI::Graph object with the given namespace.
|
||||
|
|
@ -538,6 +554,7 @@ sub load {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 loadByConfiguration ( session, configuration )
|
||||
|
||||
Loads a plugin defined by a configuration hash.
|
||||
|
|
@ -569,6 +586,7 @@ sub loadByConfiguration {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 processConfigurationForm ( session )
|
||||
|
||||
Processes the configuration form that is submitted and returns the correct
|
||||
|
|
@ -599,6 +617,7 @@ my $graph = $class->load($session, $namespace);
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setConfiguration ( config )
|
||||
|
||||
Configures the pluging according to the configuration hashref that is passed.
|
||||
|
|
@ -627,6 +646,7 @@ sub setConfiguration {
|
|||
};
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabelColor ( color )
|
||||
|
||||
Sets the color triplet of the labels.
|
||||
|
|
@ -645,6 +665,7 @@ sub setLabelColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabelFont ( font )
|
||||
|
||||
Set the label font.
|
||||
|
|
@ -663,6 +684,7 @@ sub setLabelFont {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabelFontSize ( size )
|
||||
|
||||
Sets the font size of the labels.
|
||||
|
|
@ -681,6 +703,7 @@ sub setLabelFontSize {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabelOffset ( offset )
|
||||
|
||||
Sets the label offset. This is the distance in pixels between the labels and the
|
||||
|
|
@ -700,6 +723,7 @@ sub setLabelOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabels ( labels )
|
||||
|
||||
Sets the labels for the datasets.
|
||||
|
|
@ -718,6 +742,7 @@ sub setLabels {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 wrapLabelToWidth ( text, maxWidth, [ properties ] )
|
||||
|
||||
Wraps a text string onto multiple lines having a width of maxWidth.
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 _mod2pi ( angle )
|
||||
|
||||
Returns the angle modulo 2*pi.
|
||||
|
|
@ -258,6 +259,7 @@ sub addSlice {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 calcCoordinates ( slice )
|
||||
|
||||
Calcs the coordinates of the corners of the given pie slice.
|
||||
|
|
@ -296,7 +298,8 @@ sub calcCoordinates {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 configurationForm
|
||||
|
||||
=head2 configurationForm ( )
|
||||
|
||||
The configuration form part for this object. See WebGUI::Image::Graph for
|
||||
documentation.
|
||||
|
|
@ -387,7 +390,8 @@ my $configForms = $self->SUPER::configurationForm;
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 draw
|
||||
|
||||
=head2 draw ( )
|
||||
|
||||
Draws the pie chart.
|
||||
|
||||
|
|
@ -452,6 +456,7 @@ sub draw {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawBottom ( slice )
|
||||
|
||||
Draws the bottom of the given pie slice.
|
||||
|
|
@ -470,6 +475,7 @@ sub drawBottom {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawLabel ( slice )
|
||||
|
||||
Draws the label including stick if needed for the given pie slice.
|
||||
|
|
@ -563,6 +569,7 @@ sub drawLabel {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawLeftSide ( slice )
|
||||
|
||||
Draws the side connected to the startpoint of the slice.
|
||||
|
|
@ -581,6 +588,7 @@ sub drawLeftSide {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawPieSlice ( slice, offset, fillColor )
|
||||
|
||||
Draws a pie slice shape, ie. the bottom or top of a slice.
|
||||
|
|
@ -638,6 +646,7 @@ sub drawPieSlice {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawRightSide ( slice )
|
||||
|
||||
Draws the side connected to the endpoint of the slice.
|
||||
|
|
@ -656,6 +665,7 @@ sub drawRightSide {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawRim ( slice )
|
||||
|
||||
Draws the rim of the slice.
|
||||
|
|
@ -708,6 +718,7 @@ sub drawRim {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawSide ( slice, [ cornerName ], [ fillColor ] )
|
||||
|
||||
Draws the sides connecting the rim and tip of a pie slice.
|
||||
|
|
@ -767,6 +778,7 @@ sub drawSide {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 drawBottom ( slice )
|
||||
|
||||
Draws the bottom of the given pie slice.
|
||||
|
|
@ -785,7 +797,8 @@ sub drawTop {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 formNamespace
|
||||
|
||||
=head2 formNamespace ( )
|
||||
|
||||
Extends the form namespace for this object. See WebGUI::Image::Graph for
|
||||
documentation.
|
||||
|
|
@ -799,7 +812,8 @@ sub formNamespace {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getBottomHeight
|
||||
|
||||
=head2 getBottomHeight ( )
|
||||
|
||||
Returns the thickness of the bottom. Defaults to 0.
|
||||
|
||||
|
|
@ -812,7 +826,8 @@ sub getBottomHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getConfiguration
|
||||
|
||||
=head2 getConfiguration ( )
|
||||
|
||||
Returns a configuration hashref. See WebGUI::Image::Graph for documentation.
|
||||
|
||||
|
|
@ -837,7 +852,8 @@ sub getConfiguration {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getDataset
|
||||
|
||||
=head2 getDataset ( )
|
||||
|
||||
Returns the first dataset that is added. Pie charts can only handle one dataset
|
||||
and therefore the first added dataset is used.
|
||||
|
|
@ -851,7 +867,8 @@ sub getDataset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getExplosionLength
|
||||
|
||||
=head2 getExplosionLength ( )
|
||||
|
||||
Returns the explosion length. This value indicates how much a slice will be
|
||||
shifted from the center of the pie. Defaults to 0.
|
||||
|
|
@ -865,7 +882,8 @@ sub getExplosionLength {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getLabels
|
||||
|
||||
=head2 getLabels ( )
|
||||
|
||||
Returns an arrayref containing the labels that belong to the slices.
|
||||
|
||||
|
|
@ -878,7 +896,8 @@ sub getLabels {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getLabelPosition
|
||||
|
||||
=head2 getLabelPosition ( )
|
||||
|
||||
Returns the position of the labels relative to the thickness of the pie.
|
||||
Allowed positions are 'bottom', 'center' and 'top'. Defaults to 'top'.
|
||||
|
|
@ -892,7 +911,8 @@ sub getLabelPosition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPieMode
|
||||
|
||||
=head2 getPieMode ( )
|
||||
|
||||
Returns the mode in which the pie is drawn. Currently available are 'normal' and
|
||||
'stepped'. The latter mode draws each pie slice with a smaller thickness,
|
||||
|
|
@ -908,7 +928,8 @@ sub getPieMode {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getRadius
|
||||
|
||||
=head2 getRadius ( )
|
||||
|
||||
Returns the radius of the pie in pixels. Defaults to 80.
|
||||
|
||||
|
|
@ -921,7 +942,8 @@ sub getRadius {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getScaleFactor
|
||||
|
||||
=head2 getScaleFactor ( )
|
||||
|
||||
Returns the factor with which the pies that are added afterwards should be
|
||||
scaled. In effect this will cause the radius of the slice to grow or shrink, and
|
||||
|
|
@ -938,6 +960,7 @@ sub getScaleFactor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getSlice ( [ sliceNumber ] )
|
||||
|
||||
Returns the sliceNumber'th slice properties hashref. Defaults to the slice last
|
||||
|
|
@ -948,6 +971,7 @@ added.
|
|||
The index of the slice you want.
|
||||
|
||||
=cut
|
||||
|
||||
sub getSlice {
|
||||
my $self = shift;
|
||||
my $slice = shift || (scalar(@{$self->{_slices}}) - 1);
|
||||
|
|
@ -956,7 +980,8 @@ sub getSlice {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getStartAngle
|
||||
|
||||
=head2 getStartAngle ( )
|
||||
|
||||
Rteurn the initial angle of the first slice. In effect all slices are rotated by
|
||||
this value.
|
||||
|
|
@ -970,7 +995,8 @@ sub getStartAngle {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getStickColor
|
||||
|
||||
=head2 getStickColor ( )
|
||||
|
||||
Returns the color of the sticks connecting pie and labels. Defaults to #333333.
|
||||
|
||||
|
|
@ -983,7 +1009,8 @@ sub getStickColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getStickLength
|
||||
|
||||
=head2 getStickLength ( )
|
||||
|
||||
Return the length of the sticks connecting the labels with the pie. Defaults to
|
||||
0.
|
||||
|
|
@ -997,7 +1024,8 @@ sub getStickLength {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getStickOffset
|
||||
|
||||
=head2 getStickOffset ( )
|
||||
|
||||
Returns the distance between the label sticks and the pie. Defaults to 0.
|
||||
|
||||
|
|
@ -1010,7 +1038,8 @@ sub getStickOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getTiltAngle
|
||||
|
||||
=head2 getTiltAngle ( )
|
||||
|
||||
Returns the angle between the screen and the pie chart. Valid angles are 0 to 90
|
||||
degrees. Zero degrees results in a 2d pie where other values will generate a 3d
|
||||
|
|
@ -1027,7 +1056,8 @@ sub getTiltAngle {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getTopHeight
|
||||
|
||||
=head2 getTopHeight ( )
|
||||
|
||||
Returns the thickness of the top of the pie in pixels. Defaults to 20 pixels.
|
||||
|
||||
|
|
@ -1041,7 +1071,8 @@ sub getTopHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 hasShadedSides
|
||||
|
||||
=head2 hasShadedSides ( )
|
||||
|
||||
A boolean value indicating whether the sides and the rim of the pie should be
|
||||
drawn with a darkened color.
|
||||
|
|
@ -1055,7 +1086,8 @@ sub hasShadedSides {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 new
|
||||
|
||||
=head2 new ( )
|
||||
|
||||
Contstructor. See SUPER classes for additional parameters.
|
||||
|
||||
|
|
@ -1071,7 +1103,8 @@ sub new {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 processDataset
|
||||
|
||||
=head2 processDataset ( )
|
||||
|
||||
Takes the dataset and takes the necesarry steps for the pie to be drawn.
|
||||
|
||||
|
|
@ -1101,6 +1134,7 @@ sub processDataset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setBottomHeight ( thickness )
|
||||
|
||||
Sets the thickness of the bottom.
|
||||
|
|
@ -1119,6 +1153,7 @@ sub setBottomHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setCenter( [ xOffset ], [ yOffset ] )
|
||||
|
||||
Sets the offset of the center of the graph relative to the center of the image.
|
||||
|
|
@ -1143,6 +1178,7 @@ sub setCenter {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setConfiguration ( config )
|
||||
|
||||
Applies the settings in the given configuration hash. See WebGUI::Image::Graph
|
||||
|
|
@ -1175,6 +1211,7 @@ sub setConfiguration {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setExplosionLength ( length )
|
||||
|
||||
Sets the explosion length. This value indicates how much a slice will be
|
||||
|
|
@ -1194,6 +1231,7 @@ sub setExplosionLength {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setLabelPosition ( position )
|
||||
|
||||
Sets the position of the labels relative to the thickness of the pie.
|
||||
|
|
@ -1213,6 +1251,7 @@ sub setLabelPosition {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setPieMode ( mode )
|
||||
|
||||
Sets the mode in which the pie is drawn. Currently available are 'normal' and
|
||||
|
|
@ -1234,6 +1273,7 @@ sub setPieMode {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setRadius ( radius )
|
||||
|
||||
Sets the radius of the pie in pixels. Defaults to 80.
|
||||
|
|
@ -1254,6 +1294,7 @@ sub setRadius {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setScaleFactor ( multiplier )
|
||||
|
||||
Sets the factor with which the pies that are added afterwards should be
|
||||
|
|
@ -1276,6 +1317,7 @@ sub setScaleFactor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setStartAngle ( angle )
|
||||
|
||||
Sets the initial angle of the first slice. In effect all slices are rotated by
|
||||
|
|
@ -1295,6 +1337,7 @@ sub setStartAngle {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setShadedSides ( shaded )
|
||||
|
||||
A boolean value indicating whether the sides and the rim of the pie should be
|
||||
|
|
@ -1314,6 +1357,7 @@ sub setShadedSides {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setStickColor ( color )
|
||||
|
||||
Sets the color of the sticks connecting pie and labels. Defaults to #333333.
|
||||
|
|
@ -1332,6 +1376,7 @@ sub setStickColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setStickLength ( length )
|
||||
|
||||
Sets the length of the sticks connecting the labels with the pie. Defaults to
|
||||
|
|
@ -1351,6 +1396,7 @@ sub setStickLength {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setStickOffset ( offset )
|
||||
|
||||
Sets the distance between the label sticks and the pie. Defaults to 0.
|
||||
|
|
@ -1369,6 +1415,7 @@ sub setStickOffset {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setTiltAngle ( angle )
|
||||
|
||||
Sets the angle between the screen and the pie chart. Valid angles are 0 to 90
|
||||
|
|
@ -1394,6 +1441,7 @@ sub setTiltAngle {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setTopHeight ( thickness )
|
||||
|
||||
Sets the thickness of the top of the pie in pixels. Defaults to 20 pixels.
|
||||
|
|
@ -1412,6 +1460,7 @@ sub setTopHeight {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 sortSlices
|
||||
|
||||
A sort routine for sorting the slices in drawing order. Must be run from within
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ These methods are available from this class:
|
|||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 addColor ( color )
|
||||
|
||||
Adds a color to this palette. The color will be automatically saved or updated
|
||||
|
|
@ -54,7 +55,8 @@ sub addColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 canDelete
|
||||
|
||||
=head2 canDelete ( )
|
||||
|
||||
Returns true if this palette can be deleted.
|
||||
|
||||
|
|
@ -68,7 +70,8 @@ sub canDelete {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 canEdit
|
||||
|
||||
=head2 canEdit ( )
|
||||
|
||||
Returns true if this palette can be edited.
|
||||
|
||||
|
|
@ -81,7 +84,8 @@ sub canEdit {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 delete
|
||||
|
||||
=head2 delete ( )
|
||||
|
||||
Deletes the palette from the database. This is only possible if the canDelete
|
||||
method returns true.
|
||||
|
|
@ -104,6 +108,7 @@ sub delete {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getColor ( [ index ] )
|
||||
|
||||
Returns the color at index in the palette. If index is not passed it will return
|
||||
|
|
@ -120,6 +125,7 @@ sub getColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getColorIndex ( color )
|
||||
|
||||
Returns the index of color. If the color is not in the palette it will return
|
||||
|
|
@ -146,7 +152,8 @@ sub getColorIndex {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getColorsInPalette
|
||||
|
||||
=head2 getColorsInPalette ( )
|
||||
|
||||
Returns a arrayref containing all color objects in the palette.
|
||||
|
||||
|
|
@ -160,7 +167,8 @@ sub getColorsInPalette {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getDefaultPaletteId
|
||||
|
||||
=head2 getDefaultPaletteId ( )
|
||||
|
||||
Returns the id of the default palette.
|
||||
|
||||
|
|
@ -173,7 +181,8 @@ sub getDefaultPaletteId {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getId
|
||||
|
||||
=head2 getId ( )
|
||||
|
||||
Returns the guid of this palette.
|
||||
|
||||
|
|
@ -186,7 +195,8 @@ sub getId {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getName
|
||||
|
||||
=head2 getName ( )
|
||||
|
||||
Returns the name of this palette.
|
||||
|
||||
|
|
@ -199,7 +209,8 @@ sub getName {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getNextColor
|
||||
|
||||
=head2 getNextColor ( )
|
||||
|
||||
Returns the next color in the palette relative to the internal palette index
|
||||
counter, and increases this counter to that color. If the counter already is at
|
||||
|
|
@ -219,7 +230,8 @@ sub getNextColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getNumberOfColors
|
||||
|
||||
=head2 getNumberOfColors ( )
|
||||
|
||||
Returns the number of colors in the palette.
|
||||
|
||||
|
|
@ -232,7 +244,8 @@ sub getNumberOfColors {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPaletteIndex
|
||||
|
||||
=head2 getPaletteIndex ( )
|
||||
|
||||
Returns the index the internal palette index counter is set to. Ie. it returns
|
||||
the current color.
|
||||
|
|
@ -246,7 +259,8 @@ sub getPaletteIndex {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPaletteList
|
||||
|
||||
=head2 getPaletteList ( )
|
||||
|
||||
Returns a hashref containing a list of all available palettes. The keys are the
|
||||
palette id's and the value are the names of the palettes.
|
||||
|
|
@ -261,7 +275,8 @@ sub getPaletteList {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getPreviousColor
|
||||
|
||||
=head2 getPreviousColor ( )
|
||||
|
||||
Returns the previous color in the palette relative to the internal palette index
|
||||
counter, and decreases this counter to that color. If the counter already is at
|
||||
|
|
@ -281,7 +296,8 @@ sub getPreviousColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 new ( session, paletteId, [ name ])
|
||||
|
||||
=head2 new ( session, paletteId, [ name ] )
|
||||
|
||||
Constructor for this class.
|
||||
|
||||
|
|
@ -338,6 +354,7 @@ sub new {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 removeColor ( index )
|
||||
|
||||
Removes color at index.
|
||||
|
|
@ -373,7 +390,8 @@ sub removeColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 session
|
||||
|
||||
=head2 session ( )
|
||||
|
||||
Returns the WebGUI::Session object.
|
||||
|
||||
|
|
@ -386,6 +404,7 @@ sub session {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setColor ( index, color )
|
||||
|
||||
Sets palette position index to color. This method will automatically save or
|
||||
|
|
@ -424,7 +443,8 @@ sub setColor {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head setName ( name )
|
||||
|
||||
=head2 setName ( name )
|
||||
|
||||
Set the name of this palette.
|
||||
|
||||
|
|
@ -447,6 +467,7 @@ sub setName {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setPaletteIndex ( index )
|
||||
|
||||
Set the internal palette index counter. In other words, it sets the current
|
||||
|
|
@ -472,6 +493,7 @@ sub setPaletteIndex {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 swapColors ( firstIndex, secondIndex )
|
||||
|
||||
Swaps the position of two colors within the palette.
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@ A userId of a user attached to this message.
|
|||
|
||||
A groupId of a group attached to this message.
|
||||
|
||||
=head
|
||||
|
||||
=cut
|
||||
|
||||
sub create {
|
||||
|
|
@ -113,9 +111,9 @@ sub create {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 delete
|
||||
=head2 delete ( )
|
||||
|
||||
Deletes this message from the inbox.
|
||||
Deletes this message from the inbox.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -171,7 +169,7 @@ sub get {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getId ()
|
||||
=head2 getId ( )
|
||||
|
||||
Returns the ID of this message.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
package WebGUI::Macro::RandomThread;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
|
@ -18,7 +19,7 @@ use WebGUI::Asset;
|
|||
use WebGUI::Asset::Template;
|
||||
use WebGUI::Utility;
|
||||
|
||||
=head1 NAME
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Macro::RandomThread
|
||||
|
||||
|
|
|
|||
|
|
@ -106,28 +106,28 @@ sub www_editAd {
|
|||
hoverHelp => $i18n->get("is active help"),
|
||||
label=>$i18n->get("is active")
|
||||
);
|
||||
my $value = $ad->get("title") if defined $ad;
|
||||
$value = $ad->get("title") if defined $ad;
|
||||
$f->text(
|
||||
name=>"title",
|
||||
value=>$value,
|
||||
hoverHelp => $i18n->get("title help"),
|
||||
label=>$i18n->get("title")
|
||||
);
|
||||
my $value = $ad->get("url") if defined $ad;
|
||||
$value = $ad->get("url") if defined $ad;
|
||||
$f->url(
|
||||
name=>"url",
|
||||
value=>$value,
|
||||
hoverHelp => $i18n->get("url help"),
|
||||
label=>$i18n->get("url")
|
||||
);
|
||||
my $value = $ad->get("priority") if defined $ad;
|
||||
$value = $ad->get("priority") if defined $ad;
|
||||
$f->integer(
|
||||
name=>"priority",
|
||||
value=>$value,
|
||||
hoverHelp => $i18n->get("priority help"),
|
||||
label=>$i18n->get("priority"),
|
||||
);
|
||||
my $value = $ad->get("impressionsBought") if defined $ad;
|
||||
$value = $ad->get("impressionsBought") if defined $ad;
|
||||
$f->integer(
|
||||
name=>"impressionsBought",
|
||||
value=>$value,
|
||||
|
|
@ -135,7 +135,7 @@ sub www_editAd {
|
|||
label=>$i18n->get("impressions bought"),
|
||||
subtext=> defined $ad ? $i18n->get("used").": ".$ad->get("impressions") : undef
|
||||
);
|
||||
my $value = $ad->get("clicksBought") if defined $ad;
|
||||
$value = $ad->get("clicksBought") if defined $ad;
|
||||
$f->integer(
|
||||
name=>"clicksBought",
|
||||
value=>$value,
|
||||
|
|
@ -143,7 +143,7 @@ sub www_editAd {
|
|||
label=>$i18n->get("clicks bought"),
|
||||
subtext=> defined $ad ? $i18n->get("used").": ".$ad->get("clicks") : undef
|
||||
);
|
||||
my $value = $ad->get("type") if defined $ad;
|
||||
$value = $ad->get("type") if defined $ad;
|
||||
$f->selectBox(
|
||||
name=>"type",
|
||||
value=>$value,
|
||||
|
|
@ -157,7 +157,7 @@ sub www_editAd {
|
|||
label=>$i18n->get("type")
|
||||
);
|
||||
$f->fieldSetStart($i18n->get("text"));
|
||||
my $value = $ad->get("adText") if defined $ad;
|
||||
$value = $ad->get("adText") if defined $ad;
|
||||
$f->text(
|
||||
name=>"adText",
|
||||
size=>60,
|
||||
|
|
@ -165,7 +165,7 @@ sub www_editAd {
|
|||
hoverHelp => $i18n->get("ad text help"),
|
||||
label=>$i18n->get("ad text")
|
||||
);
|
||||
my $value = $ad->get("borderColor") if defined $ad;
|
||||
$value = $ad->get("borderColor") if defined $ad;
|
||||
$f->color(
|
||||
name=>"borderColor",
|
||||
value=>$value,
|
||||
|
|
@ -173,7 +173,7 @@ sub www_editAd {
|
|||
hoverHelp => $i18n->get("border color help"),
|
||||
label=>$i18n->get("border color")
|
||||
);
|
||||
my $value = $ad->get("textColor") if defined $ad;
|
||||
$value = $ad->get("textColor") if defined $ad;
|
||||
$f->color(
|
||||
name=>"textColor",
|
||||
value=>$value,
|
||||
|
|
@ -181,7 +181,7 @@ sub www_editAd {
|
|||
hoverHelp => $i18n->get("text color help"),
|
||||
label=>$i18n->get("text color")
|
||||
);
|
||||
my $value = $ad->get("backgroundColor") if defined $ad;
|
||||
$value = $ad->get("backgroundColor") if defined $ad;
|
||||
$f->color(
|
||||
name=>"backgroundColor",
|
||||
value=>$value,
|
||||
|
|
@ -202,7 +202,7 @@ sub www_editAd {
|
|||
}
|
||||
$f->fieldSetEnd;
|
||||
$f->fieldSetStart($i18n->get("rich"));
|
||||
my $value = $ad->get("richMedia") if defined $ad;
|
||||
$value = $ad->get("richMedia") if defined $ad;
|
||||
$f->codearea(
|
||||
name=>"richMedia",
|
||||
label=>$i18n->get("rich"),
|
||||
|
|
@ -290,21 +290,21 @@ sub www_editAdSpace {
|
|||
hoverHelp => $i18n->get("name help"),
|
||||
label=>$i18n->get("name")
|
||||
);
|
||||
my $value = $adSpace->get("title") if defined $adSpace;
|
||||
$value = $adSpace->get("title") if defined $adSpace;
|
||||
$f->text(
|
||||
name=>"title",
|
||||
value=>$value,
|
||||
hoverHelp => $i18n->get("title help"),
|
||||
label=>$i18n->get("title")
|
||||
);
|
||||
my $value = $adSpace->get("description") if defined $adSpace;
|
||||
$value = $adSpace->get("description") if defined $adSpace;
|
||||
$f->textarea(
|
||||
name=>"description",
|
||||
value=>$value,
|
||||
hoverHelp => $i18n->get("description help"),
|
||||
label=>$i18n->get("description")
|
||||
);
|
||||
my $value = $adSpace->get("width") if defined $adSpace;
|
||||
$value = $adSpace->get("width") if defined $adSpace;
|
||||
$f->integer(
|
||||
name=>"width",
|
||||
value=>$value,
|
||||
|
|
@ -312,7 +312,7 @@ sub www_editAdSpace {
|
|||
hoverHelp => $i18n->get("width help"),
|
||||
label=>$i18n->get("width")
|
||||
);
|
||||
my $value = $adSpace->get("height") if defined $adSpace;
|
||||
$value = $adSpace->get("height") if defined $adSpace;
|
||||
$f->integer(
|
||||
name=>"height",
|
||||
value=>$value,
|
||||
|
|
@ -340,7 +340,7 @@ sub www_editAdSpace {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editAdSpaceSave ()
|
||||
=head2 www_editAdSpaceSave ( )
|
||||
|
||||
Save the www_editAdSpace method.
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ sub _load {
|
|||
my $other = _load($session, $hash->{$tag}{isa}{namespace});
|
||||
my $add = $other->{$hash->{$tag}{isa}{tag}}{fields};
|
||||
@{$hash->{$tag}{fields}} = (@{$hash->{$tag}{fields}}, @{$add});
|
||||
my $add = $other->{$hash->{$tag}{isa}{tag}}{related};
|
||||
$add = $other->{$hash->{$tag}{isa}{tag}}{related};
|
||||
@{$hash->{$tag}{related}} = (@{$hash->{$tag}{related}}, @{$add});
|
||||
my $add = $other->{$hash->{$tag}{isa}{tag}}{variables};
|
||||
$add = $other->{$hash->{$tag}{isa}{tag}}{variables};
|
||||
foreach my $row (@{$add}) {
|
||||
push(@{$hash->{$tag}{variables}}, {
|
||||
name=> $row->{name},
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ use WebGUI::Session::Stow;
|
|||
use WebGUI::Session::Style;
|
||||
use WebGUI::Session::Url;
|
||||
use WebGUI::Session::Var;
|
||||
use Data::Dumper;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -145,7 +144,7 @@ sub config {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 datetime ()
|
||||
=head2 datetime ( )
|
||||
|
||||
Returns a WebGUI::Session::DateTime object.
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,7 @@ Returns a boolean (0|1) value signifying that the user has the required privileg
|
|||
The group that you wish to verify against the user. Defaults to group with Id 3 (the Admin group).
|
||||
|
||||
=cut
|
||||
|
||||
sub isInGroup {
|
||||
my (@data, $groupId);
|
||||
my ($self, $gid, $secondRun) = @_;
|
||||
|
|
@ -458,7 +459,7 @@ sub newByEmail {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 profileField ( fieldName [ value ] )
|
||||
=head2 profileField ( fieldName [, value ] )
|
||||
|
||||
Returns a profile field's value. If "value" is specified, it also sets the field to that value.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue