remove style wizard
This commit is contained in:
parent
b0c4cc8704
commit
325dbad2a3
1 changed files with 0 additions and 261 deletions
|
|
@ -799,9 +799,6 @@ ENDHTML
|
|||
}
|
||||
$output .= $f->toHtml;
|
||||
|
||||
# TODO: Asset Helper
|
||||
#$self->getAdminConsole->addSubmenuItem($self->getUrl('func=styleWizard'),$i18n->get("style wizard")) if ($self->get("namespace") eq "style");
|
||||
|
||||
# TODO: Make a www_edit template
|
||||
return $self->session->style->process(
|
||||
'<div class="yui-skin-sam">' . $output . '</div>',
|
||||
|
|
@ -892,264 +889,6 @@ sub www_manage {
|
|||
return $self->getParent->www_manageAssets;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_styleWizard
|
||||
|
||||
Edit form for building style templates in a WYSIWIG fashion.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_styleWizard {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
return $self->session->privilege->locked() unless $self->canEditIfLocked;
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_Template");
|
||||
my $form = $self->session->form;
|
||||
my $output = "";
|
||||
if ($form->get("step") == 2) {
|
||||
my $f = WebGUI::HTMLForm->new($self->session,{action=>$self->getUrl});
|
||||
$f->hidden(name=>"func", value=>"styleWizard");
|
||||
$f->hidden(name=>"proceed", value=>"manageAssets") if ($form->get("proceed"));
|
||||
$f->hidden(name=>"step", value=>3);
|
||||
$f->hidden(name=>"layout", value=>$form->get("layout"));
|
||||
$f->text(
|
||||
name=>"heading",
|
||||
value=>"My Site",
|
||||
label=>$i18n->get("site name"),
|
||||
hoverHelp=>$i18n->get("site name description")
|
||||
);
|
||||
$f->file(
|
||||
name=>"logo",
|
||||
label=>$i18n->get("logo"),
|
||||
hoverHelp=>$i18n->get("logo description"),
|
||||
subtext=>$i18n->get("logo subtext")
|
||||
);
|
||||
$f->color(
|
||||
name=>"pageBackgroundColor",
|
||||
value=>"#ccccdd",
|
||||
label=>$i18n->get("page background color"),
|
||||
hoverHelp=>$i18n->get("page background color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"headingBackgroundColor",
|
||||
value=>"#ffffff",
|
||||
label=>$i18n->get("header background color"),
|
||||
hoverHelp=>$i18n->get("header background color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"headingForegroundColor",
|
||||
value=>"#000000",
|
||||
label=>$i18n->get("header text color"),
|
||||
hoverHelp=>$i18n->get("header text color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"bodyBackgroundColor",
|
||||
value=>"#ffffff",
|
||||
label=>$i18n->get("body background color"),
|
||||
hoverHelp=>$i18n->get("body background color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"bodyForegroundColor",
|
||||
value=>"#000000",
|
||||
label=>$i18n->get("body text color"),
|
||||
hoverHelp=>$i18n->get("body text color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"menuBackgroundColor",
|
||||
value=>"#eeeeee",
|
||||
label=>$i18n->get("menu background color"),
|
||||
hoverHelp=>$i18n->get("menu background color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"linkColor",
|
||||
value=>"#0000ff",
|
||||
label=>$i18n->get("link color"),
|
||||
hoverHelp=>$i18n->get("link color description"),
|
||||
);
|
||||
$f->color(
|
||||
name=>"visitedLinkColor",
|
||||
value=>"#ff00ff",
|
||||
label=>$i18n->get("visited link color"),
|
||||
hoverHelp=>$i18n->get("visited link color description"),
|
||||
);
|
||||
$f->submit;
|
||||
$output = $f->print;
|
||||
} elsif ($form->get("step") == 3) {
|
||||
my $storageId = $form->get("logo","file");
|
||||
my $logo;
|
||||
my $logoContent = '';
|
||||
if ($storageId) {
|
||||
my $storage = WebGUI::Storage->get($self->session,$storageId);
|
||||
$logo = $self->addChild({
|
||||
className=>"WebGUI::Asset::File::Image",
|
||||
title=>join(' ', $form->get("heading"), $i18n->get('logo')),
|
||||
menuTitle=>join(' ', $form->get("heading"), $i18n->get('logo')),
|
||||
url=>join(' ', $form->get("heading"), $i18n->get('logo')),
|
||||
storageId=>$storage->getId,
|
||||
filename=>@{$storage->getFiles}[0],
|
||||
templateId=>"PBtmpl0000000000000088"
|
||||
});
|
||||
$logo->generateThumbnail;
|
||||
$logoContent = '<div class="logo"><a href="^H(linkonly);">^AssetProxy('.$logo->get("url").');</a></div>';
|
||||
}
|
||||
my $customHead = '';
|
||||
if ($form->get("layout") eq "1") {
|
||||
$customHead .= '
|
||||
.bodyContent {
|
||||
background-color: '.$form->get("bodyBackgroundColor","color").';
|
||||
color: '.$form->get("bodyForegroundColor","color").';
|
||||
width: 70%;
|
||||
float: left;
|
||||
}
|
||||
.menu {
|
||||
width: 30%;
|
||||
float: left;
|
||||
}
|
||||
.wrapper {
|
||||
width: 80%;
|
||||
margin-right: 10%;
|
||||
margin-left: 10%;
|
||||
background-color: '.$form->get("menuBackgroundColor","color").';
|
||||
}
|
||||
';
|
||||
} else {
|
||||
$customHead .= '
|
||||
.bodyContent {
|
||||
background-color: '.$form->get("bodyBackgroundColor","color").';
|
||||
color: '.$form->get("bodyForegroundColor","color").';
|
||||
width: 100%;
|
||||
}
|
||||
.menu {
|
||||
background-color: '.$form->get("menuBackgroundColor","color").';
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.wrapper {
|
||||
width: 80%;
|
||||
margin-right: 10%;
|
||||
margin-left: 10%;
|
||||
}
|
||||
';
|
||||
}
|
||||
my $style = '<html>
|
||||
<head>
|
||||
<tmpl_var head.tags>
|
||||
<title>^Page(title); - ^c;</title>
|
||||
<style type="text/css">
|
||||
.siteFunctions {
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
.copyright {
|
||||
font-size: 12px;
|
||||
}
|
||||
body {
|
||||
background-color: '.$form->get("pageBackgroundColor","color").';
|
||||
font-family: helvetica;
|
||||
font-size: 14px;
|
||||
}
|
||||
.heading {
|
||||
background-color: '.$form->get("headingBackgroundColor","color").';
|
||||
color: '.$form->get("headingForegroundColor","color").';
|
||||
font-size: 30px;
|
||||
margin-left: 10%;
|
||||
margin-right: 10%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.logo {
|
||||
width: 200px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
}
|
||||
.logo img {
|
||||
border: 0px;
|
||||
}
|
||||
.endFloat {
|
||||
clear: both;
|
||||
}
|
||||
.padding {
|
||||
padding: 5px;
|
||||
}
|
||||
'.$customHead.'
|
||||
a {
|
||||
color: '.$form->get("linkColor","color").';
|
||||
}
|
||||
a:visited {
|
||||
color: '.$form->get("visitedLinkColor","color").';
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
^AdminBar;
|
||||
<div class="heading">
|
||||
<div class="padding">
|
||||
'.$logoContent.'
|
||||
'.$form->get("heading").'
|
||||
<div class="endFloat"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="menu">
|
||||
<div class="padding">^AssetProxy('.($form->get("layout") == 1 ? 'flexmenu' : 'toplevelmenuhorizontal').');</div>
|
||||
</div>
|
||||
<div class="bodyContent">
|
||||
<div class="padding"><tmpl_var body.content></div>
|
||||
</div>
|
||||
<div class="endFloat"></div>
|
||||
</div>
|
||||
<div class="heading">
|
||||
<div class="padding">
|
||||
<div class="siteFunctions">^a(^@;); ^AdminToggle;</div>
|
||||
<div class="copyright">© ^D(%y); ^c;</div>
|
||||
<div class="endFloat"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
my $tag = WebGUI::VersionTag->getWorking( $self->session );
|
||||
my $newSelf = $self->addRevision({
|
||||
template=>$style
|
||||
});
|
||||
$newSelf->setVersionLock;
|
||||
return $newSelf->www_edit;
|
||||
} else {
|
||||
$output = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl}).WebGUI::Form::hidden($self->session,{name=>"func", value=>"styleWizard"});
|
||||
$output .= WebGUI::Form::hidden($self->session,{name=>"proceed", value=>"manageAssets"}) if ($form->get("proceed"));
|
||||
$output .= '<style type="text/css">
|
||||
.chooser { float: left; width: 150px; height: 150px; }
|
||||
.representation, .representation td { font-size: 12px; width: 120px; border: 1px solid black; }
|
||||
.representation { height: 130px; }
|
||||
</style>';
|
||||
$output .= $i18n->get('choose a layout');
|
||||
$output .= WebGUI::Form::hidden($self->session,{name=>"step", value=>2});
|
||||
$output .= '<div class="chooser">'.WebGUI::Form::radio($self->session,{name=>"layout", value=>1, checked=>1}).sprintf(q|<table class="representation"><tbody>
|
||||
<tr><td>%s</td><td>%s</td></tr>
|
||||
<tr><td>%s</td><td>%s</td></tr>
|
||||
</tbody></table></div>|,
|
||||
$i18n->get('logo'),
|
||||
$i18n->get('heading'),
|
||||
$i18n->get('menu'),
|
||||
$i18n->get('body content'),
|
||||
);
|
||||
$output .= '<div class="chooser">'.WebGUI::Form::radio($self->session,{name=>"layout", value=>2}).sprintf(q|<table class="representation"><tbody>
|
||||
<tr><td>%s</td><td>%s</td></tr>
|
||||
<tr><td style="text-align: center;" colspan="2">%s</td></tr>
|
||||
<tr><td colspan="2">%s</td></tr>
|
||||
</tbody></table></div>|,
|
||||
$i18n->get('logo'),
|
||||
$i18n->get('heading'),
|
||||
$i18n->get('menu'),
|
||||
$i18n->get('body content'),
|
||||
);
|
||||
$output .= WebGUI::Form::submit($self->session);
|
||||
$output .= WebGUI::Form::formFooter($self->session);
|
||||
}
|
||||
$self->getAdminConsole->addSubmenuItem($self->getUrl('func=edit'),$i18n->get("edit template")) if ($self->get("url"));
|
||||
return $self->getAdminConsole->render($output,$i18n->get('style wizard'));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue