Skip to content

Commit

Permalink
Item1208: redo menu's using tables so that users can edit the menu st…
Browse files Browse the repository at this point in the history
…ructure using ETP/ERP

git-svn-id: http://svn.foswiki.org/trunk/YuiMenuContrib@2887 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Mar 6, 2009
1 parent 9626ac3 commit c592f44
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 28 deletions.
20 changes: 11 additions & 9 deletions data/Main/WebMenu.txt
@@ -1,10 +1,12 @@

%STARTSECTION{"webmenu"}%
* [[%MENUWEB%.WebTopicList][ %ICON{"index"}% %MAKETEXT{"Index"}%]]
* [[%MENUWEB%.WebSearch][ %ICON{"searchtopic"}% %MAKETEXT{"Search"}%]]
* [[%MENUWEB%.WebChanges][ %ICON{"changes"}% %MAKETEXT{"Changes"}%]]
* [[%MENUWEB%.WebNotify][ %ICON{"notify"}% %MAKETEXT{"Notifications"}%]]
* [[%MENUWEB%.WebRss][ %ICON{"feed"}% %MAKETEXT{"RSS Feed"}%]]
* [[%MENUWEB%.WebStatistics][ %ICON{"statistics"}% %MAKETEXT{"Statistics"}%]]
* [[%MENUWEB%.WebPreferences][ %ICON{"wrench"}% %MAKETEXT{"Preferences"}%]]
%ENDSECTION{"webmenu"}%


( web.topic, label, link to next submenu)
%EDITTABLE{}%
| %MENUWEB%.WebTopicList | %ICON{"index"}% %MAKETEXT{"Index"}% | element |
| %MENUWEB%.WebTopicList | %ICON{"searchtopic"}% %MAKETEXT{"Search"}% | element |
| %MENUWEB%.WebChanges | %ICON{"changes"}% %MAKETEXT{"Changes"}% | element |
| %MENUWEB%.WebNotify | %ICON{"notify"}% %MAKETEXT{"Notifications"}% | element |
| %MENUWEB%.WebRss | %ICON{"feed"}% %MAKETEXT{"RSS Feed"}% | element |
| %MENUWEB%.WebStatistics | %ICON{"statistics"}% %MAKETEXT{"Statistics"}% | element |
| %MENUWEB%.WebPreferences | %ICON{"statistics"}% %MAKETEXT{"Statistics"}% | element |
34 changes: 17 additions & 17 deletions data/System/WebMenu.txt
@@ -1,18 +1,18 @@

%STARTSECTION{"webmenu"}%
* <b>%MAKETEXT{"User Reference"}%</b>
* %MENUWEB%.BeginnersStartHere
* %MENUWEB%.TextFormattingRules
* [[%MENUWEB%.Macros][Macros]]
* %MENUWEB%.FormattedSearch
* %MENUWEB%.QuerySearch
* %MENUWEB%.DocumentGraphics
* %MENUWEB%.SkinBrowser
* %MENUWEB%.InstalledPlugins
* <b>%MAKETEXT{"Categories"}%</b>
* [[%MENUWEB%.AdminDocumentationCategory][Admin Documentation]]
* [[%MENUWEB%.AdminToolsCategory][Admin Tools]]
* [[%MENUWEB%.DeveloperDocumentationCategory][Developer Doc]]
* [[%MENUWEB%.UserDocumentationCategory][User Documentation]]
* [[%MENUWEB%.UserToolsCategory][User Tools]]
%ENDSECTION{"webmenu"}%

( web.topic, label, link to next submenu)
%EDITTABLE{}%
| %MENUWEB%.BeginnersStartHere | BeginnersStartHere | element |
| %MENUWEB%.TextFormattingRules | TextFormattingRules | element |
| %MENUWEB%.Macros | Macros | element |
| %MENUWEB%.FormattedSearch | FormattedSearch | element |
| %MENUWEB%.QuerySearch | QuerySearch | element |
| %MENUWEB%.DocumentGraphics | DocumentGraphics | element |
| %MENUWEB%.SkinBrowser | SkinBrowser | element |
| %MENUWEB%.InstalledPlugins | InstalledPlugins | element |
| %MENUWEB%.AdminDocumentationCategory | AdminDocumentationCategory | element |
| %MENUWEB%.AdminToolsCategory | AdminToolsCategory | element |
| %MENUWEB%.DeveloperDocumentationCategory | DeveloperDocumentationCategory | element |
| %MENUWEB%.UserDocumentationCategory | UserDocumentationCategory | element |
| %MENUWEB%.UserToolsCategory | UserToolsCategory | element |
| %MENUWEB%.WebChanges | Recent Changes | element |
71 changes: 69 additions & 2 deletions data/System/YuiMenuContrib.txt
Expand Up @@ -55,13 +55,70 @@ fall back to the default in this topic
<verbatim>
%STARTSECTION{"webmenu-defaultselector"}%
%INCLUDE{
"%IF{"istopic '%USERSWEB%.DefaultWebMenu'" then="%USERSWEB%.DefaultWebMenu" else="%SYSTEMWEB%.YuiMenuContrib"}%"
"%WEB%.%TOPIC%"
MENUTOPIC="%IF{"istopic '%USERSWEB%.DefaultWebMenu'" then="%USERSWEB%.DefaultWebMenu" else="%SYSTEMWEB%.YuiMenuContrib"}%"
MENUWEB="%MENUWEB%"
section="webmenu"
section="webmenu-builder"
}%
%ENDSECTION{"webmenu-defaultselector"}%
</verbatim>

