Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lolo888
ISPConfig 3
Commits
f699a20c
Commit
f699a20c
authored
Sep 28, 2012
by
mcramer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented: Extend menus by putting *.menu.php inside the module/lib/menu.d/ folder
parent
656a1c32
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
32 deletions
+43
-32
interface/web/admin/lib/interface.d/tpl_default.menu.php
interface/web/admin/lib/interface.d/tpl_default.menu.php
+11
-4
interface/web/admin/lib/module.conf.php
interface/web/admin/lib/module.conf.php
+0
-14
interface/web/capp.php
interface/web/capp.php
+15
-1
interface/web/login/index.php
interface/web/login/index.php
+12
-0
interface/web/themes/default/templates/sidenav.tpl.htm
interface/web/themes/default/templates/sidenav.tpl.htm
+4
-0
interface/web/tools/lib/module.conf.php
interface/web/tools/lib/module.conf.php
+1
-13
No files found.
interface/web/admin/lib/interface.d/tpl_default.menu.php
View file @
f699a20c
<?php
$items
[]
=
array
(
'title'
=>
'Default Theme'
,
'target'
=>
'content'
,
'link'
=>
'admin/tpl_default.php'
,
'html_id'
=>
'tpl_default'
);
for
(
$m
=
0
;
$m
<
count
(
$module
[
'nav'
]);
$m
++
)
{
if
(
$module
[
'nav'
][
$m
][
'title'
]
==
'Interface'
)
{
$module
[
'nav'
][
$m
][
'items'
][]
=
array
(
'title'
=>
'Default Theme'
,
'target'
=>
'content'
,
'link'
=>
'admin/tpl_default.php'
,
'html_id'
=>
'tpl_default'
);
break
;
}
}
?>
interface/web/admin/lib/module.conf.php
View file @
f699a20c
...
...
@@ -83,20 +83,6 @@ $items[] = array( 'title' => 'Interface Config',
'link'
=>
'admin/system_config_edit.php?id=1'
,
'html_id'
=>
'interface_config'
);
//**** Load the settings pages of all installed themes
$menu_dir
=
ISPC_WEB_PATH
.
'/admin/lib/interface.d'
;
if
(
is_dir
(
$menu_dir
))
{
if
(
$dh
=
opendir
(
$menu_dir
))
{
//** Go through all files in the menu dir
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
if
(
$file
!=
'.'
&&
$file
!=
'..'
&&
substr
(
$file
,
-
9
,
9
)
==
'.menu.php'
)
{
include_once
(
$menu_dir
.
'/'
.
$file
);
}
}
}
}
$module
[
'nav'
][]
=
array
(
'title'
=>
'Interface'
,
'open'
=>
"1"
,
'items'
=>
$items
);
...
...
interface/web/capp.php
View file @
f699a20c
...
...
@@ -52,7 +52,21 @@ if(!in_array($mod,$user_modules)) $app->error($app->lng(301));
//* Load module configuration into the session.
if
(
is_file
(
$mod
.
"/lib/module.conf.php"
))
{
include_once
(
$mod
.
"/lib/module.conf.php"
);
$_SESSION
[
"s"
][
"module"
]
=
$module
;
$menu_dir
=
ISPC_WEB_PATH
.
'/'
.
$mod
.
'/lib/menu.d'
;
if
(
is_dir
(
$menu_dir
))
{
if
(
$dh
=
opendir
(
$menu_dir
))
{
//** Go through all files in the menu dir
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
if
(
$file
!=
'.'
&&
$file
!=
'..'
&&
substr
(
$file
,
-
9
,
9
)
==
'.menu.php'
&&
$file
!=
'dns_resync.menu.php'
)
{
include_once
(
$menu_dir
.
'/'
.
$file
);
}
}
}
}
$_SESSION
[
"s"
][
"module"
]
=
$module
;
session_write_close
();
if
(
$redirect
==
''
){
echo
"HEADER_REDIRECT:"
.
$_SESSION
[
"s"
][
"module"
][
"startpage"
];
...
...
interface/web/login/index.php
View file @
f699a20c
...
...
@@ -195,6 +195,18 @@ class login_index {
if
(
is_file
(
$_SESSION
[
's'
][
'user'
][
'startmodule'
]
.
'/lib/module.conf.php'
))
{
include_once
(
$_SESSION
[
's'
][
'user'
][
'startmodule'
]
.
'/lib/module.conf.php'
);
$menu_dir
=
ISPC_WEB_PATH
.
'/'
.
$_SESSION
[
's'
][
'user'
][
'startmodule'
]
.
'/lib/menu.d'
;
if
(
is_dir
(
$menu_dir
))
{
if
(
$dh
=
opendir
(
$menu_dir
))
{
//** Go through all files in the menu dir
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
if
(
$file
!=
'.'
&&
$file
!=
'..'
&&
substr
(
$file
,
-
9
,
9
)
==
'.menu.php'
&&
$file
!=
'dns_resync.menu.php'
)
{
include_once
(
$menu_dir
.
'/'
.
$file
);
}
}
}
}
$_SESSION
[
's'
][
'module'
]
=
$module
;
}
...
...
interface/web/themes/default/templates/sidenav.tpl.htm
View file @
f699a20c
...
...
@@ -12,7 +12,11 @@
<tmpl_loop
name=
"items"
>
<li
<
tmpl_if
name=
"html_id"
>
id='
<tmpl_var
name=
"html_id"
>
'
</tmpl_if>
>
<tmpl_if
name=
"link"
>
<tmpl_if
name=
"target"
op=
"=="
value=
"_blank"
>
<a
href=
"<tmpl_var name='link'>"
target=
"_blank"
>
<tmpl_else>
<a
href=
"#"
onclick=
"loadContent('<tmpl_var name='link'>')"
>
</tmpl_if>
</tmpl_if>
<tmpl_var
name=
"title"
>
<tmpl_if
name=
"link"
>
...
...
interface/web/tools/lib/module.conf.php
View file @
f699a20c
...
...
@@ -40,18 +40,6 @@ $module['nav'][] = array( 'title' => 'Interface',
unset
(
$items
);
//**** Load additional menu items
$menu_dir
=
ISPC_WEB_PATH
.
'/tools/lib/menu.d'
;
if
(
is_dir
(
$menu_dir
))
{
if
(
$dh
=
opendir
(
$menu_dir
))
{
//** Go through all files in the menu dir
while
((
$file
=
readdir
(
$dh
))
!==
false
)
{
if
(
$file
!=
'.'
&&
$file
!=
'..'
&&
substr
(
$file
,
-
9
,
9
)
==
'.menu.php'
&&
$file
!=
'dns_resync.menu.php'
)
{
include_once
(
$menu_dir
.
'/'
.
$file
);
}
}
}
}
?>
\ No newline at end of file
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