From 75b03b006eae0f5df4b9aa0fd30edb42e0f5041b Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Wed, 19 Jul 2006 15:57:12 +0000 Subject: [PATCH] Adding reverse page loop --- docs/changelog/7.x.x.txt | 3 ++- docs/upgrades/upgrade_7.0.1-7.0.2.pl | 13 ++++++++++++- lib/WebGUI/Asset/Wobject/Navigation.pm | 15 ++++++++++++++- lib/WebGUI/Help/Asset_Navigation.pm | 5 +++++ lib/WebGUI/i18n/English/Asset_Navigation.pm | 9 +++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4a29b5d07..f3faae762 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,7 +25,8 @@ Kamerbeek / Procolix) - Fixed a bug where WebGUI::Asset::File->addRevision did not set correct privs to the storage associated with it. (Martin Kamerbeek / Procolix) - + - Added a reverse page loop option to the navigation asset (Martin + Kamerbeek / Procolix) 7.0.1 - fix: User profile field "Department" needs i18n diff --git a/docs/upgrades/upgrade_7.0.1-7.0.2.pl b/docs/upgrades/upgrade_7.0.1-7.0.2.pl index 16d91e976..0bbda1bfb 100644 --- a/docs/upgrades/upgrade_7.0.1-7.0.2.pl +++ b/docs/upgrades/upgrade_7.0.1-7.0.2.pl @@ -12,7 +12,7 @@ use lib "../../lib"; use strict; use Getopt::Long; use WebGUI::Session; - +use WebGUI::Utility; my $toVersion = "7.0.2"; # make this match what version you're going to my $quiet; # this line required @@ -22,6 +22,7 @@ my $session = start(); # this line required # upgrade functions go here addAdminToVisitorGroup($session); +addReversePageLoopColumn($session); finish($session); # this line required @@ -32,6 +33,16 @@ sub addAdminToVisitorGroup { return 1; } +sub addReversePageLoopColumn { + my $session = shift; + print "\tAdding the reversePageLoop column to the Navigation table\n" unless ($quiet); + + my @columns = $session->db->buildArray('describe Navigation'); + unless (isIn('reversePageLoop', @columns)) { + $session->db->write('alter table Navigation add column reversePageLoop tinyint(1) default 0'); + } +} + ##------------------------------------------------- #sub exampleFunction { # my $session = shift; diff --git a/lib/WebGUI/Asset/Wobject/Navigation.pm b/lib/WebGUI/Asset/Wobject/Navigation.pm index bb1dfb264..39cb14006 100644 --- a/lib/WebGUI/Asset/Wobject/Navigation.pm +++ b/lib/WebGUI/Asset/Wobject/Navigation.pm @@ -73,7 +73,11 @@ sub definition { showUnprivilegedPages=>{ fieldType=>'yesNo', defaultValue=>0 - } + }, + reversePageLoop=>{ + fieldType=>'yesNo', + defaultValue=>0 + }, } }); return $class->SUPER::definition($session, $definition); @@ -222,6 +226,12 @@ sub getEditForm { -hoverHelp=>$i18n->get('32 description'), -value=>$self->getValue("showUnprivilegedPages") ); + $tabform->getTab("display")->yesNo( + -name=>'reversePageLoop', + -label=>$i18n->get('reverse page loop'), + -hoverHelp => $i18n->get('reverse page loop description'), + -value=>$self->getValue('reversePageLoop'), + ); my $start = $self->getValue("startPoint"); $tabform->getTab("properties")->raw("