<verbatim>
%STARTSECTION{"webmenu-builder"}%<ul>
%SEARCH{
"^\|.*\|$"
web="%MENUWEB%"
topic="%MENUTOPIC%"
type="regex"
multiple="on"
casesensitive="on"
nonoise="on"
separator=""
format="$percntINCLUDE{
$quot%WEB%.%TOPIC%$quot
MENUWEB=$quot%MENUWEB%$quot
MENUTOPIC=$quot$pattern(\|\s*([^\|\s]*)\s*\|.*)$quot
MENULABEL=$quot$pattern(\|\s*[^\|\s]*\s*\|\s*([^\|]*)\s*\|.*)$quot
section=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*([^\|\s]*)\s*\|.*)$quot
SUBMENUWEB=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*([^\|\s]*)\.[^.]*\s*\|.*)$quot
SUBMENUTOPIC=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*[^.]*\.([^\|\s]*)\s*\|.*)$quot
}$percnt"
}%
</ul>%ENDSECTION{"webmenu-builder"}%

%STARTSECTION{"element"}%<li>[[%MENUTOPIC%][%MENULABEL%]]</li>%ENDSECTION{"element"}%
%STARTSECTION{"submenu"}%<li>[[%MENUTOPIC%][%MENULABEL%]]
<div class='yuimenu'><div class='bd'> %INCLUDE{
"%WEB%.%TOPIC%"
section="webmenu-builder%IF{"istopic '%SUBMENUWEB%.%SUBMENUTOPIC%'" then="" else="-default"}%"
MENUWEB="%SUBMENUWEB%"
MENUTOPIC="%SUBMENUTOPIC%"
}% </div></div>
</li>%ENDSECTION{"submenu"}%

****TOTO: this should use the SYSTEM web one we distribute unless the MAINWEB one exists.
%STARTSECTION{"webmenu-builder-default"}%<ul> SVSV
%SEARCH{
"^\|.*\|$"
web="%MAINWEB%"
topic="DefaultWebMenu"
type="regex"
multiple="on"
casesensitive="on"
nonoise="on"
separator=""
format="$percntINCLUDE{
$quot%WEB%.%TOPIC%$quot
MENUWEB=$quot%MENUWEB%$quot
MENUTOPIC=$quot$pattern(\|\s*([^\|\s]*)\s*\|.*)$quot
MENULABEL=$quot$pattern(\|\s*[^\|\s]*\s*\|\s*([^\|]*)\s*\|.*)$quot
section=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*([^\|\s]*)\s*\|.*)$quot
SUBMENUWEB=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*([^\|\s]*)\.[^.]*\s*\|.*)$quot
SUBMENUTOPIC=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*[^.]*\.([^\|\s]*)\s*\|.*)$quot
}$percnt"
}%
</ul>%ENDSECTION{"webmenu-builder-default"}%
</verbatim>

---++ Top level Menu entries
to define your own WebMenu for all webs, copy and customise the content below to your Web's WebMenu topic
Expand Down Expand Up @@ -200,6 +257,16 @@ overflow:visible;
%ENDSECTION{"yui-navigation-menu-js-yui"}%
</verbatim>

<verbatim>
%STARTSECTION{"yui-navigation-sub-menu"}% * [[%MENUWEB%.WebHome][%MENULABEL%]]
<div class='yuimenu'><div class='bd'> %INCLUDE{
"%MENUWEB%.WebMenu"
SECTION="webmenu"
MENUWEB="%MENUWEB%"
warn="%INCLUDE{"%SYSTEMWEB%.YuiMenuContrib" MENUWEB="%MENUWEB%" section="webmenu-defaultselector"}%"
}% </div></div>%ENDSECTION{"yui-navigation-sub-menu"}%
</verbatim>


---++ Info

Expand Down

0 comments on commit c592f44

Please sign in to comment.