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
20ca5995
Commit
20ca5995
authored
May 07, 2009
by
Nigel McNie
Browse files
Disable the export and import tabs if no export or import plugins are enabled.
parent
9249b8db
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/export/index.php
View file @
20ca5995
...
...
@@ -34,7 +34,13 @@ $SESSION->set('exportdata', '');
$SESSION
->
set
(
'exportfile'
,
''
);
$exportoptions
=
array
();
foreach
(
plugins_installed
(
'export'
)
as
$plugin
)
{
$exportplugins
=
plugins_installed
(
'export'
);
if
(
!
$exportplugins
)
{
die_info
(
get_string
(
'noexportpluginsenabled'
,
'export'
));
}
foreach
(
$exportplugins
as
$plugin
)
{
safe_require
(
'export'
,
$plugin
->
name
);
$exportoptions
[
$plugin
->
name
]
=
array
(
'text'
=>
call_static_method
(
generate_class_name
(
'export'
,
$plugin
->
name
),
'get_title'
),
...
...
htdocs/import/index.php
View file @
20ca5995
...
...
@@ -29,6 +29,12 @@ define('MENUITEM', 'myportfolio/import');
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
define
(
'TITLE'
,
get_string
(
'import'
,
'import'
));
$importplugins
=
plugins_installed
(
'import'
);
if
(
!
$importplugins
)
{
die_info
(
get_string
(
'noimportpluginsenabled'
,
'import'
));
}
$form
=
pieform
(
array
(
'name'
=>
'import'
,
'elements'
=>
array
(
...
...
htdocs/lang/en.utf8/export.php
View file @
20ca5995
...
...
@@ -34,6 +34,7 @@ $string['exportgeneratedsuccessfully'] = 'Export generated successfully. %sClick
$string
[
'exportgeneratedsuccessfullyjs'
]
=
'Export generated successfully. %sContinue%s'
;
$string
[
'exportyourportfolio'
]
=
'Export Your Portfolio'
;
$string
[
'generateexport'
]
=
'Generate export'
;
$string
[
'noexportpluginsenabled'
]
=
'No export plugins have been enabled by the administrator, so you are unable to use this feature'
;
$string
[
'justsomeviews'
]
=
'Just some of my Views'
;
$string
[
'pleasewaitwhileyourexportisbeinggenerated'
]
=
'Please wait while your export is being generated...'
;
$string
[
'Starting'
]
=
'Starting'
;
...
...
htdocs/lang/en.utf8/import.php
View file @
20ca5995
...
...
@@ -27,3 +27,6 @@
defined
(
'INTERNAL'
)
||
die
();
$string
[
'import'
]
=
'Import'
;
$string
[
'noimportpluginsenabled'
]
=
'No import plugins have been enabled by the administrator, so you are unable to use this feature'
;
?>
htdocs/lib/web.php
View file @
20ca5995
...
...
@@ -1685,6 +1685,8 @@ function institutional_admin_nav() {
* @return $standardnav a data structure containing the standard navigation
*/
function
mahara_standard_nav
()
{
$exportenabled
=
plugins_installed
(
'export'
);
$importenabled
=
plugins_installed
(
'import'
);
$menu
=
array
(
array
(
'path'
=>
''
,
...
...
@@ -1709,12 +1711,14 @@ function mahara_standard_nav() {
'url'
=>
'export/'
,
'title'
=>
get_string
(
'Export'
,
'export'
),
'weight'
=>
30
,
'ignore'
=>
!
$exportenabled
,
),
array
(
'path'
=>
'myportfolio/import'
,
'url'
=>
'import/'
,
'title'
=>
get_string
(
'import'
,
'import'
),
'weight'
=>
30
,
'ignore'
=>
!
$importenabled
,
),
array
(
'path'
=>
'profile/view'
,
...
...
@@ -1789,6 +1793,8 @@ function mahara_standard_nav() {
'weight'
=>
40
,
),
);
$menu
=
array_filter
(
$menu
,
create_function
(
'$a'
,
'return empty($a["ignore"]);'
));
if
(
$plugins
=
get_records_array
(
'artefact_installed'
,
'active'
,
1
))
{
foreach
(
$plugins
as
&
$plugin
)
{
...
...
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