fixed an upgrade bug

This commit is contained in:
JT Smith 2005-07-22 19:07:54 +00:00
parent aee65b8391
commit bbdd05904a
6 changed files with 19 additions and 812 deletions

View file

@ -9,6 +9,7 @@ use WebGUI::Asset::Wobject::Folder;
use WebGUI::Asset::Snippet; use WebGUI::Asset::Snippet;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::SQL; use WebGUI::SQL;
use WebGUI::Group;
my $configFile; my $configFile;
my $quiet; my $quiet;
@ -25,6 +26,7 @@ updateConfigFile();
insertHelpTemplate(); insertHelpTemplate();
insertXSLTSheets(); insertXSLTSheets();
insertSyndicatedContentTemplate(); insertSyndicatedContentTemplate();
WebGUI::Group->new('9')->delete;
WebGUI::Session::close(); WebGUI::Session::close();
@ -59,7 +61,7 @@ sub addAssetVersioning {
my $now = time(); my $now = time();
WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000001','Initial Import','1',$now,'3',$now,'3')"); WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000001','Initial Import','1',$now,'3',$now,'3')");
WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000002','Auto Commit','1',$now,'3',$now,'3')"); WebGUI::SQL->write("insert into assetVersionTag values ('pbversion0000000000002','Auto Commit','1',$now,'3',$now,'3')");
foreach my $table (qw(FileAsset Post RichEdit Snippet EventsCalendar_Event ImageAsset Thread redirect Shortcut Template Article EventsCalendar IndexedSearch MessageBoard SQLReport Folder Navigation Survey WSClient Collaboration HttpProxy Layout Poll SyndicatedContent Product DataForm wobject)) { foreach my $table (qw(FileAsset Post RichEdit snippet EventsCalendar_event ImageAsset Thread redirect Shortcut template Article EventsCalendar IndexedSearch MessageBoard SQLReport Folder Navigation Survey WSClient Collaboration HttpProxy Layout Poll SyndicatedContent Product DataForm wobject)) {
WebGUI::SQL->write("alter table $table add column revisionDate bigint not null"); WebGUI::SQL->write("alter table $table add column revisionDate bigint not null");
WebGUI::SQL->write("update $table set revisionDate=$now"); WebGUI::SQL->write("update $table set revisionDate=$now");
WebGUI::SQL->write("alter table $table drop primary key"); WebGUI::SQL->write("alter table $table drop primary key");

View file

@ -2,4 +2,5 @@ insert into webguiVersion values ('6.7.0','upgrade',unix_timestamp());
alter table SyndicatedContent add column displayMode varchar(20) not null default 'interleaved'; alter table SyndicatedContent add column displayMode varchar(20) not null default 'interleaved';
alter table SyndicatedContent add column hasTerms varchar(255) not null; alter table SyndicatedContent add column hasTerms varchar(255) not null;
alter table snippet add column mimeType varchar(50) not null default 'text/html'; alter table snippet add column mimeType varchar(50) not null default 'text/html';
drop table theme;
drop table themeComponent;

View file

@ -83,6 +83,19 @@ All of the functions in this package accept the input of a hash reference contai
=cut =cut
sub AUTOLOAD {
our $AUTOLOAD;
my $name = (split /::/, $AUTOLOAD)[-1];
my @params = @_;
my $cmd = "use WebGUI::Form::".$name;
eval ($cmd);
if ($@) {
WebGUI::ErrorHandler::error("Couldn't compile form field: ".$name.". Root cause: ".$@);
return undef;
}
my $class = "WebGUI::Form::".$name;
return $class->new(@params)->toHtml;
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub _fixMacros { sub _fixMacros {
@ -1724,7 +1737,7 @@ This will be used if no value is specified.
=cut =cut
sub text { sub texta {
my $params = shift; my $params = shift;
my $value = _fixSpecialCharacters($params->{value}||$params->{defaultValue}); my $value = _fixSpecialCharacters($params->{value}||$params->{defaultValue});
$value = _fixQuotes($value); $value = _fixQuotes($value);

View file

@ -600,86 +600,6 @@ our $HELP = {
} }
] ]
}, },
'themes manage' => {
title => '931',
body => '932',
fields => [
],
related => [
{
tag => 'templates manage',
namespace => 'Asset_Template'
},
{
tag => 'theme delete',
namespace => 'WebGUI'
},
{
tag => 'theme edit',
namespace => 'WebGUI'
},
{
tag => 'theme import',
namespace => 'WebGUI'
}
]
},
'theme edit' => {
title => '933',
body => '934',
fields => [
{
title => '903',
description => '903 description',
namespace => 'WebGUI',
},
{
title => '904',
description => '904 description',
namespace => 'WebGUI',
},
{
title => '905',
description => '905 description',
namespace => 'WebGUI',
},
{
title => '906',
description => '906 description',
namespace => 'WebGUI',
},
],
related => [
{
tag => 'themes manage',
namespace => 'WebGUI'
}
]
},
'theme import' => {
title => '936',
body => '937',
fields => [
],
related => [
{
tag => 'themes manage',
namespace => 'WebGUI'
}
]
},
'theme delete' => {
title => '938',
body => '939',
fields => [
],
related => [
{
tag => 'themes manage',
namespace => 'WebGUI'
}
]
},
'database links manage' => { 'database links manage' => {
title => '997', title => '997',
body => '1000', body => '1000',

View file

@ -1,492 +0,0 @@
package WebGUI::Operation::Theme;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2005 Plain Black Corporation.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use Tie::IxHash;
use Tie::CPHash;
use WebGUI::AdminConsole;
use WebGUI::Grouping;
use WebGUI::HTMLForm;
use WebGUI::HTTP;
use WebGUI::Icon;
use WebGUI::Id;
use WebGUI::International;
use WebGUI::Paginator;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::Utility;
use WebGUI::FormProcessor;
#-------------------------------------------------------------------
sub _getComponentTypes {
my %components;
tie %components, 'Tie::IxHash';
%components = (
file=>WebGUI::International::get(915),
image=>WebGUI::International::get(914),
snippet=>WebGUI::International::get(916),
template=>WebGUI::International::get(913)
);
return \%components;
}
#-------------------------------------------------------------------
sub _submenu {
my $workarea = shift;
my $title = shift;
$title = WebGUI::International::get($title) if ($title);
my $help = shift;
my $ac = WebGUI::AdminConsole->new("themes");
if ($help) {
$ac->setHelp($help);
}
$ac->addSubmenuItem(WebGUI::URL::page('op=editTheme&themeId=new'), WebGUI::International::get(901));
$ac->addSubmenuItem(WebGUI::URL::page('op=importTheme'), WebGUI::International::get(924));
unless (isIn($session{form}{op}, qw(deleteThemeConfirm viewTheme listThemes)) || $session{form}{themeId} eq "new") {
$ac->addSubmenuItem(WebGUI::URL::page('op=editTheme&themeId='.$session{form}{themeId}), WebGUI::International::get(919));
$ac->addSubmenuItem(WebGUI::URL::page('op=deleteTheme&themeId='.$session{form}{themeId}), WebGUI::International::get(918));
$ac->addSubmenuItem(WebGUI::URL::page('op=exportTheme&themeId='.$session{form}{themeId}), WebGUI::International::get(920));
}
$ac->addSubmenuItem(WebGUI::URL::page('op=listThemes'), WebGUI::International::get(900));
return $ac->render($workarea, $title);
}
#-------------------------------------------------------------------
sub www_addThemeComponent {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my (@q, $output, $defaultList, $component, $f);
my $types = _getComponentTypes();
push(@q,{query=>"select collateralType,collateralId,name from collateral where collateralType='file' order by name",type=>"file"});
push(@q,{query=>"select collateralType,collateralId,name from collateral where collateralType='image' order by name",type=>"image"});
push(@q,{query=>"select collateralType,collateralId,name from collateral where collateralType='snippet' order by name",type=>"snippet"});
my $selectList = '<select name="id" multiple="1" size="10">';
foreach my $row (@q) {
my $comp = WebGUI::SQL->buildHashRef($row->{query});
$selectList .= "\n".'<optgroup label="'.$types->{$row->{type}}.'">';
foreach my $key (keys %{$comp}) {
$selectList .= '<option value="'.$key.'">'.$comp->{$key}.'</option>';
}
$selectList .= '</optgroup>';
}
my $sth = WebGUI::SQL->read("select templateId,namespace,name from template order by namespace,name");
my $previous;
while( my $comp = $sth->hashRef) {
if ($previous ne $comp->{namespace}) {
$selectList .= "\n".'<optgroup label="'.$types->{template}.'/'.$comp->{namespace}.'">';
}
$selectList .= '<option value="template_'.$comp->{templateId}.'_'.$comp->{namespace}.'">'.$comp->{name}.'</option>';
$previous = $comp->{namespace};
}
$sth->finish;
$selectList .= '</select>';
$f = WebGUI::HTMLForm->new;
$f->hidden("op","addThemeComponentSave");
$f->hidden("themeId",$session{form}{themeId});
$f->readOnly(
-value=>$selectList,
-label=>WebGUI::International::get(911)
);
$f->submit;
$output .= $f->print;
return _submenu($output,"909");
}
#-------------------------------------------------------------------
sub www_addThemeComponentSave {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my @ids = WebGUI::FormProcessor::selectList("id");
foreach my $id (@ids) {
$id =~ /^(.*?)\_(.*)/;
my $type = $1;
$id = $2;
my $componentId = WebGUI::Id::generate();
WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id)
values (".quote($session{form}{themeId}).", ".quote($componentId).", ".quote($type).", ".quote($id).")");
}
return www_editTheme();
}
#-------------------------------------------------------------------
sub www_deleteThemeConfirm {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".quote($session{form}{themeId}));
unless ($theme->{original}) {
WebGUI::SQL->write("delete from collateralFolder where name=".quote($theme->{name}));
my $sth = WebGUI::SQL->read("select type,Id from themeComponent where themeId=".quote($session{form}{themeId}));
while (my $component = $sth->hashRef) {
if ($component->{type} eq "template") {
my ($id,$namespace) = split("_",$component->{id});
WebGUI::SQL->write("delete from template where templateId=".quote($id)
." and namespace=".quote($namespace));
} else {
my $c = WebGUI::Collateral->new($component->{id});
$c->delete;
}
}
$sth->finish;
}
WebGUI::SQL->write("delete from theme where themeId=".quote($session{form}{themeId}));
WebGUI::SQL->write("delete from themeComponent where themeId=".quote($session{form}{themeId}));
return www_listThemes();
}
#-------------------------------------------------------------------
sub www_deleteThemeComponentConfirm {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
WebGUI::SQL->write("delete from themeComponent where themeComponentId=".quote($session{form}{themeComponentId}));
return www_editTheme();
}
#-------------------------------------------------------------------
sub www_editTheme {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my ($output, $theme, $f);
unless($session{form}{themeId} eq "new") {
$theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".quote($session{form}{themeId}));
}
$f = WebGUI::HTMLForm->new;
$f->hidden(
-name => "op",
-value => "editThemeSave",
);
$f->hidden(
-name => "themeId",
-value => $session{form}{themeId},
);
$f->readOnly(
-name => $session{form}{themeId},
-label => WebGUI::International::get(903),
-hoverHelp => WebGUI::International::get('903 description'),
);
$f->text(
-name => "name",
-label => WebGUI::International::get(904),
-hoverHelp => WebGUI::International::get('904 description'),
-value => $theme,
);
$f->text(
-name => "designer",
-label => WebGUI::International::get(905),
-hoverHelp => WebGUI::International::get('905 description'),
-value => $theme,
);
$f->url(
-name=>"designerURL",
-label=>WebGUI::International::get(906),
-hoverHelp=>WebGUI::International::get('906 description'),
-value=>$theme->{designerURL}
);
if ($session{form}{themeId} eq "new") {
$f->whatNext(
-value=>"addComponent",
-options=>{
listThemes=>WebGUI::International::get(900),
addComponent=>WebGUI::International::get(917)
}
);
}
$f->submit;
$output .= $f->print;
unless ($session{form}{themeId} eq "new") {
$output .= '<p><a href="'.WebGUI::URL::page('op=addThemeComponent&themeId='.$session{form}{themeId}).'">'
.WebGUI::International::get(917).'</a><p>';
my $componentTypes = _getComponentTypes();
my $query = "select collateral.name as name, themeComponent.themeComponentId as componentId,
collateral.collateralType as componentType from themeComponent, collateral
where collateral.collateralId=themeComponent.id and themeComponent.type=collateral.collateralType
and themeComponent.themeId=".quote($session{form}{themeId})." order by name";
my $sth = WebGUI::SQL->read($query);
while (my $component = $sth->hashRef) {
$output .= deleteIcon('op=deleteThemeComponentConfirm&themeId='.$session{form}{themeId}
.'&themeComponentId='.$component->{componentId},'',WebGUI::International::get(908))
.' '.$component->{name}.' ('.$componentTypes->{$component->{componentType}}.')<br>';
}
$sth->finish;
$sth = WebGUI::SQL->read("select themeComponentId,id from themeComponent
where type='template' and themeId=".quote($session{form}{themeId}));
while (my $data = $sth->hashRef) {
my ($templateId,$namespace) = split("_",$data->{id});
my ($name) = WebGUI::SQL->quickArray("select name from template where
templateId=".quote($templateId)." and namespace=".quote($namespace));
$output .= deleteIcon('op=deleteThemeComponentConfirm&themeId='.$session{form}{themeId}
.'&themeComponentId='.$data->{themeComponentId},'',WebGUI::International::get(908))
.' '.$name.' ('.$componentTypes->{template}.'/'.$namespace.')<br>';
}
$sth->finish;
}
return _submenu($output,'902',"theme edit");
}
#-------------------------------------------------------------------
sub www_editThemeSave {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
if ($session{form}{themeId} eq "new") {
$session{form}{themeId} = WebGUI::Id::generate();
WebGUI::SQL->write("insert into theme (themeId,webguiVersion,original,versionNumber)
values (".quote($session{form}{themeId}).",".quote($WebGUI::VERSION).",1,0)");
}
WebGUI::SQL->write("update theme set name=".quote($session{form}{name}).", designer=".quote($session{form}{designer}).",
designerURL=".quote($session{form}{designerURL})." where themeId=".quote($session{form}{themeId}));
if ($session{form}{proceed} eq "addComponent") {
return www_addThemeComponent();
}
return www_listThemes();
}
#-------------------------------------------------------------------
sub www_exportTheme {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my $tempId = "theme".$session{form}{themeId};
my $propertyFile = WebGUI::Attachment->new("_theme.properties","temp",$tempId);
WebGUI::SQL->write("update theme set versionNumber=versionNumber+1, webguiVersion=".quote($WebGUI::VERSION)
." where themeId=".quote($session{form}{themeId}));
my $theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".quote($session{form}{themeId}));
my $sth = WebGUI::SQL->read("select * from themeComponent where themeId=".quote($session{form}{themeId}));
while (my $component = $sth->hashRef) {
my $key = $component->{themeComponentId};
$theme->{components}{$key}{type} = $component->{type};
if ($component->{type} eq "image") {
my $c = WebGUI::Collateral->new($component->{id});
$theme->{components}{$key}{properties} = $c->get;
$c->copy("temp",$tempId);
my $a = WebGUI::Attachment->new($c->getFilename,"temp",$tempId);
$theme->{components}{$key}{properties}{filename} = WebGUI::URL::makeCompliant($c->get("name"))
.".".$a->getType;
$a->rename($theme->{components}{$key}{properties}{filename});
} elsif ($component->{type} eq "file") {
my $c = WebGUI::Collateral->new($component->{id});
$theme->{components}{$key}{properties} = $c->get;
$c->copy("temp",$tempId);
my $a = WebGUI::Attachment->new($c->getFilename,"temp",$tempId);
$theme->{components}{$key}{properties}{filename} = WebGUI::URL::makeCompliant($c->get("name"))
.".".$a->getType;
$a->rename($theme->{components}{$key}{properties}{filename});
} elsif ($component->{type} eq "snippet") {
my $c = WebGUI::Collateral->new($component->{id});
$theme->{components}{$key}{properties} = $c->get;
} elsif ($component->{type} eq "template") {
my ($id, $namespace) = split("_",$component->{id});
$theme->{components}{$key}{properties} = WebGUI::SQL->quickHashRef("select * from template
where templateId=".quote($id)." and namespace=".quote($namespace));
}
}
$sth->finish;
$propertyFile->saveFromHashref($theme);
my $packageName = WebGUI::URL::makeCompliant($theme->{name}).".theme.tar.gz";
$propertyFile->getNode->tar($packageName);
my $export = WebGUI::Attachment->new($packageName,"temp");
WebGUI::HTTP::setRedirect($export->getURL);
return "";
}
#-------------------------------------------------------------------
sub www_importTheme {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my $f = WebGUI::HTMLForm->new;
$f->hidden(
-name=>"op",
-value=>"importThemeValidate"
);
$f->file(
-name=>"themePackage",
-label=>WebGUI::International::get(921)
-hoverHelp=>WebGUI::International::get('921 description')
);
$f->submit(WebGUI::International::get(929));
return _submenu($f->print,'927',"theme import");
}
#-------------------------------------------------------------------
sub www_importThemeValidate {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my $a = WebGUI::Attachment->new("","temp");
my $filename = $a->save("themePackage");
return _submenu(WebGUI::International::get(935)) unless ($filename =~ /\.theme.tar.gz$/);
my $subnode = time();
my $extracted = WebGUI::Node->new("temp",$subnode);
$extracted->untar($filename);
my $propertiesFile = WebGUI::Attachment->new("_theme.properties","temp",$subnode);
my $theme = $propertiesFile->getHashref;
my @themes = WebGUI::SQL->buildArray("select name from theme");
my $f = WebGUI::HTMLForm->new;
$f->hidden(
-name=>"op",
-value=>"importThemeSave"
);
$f->readOnly(
-label=>WebGUI::International::get(904),
-hoverHelp=>WebGUI::International::get('904 description'),
-value=>$theme->{name}
);
$f->readOnly(
-label=>WebGUI::International::get(905),
-hoverHelp=>WebGUI::International::get('905 description'),
-value=>$theme->{designer}
);
$f->readOnly(
-label=>WebGUI::International::get(906),
-hoverHelp=>WebGUI::International::get('906 description'),
-value=>$theme->{designerURL}
);
$f->hidden(
-name=>"extractionPoint",
-value=>$subnode
);
$f->readOnly(
-label=>WebGUI::International::get(922),
-value=>"WebGUI ".$theme->{webguiVersion}
);
$f->readOnly(
-label=>WebGUI::International::get(923),
-value=>$theme->{versionNumber}
);
my $output;
if ($theme->{webguiVersion} > $WebGUI::VERSION) {
$output = WebGUI::International::get(926);
} elsif (isIn($theme->{name},@themes)) {
$output = WebGUI::International::get(925);
} else {
$output = WebGUI::International::get(928);
$f->submit(WebGUI::International::get(929));
}
$output .= "<p>".$f->print;
return _submenu($output,'927',"theme import");
}
#-------------------------------------------------------------------
sub www_importThemeSave {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my $propertiesFile = WebGUI::Attachment->new("_theme.properties","temp",$session{form}{extractionPoint});
my $theme = $propertiesFile->getHashref;
my $themeId = WebGUI::Id::generate();
WebGUI::SQL->write("insert into theme (themeId,name,designer,designerURL,webguiVersion,versionNumber,original) values
(".quote($themeId).", ".quote($theme->{name}).", ".quote($theme->{designer}).", ".quote($theme->{designerURL})
.", ".quote($theme->{webguiVersion}).", $theme->{versionNumber}, 0)");
my $collateralFolderId = WebGUI::Id::generate();
WebGUI::SQL->write("insert into collateralFolder (collateralFolderId,name,parentId) values (".quote($collateralFolderId).",
".quote($theme->{name}).", 0)");
foreach my $key (keys %{$theme->{components}}) {
my $type = $theme->{components}{$key}{type};
if ($type eq "template") {
$theme->{components}{$key}{properties}{$type."Id"} = WebGUI::Id::generate();
my (@fields, @values);
foreach my $property (keys %{$theme->{components}{$key}{properties}}) {
push(@fields,$property);
push(@values,quote($theme->{components}{$key}{properties}{$property}));
}
WebGUI::SQL->write("insert into ".$type." (".join(",",@fields).") values (".join(",",@values).")");
my $id = $theme->{components}{$key}{properties}{$type."Id"};
$id .= "_".$theme->{components}{$key}{properties}{namespace} if ($type eq "template");
WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id)
values (".quote($themeId).", ".quote(WebGUI::Id::generate()).", ".quote($type).", ".quote($id).")");
} elsif (isIn($type, qw(image file snippet))) {
$theme->{components}{$key}{properties}{collateralFolderId} = $collateralFolderId;
my $c = WebGUI::Collateral->new("new");
$c->set($theme->{components}{$key}{properties});
$c->saveFromFilesystem($propertiesFile->getNode->getPath.$session{os}{slash}
.$theme->{components}{$key}{properties}{filename});
WebGUI::SQL->write("insert into themeComponent (themeId,themeComponentId,type,id)
values (".quote($themeId).", ".quote(WebGUI::Id::generate()).", ".quote($type).", "
.quote($c->get("collateralId")).")");
}
}
return www_listThemes();
}
#-------------------------------------------------------------------
sub www_listThemes {
return WebGUI::AdminConsole->new("themes")->render("Themes are disabled in this version of WebGUI. They will return in a future release.");
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my ($output,@data, @row, $i, $p);
my $sth = WebGUI::SQL->read("select themeId,name,original from theme order by name");
while (@data = $sth->array) {
$row[$i] = '<tr><td valign="top" class="tableData">'.deleteIcon('op=deleteThemeConfirm&themeId='.$data[0],'',WebGUI::International::get(907));
if ($data[2]) {
$row[$i] .= editIcon('op=editTheme&themeId='.$data[0]);
} else {
$row[$i] .= viewIcon('op=viewTheme&themeId='.$data[0]);
}
$row[$i] .= '</td>';
$row[$i] .= '<td valign="top" class="tableData">'.$data[1].'</td></tr>';
$i++;
}
$sth->finish;
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listThemes'));
$p->setDataByArrayRef(\@row);
$output .= '<table border=1 cellpadding=5 cellspacing=0 align="center">';
$output .= $p->getPage($session{form}{pn});
$output .= '</table>';
$output .= $p->getBarTraditional($session{form}{pn});
return _submenu($output,undef,"themes manage");
}
#-------------------------------------------------------------------
sub www_viewTheme {
return WebGUI::Privilege::insufficient unless (WebGUI::Grouping::isInGroup(9));
my ($output, $theme, $f);
$theme = WebGUI::SQL->quickHashRef("select * from theme where themeId=".quote($session{form}{themeId}));
$f = WebGUI::HTMLForm->new;
$f->readOnly(
-value=>$session{form}{themeId},
-label=>WebGUI::International::get(903)
);
$f->readOnly(
-label=>WebGUI::International::get(904),
-value=>$theme->{name}
);
$f->readOnly(
-label=>WebGUI::International::get(905),
-value=>$theme->{designer}
);
$f->readOnly(
-label=>WebGUI::International::get(906),
-value=>$theme->{designerURL}
);
$f->readOnly(
-label=>WebGUI::International::get(922),
-value=>"WebGUI ".$theme->{webguiVersion}
);
$f->readOnly(
-label=>WebGUI::International::get(923),
-value=>$theme->{versionNumber}
);
$output .= $f->print;
my $componentTypes = _getComponentTypes();
my $query = "select collateral.name as name, themeComponent.themeComponentId as componentId,
collateral.collateralType as componentType from themeComponent, collateral
where collateral.collateralId=themeComponent.id and themeComponent.type=collateral.collateralType
and themeComponent.themeId=".quote($session{form}{themeId})." order by name";
my $sth = WebGUI::SQL->read($query);
while (my $component = $sth->hashRef) {
$output .= $component->{name}.' ('.$componentTypes->{$component->{componentType}}.')<br>';
}
$sth->finish;
$sth = WebGUI::SQL->read("select themeComponentId,id from themeComponent
where type='template' and themeId=".quote($session{form}{themeId}));
while (my $data = $sth->hashRef) {
my ($templateId,$namespace) = split("_",$data->{id});
my ($name) = WebGUI::SQL->quickArray("select name from template where
templateId=".quote($templateId)." and namespace=".quote($namespace));
$output .= $name.' ('.$componentTypes->{template}.')<br>';
}
$sth->finish;
return _submenu($output,'930');
}
1;

View file

@ -117,36 +117,6 @@ our $I18N = {
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'903 description' => {
message => q|The unique ID for this theme within this WebGUI site. This ID will change if this theme is imported into another site.|,
lastUpdated => 1120856677,
},
'904 description' => {
message => q|This is the unique name of the theme. It must be unique in every site that the theme will be imported into. This name will not change across sites.|,
lastUpdated => 1120856677,
},
'905 description' => {
message => q|The name of the person or company that created this theme. |,
lastUpdated => 1120856677,
},
'906 description' => {
message => q|The URL of the web site for this theme's designer. If you are in the business of creating themes for WebGUI, then this is your place to attract attention to your offerings.|,
lastUpdated => 1120856677,
},
'934' => {
message => q|Creating and editing themes is a fairly simple process. First you set up some basic properties for the theme, and then you start adding components to the theme.
<p>
The basic properties of a theme cannot be changed by anyone except the site that the theme was created on. The following are the definitions of the basic properties of a theme:
<p>
|,
lastUpdated => 1120856659
},
'978' => { '978' => {
message => q|User added successfully.|, message => q|User added successfully.|,
lastUpdated => 1053804577 lastUpdated => 1053804577
@ -267,16 +237,6 @@ The basic properties of a theme cannot be changed by anyone except the site that
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'917' => {
message => q|Add a theme component.|,
lastUpdated => 1050232824
},
'926' => {
message => q|This theme was created with a newer version of WebGUI than is installed on your system. You must upgrade before installing this theme.|,
lastUpdated => 1050264990
},
'859' => { '859' => {
message => q|Signature|, message => q|Signature|,
lastUpdated => 1043879866 lastUpdated => 1043879866
@ -302,11 +262,6 @@ The basic properties of a theme cannot be changed by anyone except the site that
lastUpdated => 1046604931 lastUpdated => 1046604931
}, },
'933' => {
message => q|Theme, Edit|,
lastUpdated => 1050430737
},
'706' => { '706' => {
message => q|Hour(s)|, message => q|Hour(s)|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -492,11 +447,6 @@ Be aware that any database links you create here will be available to all conten
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'901' => {
message => q|Add a new theme.|,
lastUpdated => 1050190107
},
'1035' => { '1035' => {
message => q|Notification Template|, message => q|Notification Template|,
lastUpdated => 1066034661 lastUpdated => 1066034661
@ -664,11 +614,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'914' => {
message => q|Image|,
lastUpdated => 1050232286
},
'965' => { '965' => {
message => q|System Trash|, message => q|System Trash|,
lastUpdated => 1099050265 lastUpdated => 1099050265
@ -704,11 +649,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'906' => {
message => q|Designer URL|,
lastUpdated => 1050191766
},
'496' => { '496' => {
message => q|Editor To Use|, message => q|Editor To Use|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -734,11 +674,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'927' => {
message => q|Import Theme|,
lastUpdated => 1050265139
},
'1073' => { '1073' => {
message => q|Style Template|, message => q|Style Template|,
lastUpdated => 1070027660 lastUpdated => 1070027660
@ -809,11 +744,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'919' => {
message => q|Edit this theme.|,
lastUpdated => 1050247154
},
'746' => { '746' => {
message => q|Toolbar Icon Set|, message => q|Toolbar Icon Set|,
lastUpdated => 1036046598 lastUpdated => 1036046598
@ -874,13 +804,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1056151382 lastUpdated => 1056151382
}, },
'932' => {
message => q|Themes are a mechanism to quickly install new styles, templates, and assets into a WebGUI site. They are also great for moving those same items from one site to another.
<p>
<b>TIP:</b> When building a theme, be sure to name the components (styles, templates, assets) in the theme with some name that is unique to the theme. This is useful so that your users can find the components in your theme, as well as to avoid name conflicts.|,
lastUpdated => 1070027889
},
'349' => { '349' => {
message => q|Latest version available|, message => q|Latest version available|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -956,21 +879,11 @@ That particular example will help you get good ranking on search engines.
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'911' => {
message => q|Component|,
lastUpdated => 1050232236
},
'17' => { '17' => {
message => q|March|, message => q|March|,
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'907' => {
message => q|Are you certain you wish to delete this theme?|,
lastUpdated => 1050230443
},
'333' => { '333' => {
message => q|Work Country|, message => q|Work Country|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -1079,11 +992,6 @@ will be modified to make it unique.|,
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'920' => {
message => q|Export this theme.|,
lastUpdated => 1050247169
},
'660' => { '660' => {
message => q|Groups, Manage|, message => q|Groups, Manage|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -1154,11 +1062,6 @@ will be modified to make it unique.|,
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'918' => {
message => q|Delete this theme.|,
lastUpdated => 1050247144
},
'108' => { '108' => {
message => q|Owner|, message => q|Owner|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -1318,11 +1221,6 @@ The Connect DN is the <b>cn</b> (or common name) of a given user in your LDAP da
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'931' => {
message => q|Themes, Manage|,
lastUpdated => 1050437240
},
'725' => { '725' => {
message => q|Your username cannot be blank.|, message => q|Your username cannot be blank.|,
lastUpdated => 1031879612 lastUpdated => 1031879612
@ -1369,10 +1267,6 @@ Users that have privileges to edit styles for this site. These privileges do not
Users that have privileges to edit templates for this site. Users that have privileges to edit templates for this site.
<p> <p>
<b>Theme Managers</b><br>
Users in this group can use the theme manager to create new themes and install themes from other systems.
<p>
<b>Turn Admin On</b><br> <b>Turn Admin On</b><br>
These users are allowed to turn on Admin mode. These users are allowed to turn on Admin mode.
<p> <p>
@ -1615,16 +1509,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1057208065 lastUpdated => 1057208065
}, },
'937' => {
message => q|In order to import a theme you need a valid theme file exported from another WebGUI site. Just select the theme from your hard drive and click the "Import" button. You'll then get a confirmation screen asking whether this is the theme you wanted to import. If you agree, click on the "Import" button again and you'll have your new theme. You can then start to apply the theme to your site as you would any normal style, template, or collateral data.
<p>
You cannot import a theme twice. If you wish to import a new version of a theme, then you must first delete the previous version of the theme.
<p>
You also cannot import a theme from a version of WebGUI that is newer than the one you're using. Therefore if you are using WebGUI 5.2.4 and a theme was created with WebGUI 6.0.0, then you will not be allowed to import the theme until you upgrade.
|,
lastUpdated => 1050436484
},
'891' => { '891' => {
message => q|Only negate macros.|, message => q|Only negate macros.|,
lastUpdated => 1047838859 lastUpdated => 1047838859
@ -1650,16 +1534,6 @@ You also cannot import a theme from a version of WebGUI that is newer than the o
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'921' => {
message => q|Theme Package File|,
lastUpdated => 1050260403
},
'921 description' => {
message => q|Select a file from your computer to import.|,
lastUpdated => 1120857461
},
'1069' => { '1069' => {
message => q|Host To Use|, message => q|Host To Use|,
lastUpdated => 1066641432 lastUpdated => 1066641432
@ -1751,16 +1625,6 @@ You also cannot import a theme from a version of WebGUI that is newer than the o
lastUpdated => 1044126938 lastUpdated => 1044126938
}, },
'904' => {
message => q|Theme Name|,
lastUpdated => 1050190959
},
'930' => {
message => q|View Theme|,
lastUpdated => 1050270912
},
'442' => { '442' => {
message => q|Work Information|, message => q|Work Information|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -1807,11 +1671,6 @@ You also cannot import a theme from a version of WebGUI that is newer than the o
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'939' => {
message => q|When you delete a theme you've created all you're actually deleting is the basic properties for the theme. However, when you delete a theme you've imported, you'll also be deleting all of its components (styles, templates, and collateral) as well. Be careful that you are no longer using any of those components before deleting them.|,
lastUpdated => 1050437207
},
'320' => { '320' => {
message => q|<a href="http://messenger.yahoo.com/">Yahoo! Messenger</a> Id|, message => q|<a href="http://messenger.yahoo.com/">Yahoo! Messenger</a> Id|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -1827,11 +1686,6 @@ You also cannot import a theme from a version of WebGUI that is newer than the o
lastUpdated => 1033836660 lastUpdated => 1033836660
}, },
'913' => {
message => q|Template|,
lastUpdated => 1050232279
},
'811' => { '811' => {
message => q|From|, message => q|From|,
lastUpdated => 1037580145 lastUpdated => 1037580145
@ -2318,16 +2172,6 @@ div.tabs {
lastUpdated => 1099434667 lastUpdated => 1099434667
}, },
'922' => {
message => q|Created With|,
lastUpdated => 1050262917
},
'922 description' => {
message => q|The version of WebGUI that was used to create this theme.|,
lastUpdated => 1120857530
},
'871' => { '871' => {
message => q|Who can edit?|, message => q|Who can edit?|,
lastUpdated => 1044218026 lastUpdated => 1044218026
@ -2355,16 +2199,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1101775447, lastUpdated => 1101775447,
}, },
'902' => {
message => q|Edit Theme|,
lastUpdated => 1050190716
},
'936' => {
message => q|Theme, Import|,
lastUpdated => 1050436484
},
'827' => { '827' => {
message => q|Wobject Template|, message => q|Wobject Template|,
lastUpdated => 1052046436 lastUpdated => 1052046436
@ -2464,11 +2298,6 @@ A list of links to the 10 nearest in the paginator relative to the current page.
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'905' => {
message => q|Theme Designer|,
lastUpdated => 1050191749
},
'817' => { '817' => {
message => q|Active|, message => q|Active|,
lastUpdated => 1038431287 lastUpdated => 1038431287
@ -2574,11 +2403,6 @@ A list of links to the 10 nearest in the paginator relative to the current page.
lastUpdated => 1067951807 lastUpdated => 1067951807
}, },
'928' => {
message => q|Do you wish to import this theme?|,
lastUpdated => 1050265284
},
'623' => { '623' => {
message => q|<a href="http://www.w3.org/Style/CSS/">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI. message => q|<a href="http://www.w3.org/Style/CSS/">Cascading Style Sheets (CSS)</a> are a great way to manage the look and feel of any web site. They are used extensively in WebGUI.
<p> <p>
@ -2821,11 +2645,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'923' => {
message => q|Theme Version|,
lastUpdated => 1050262964
},
'313' => { '313' => {
message => q|Allow miscellaneous information?|, message => q|Allow miscellaneous information?|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -2891,16 +2710,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'935' => {
message => q|The file you uploaded does not appear to be a valid theme file.|,
lastUpdated => 1050431137
},
'908' => {
message => q|Are you certain you wish to remove this component from this theme?|,
lastUpdated => 1050230878
},
'81' => { '81' => {
message => q|Account updated successfully!|, message => q|Account updated successfully!|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -2926,11 +2735,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1038706332 lastUpdated => 1038706332
}, },
'903' => {
message => q|Theme ID|,
lastUpdated => 1050190880
},
'371' => { '371' => {
message => q|Add Grouping|, message => q|Add Grouping|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -2961,11 +2765,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1037579487 lastUpdated => 1037579487
}, },
'924' => {
message => q|Import a theme.|,
lastUpdated => 1050262993
},
'885' => { '885' => {
message => q|Allow users to deactivate their account?|, message => q|Allow users to deactivate their account?|,
lastUpdated => 1044708760 lastUpdated => 1044708760
@ -3006,11 +2805,6 @@ As with any delete operation, you are prompted to be sure you wish to proceed wi
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'915' => {
message => q|File|,
lastUpdated => 1050232294
},
'319' => { '319' => {
message => q|<a href="http://messenger.msn.com/">MSN Messenger</a> Id|, message => q|<a href="http://messenger.msn.com/">MSN Messenger</a> Id|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -3192,11 +2986,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'938' => {
message => q|Theme, Delete|,
lastUpdated => 1050437207
},
'879' => { '879' => {
message => q|Classic Editor (Internet Explorer 5+)|, message => q|Classic Editor (Internet Explorer 5+)|,
lastUpdated => 1044705103 lastUpdated => 1044705103
@ -3212,11 +3001,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'929' => {
message => q|Import!|,
lastUpdated => 1050265357
},
'958' => { '958' => {
message => q|The clipboard is a special system location to which content may be temporarily cut or copied. Items in the clipboard may then be pasted to a new location. message => q|The clipboard is a special system location to which content may be temporarily cut or copied. Items in the clipboard may then be pasted to a new location.
<p>The clipboard contents may be managed individually. You may delete or paste an item by selecting the appropriate icon. You may also empty the entire contents of the clipboard to the trash by choosing the Empty clipboard menu option. <p>The clipboard contents may be managed individually. You may delete or paste an item by selecting the appropriate icon. You may also empty the entire contents of the clipboard to the trash by choosing the Empty clipboard menu option.
@ -3328,11 +3112,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
lastUpdated => 1031514049 lastUpdated => 1031514049
}, },
'909' => {
message => q|Add Theme Component|,
lastUpdated => 1050232207
},
'403' => { '403' => {
message => q|Prefer not to say.|, message => q|Prefer not to say.|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -3393,11 +3172,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
lastUpdated => 1044126838 lastUpdated => 1044126838
}, },
'900' => {
message => q|Manage themes.|,
lastUpdated => 1050189066
},
'1016' => { '1016' => {
message => q|Replies|, message => q|Replies|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -3423,11 +3197,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
lastUpdated => 1046638916 lastUpdated => 1046638916
}, },
'925' => {
message => q|You already have another version of this theme installed. You must delete it before installing it again.|,
lastUpdated => 1050264954
},
'146' => { '146' => {
message => q|Active Sessions|, message => q|Active Sessions|,
lastUpdated => 1031514049 lastUpdated => 1031514049
@ -3488,12 +3257,6 @@ Privileges and styles assigned to pages in the package will not be copied when t
context => q|Title of the package manager for the admin console.| context => q|Title of the package manager for the admin console.|
}, },
'themes' => {
message => q|Themes|,
lastUpdated =>1092930637,
context => q|Title of the themes manager for the admin console.|
},
'help' => { 'help' => {
message => q|Help|, message => q|Help|,
lastUpdated =>1092930637, lastUpdated =>1092930637,