Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
cb4fd29b
Commit
cb4fd29b
authored
Aug 23, 2004
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added menu-procs.tcl
parent
efa6849a
Pipeline
#1065
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
intranet-menu-procs.tcl
tcl/intranet-menu-procs.tcl
+53
-0
No files found.
tcl/intranet-menu-procs.tcl
0 → 100755
View file @
cb4fd29b
# /packages/intranet-core/tcl/intranet-menu-procs.tcl
#
# Copyright (C
)
2004 Project/Open
#
# This program is free software. You can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation
;
# either version 2 of the License, or (at your option
)
# any later version. This program is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY
;
# without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
ad_library
{
Library with auxillary routines related to im_menus.
@author frank.bergmann@project-open.com
}
ad_proc -public im_menu_parent_options
{
{
include_empty 0
}
}
{
Returns a list of all menus,
ordered and indented according to hierarchy.
}
{
set start_menu_id
[
db_string start_menu_id
"select menu_id from im_menus where label='main'"
-default 0
]
set parent_options_sql
"
select
m.name,
m.menu_id,
m.label,
(level-1) as indent_level
from
im_menus m
start with
menu_id = :start_menu_id
connect by
parent_menu_id = PRIOR menu_id"
set parent_options
[
list
]
db_foreach parent_options
$parent
_options_sql
{
set spaces
""
for
{
set
i 0
}
{
$i
<
$indent
_level
}
{
incr i
}
{
append spaces
" "
}
lappend parent_options
[
list
"
$spaces$name
-
$label
"
$menu
_id
]
}
return
$parent
_options
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment