fixed version tag problem. changed admin toggle

This commit is contained in:
Doug Bell 2010-05-07 13:03:05 -05:00
parent ea1a020ab5
commit 5c2581850f
6 changed files with 30 additions and 9 deletions

View file

@ -3,6 +3,14 @@ WebGUI 8 Migration Guide
The information contained herein documents the API changes that have occurred in the WebGUI 8 development effort and how to migrate your code to accomodate the new APIs. The information contained herein documents the API changes that have occurred in the WebGUI 8 development effort and how to migrate your code to accomodate the new APIs.
WebGUI::Macro::AdminBar
==========================
There is no Admin Bar for normal pages. Only the admin mode can see the admin bar.
WebGUI::Macro::AdminToggle
==========================
The Admin Toggle can only enter admin mode, it cannot leave it, so there is no "Turn Off" text. The second
parameter is now the template ID.
WebGUI::Config WebGUI::Config

View file

@ -327,7 +327,7 @@ __DATA__
<dt class="a-m-t">^International("admin console","AdminConsole");</dt> <dt class="a-m-t">^International("admin console","AdminConsole");</dt>
<dd class="a-m-d"><div class="bd"> <dd class="a-m-d"><div class="bd">
<TMPL_LOOP adminPlugins> <TMPL_LOOP adminPlugins>
<a class="link" href="<tmpl_var url>"> <a class="link" target="view" href="<tmpl_var url>">
<img src="<tmpl_var icon.small>" style="border: 0px; vertical-align: middle;" alt="icon" /> <img src="<tmpl_var icon.small>" style="border: 0px; vertical-align: middle;" alt="icon" />
<tmpl_var title> <tmpl_var title>
</a> </a>

View file

@ -1042,7 +1042,7 @@ sub getHelpers {
my ( $self ) = @_; my ( $self ) = @_;
my $default = [ my $default = [
{ {
class => 'WebGUI::AssetHelper::EditBranch', class => 'WebGUI::AssetHelper::EditBranch',
label => 'Edit Branch', label => 'Edit Branch',
}, },
@ -2059,6 +2059,8 @@ sub processEditForm {
my $overrides = $self->session->config->get( "assets/" . $self->get("className") . "/fields" ); my $overrides = $self->session->config->get( "assets/" . $self->get("className") . "/fields" );
foreach my $property ( $self->getProperties ) { foreach my $property ( $self->getProperties ) {
next if $self->meta->find_attribute_by_name( $property )->noFormPost;
my $fieldType = $self->meta->find_attribute_by_name($property)->fieldType; my $fieldType = $self->meta->find_attribute_by_name($property)->fieldType;
my $fieldOverrides = $overrides->{$property} || {}; my $fieldOverrides = $overrides->{$property} || {};
my $fieldHash = { my $fieldHash = {
@ -2069,7 +2071,6 @@ sub processEditForm {
value => $self->$property, value => $self->$property,
}; };
next if ( $fieldHash->{noFormPost} );
# process the form element # process the form element
$data{$property} = $form->process( $property, $fieldType, $fieldHash->{defaultValue}, $fieldHash ); $data{$property} = $form->process( $property, $fieldType, $fieldHash->{defaultValue}, $fieldHash );
@ -2084,6 +2085,9 @@ sub processEditForm {
$self->updateMetaData( $field, $value ); $self->updateMetaData( $field, $value );
} }
} }
$self->session->log->info( Dumper \%data );
$self->session->db->beginTransaction; $self->session->db->beginTransaction;
$self->update( \%data ); $self->update( \%data );
$self->session->db->commit; $self->session->db->commit;

View file

@ -43,7 +43,7 @@ These functions are available from this package:
=cut =cut
#------------------------------------------------------------------- #-------------------------------------------------------------------
my $macro_re = qr{ our $macro_re = qr{
( # capture #1 - entire macro call ( # capture #1 - entire macro call
\^ # start with carat \^ # start with carat
([-a-zA-Z0-9_@#/*]{1,64}) # capture #2 - macro name ([-a-zA-Z0-9_@#/*]{1,64}) # capture #2 - macro name

View file

@ -48,16 +48,15 @@ sub process {
my $session = shift; my $session = shift;
return "" return ""
unless $session->user->canUseAdminMode; unless $session->user->canUseAdminMode;
my ($turnOn, $turnOff, $templateName) = @_; my ($turnOn, $templateName) = @_;
my $i18n = WebGUI::International->new($session,'Macro_AdminToggle'); my $i18n = WebGUI::International->new($session,'Macro_AdminToggle');
my %var; my %var;
$var{'toggle.text'} = $turnOn || $i18n->get(516);
if ($session->var->isAdminOn) { if ($session->var->isAdminOn) {
$var{'toggle.url'} = $session->url->page('op=switchOffAdmin'); $var{'toggle.url'} = '#'
$var{'toggle.text'} = $turnOff || $i18n->get(517);
} }
else { else {
$var{'toggle.url'} = $session->url->page('op=switchOnAdmin'); $var{'toggle.url'} = $session->url->page('op=admin');
$var{'toggle.text'} = $turnOn || $i18n->get(516);
} }
my $template = $templateName ? WebGUI::Asset::Template->newByUrl($session, $templateName) my $template = $templateName ? WebGUI::Asset::Template->newByUrl($session, $templateName)
: WebGUI::Asset::Template->newById($session, "PBtmpl0000000000000036"); : WebGUI::Asset::Template->newById($session, "PBtmpl0000000000000036");

View file

@ -0,0 +1,10 @@
use WebGUI::Upgrade::Script;
report "\tRemoving Admin Bar... ";
$session->config->delete( 'macros/AdminBar' );
done;