From 3f8162519f68691b14832c7efdf6a4c1e90cbf2b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 25 Mar 2004 19:26:52 +0000 Subject: [PATCH] bugfix [ 912217 ] top level nav macro problems --- docs/changelog/6.x.x.txt | 2 ++ docs/upgrades/upgrade_6.0.0-6.0.1.sql | 1 + lib/WebGUI/Operation/Navigation.pm | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 5033f2e40..c72149c0a 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -8,6 +8,8 @@ Andreas Graf). - Apache 2.0 is now the default web server for WebGUI. See gotcha.txt for details. - Bugfix [ 904313 ] Problem with page-template preview in 6.0.0 + - Bugfix [ 912017 ] viewSubmission function error in 6.0.0 + - Bugfix [ 912217 ] top level nav macro problems diff --git a/docs/upgrades/upgrade_6.0.0-6.0.1.sql b/docs/upgrades/upgrade_6.0.0-6.0.1.sql index 6d893e966..2183342c3 100644 --- a/docs/upgrades/upgrade_6.0.0-6.0.1.sql +++ b/docs/upgrades/upgrade_6.0.0-6.0.1.sql @@ -78,4 +78,5 @@ INSERT INTO international VALUES (1094,'WebGUI',1,'Navigation, Manage',107820804 INSERT INTO international VALUES (1095,'WebGUI',1,'

The general idea behind the navigation system is that instead of
hardwiring all the various choices you might make into the code, the
system manages a \'library\' of these styles, just the way it does with
Snippets, Images, Templates, Page Styles, and other types of reusable
information.  You can create a new \'nav menu style\', give it a name,
and then use it anywhere on your site that you like.

\r\n

The navigation system consists of two parts:

\r\n
    \r\n
  1. The navigation editor
  2. \r\n
  3. The ^Navigation(); macro
\r\n

The easiest way to add a completely new menu to your site is to put a ^Navigation(myMenu); macro into your style.
A \"edit myMenu\" link will be displayed if \"myMenu\" is not defined.

\r\n

Note: In this example \"myMenu\" is used, but you can pick any name, as long as it is unique.

',1078462928,NULL); INSERT INTO international VALUES (1096,'WebGUI',1,'Navigation Template',1078207966,NULL); INSERT INTO international VALUES (1097,'WebGUI',1,'config.button 
A \"Edit / Manage\" button for this navigation item.
\r\n

page_loop
A loop containing page information.

\r\n
\r\n

page.menuTitle
The menu title of this page.

\r\n

page.title
The title of this page.

\r\n

page.urlizedTitle
The urlized title of this pagepage.url.

\r\n

page.url
The url of this page.

\r\n

page.pageId
The pageId of this page.

\r\n

page.parentId
The ParentId of this page.

\r\n

page.ownerId
The ownerId of this page.

\r\n

page.synopsis
The synopsis of this page.

\r\n

page.newWindow
A condition indicating whether this page should be opened in a new window.

\r\n

page.absDepth
The absolute depth of this page (relative to nameless root).

\r\n

page.relDepth
The relative depth of this page (relative to starting point).

\r\n

page.isCurrent
A condition indicating whether this page is current page.

\r\n

page.isHidden
A condition indicating whether this page is a hidden page.
(Note: This variable is only visible if \"Show hidden pages\" is switched on.)

\r\n

page.isSystem
A condition indicating whether this page is a system page (Trash, Clipboard, etc).
(Note: This variable is only visible if \"Show system pages\" is switched on.)

\r\n

page.isViewable
A condition indicating whether the user has permission to view it.
(Note: This variable is only visible if \"Show unprivileged pages\" is switched on.)

\r\n

page.indent
A variable containing the indent for current page. The default indent is three spaces. Use the page.indent_loop if you need a more flexible indent.

\r\n

page.indent_loop
A loop that runs page.relDepth times.

\r\n
\r\n

indent
A number representing the loop count.

\r\n

page.isRoot
A condition indication whether this page is a root page.

\r\n

page.isTop
A condition indication whether this page is a top page (daughter of root).

\r\n

page.hasDaughter
A condition indication whether this page has a daughter. In other words: It evaluates to true if this page is a mother.

\r\n

page.isMyDaughter
A condition indication whether this page is a daughter of current page.

\r\n

page.isMyMother
A condition indication whether this page is the mother of current page.

\r\n

page.mother.title
The title of the mother of this page.

\r\n

page.mother.urlizedTitle
The urlized title of the mother of this page.

\r\n

page.mother.pageId
The pageId of the mother of this page.

\r\n

page.mother.parentId
The parentId of the mother of this page.

\r\n

page.depthIs1 , page.depthIs2 , page.depthIs3 , page.depthIs4 , page.depthIsN
A condition indicating whether the depth of this page is N. This variable is useful if you want to style a certain level.

\r\n

<tmpl_if page.depthIs1>
   <img src=\"level1.gif\">
<tmpl_else>
   <img src=\"defaultBullet.gif\">
</tmpl_if>

\r\n

page.relativeDepthIs1 , page.relativeDepthIs2 , page.relativeDepthIs3 , page.relativeDepthIsN
A condition indicating whether the relative depth of this page is N.

\r\n

 

',1078207966,NULL); +update Navigation set depth=99 where depth=0; diff --git a/lib/WebGUI/Operation/Navigation.pm b/lib/WebGUI/Operation/Navigation.pm index 9ad37111c..821956827 100644 --- a/lib/WebGUI/Operation/Navigation.pm +++ b/lib/WebGUI/Operation/Navigation.pm @@ -174,8 +174,7 @@ sub www_editNavigation { -value=>[$session{form}{stopAtLevel} || $config->{stopAtLevel}] ); tie my %depths, 'Tie::IxHash'; - %depths = ( '0' => '0 levels', - '1' => '1 level', + %depths = ( '1' => '1 level', '2' => '2 levels', '3' => '3 levels', '4' => '4 levels',