Added Site Starter to WebGUI Initial Configuration.
This commit is contained in:
parent
86d92d68a8
commit
2082506efb
11 changed files with 660 additions and 139 deletions
|
|
@ -3,6 +3,9 @@
|
|||
subroutines directly in their files. See
|
||||
WebGUI::Operation::FormHelpers::www_formHelper and
|
||||
WebGUI::Operation::Workflow::www_activityHelper for details.
|
||||
- api: Asset properties that have default values are now enforced by the API
|
||||
as they always have been by the user interface.
|
||||
- Added Site Starter to WebGUI Initial Configuration.
|
||||
- Added pagination to purchase history in commerce.
|
||||
- Replaced color picker form control with a more robust version.
|
||||
- Added keyword tagging api.
|
||||
|
|
|
|||
159
lib/WebGUI.pm
159
lib/WebGUI.pm
|
|
@ -1,29 +1,33 @@
|
|||
package WebGUI;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
our $VERSION = "7.4.0";
|
||||
our $STATUS = "beta";
|
||||
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict qw(vars subs);
|
||||
use Tie::CPHash;
|
||||
use Time::HiRes;
|
||||
use WebGUI::Affiliate;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::Cache;
|
||||
use WebGUI::Config;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::User;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::PassiveProfiling;
|
||||
use WebGUI::Setup;
|
||||
use Apache2::Upload;
|
||||
use Apache2::Request;
|
||||
use Apache2::RequestRec ();
|
||||
|
|
@ -32,8 +36,23 @@ use Apache2::Const -compile => qw(OK DECLINED NOT_FOUND DIR_MAGIC_TYPE);
|
|||
use Apache2::ServerUtil ();
|
||||
use LWP::MediaTypes qw(guess_media_type);
|
||||
|
||||
our $VERSION = "7.4.0";
|
||||
our $STATUS = "beta";
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
An Apache mod_perl handler for WebGUI.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI;
|
||||
|
||||
=head1 SUBROUTINES
|
||||
|
||||
These subroutines are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
@ -109,7 +128,7 @@ sub contentHandler {
|
|||
# do nothing because we have operation output to display
|
||||
$out = undef if ($out eq "chunked"); #'chunked' is WebGUI's way of saying 'I took care of it' The output was sent to the browser in pieces as quickly as it could be produced.
|
||||
} elsif ($setting->get("specialState") eq "init") { #if specialState is flagged and it's 'init' do initial setup
|
||||
$out = setup($session);
|
||||
$out = WebGUI::Setup::setup($session);
|
||||
} elsif ($errorHandler->canShowPerformanceIndicators) { #show performance indicators if required
|
||||
my $t = [Time::HiRes::gettimeofday()];
|
||||
$out = page($session);
|
||||
|
|
@ -269,112 +288,6 @@ sub processOperations {
|
|||
return $output;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setup ( session )
|
||||
|
||||
Handles a specialState: "setup"
|
||||
|
||||
=head3 session
|
||||
|
||||
The current WebGUI::Session object.
|
||||
|
||||
=cut
|
||||
|
||||
sub setup {
|
||||
my $session = shift;
|
||||
my $i18n = WebGUI::International->new($session, "WebGUI");
|
||||
my $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>WebGUI Initial Configuration</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<style type="text/css">
|
||||
a { color: black; }
|
||||
a:visited { color: black;}
|
||||
</style>
|
||||
</head>
|
||||
<body><div style="font-family: georgia, helvetica, arial, sans-serif; color: white; z-index: 10; width: 550px; height: 400px; top: 20%; left: 20%; position: absolute;"><h1>WebGUI Initial Configuration</h1><fieldset>';
|
||||
if ($session->form->process("step") eq "2") {
|
||||
$output .= '<legend align="left">Company Information</legend>';
|
||||
my $u = WebGUI::User->new($session,"3");
|
||||
$u->username($session->form->process("username","text","Admin"));
|
||||
$u->profileField("email",$session->form->email("email"));
|
||||
$u->identifier(Digest::MD5::md5_base64($session->form->process("identifier","password","123qwe")));
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden(
|
||||
-name=>"step",
|
||||
-value=>"3"
|
||||
);
|
||||
$f->text(
|
||||
-name=>"companyName",
|
||||
-value=>$session->setting->get("companyName"),
|
||||
-label=>$i18n->get(125),
|
||||
-hoverHelp=>$i18n->get('125 description'),
|
||||
);
|
||||
$f->email(
|
||||
-name=>"companyEmail",
|
||||
-value=>$session->setting->get("companyEmail"),
|
||||
-label=>$i18n->get(126),
|
||||
-hoverHelp=>$i18n->get('126 description'),
|
||||
);
|
||||
$f->url(
|
||||
-name=>"companyURL",
|
||||
-value=>$session->setting->get("companyURL"),
|
||||
-label=>$i18n->get(127),
|
||||
-hoverHelp=>$i18n->get('127 description'),
|
||||
);
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
} elsif ($session->form->process("step") eq "3") {
|
||||
$session->setting->remove('specialState');
|
||||
$session->setting->set('companyName',$session->form->text("companyName"));
|
||||
$session->setting->set('companyURL',$session->form->url("companyURL"));
|
||||
$session->setting->set('companyEmail',$session->form->email("companyEmail"));
|
||||
$session->http->setRedirect($session->url->gateway());
|
||||
return undef;
|
||||
} else {
|
||||
$output .= '<legend align="left">Admin Account</legend>';
|
||||
my $u = WebGUI::User->new($session,'3');
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden(
|
||||
-name=>"step",
|
||||
-value=>"2"
|
||||
);
|
||||
$f->text(
|
||||
-name=>"username",
|
||||
-value=>$u->username,
|
||||
-label=>$i18n->get(50),
|
||||
-hoverHelp=>$i18n->get('50 setup description'),
|
||||
);
|
||||
$f->text(
|
||||
-name=>"identifier",
|
||||
-value=>"123qwe",
|
||||
-label=>$i18n->get(51),
|
||||
-hoverHelp=>$i18n->get('51 description'),
|
||||
-subtext=>'<div style=\"font-size: 10px;\">('.$i18n->get("password clear text").')</div>'
|
||||
);
|
||||
$f->email(
|
||||
-name=>"email",
|
||||
-value=>$u->profileField("email"),
|
||||
-label=>$i18n->get(56),
|
||||
-hoverHelp=>$i18n->get('56 description'),
|
||||
);
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
}
|
||||
$output .= '</fieldset></div>
|
||||
<img src="'.$session->url->extras('background.jpg').'" style="border-style:none;position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5;" />
|
||||
</body>
|
||||
</html>';
|
||||
$session->http->setCacheControl("none");
|
||||
$session->http->setMimeType("text/html");
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 tryAssetMethod ( session )
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('886 description'),
|
||||
uiLevel=>6,
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
defaultValue=>0,
|
||||
},
|
||||
newWindow=>{
|
||||
tab=>"display",
|
||||
|
|
@ -2025,7 +2025,7 @@ sub update {
|
|||
|
||||
# deal with all the properties in this part of the definition
|
||||
foreach my $property (keys %{$definition->{properties}}) {
|
||||
|
||||
|
||||
# skip a property unless it was specified to be set by the properties field or has a default value
|
||||
next unless (exists $properties->{$property} || exists $definition->{properties}{$property}{defaultValue});
|
||||
# use the update value
|
||||
|
|
@ -2042,7 +2042,7 @@ sub update {
|
|||
}
|
||||
|
||||
# use the default value because default and update were both undef
|
||||
unless (defined $value) {
|
||||
if ($value eq "" && exists $definition->{properties}{$property}{defaultValue}) {
|
||||
$value = $definition->{properties}{$property}{defaultValue};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ sub definition {
|
|||
properties=>{
|
||||
templateId =>{
|
||||
fieldType=>"template",
|
||||
defaultValue=>'PBtmpl0000000000000054'
|
||||
namespace => "Layout",
|
||||
defaultValue=>'PBtmpl0000000000000054',
|
||||
},
|
||||
contentPositions => {
|
||||
noFormPost=>1,
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ sub toHtmlWithWrapper {
|
|||
if ($self->passUiLevelCheck) {
|
||||
my $rawField = $self->toHtml(); # has to be called before prepareWrapper for some controls, namely captcha.
|
||||
my ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext) = $self->prepareWrapper;
|
||||
return '<tr'.$rowClass.'>
|
||||
return '<tr'.$rowClass.' id="'.$self->get("id").'_row">
|
||||
<td'.$labelClass.$hoverHelp.' valign="top" style="width: 180px;"><label for="'.$self->get("id").'">'.$self->get("label").'</label></td>
|
||||
<td valign="top"'.$fieldClass.'>'.$rawField.$subtext."</td>
|
||||
</tr>\n";
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ Renders an HTML area field.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
#return $self->SUPER::toHtml.WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"))->getRichEditor($self->get('id'));
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
my $richEdit = WebGUI::Asset::RichEdit->new($self->session,$self->get("richEditId"));
|
||||
if (defined $richEdit) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ sub generateAdditionalHeadTags {
|
|||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 makePrintable ( boolean )
|
||||
|
|
|
|||
570
lib/WebGUI/Setup.pm
Normal file
570
lib/WebGUI/Setup.pm
Normal file
|
|
@ -0,0 +1,570 @@
|
|||
package WebGUI::Setup;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use Digest::MD5;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Storage::Image;
|
||||
use WebGUI::VersionTag;
|
||||
use WebGUI::Utility;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Setup
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Initializes a new WebGUI install.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Setup;
|
||||
WebGUI::Setup::setup();
|
||||
|
||||
=head1 SUBROUTINES
|
||||
|
||||
These subroutines are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 addAsset ( parent, properties )
|
||||
|
||||
A helper to add assets with less code.
|
||||
|
||||
=head3 parent
|
||||
|
||||
The parent asset to add to.
|
||||
|
||||
=head3 properties
|
||||
|
||||
A hash ref of properties to attach to the asset. One must be className.
|
||||
|
||||
=cut
|
||||
|
||||
sub addAsset {
|
||||
my $parent = shift;
|
||||
my $properties = shift;
|
||||
$properties->{url} = $parent->get("url")."/".$properties->{title};
|
||||
$properties->{groupIdEdit} = $parent->get("groupIdEdit");
|
||||
$properties->{groupIdView} = $parent->get("groupIdView");
|
||||
$properties->{ownerUserId} = $parent->get("ownerUserId");
|
||||
$properties->{styleTemplateId} = $parent->get("styleTemplateId");
|
||||
$properties->{printableStyleTemplateId} = $parent->get("styleTemplateId");
|
||||
return $parent->addChild($properties);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 addPage ( parent, title )
|
||||
|
||||
Adds a page to a parent page.
|
||||
|
||||
=head3 parent
|
||||
|
||||
A parent page asset.
|
||||
|
||||
=head3 title
|
||||
|
||||
The title of the new page.
|
||||
|
||||
=cut
|
||||
|
||||
sub addPage {
|
||||
my $parent = shift;
|
||||
my $title = shift;
|
||||
return addAsset($parent, {title=>$title, className => "WebGUI::Asset::Wobject::Layout", displayTitle=>0});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setup ( session )
|
||||
|
||||
Handles a specialState: "setup"
|
||||
|
||||
=head3 session
|
||||
|
||||
The current WebGUI::Session object.
|
||||
|
||||
=cut
|
||||
|
||||
sub setup {
|
||||
my $session = shift;
|
||||
my $i18n = WebGUI::International->new($session, "WebGUI");
|
||||
my ($output,$legend) = "";
|
||||
if ($session->form->process("step") eq "2") {
|
||||
$legend = 'Company Information';
|
||||
my $u = WebGUI::User->new($session,"3");
|
||||
$u->username($session->form->process("username","text","Admin"));
|
||||
$u->profileField("email",$session->form->email("email"));
|
||||
$u->identifier(Digest::MD5::md5_base64($session->form->process("identifier","password","123qwe")));
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden( name=>"step", value=>"3");
|
||||
$f->text(
|
||||
name=>"companyName",
|
||||
value=>$session->setting->get("companyName"),
|
||||
label=>$i18n->get(125),
|
||||
hoverHelp=>$i18n->get('125 description'),
|
||||
);
|
||||
$f->email(
|
||||
name=>"companyEmail",
|
||||
value=>$session->setting->get("companyEmail"),
|
||||
label=>$i18n->get(126),
|
||||
hoverHelp=>$i18n->get('126 description'),
|
||||
);
|
||||
$f->url(
|
||||
name=>"companyURL",
|
||||
value=>$session->setting->get("companyURL"),
|
||||
label=>$i18n->get(127),
|
||||
hoverHelp=>$i18n->get('127 description'),
|
||||
);
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
}
|
||||
elsif ($session->form->process("step") eq "3") {
|
||||
my $form = $session->form;
|
||||
$session->setting->set('companyName',$form->text("companyName")) if ($form->get("companyName"));
|
||||
$session->setting->set('companyURL',$form->url("companyURL")) if ($form->get("companyURL"));
|
||||
$session->setting->set('companyEmail',$form->email("companyEmail")) if ($form->get("companyEmail"));
|
||||
$legend = "Site Starter";
|
||||
$output .= ' <p>Do you wish to use the WebGUI Site Starter, which will lead you through options to create a custom
|
||||
look and feel for your site, and set up some basic content areas?</p>
|
||||
<p><a href="'.$session->url->gateway(undef, "step=7").'">No, thanks.</a>
|
||||
<a href="'.$session->url->gateway(undef,"step=4").'">Yes, please!</a></p>
|
||||
';
|
||||
}
|
||||
elsif ($session->form->process("step") eq "4") {
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden( name=>"step", value=>"5",);
|
||||
$f->file(name=>"logo", label=>"Logo");
|
||||
$f->submit;
|
||||
$legend = "Upload Your Logo";
|
||||
$output .= $f->print;
|
||||
}
|
||||
elsif ($session->form->process("step") eq "5") {
|
||||
my $storageId = $session->form->process("logo","image");
|
||||
my $url = $session->url;
|
||||
my $logoUrl = $url->extras("plainblack.gif");
|
||||
if (defined $storageId) {
|
||||
my $storage = WebGUI::Storage::Image->get($session, $storageId);
|
||||
my $importNode = WebGUI::Asset->getImportNode($session);
|
||||
my $logo = addAsset($importNode, {
|
||||
title => $storage->getFiles->[0],
|
||||
filename => $storage->getFiles->[0],
|
||||
isHidden => 1,
|
||||
storageId => $storageId,
|
||||
className => "WebGUI::Asset::File::Image",
|
||||
parameters => 'alt="'.$storage->getFiles->[0].'"'
|
||||
});
|
||||
$logoUrl = $logo->getStorageLocation->getUrl($logo->get("filename"));
|
||||
}
|
||||
my $style = $session->style;
|
||||
$style->setScript($url->extras('/yui/build/yahoo/yahoo-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/event/event-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/dom/dom-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/dragdrop/dragdrop-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/animation/animation-min.js'),{ type=>'text/javascript' });
|
||||
$style->setLink($url->extras('/colorpicker/colorpicker.css'),{ type=>'text/css', rel=>"stylesheet" });
|
||||
$style->setScript($url->extras('/colorpicker/color.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/colorpicker/key.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/yui/build/slider/slider-min.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras('/colorpicker/colorpicker.js'),{ type=>'text/javascript' });
|
||||
$style->setScript($url->extras("/styleDesigner/styleDesigner.js"), {type=>"text/javascript"});
|
||||
$style->setLink($url->extras("/styleDesigner/styleDesigner.css"), {rel=>"stylesheet", type=>"text/css"});
|
||||
$legend = "Style Designer";
|
||||
$output .= '
|
||||
<form method="post">
|
||||
<input type="submit" value="Save">
|
||||
<input type="hidden" name="step" value="6" />
|
||||
<input type="hidden" name="logoUrl" value="'.$logoUrl.'" />
|
||||
<script type="text/javascript">
|
||||
document.write(WebguiStyleDesigner.draw("^c;","'.$logoUrl.'","'.$storageId.'"));
|
||||
</script>
|
||||
<input type="submit" value="Save">
|
||||
</form>
|
||||
';
|
||||
}
|
||||
elsif ($session->form->process("step") eq "6") {
|
||||
my $importNode = WebGUI::Asset->getImportNode($session);
|
||||
my $form = $session->form;
|
||||
my $snippet = '/* auto generated by WebGUI '.$WebGUI::VERSION.' */
|
||||
.clearFloat { clear: both; }
|
||||
body { background-color: '.$form->get("pageBackgroundColor").'; }
|
||||
a { color: '.$form->get("linkColor").';}
|
||||
a:visited { color: '.$form->get("visitedLinkColor").'; }
|
||||
#editToggleContainer { padding: 1px; }
|
||||
#utilityLinksContainer { float: right; padding: 1px; }
|
||||
#pageUtilityContainer { font-size: 9pt; background-color: '.$form->get("utilityBackgroundColor").'; color: '.$form->get("utilityTextColor").'; }
|
||||
#pageHeaderContainer { background-color: '.$form->get("headerBackgroundColor").'; color: '.$form->get("headerTextColor").'; }
|
||||
#pageHeaderLogoContainer { float: left; padding: 5px; background-color: '.$form->get("headerBackgroundColor").';}
|
||||
#logo { border: 0px; max-width: 300px; }
|
||||
#companyNameContainer { float: right; padding: 5px; font-size: 16pt; }
|
||||
#pageBodyContainer { background-color: '.$form->get("contentBackgroundColor").'; color: '.$form->get("contentTextColor").'; }
|
||||
#mainNavigationContainer { min-height: 300px; padding: 5px; float: left; width: 180px; font-size: 10pt; background-color: '.$form->get("navigationBackgroundColor").'; }
|
||||
#mainNavigationContainer A, #mainNavigationContainer A:link { color: '.$form->get("navigationTextColor").'; }
|
||||
#mainBodyContentContainer { padding: 5px; margin-left: 200px; font-family: serif, times new roman; font-size: 12pt; }
|
||||
#pageFooterContainer { text-align: center; background-color: '.$form->get("footerBackgroundColor").'; color: '.$form->get("footerTextColor").'; }
|
||||
#copyrightContainer { font-size: 8pt; }
|
||||
#pageWidthContainer { margin-left: 10%; margin-right: 10%; font-family: sans-serif, helvetica, arial; border: 3px solid black; }
|
||||
';
|
||||
my $css = addAsset($importNode, {
|
||||
title => "my-style.css",
|
||||
className => "WebGUI::Asset::Snippet",
|
||||
snippet => $snippet,
|
||||
isHidden => 1,
|
||||
mimeType => "text/css",
|
||||
});
|
||||
my $styleTemplate = '<html>
|
||||
<head>
|
||||
<title>^Page(title); - ^c;</title>
|
||||
<link type="text/css" href="'.$css->getUrl.'" rel="stylesheet" />
|
||||
<tmpl_var head.tags>
|
||||
</head>
|
||||
<body>
|
||||
^AdminBar;
|
||||
<div id="pageWidthContainer">
|
||||
<div id="pageUtilityContainer">
|
||||
<div id="utilityLinksContainer">^a(^@;); :: ^LoginToggle; :: ^r(Print!);</div>
|
||||
<div id="editToggleContainer">^AdminToggle;</div>
|
||||
<div class="clearFloat"></div>
|
||||
</div>
|
||||
<div id="pageHeaderContainer">
|
||||
<div id="companyNameContainer">^c;</div>
|
||||
<div id="pageHeaderLogoContainer"><a href="^H(linkonly);"><img src="'.$form->get("logoUrl").'" id="logo" alt="logo" /></a></div>
|
||||
<div class="clearFloat"></div>
|
||||
</div>
|
||||
<div id="pageBodyContainer">
|
||||
<div id="mainNavigationContainer"><p>^AssetProxy("flexmenu");</p></div>
|
||||
<div id="mainBodyContentContainer">
|
||||
<tmpl_var body.content>
|
||||
</div>
|
||||
<div class="clearFloat"></div>
|
||||
</div>
|
||||
<div id="pageFooterContainer">
|
||||
<div id="copyrightContainer">©^D(%y); ^c;. All Rights Reserved.</div>
|
||||
<div class="clearFloat"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>';
|
||||
my $style = addAsset($importNode, {
|
||||
className => "WebGUI::Asset::Template",
|
||||
title => "My Style",
|
||||
isHidden => 1,
|
||||
namespace => "style",
|
||||
template => $styleTemplate
|
||||
});
|
||||
$session->setting->set("userFunctionStyleId",$style->getId);
|
||||
|
||||
# collect new page info
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden(name=>"step", value=>"7");
|
||||
$f->hidden(name=>"styleTemplateId", value=>$style->getId);
|
||||
$f->yesNo(name=>"contactUs",label=>"Contact Us");
|
||||
$f->yesNo(name=>"aboutUs",label=>"About Us",
|
||||
extras=>'onchange="document.getElementById(\'aboutUsContent_formId_row\').style.display=\'table-row\';"');
|
||||
$f->HTMLArea(name=>"aboutUsContent", richEditId=>"PBrichedit000000000002",
|
||||
value=>"Put your about us content here.");
|
||||
if (isIn("WebGUI::Asset::Wobject::Collaboration", @{$session->config->get("assets")})) {
|
||||
$f->yesNo(name=>"forums",label=>"Forums",
|
||||
extras=>'onchange="document.getElementById(\'forumNames_formId_row\').style.display=\'table-row\'"');
|
||||
$f->textarea(name=>"forumNames",subtext=>"One forum name per line", value=>"Support\nGeneral Discussion");
|
||||
$f->yesNo(name=>"news",label=>"News");
|
||||
}
|
||||
$f->yesNo(name=>"calendar",label=>"Calendar");
|
||||
$f->yesNo(name=>"wiki",label=>"Wiki");
|
||||
$f->yesNo(name=>"search",label=>"Search");
|
||||
$f->submit;
|
||||
$legend = "Initial Pages";
|
||||
$output .= $f->print;
|
||||
}
|
||||
elsif ($session->form->process("step") eq "7") {
|
||||
my $home = WebGUI::Asset->getDefault($session);
|
||||
my $form = $session->form;
|
||||
|
||||
# update default site style
|
||||
foreach my $asset (@{$home->getLineage(["self","descendants"], {returnObjects=>1})}) {
|
||||
if (defined $asset) {
|
||||
$asset->update({styleTemplateId=>$form->get("styleTemplateId")});
|
||||
}
|
||||
}
|
||||
|
||||
# add new pages
|
||||
if ($form->get("aboutUs")) {
|
||||
my $page = addPage($home, "About Us");
|
||||
addAsset($page, {
|
||||
title => "About Us",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::Article",
|
||||
description => $form->get("aboutUsContent"),
|
||||
});
|
||||
}
|
||||
|
||||
# add forums
|
||||
if ($form->get("forums")) {
|
||||
my $page = addPage($home, "Forums");
|
||||
my $board = addAsset($page, {
|
||||
title => "Forums",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::MessageBoard",
|
||||
description => "Discuss your ideas and get help from our community.",
|
||||
});
|
||||
my $forumNames = $form->get("forumNames");
|
||||
$forumNames =~ s/\r//g;
|
||||
foreach my $forumName (split "\n", $forumNames) {
|
||||
next if $forumName eq "";
|
||||
addAsset($board, {
|
||||
title => $forumName,
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::Collaboration"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
# add news
|
||||
if ($form->get("news")) {
|
||||
my $page = addPage($home, "News");
|
||||
addAsset($page, {
|
||||
title => "News",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::Collaboration",
|
||||
collaborationTemplateId => "PBtmpl0000000000000112",
|
||||
allowReplies => 0,
|
||||
attachmentsPerPost => 5,
|
||||
postFormTemplateId => "PBtmpl0000000000000068",
|
||||
threadTemplateId => "PBtmpl0000000000000067",
|
||||
description => "All the news you need to know.",
|
||||
});
|
||||
}
|
||||
|
||||
# add wiki
|
||||
if ($form->get("wiki")) {
|
||||
my $page = addPage($home, "Wiki");
|
||||
addAsset($page, {
|
||||
title => "Wiki",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::WikiMaster",
|
||||
description => "Welcome to our wiki. Here you can help us keep information up to date.",
|
||||
});
|
||||
}
|
||||
|
||||
# add calendar
|
||||
if ($form->get("calendar")) {
|
||||
my $page = addPage($home, "Calendar");
|
||||
addAsset($page, {
|
||||
title => "Calendar",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::Calendar",
|
||||
description => "Check out what's going on.",
|
||||
});
|
||||
}
|
||||
|
||||
# add contact us
|
||||
if ($form->get("contactUs")) {
|
||||
my $page = addPage($home, "Contact Us");
|
||||
my $i18n = WebGUI::International->new($session, "Asset_DataForm");
|
||||
my $dataForm = addAsset($page, {
|
||||
title => "Contact Us",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::DataForm",
|
||||
description => "We welcome your feedback.",
|
||||
acknowledgement => "Thanks for for your interest in ^c;. We'll review your message shortly.",
|
||||
mailData => 1,
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>"new",
|
||||
DataForm_tabId=>0,
|
||||
name=>"from",
|
||||
label=>"Your Email Address",
|
||||
status=>"required",
|
||||
isMailField=>1,
|
||||
width=>0,
|
||||
type=>"email"
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>"new",
|
||||
DataForm_tabId=>0,
|
||||
name=>"to",
|
||||
label=>$i18n->get(11),
|
||||
status=>"hidden",
|
||||
isMailField=>1,
|
||||
width=>0,
|
||||
type=>"email",
|
||||
defaultValue=>$session->setting->get("companyEmail")
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>"new",
|
||||
DataForm_tabId=>0,
|
||||
name=>"cc",
|
||||
label=>$i18n->get(12),
|
||||
status=>"hidden",
|
||||
isMailField=>1,
|
||||
width=>0,
|
||||
type=>"email"
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>"new",
|
||||
DataForm_tabId=>0,
|
||||
name=>"bcc",
|
||||
label=>$i18n->get(13),
|
||||
status=>"hidden",
|
||||
isMailField=>1,
|
||||
width=>0,
|
||||
type=>"email"
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>"new",
|
||||
DataForm_tabId=>0,
|
||||
name=>"subject",
|
||||
label=>$i18n->get(14),
|
||||
status=>"hidden",
|
||||
isMailField=>1,
|
||||
width=>0,
|
||||
type=>"text",
|
||||
defaultValue=>"Contact Us",
|
||||
});
|
||||
$dataForm->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId =>"new",
|
||||
width => "",
|
||||
name => "comments",
|
||||
label => "Comments",
|
||||
DataForm_tabId => 0,
|
||||
status => "required",
|
||||
type => "textarea",
|
||||
possibleValues => undef,
|
||||
defaultValue => undef,
|
||||
subtext => "Tell us how we can assist you.",
|
||||
rows => undef,
|
||||
vertical => undef,
|
||||
extras => undef,
|
||||
}, "1","1", undef);
|
||||
}
|
||||
|
||||
# add search
|
||||
if ($form->get("search")) {
|
||||
my $page = addPage($home, "Search");
|
||||
addAsset($page, {
|
||||
title => "Search",
|
||||
isHidden => 1,
|
||||
className => "WebGUI::Asset::Wobject::Search",
|
||||
description => "Can't find what you're looking for? Try our search.",
|
||||
searchRoot => $home->getId,
|
||||
});
|
||||
}
|
||||
|
||||
# commit the working tag
|
||||
my $working = WebGUI::VersionTag->getWorking($session);
|
||||
$working->set({title=>"Initial Site Setup"});
|
||||
$working->commit;
|
||||
|
||||
# remove init state
|
||||
$session->setting->remove('specialState');
|
||||
$session->http->setRedirect($session->url->gateway());
|
||||
return undef;
|
||||
}
|
||||
else {
|
||||
$legend = "Admin Acccount";
|
||||
my $u = WebGUI::User->new($session,'3');
|
||||
my $f = WebGUI::HTMLForm->new($session,action=>$session->url->gateway());
|
||||
$f->hidden( -name=>"step", -value=>"2");
|
||||
$f->text(
|
||||
-name=>"username",
|
||||
-value=>$u->username,
|
||||
-label=>$i18n->get(50),
|
||||
-hoverHelp=>$i18n->get('50 setup description'),
|
||||
);
|
||||
$f->text(
|
||||
-name=>"identifier",
|
||||
-value=>"123qwe",
|
||||
-label=>$i18n->get(51),
|
||||
-hoverHelp=>$i18n->get('51 description'),
|
||||
-subtext=>'<div style=\"font-size: 10px;\">('.$i18n->get("password clear text").')</div>'
|
||||
);
|
||||
$f->email(
|
||||
-name=>"email",
|
||||
-value=>$u->profileField("email"),
|
||||
-label=>$i18n->get(56),
|
||||
-hoverHelp=>$i18n->get('56 description'),
|
||||
);
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
}
|
||||
my $page = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>WebGUI Initial Configuration :: '.$legend.'</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<script type="text/javascript">
|
||||
function getWebguiProperty (propName) {
|
||||
var props = new Array();
|
||||
props["extrasURL"] = "'.$session->url->extras().'";
|
||||
props["pageURL"] = "'.$session->url->page(undef, undef, 1).'";
|
||||
return props[propName];
|
||||
}
|
||||
</script>'. $session->style->generateAdditionalHeadTags .'
|
||||
<style type="text/css">';
|
||||
if ($session->form->process("step") != 5) {
|
||||
$page .= ' #initBox {
|
||||
font-family: georgia, helvetica, arial, sans-serif; color: white; z-index: 10;
|
||||
top: 5%; left: 10%; position: absolute;
|
||||
}
|
||||
#initBoxSleeve {
|
||||
overflow: auto;
|
||||
width: 700px;
|
||||
height: 475px;
|
||||
}
|
||||
a { color: black; }
|
||||
a:visited { color: black;}
|
||||
';
|
||||
}
|
||||
else {
|
||||
$page .= '
|
||||
#initBox {
|
||||
font-family: georgia, helvetica, arial, sans-serif; color: white; z-index: 10; width: 98%;
|
||||
height: 98%; top: 10; left: 10; position: absolute;
|
||||
}
|
||||
';
|
||||
}
|
||||
if ($session->form->process("step") == 6) {
|
||||
$page .= '
|
||||
#forumNames_formId_row, #aboutUsContent_formId_row {
|
||||
display: none;
|
||||
}
|
||||
';
|
||||
}
|
||||
$page .= ' </style> </head> <body>
|
||||
<div id="initBox"><h1>'.$legend.'</h1><div id="initBoxSleeve"> '.$output.'</div></div>
|
||||
<img src="'.$session->url->extras('background.jpg').'" style="border-style:none;position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;" />
|
||||
</body> </html>';
|
||||
$session->http->setCacheControl("none");
|
||||
$session->http->setMimeType("text/html");
|
||||
return $page;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
3
www/extras/extjs/resources/css/ext-all.css
vendored
3
www/extras/extjs/resources/css/ext-all.css
vendored
|
|
@ -6,7 +6,8 @@
|
|||
* http://www.extjs.com/license
|
||||
*/
|
||||
|
||||
html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
|
||||
/*html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul
|
||||
* {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}*/
|
||||
.ext-el-mask {
|
||||
z-index: 20000;
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@
|
|||
width: 180px;
|
||||
float: left;
|
||||
}
|
||||
#initBox {
|
||||
font-family: georgia, helvetica, arial, sans-serif; color: white; z-index: 10; width: 98%;
|
||||
height: 98%; top: 10; left: 10; position: absolute;
|
||||
}
|
||||
#themeContainer {
|
||||
height: 40px;
|
||||
z-index: 10;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,21 @@ WebguiStyleDesigner = function () {
|
|||
"footerTextColor" : "#000000"
|
||||
},
|
||||
{
|
||||
"pageBackgroundColor" : "#A10101",
|
||||
"linkColor" : "#FFCACA",
|
||||
"visitedLinkColor" : "#FFCACA",
|
||||
"utilityBackgroundColor" : "#4A0000",
|
||||
"utilityTextColor" : "#ffffff",
|
||||
"headerBackgroundColor" : "#ffffff",
|
||||
"headerTextColor" : "#000000",
|
||||
"navigationBackgroundColor" : "#FFF6F6",
|
||||
"navigationTextColor" : "#FF0101",
|
||||
"contentBackgroundColor" : "#888888",
|
||||
"contentTextColor" : "#ffffff",
|
||||
"footerBackgroundColor" : "#ffffff",
|
||||
"footerTextColor" : "#000000"
|
||||
},
|
||||
{
|
||||
"pageBackgroundColor" : "#000000",
|
||||
"linkColor" : "#cccccc",
|
||||
"visitedLinkColor" : "#dddddd",
|
||||
|
|
@ -31,6 +46,21 @@ WebguiStyleDesigner = function () {
|
|||
"footerBackgroundColor" : "#ffffff",
|
||||
"footerTextColor" : "#000000"
|
||||
},
|
||||
{
|
||||
"pageBackgroundColor" : "#FFCC3D",
|
||||
"linkColor" : "#0000B3",
|
||||
"visitedLinkColor" : "#0000B3",
|
||||
"utilityBackgroundColor" : "#FFB300",
|
||||
"utilityTextColor" : "#ffffff",
|
||||
"headerBackgroundColor" : "#ffffff",
|
||||
"headerTextColor" : "#000000",
|
||||
"navigationBackgroundColor" : "#D57F1C",
|
||||
"navigationTextColor" : "#FFFFFF",
|
||||
"contentBackgroundColor" : "#FFD683",
|
||||
"contentTextColor" : "#000000",
|
||||
"footerBackgroundColor" : "#ffffff",
|
||||
"footerTextColor" : "#000000"
|
||||
}
|
||||
];
|
||||
|
||||
var drawThemeSwatch = function ( themeNumber ) {
|
||||
|
|
@ -39,8 +69,8 @@ WebguiStyleDesigner = function () {
|
|||
|
||||
var colorPickerFieldNames = {
|
||||
"pageBackgroundColor" : "Page Background",
|
||||
"linkColor" : "Link Color",
|
||||
"visitedLinkColor" : "Visited Link Color",
|
||||
"linkColor" : "Links",
|
||||
"visitedLinkColor" : "Visited Links",
|
||||
"utilityBackgroundColor" : "Utility Background",
|
||||
"utilityTextColor" : "Utility Text",
|
||||
"headerBackgroundColor" : "Header Background",
|
||||
|
|
@ -48,7 +78,7 @@ WebguiStyleDesigner = function () {
|
|||
"contentBackgroundColor" : "Content Background",
|
||||
"contentTextColor" : "Content Text",
|
||||
"navigationBackgroundColor" : "Navigation Background",
|
||||
"navigationTextColor" : "Navigation Text",
|
||||
"navigationTextColor" : "Navigation Links",
|
||||
"footerBackgroundColor" : "Footer Background",
|
||||
"footerTextColor" : "Footer Text Color"
|
||||
};
|
||||
|
|
@ -115,7 +145,14 @@ WebguiStyleDesigner = function () {
|
|||
case "contentBackgroundColor": Dom.get("pageBodyContainer").style.backgroundColor = this.value; break;
|
||||
case "contentTextColor": Dom.get("pageBodyContainer").style.color = this.value; break;
|
||||
case "navigationBackgroundColor": Dom.get("mainNavigationContainer").style.backgroundColor = this.value; break;
|
||||
case "navigationTextColor": Dom.get("mainNavigationContainer").style.color = this.value; break;
|
||||
case "navigationTextColor":
|
||||
var tags = Dom.get("mainNavigationContainer").getElementsByTagName("a");
|
||||
for (var i = 0; i < tags.length; i++) {
|
||||
tags[i].style.color = this.value;
|
||||
tags[i].style.linkColor = this.value;
|
||||
tags[i].style.vlinkColor = this.value;
|
||||
}
|
||||
break;
|
||||
case "footerBackgroundColor": Dom.get("pageFooterContainer").style.backgroundColor = this.value; break;
|
||||
case "footerTextColor": Dom.get("pageFooterContainer").style.color = this.value; break;
|
||||
}
|
||||
|
|
@ -124,7 +161,7 @@ WebguiStyleDesigner = function () {
|
|||
for (var i in themeColors) {
|
||||
theme = Dom.get("theme_" + i);
|
||||
themeColorSet = themeColors[i];
|
||||
theme.style.backgroundColor = themeColorSet["contentBackgroundColor"];
|
||||
theme.style.backgroundColor = themeColorSet["pageBackgroundColor"];
|
||||
theme.style.borderColor = themeColorSet["linkColor"];
|
||||
theme.onclick = function () {
|
||||
var id = this.id.replace(/theme_(\d+)/,"$1");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue