From a0867dd45a09a4b47a5ea46e3531c50e5613da01 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 1 Feb 2011 16:38:18 -0800 Subject: [PATCH] Show different styles based on whether a user is in admin mode, or not. Fixes bug #12032. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Fork/ProgressBar.pm | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6f7512594..4a9b9cd6c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +1,7 @@ 7.10.9 - fixed #12030: Calendar Feed Time Zone Issue - fixed: Permission on who can create a shortcut of an Asset. + - fixed #12032: deleting forum posts 7.10.8 - rfe #12016 for the top story as well diff --git a/lib/WebGUI/Fork/ProgressBar.pm b/lib/WebGUI/Fork/ProgressBar.pm index 4969980bb..844315cd3 100644 --- a/lib/WebGUI/Fork/ProgressBar.pm +++ b/lib/WebGUI/Fork/ProgressBar.pm @@ -117,7 +117,6 @@ sub renderBar { ); $tt->process( \$template, \%vars, \my $content ) or die $tt->error; - my $console = WebGUI::AdminConsole->new( $session, $form->get('icon') ); $style->setLink( $url->extras("Fork/ProgressBar.css"), { rel => 'stylesheet' } ); $style->setScript( $url->extras("$_.js") ) for ( ( @@ -134,7 +133,12 @@ sub renderBar { 'Fork/poll', 'Fork/redirect' ); - return $console->render( $content, encode_entities( $form->get('title') ) ); + ##If the user does not have admin mode turned on, then render the content in the user function style. + ##Otherwise, use the AdminConsole. + if ($session->var->isAdminOn) { + return WebGUI::AdminConsole->new($session, $form->get('icon'))->render($content, encode_entities( $form->get('title') )); + } + return $session->style->userStyle($content); } ## end sub renderBar 1;