Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
3d55897c
Commit
3d55897c
authored
Mar 11, 2015
by
Son Nguyen
Committed by
Gerrit Code Review
Mar 11, 2015
Browse files
Merge "Checking that webservices is installed and active before displaying it's menu item"
parents
bce01540
675a257b
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
3d55897c
...
...
@@ -1489,6 +1489,21 @@ function safe_require_plugin($plugintype, $pluginname, $filename='lib.php', $fun
}
}
/**
* Check to see if a particular plugin is installed and is active by plugin name
*
* @param string $pluginname Name of plugin
* @return bool
*/
function
is_plugin_active
(
$pluginname
)
{
foreach
(
plugin_types
()
as
$type
)
{
if
(
record_exists
(
$type
.
'_installed'
,
'name'
,
$pluginname
,
'active'
,
1
))
{
return
true
;
}
}
return
false
;
}
/**
* This function returns the list of plugintypes we currently care about.
*
...
...
htdocs/lib/web.php
View file @
3d55897c
...
...
@@ -2327,13 +2327,16 @@ function admin_nav() {
'title'
=>
get_string
(
'cleanurls'
,
'admin'
),
'weight'
=>
40
,
),
'configextensions/webservices'
=>
array
(
);
if
(
is_plugin_active
(
'webservice'
))
{
$menu
[
'configextensions/webservices'
]
=
array
(
'path'
=>
'configextensions/webservices'
,
'url'
=>
'webservice/admin/index.php'
,
'title'
=>
get_string
(
'webservices'
,
'auth.webservice'
),
'weight'
=>
50
,
)
,
);
)
;
}
// Add the menu items for skins, if that feature is enabled
if
(
get_config
(
'skins'
))
{
...
...
Write
Preview
Supports
Markdown
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