Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
7c267cad
Commit
7c267cad
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to set active sub-menu by href. Redo settings page/target handling
parent
3ffee52c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.nav.php
+21
-11
21 additions, 11 deletions
include/class.nav.php
scp/settings.php
+16
-37
16 additions, 37 deletions
scp/settings.php
with
37 additions
and
48 deletions
include/class.nav.php
+
21
−
11
View file @
7c267cad
...
...
@@ -43,7 +43,7 @@ class StaffNav {
return
(
!
$this
->
isAdminPanel
());
}
function
setTabActive
(
$tab
){
function
setTabActive
(
$tab
,
$menu
=
''
){
if
(
$this
->
tabs
[
$tab
]){
$this
->
tabs
[
$tab
][
'active'
]
=
true
;
...
...
@@ -51,6 +51,7 @@ class StaffNav {
$this
->
tabs
[
$this
->
activetab
][
'active'
]
=
false
;
$this
->
activetab
=
$tab
;
if
(
$menu
)
$this
->
setActiveSubMenu
(
$menu
,
$tab
);
return
true
;
}
...
...
@@ -58,16 +59,25 @@ class StaffNav {
return
false
;
}
function
setActiveTab
(
$tab
){
return
$this
->
setTabActive
(
$tab
);
function
setActiveTab
(
$tab
,
$menu
=
''
){
return
$this
->
setTabActive
(
$tab
,
$menu
);
}
function
getActiveTab
(){
return
$this
->
activetab
;
}
function
setActiveSubMenu
(
$mid
)
{
$this
->
activeMenu
=
$mid
;
function
setActiveSubMenu
(
$mid
,
$tab
=
''
)
{
if
(
is_numeric
(
$mid
))
$this
->
activeMenu
=
$mid
;
elseif
(
$mid
&&
$tab
&&
(
$subNav
=
$this
->
getSubNav
(
$tab
)))
{
foreach
(
$subNav
as
$k
=>
$menu
)
{
if
(
strcasecmp
(
$mid
,
$menu
[
'href'
]))
continue
;
$this
->
activeMenu
=
$k
+
1
;
break
;
}
}
}
function
getActiveMenu
()
{
...
...
@@ -183,12 +193,12 @@ class AdminNav extends StaffNav{
$subnav
[]
=
array
(
'desc'
=>
'System Logs'
,
'href'
=>
'logs.php'
,
'iconclass'
=>
'logs'
);
break
;
case
'settings'
:
$subnav
[]
=
array
(
'desc'
=>
'System Preferences'
,
'href'
=>
'settings.php'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Tickets'
,
'href'
=>
'settings.php'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Emails'
,
'href'
=>
'settings.php'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Knowledgebase'
,
'href'
=>
'settings.php'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Autoresponder'
,
'href'
=>
'
autoresponder.ph
p'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Alerts Notices'
,
'href'
=>
'alerts
.php
'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'System Preferences'
,
'href'
=>
'settings.php
?t=system
'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Tickets'
,
'href'
=>
'settings.php
?t=tickets
'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Emails'
,
'href'
=>
'settings.php
?t=emails
'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Knowledgebase'
,
'href'
=>
'settings.php
?t=kb
'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Autoresponder'
,
'href'
=>
'
settings.php?t=autores
p'
,
'iconclass'
=>
'preferences'
);
$subnav
[]
=
array
(
'desc'
=>
'Alerts
&
Notices'
,
'href'
=>
'
settings.php?t=
alerts'
,
'iconclass'
=>
'preferences'
);
break
;
case
'manage'
:
$subnav
[]
=
array
(
'desc'
=>
'Help Topics'
,
'href'
=>
'helptopics.php'
,
'iconclass'
=>
'helpTopics'
);
...
...
This diff is collapsed.
Click to expand it.
scp/settings.php
+
16
−
37
View file @
7c267cad
...
...
@@ -15,49 +15,28 @@
**********************************************************************/
require
(
'admin.inc.php'
);
$errors
=
array
();
$SettingOptions
=
array
(
'general'
=>
'General Settings'
,
'dates'
=>
'Date and Time Options'
,
'tickets'
=>
'Ticket Settings and Options'
,
'emails'
=>
'Email Settings'
,
'attachments'
=>
'Attachments Settings'
,
'kb'
=>
'Knowledgebase Settings'
,
'autoresponders'
=>
'Autoresponder Settings'
,
'alerts'
=>
'Alerts and Notices Settings'
);
$settingOptions
=
array
(
'system'
=>
'System Settings'
,
'tickets'
=>
'Ticket Settings and Options'
,
'emails'
=>
'Email Settings'
,
'kb'
=>
'Knowledgebase Settings'
,
'autoresp'
=>
'Autoresponder Settings'
,
'alerts'
=>
'Alerts and Notices Settings'
);
//Handle a POST.
if
(
$_POST
&&
!
$errors
){
$errors
=
array
();
if
(
$cfg
&&
$cfg
->
updateSettings
(
$_POST
,
$errors
)){
$msg
=
Format
::
htmlchars
(
$SettingOptions
[
$_POST
[
't'
]])
.
' Updated Successfully'
;
if
(
$_POST
&&
!
$errors
)
{
if
(
$cfg
&&
$cfg
->
updateSettings
(
$_POST
,
$errors
))
{
$msg
=
Format
::
htmlchars
(
$settingOptions
[
$_POST
[
't'
]])
.
' Updated Successfully'
;
$cfg
->
reload
();
}
elseif
(
!
$errors
[
'err'
]){
$errors
[
'err'
]
=
'Unable to update
system
settings - correct
any
errors below and try again'
;
}
elseif
(
!
$errors
[
'err'
])
{
$errors
[
'err'
]
=
'Unable to update settings - correct errors below and try again'
;
}
}
$target
=
(
$_REQUEST
[
't'
]
&&
$SettingOptions
[
$_REQUEST
[
't'
]])
?
$_REQUEST
[
't'
]
:
'general'
;
$nav
->
setTabActive
(
'settings'
);
require
(
STAFFINC_DIR
.
'header.inc.php'
);
?>
<h2>
System Preferences and Settings -
<span>
osTicket (v
<?php
echo
$cfg
->
getVersion
();
?>
)
</span></h2>
<div
style=
"padding-top:10px;padding-bottom:5px;"
>
<form
method=
"get"
action=
"settings.php"
>
Setting Option:
<select
id=
"setting_options"
name=
"t"
style=
"width:300px;"
>
<option
value=
""
>
—
Select Setting Group
—
</option>
<?php
foreach
(
$SettingOptions
as
$k
=>
$v
)
{
$sel
=
(
$target
==
$k
)
?
'selected="selected"'
:
''
;
echo
sprintf
(
'<option value="%s" %s>%s</option>'
,
$k
,
$sel
,
$v
);
}
?>
</select>
<input
type=
"submit"
value=
"Go"
>
</form>
</div>
<?php
$target
=
(
$_REQUEST
[
't'
]
&&
$settingOptions
[
$_REQUEST
[
't'
]])
?
$_REQUEST
[
't'
]
:
'system'
;
$config
=
(
$errors
&&
$_POST
)
?
Format
::
input
(
$_POST
)
:
Format
::
htmlchars
(
$cfg
->
getConfigInfo
());
$nav
->
setTabActive
(
'settings'
,
(
'settings.php?t='
.
$target
));
require_once
(
STAFFINC_DIR
.
'header.inc.php'
);
include_once
(
STAFFINC_DIR
.
"settings-
$target
.inc.php"
);
include_once
(
STAFFINC_DIR
.
'footer.inc.php'
);
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment