From 325dbad2a36a03721fecba78f4a48ae7876e17a7 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Tue, 25 Jan 2011 18:09:46 -0600 Subject: [PATCH] remove style wizard --- lib/WebGUI/Asset/Template.pm | 261 ----------------------------------- 1 file changed, 261 deletions(-) diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 0ce4218c8..b9b36bc66 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -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( '
' . $output . '
', @@ -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 = ''; - } - 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 = ' - - - ^Page(title); - ^c; - - - -^AdminBar; -
-
- '.$logoContent.' - '.$form->get("heading").' -
-
-
-
- -
-
-
-
-
-
-
-
^a(^@;); ^AdminToggle;
- -
-
-
- -'; - 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 .= ''; - $output .= $i18n->get('choose a layout'); - $output .= WebGUI::Form::hidden($self->session,{name=>"step", value=>2}); - $output .= '
'.WebGUI::Form::radio($self->session,{name=>"layout", value=>1, checked=>1}).sprintf(q| - - -
%s%s
%s%s
|, - $i18n->get('logo'), - $i18n->get('heading'), - $i18n->get('menu'), - $i18n->get('body content'), - ); - $output .= '
'.WebGUI::Form::radio($self->session,{name=>"layout", value=>2}).sprintf(q| - - - -
%s%s
%s
%s
|, - $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