Huge amount of ISA work for Assets (as opposed to Wobjects).

Bug fix for toolbar button rows that do not go away when all buttons
are deselected.
This commit is contained in:
Colin Kuskie 2006-12-23 23:58:51 +00:00
parent 224b2c08d1
commit 93288c8332
20 changed files with 518 additions and 71 deletions

View file

@ -736,7 +736,7 @@ sub getEditForm {
=head2 getExtraHeadTags ( )
Returns the extraHeadTags stored in the asset. Called in $self->session->style->generateAdditionalHeadTags if this asset is the $self->session->asset. Also called in WebGUI::Layout::view for its child assets. Overriden in Shortcut.pm.
Returns the extraHeadTags stored in the asset. Called in $self->session->style->generateAdditionalHeadTags if this asset is the current session asset. Also called in WebGUI::Layout::view for its child assets. Overriden in Shortcut.pm.
=cut

View file

@ -45,6 +45,32 @@ These methods are available from this class:
#-------------------------------------------------------------------
=head2 _fetch_button_rows ( @toolbarRows )
Return the definitions for toolbar rows.
=head3 definition
A hash reference passed in from a subclass definition.
=cut
sub _fetch_button_rows {
my $self = shift;
my @toolbarRows = @_;
my %toolbarRow = ();
foreach my $rowIndex (0..$#toolbarRows) {
$toolbarRow{'theme_advanced_buttons'.$rowIndex} =
join(',', @{$toolbarRows[$_]});
}
#(map { "theme_advanced_buttons".($_+1) => }
#(0..$#toolbarRows)),
}
#-------------------------------------------------------------------
=head2 definition ( definition )
@ -433,9 +459,10 @@ sub getRichEditor {
my $self = shift;
return '' if ($self->getValue('disableRichEditor') || $self->session->env->get("HTTP_USER_AGENT") =~ /Safari/);
my $nameId = shift;
my @toolbarRows = grep{@$_} map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3);
#my @toolbarRows = grep{@$_} map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3);
my @toolbarRows = map{[split "\n", $self->getValue("toolbarRow$_")]} (1..3);
push(@{$toolbarRows[0]},"contextmenu") if ($self->getValue("enableContextMenu"));
my @toolbarButtons = map{@$_} @toolbarRows;
my @toolbarButtons = map{ @{$_} } @toolbarRows;
my @plugins;
my $i18n = WebGUI::International->new($self->session, 'Asset_RichEdit');
@ -450,6 +477,7 @@ sub getRichEditor {
cleanup_callback => "tinyMCE_WebGUI_Cleanup",
urlconvertor_callback => "tinyMCE_WebGUI_URLConvertor",
theme_advanced_resizing => "true",
#$self->_fetch_button_rows(@toolbarRows),
(map { "theme_advanced_buttons".($_+1) => (join ',', @{$toolbarRows[$_]}) }
(0..$#toolbarRows)),
ask => $self->getValue("askAboutRichEdit") ? "true" : "false",

View file

@ -116,6 +116,62 @@ our $HELP = {
]
},
'asset template asset variables' => {
title => 'asset template asset var title',
body => 'asset template asset var body',
variables => [
{
name => 'title',
},
{
name => 'menuTitle',
},
{
name => 'url',
},
{
name => 'isHidden',
},
{
name => 'newWindow',
},
{
name => 'encryptPage',
},
{
name => 'ownerUserId',
},
{
name => 'groupIdView',
},
{
name => 'groupIdEdit',
},
{
name => 'synopsis',
},
{
name => 'extraHeadTags',
},
{
name => 'isPackage',
},
{
name => 'isPrototype',
},
{
name => 'status',
},
{
name => 'assetSize',
},
],
fields => [
],
related => [
]
},
'asset toolbar' => {
title => 'asset toolbar title',
body => 'asset toolbar body',

View file

@ -47,12 +47,12 @@ our $HELP = {
body => 'file template body',
isa => [
{
namespace => "Asset_Template",
tag => "template variables"
namespace => "Asset_File",
tag => "file template asset variables"
},
{
namespace => "Asset",
tag => "asset template"
namespace => "Asset_Template",
tag => "template variables"
},
],
variables => [
@ -68,18 +68,40 @@ our $HELP = {
{
'name' => 'controls'
},
],
fields => [
],
related => [
{
tag => 'file add/edit',
namespace => 'Asset_File',
},
]
},
'file template asset variables' => {
title => 'file template asset var title',
body => 'file template asset var body',
isa => [
{
namespace => "Asset",
tag => "asset template asset variables"
},
],
variables => [
{
'name' => 'filename'
'name' => 'cacheTimeout'
},
{
'name' => 'filename',
'description' => 'filename var'
},
{
'name' => 'storageId'
},
{
'name' => 'title'
'name' => 'templateId'
},
{
'name' => 'menuTitle'
}
],
fields => [
],

View file

@ -49,6 +49,10 @@ our $HELP = {
title => 'image template title',
body => 'image template body',
isa => [
{
namespace => "Asset_Image",
tag => "image template asset variables"
},
{
namespace => "Asset_Template",
tag => "template variables"
@ -74,25 +78,6 @@ our $HELP = {
'name' => 'thumbnail',
'description' => 'thumbnail variable'
},
{
'name' => 'thumbnailSize'
},
{
'name' => 'parameters',
'description' => 'parameters variable'
},
{
'name' => 'filename'
},
{
'name' => 'storageId'
},
{
'name' => 'title'
},
{
'name' => 'menuTitle'
}
],
related => [
{
@ -106,6 +91,30 @@ our $HELP = {
]
},
'image template asset variables' => {
title => 'image template asset var title',
body => 'image template asset var body',
isa => [
{
namespace => "Asset_File",
tag => "file template asset variables"
},
],
fields => [
],
variables => [
{
'name' => 'thumbnailSize'
},
{
'name' => 'parameters',
'description' => 'parameters variable'
},
],
related => [
]
},
'image resize' => {
title => 'resize image title',
body => 'resize image body',

View file

@ -13,6 +13,10 @@ our $HELP = {
tag => 'template language',
namespace => 'Asset_Template'
},
{
tag => 'post asset variables',
namespace => 'Asset_Post'
},
],
fields => [
],
@ -265,6 +269,10 @@ our $HELP = {
title => 'post asset variables title',
body => 'post asset variables body',
isa => [
{
tag => 'asset template asset variables',
namespace => 'Asset'
},
],
variables => [
{

View file

@ -6,6 +6,10 @@ our $HELP = {
body => 'rss from parent body',
# use the following to inherit stuff other help entries
isa => [
{
tag => 'template variables',
namespace => 'Asset_Template'
},
],
fields => [ #This array is used to list hover help for form fields.
],

View file

@ -6,6 +6,11 @@ our $HELP = {
title => 'rich edit add/edit title',
body => 'rich edit add/edit body',
fields => [
{
title => 'toolbar buttons',
description => 'toolbar buttons description',
namespace => 'Asset_RichEdit',
},
{
title => 'disable rich edit',
description => 'disable rich edit description',

View file

@ -4,6 +4,24 @@ our $HELP = {
'thread template variables' => {
title => 'thread template title',
body => 'thread template body',
isa => [
{
tag => 'template language',
namespace => 'Asset_Template'
},
{
tag => 'post template variables',
namespace => 'Asset_Post'
},
{
tag => 'collaboration template labels',
namespace => 'Asset_Collaboration'
},
{
tag => 'pagination template variables',
namespace => 'WebGUI'
},
],
fields => [
],
variables => [
@ -145,22 +163,23 @@ our $HELP = {
}
],
related => [
]
},
'thread asset template variables' => {
title => 'thread asset template title',
body => 'thread asset template body',
isa => [
{
tag => 'template language',
namespace => 'Asset_Template'
},
{
tag => 'post template variables',
tag => 'post asset variables',
namespace => 'Asset_Post'
},
{
tag => 'collaboration template labels',
namespace => 'Asset_Collaboration'
},
{
tag => 'pagination template variables',
namespace => 'WebGUI'
},
],
fields => [
],
variables => [
],
related => [
]
},

View file

@ -68,6 +68,10 @@ our $HELP = {
title => 'view title',
body => 'view body',
isa => [
{
tag => 'wiki page asset template variables',
namespace => 'Asset_WikiPage'
},
],
variables => [
{
@ -119,6 +123,35 @@ our $HELP = {
],
},
'wiki page asset template variables' => {
title => 'vars title',
body => 'vars body',
isa => [
],
variables => [
{
name => 'storageId',
},
{
name => 'content variable',
},
{
name => 'views',
},
{
name => 'isProtected',
},
{
'name' => 'actionTaken',
},
{
'name' => 'actionTakenBy',
},
],
related => [
],
},
'history template' => {
title => 'history title',
body => 'history body',

View file

@ -5,6 +5,12 @@ our $HELP = {
'zip archive add/edit' => {
title => 'zip archive add/edit title',
body => 'zip archive add/edit body',
isa => [
{
namespace => "Asset_File",
tag => "file add/edit"
},
],
fields => [
{
title => 'new file',
@ -24,18 +30,10 @@ our $HELP = {
],
related => [
{
tag => 'asset fields',
namespace => 'Asset',
},
{
tag => 'zip archive template',
namespace => 'Asset_ZipArchive',
},
{
tag => 'file add/edit',
namespace => 'Asset_File',
},
]
},
@ -43,6 +41,10 @@ our $HELP = {
title => 'zip archive template title',
body => 'zip archive template body',
isa => [
{
namespace => "Asset_ZipArchive",
tag => "zip archive asset variables"
},
{
namespace => "Asset_Template",
tag => "template variables"
@ -76,6 +78,29 @@ our $HELP = {
]
},
'zip archive asset variables' => {
title => 'zip archive asset variables title',
body => 'zip archive asset variables body',
isa => [
{
namespace => "Asset_File",
tag => "file template asset variables"
},
],
fields => [
],
variables => [
{
'name' => 'showPage'
},
{
'name' => 'templateId'
},
],
related => [
]
},
};
1;

View file

@ -1042,6 +1042,92 @@ to edit or modify that asset.</p>|,
lastUpdated => 1160773957,
},
'asset template asset var title' => {
message => q|Asset Template Asset Variables|,
lastUpdated => 1100463645,
},
'asset template asset var body' => {
message => q|<p>These template variables are common to almost every asset. Many of them are internal asset properties that govern behavior and may not be very useful for templates. One example of this would be the ID of templates used to display the Asset. Depending on whether or not the user filled out the fields, they may or may not be blank.</p>
|,
lastUpdated => 1166825198,
},
'title' => {
message => q|The title of the Asset|,
lastUpdated => 1160773957,
},
'menuTitle' => {
message => q|The title of the Asset used in Navigations.|,
lastUpdated => 1160773957,
},
'url' => {
message => q|The Asset's URL.|,
lastUpdated => 1160773957,
},
'isHidden' => {
message => q|A boolean that will be true if this Asset is set not be displayed in Navigations.|,
lastUpdated => 1160773957,
},
'newWindow' => {
message => q|A boolean that will be true if this Asset is set open in a new browser window.|,
lastUpdated => 1160773957,
},
'encryptPage' => {
message => q|A boolean that will be true if this Asset is set to be served over SSL.|,
lastUpdated => 1160773957,
},
'ownerUserId' => {
message => q|The ID of the user who owns this Asset.|,
lastUpdated => 1160773957,
},
'groupIdView' => {
message => q|The ID of the group that is allowed to view this Asset.|,
lastUpdated => 1160773957,
},
'groupIdEdit' => {
message => q|The ID of the group that is allowed to edit this Asset.|,
lastUpdated => 1160773957,
},
'synopsis' => {
message => q|A short description of the contents of the Asset.|,
lastUpdated => 1160773957,
},
'extraHeadTags' => {
message => q|Extra tags that will be added to the header of the page containing the Asset. These will be included by default so you do not need to add them youself, unless you want them to be in there twice.|,
lastUpdated => 1160773957,
},
'isPackage' => {
message => q|A boolean that will be true if this Asset is set to be a Package.|,
lastUpdated => 1160773957,
},
'isPrototype' => {
message => q|A boolean that will be true if this Asset is set to be a prototype.|,
lastUpdated => 1160773957,
},
'status' => {
message => q|With respect to version control, the status of this Asset. Typically these are the English strings "approved", "pending", "committed".|,
lastUpdated => 1160773957,
},
'assetSize' => {
message => q|How big this asset is in bytes. The sum of all database fields and attachments.|,
lastUpdated => 1160773957,
},
};
1;

View file

@ -111,6 +111,41 @@ our $I18N = {
lastUpdated => 1165517718
},
'file template asset var title' => {
message => q|File Template, Asset Variables|,
lastUpdated => 1130456105,
},
'file template asset var body' => {
message => q|<p>The following variables are available in File Templates. They may or may not be useful.</p>
|,
lastUpdated => 1166824158,
},
'cacheTimeout' => {
message => q|The length of time set for the cache timeout.
|,
lastUpdated => 1166824158,
},
'filename var' => {
message => q|The name of the file this Asset holds. It does not include the path to the file.
|,
lastUpdated => 1166824158,
},
'storageId' => {
message => q|The ID of the WebGUI storage element used to store the file.
|,
lastUpdated => 1166824158,
},
'templateId' => {
message => q|The ID of the template used to display the file.
|,
lastUpdated => 1166824158,
},
};
1;

View file

@ -151,8 +151,8 @@ shown here.|,
},
'controls' => {
message => q|A toolbar for working with the file.|,
lastUpdated => 1148952544,
message => q|An iconic toolbar for working with the file.|,
lastUpdated => 1166827236,
},
'thumbnail variable' => {
@ -190,7 +190,6 @@ shown here.|,
lastUpdated => 1148952544,
},
'image template body' => {
message => q|<p>The following variables are available in Image Templates:</p>
|,
@ -198,6 +197,17 @@ shown here.|,
lastUpdated => 1148952657,
},
'image template asset var title' => {
message => q|Image Template, Asset Variables|,
lastUpdated => 1166827631,
},
'image template asset var body' => {
message => q|<p>The following variables are available in Image Templates. They represent internal Asset properties and may or may not be particularly useful in your templates.</p>
|,
lastUpdated => 1166827628,
},
};
1;

View file

@ -8,8 +8,8 @@ our $I18N = {
},
'toolbar buttons description' => {
message => q|Shows which toolbar buttons will be used in the editor.|,
lastUpdated => 1133760935,
message => q|Shows which toolbar buttons will be used in which toolbars in the editor. To remove a toolbar, deselect all buttons in that toolbar's column. Note that other fields may add buttons to a toolbar row as well, such as Enable Context Menu.|,
lastUpdated => 1166844107,
},
'using rich edit' => {
@ -377,8 +377,8 @@ our $I18N = {
},
'using rich edit description' => {
message => q|Ask the user whether or not to use the Rich Editor on this form.|,
lastUpdated => 1119584875,
message => q|Ask the user whether or not to use the Rich Editor on this form each time the form is accessed.|,
lastUpdated => 1166844446,
},
'preformatted description' => {
@ -433,8 +433,8 @@ option is set to Yes, then all whitespace entered into the form will be preserve
},
'toolbar location description' => {
message => q|Set whether the toolbar should be placed above (top) or below (bottom) the form.|,
lastUpdated => 1119584875,
message => q|Set whether the toolbars should be placed above (top) or below (bottom) the form.|,
lastUpdated => 1166844385,
},
'css file description' => {

View file

@ -37,10 +37,12 @@ our $I18N = {
'snippet add/edit body' => {
message => q|<p>Snippets are bits of text that may be reused on your site. Things like java scripts, cascading style sheets, HTML segments, XML or company slogans can all be used as snippets. Best of all, if you need to change the text, you need change it in only one location to update the snippet whereever it is used.</p>
<p>Since Snippets are Assets, so they have all the properties that Assets do.</p>
<p>Macros placed in the Snippet will always be executed.</p>
<p>Snippets are Assets so they have all the properties that Assets do.</p>
|,
context => 'Describing snippets',
lastUpdated => 1130880179,
lastUpdated => 1166845107,
},
'snippet description' => {

View file

@ -135,8 +135,8 @@ of date submitted.|,
},
'stick.url' => {
message => q|The URL to make this thread sticky.|,
lastUpdated => 1149633755,
message => q|The URL to make this thread sticky. Sticky threads will stay at the top of the list of threads.|,
lastUpdated => 1166847623,
},
'unstick.url' => {
@ -145,8 +145,8 @@ of date submitted.|,
},
'isLocked' => {
message => q|A conditional indicating if the current thread is locked.|,
lastUpdated => 1149633755,
message => q|A conditional indicating if the current thread is locked. Locked threads can no longer be edited.|,
lastUpdated => 1166847827,
},
'lock.url' => {
@ -248,6 +248,47 @@ also contains a set of its own Post Template variables.|,
lastUpdated => 1119068745
},
'subscriptionGroupId' => {
message => q|The group ID reserved for users who subscribe to this thread.|,
lastUpdated => 1166847458
},
'replies' => {
message => q|The total number of replies in this thread.|,
lastUpdated => 1166847458
},
'isSticky variable' => {
message => q|A boolean which will be true if the thread was set to be sticky.|,
lastUpdated => 1166847458
},
'isLocked variable' => {
message => q|A boolean which will be true if the thread was locked.|,
lastUpdated => 1166847458
},
'lastPostId' => {
message => q|The ID of the most recent Post in the Thread.|,
lastUpdated => 1166847458
},
'lastPostDate' => {
message => q|The date of the most recent Post in the Thread.|,
lastUpdated => 1166847458
},
'thread asset template title' => {
message => q|Thread Asset Template Variables|,
lastUpdated => 1166848379,
},
'thread asset template body' => {
message => q|<p>The variables below are available in the Thread template. Most of them are internal variable that are not overly useful.</p>
|,
lastUpdated => 1166848381,
},
};
1;

View file

@ -178,8 +178,48 @@ our $I18N =
},
'content' => {
message => q|The content of this page, with recognized title and links changed into Wiki links.|,
lastUpdated => 1165812138,
message => q|The content of this page, with recognized titles and links changed into Wiki links.|,
lastUpdated => 1166845905,
},
'vars title' => {
message => q|WikiPage Template Asset Variables.|,
lastUpdated => 1166845955,
},
'vars body' => {
message => q|<p>These variables are available in the WikiPage template. They are based on internal Asset variables and may or may not be useful.</p>|,
lastUpdated => 1166845955,
},
'storageId' => {
message => q|The Id of the object used to store attachments for this WikiPage.|,
lastUpdated => 1166845955,
},
'content variable' => {
message => q|The raw content of the WikiPage, with no titles or links processed. You should never see the contents of this variable as it will be overridden in the template.|,
lastUpdated => 1166846242,
},
'views' => {
message => q|The number of times this WikiPage has been viewed.|,
lastUpdated => 1166846242,
},
'isProtected' => {
message => q|A boolean which will be true if this WikiPage has been protected.|,
lastUpdated => 1166846242,
},
'actionTaken' => {
message => q|The action taken to produce the current version of the WikiPage. On a brand new page, this will be "Created". Otherwise it will be "Edited".|,
lastUpdated => 1166846242,
},
'actionTakenBy' => {
message => q|The ID of the User who edited the page last.|,
lastUpdated => 1166846434,
},
'history title' => {

View file

@ -93,6 +93,30 @@ our $I18N = {
lastUpdated => 1148953449,
},
'zip archive asset variables title' => {
message => q|Zip Archive, Asset Template Variables|,
lastUpdated => 1109287565,
},
'zip archive asset variables body' => {
message => q|<p>The following variables are included by default in the Zip Archive Templates. They may or may not be particularly useful:</p>
|,
context => q|Describing the zip archive template asset variables|,
lastUpdated => 1148953449,
},
'showPage' => {
message => q|The name of the file from the Zip Archive that will be displayed when this Asset is viewed.
|,
lastUpdated => 1166823840,
},
'templateId' => {
message => q|The ID of the template used to display the contents of the Zip Archive.
|,
lastUpdated => 1166823840,
},
};