Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
13efdf6a
Commit
13efdf6a
authored
14 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
plugin manager
parent
653c6e59
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/templates/pluginform.php
+77
-0
77 additions, 0 deletions
inc/templates/pluginform.php
js/lib_ajax.js
+1
-1
1 addition, 1 deletion
js/lib_ajax.js
with
78 additions
and
1 deletion
inc/templates/pluginform.php
0 → 100644
+
77
−
0
View file @
13efdf6a
<?php
$action
=
$WEBROOT
.
'/settings/#plugin_managment'
;
if
(
isset
(
$_POST
[
'plugin_disable_id'
])){
$id
=
$_POST
[
'plugin_disable_id'
];
$disable
=
$_POST
[
'plugin_disable'
];
if
(
$disable
==
'true'
){
OC_PLUGIN
::
addToBlacklist
(
$id
);
}
else
{
OC_PLUGIN
::
removeFromBlacklist
(
$id
);
}
header
(
'location: '
.
$action
);
die
();
}
if
(
isset
(
$_POST
[
'install_plugin'
])
and
$_POST
[
'install_plugin'
]
==
'true'
){
$file
=
$_FILES
[
'plugin_file'
][
'tmp_name'
];
OC_PLUGIN
::
installPlugin
(
$file
);
header
(
'location: '
.
$action
);
die
();
}
$plugins
=
OC_PLUGIN
::
listPlugins
();
$blacklist
=
OC_PLUGIN
::
loadBlackList
();
?>
<script
type=
"text/javascript"
>
<?php
echo
(
'var plugins='
.
json_encode
(
$plugins
)
.
";
\n
"
);
echo
(
'var blacklist='
.
json_encode
(
$blacklist
)
.
";
\n
"
);
?>
disablePlugin
=
function
(
id
,
disable
){
var
form
=
document
.
getElementById
(
'
disableForm
'
);
var
input
=
document
.
getElementById
(
'
plugin_disable_name
'
);
input
.
value
=
id
;
var
input
=
document
.
getElementById
(
'
plugin_disable
'
);
input
.
value
=
disable
;
form
.
submit
();
}
</script>
<p
class=
'description'
>
Plugin List
</p>
<form
id=
'disableForm'
action=
'
<?php
echo
(
$action
);
?>
'
method=
"post"
enctype=
"multipart/form-data"
>
<input
id=
'plugin_disable_name'
type=
'hidden'
name=
'plugin_disable_id'
value=
''
/>
<input
id=
'plugin_disable'
type=
'hidden'
name=
'plugin_disable'
value=
''
/>
</form>
<table
class=
'pluginlist'
>
<thead>
<tr>
<td
colspan=
'2'
>
Id
</td>
<td>
Version
</td>
<td>
Description
</td>
<td>
Author
</td>
</tr>
</thead>
<tbody>
<?php
foreach
(
$plugins
as
$plugin
){
$pluginData
=
OC_PLUGIN
::
getPluginData
(
$plugin
);
$enabled
=
(
array_search
(
$plugin
,
$blacklist
)
===
false
);
$enabledString
=
(
$enabled
)
?
'enabled'
:
'disabled'
;
$enabledStringOther
=
(
!
$enabled
)
?
'enable'
:
'disable'
;
$enabled
=
(
$enabled
)
?
'true'
:
'false'
;
echo
(
"<tr class='
$enabledString
'>
\n
"
);
echo
(
"<td class='name'>
$plugin
</td>"
);
echo
(
"<td class='disable'>(<a href='
$action
' onclick='disablePlugin(
\"
$plugin
\"
,
$enabled
)'>
$enabledStringOther
</a>)</td>"
);
echo
(
"<td class='version'>
{
$pluginData
[
'info'
][
'version'
]
}
</td>"
);
echo
(
"<td>
{
$pluginData
[
'info'
][
'name'
]
}
</td>"
);
echo
(
"<td>
{
$pluginData
[
'info'
][
'author'
]
}
</td>"
);
echo
(
"</tr>
\n
"
);
}
?>
</tbody>
</table>
<p
class=
'description'
>
Install Plugin
</p>
<form
action=
'
<?php
echo
(
$action
);
?>
'
method=
"post"
enctype=
"multipart/form-data"
>
<input
class=
'formstyle'
type=
'file'
name=
'plugin_file'
/>
<input
type=
'hidden'
name=
'install_plugin'
value=
'true'
/>
<input
class=
'formstyle'
type=
'submit'
/>
</form>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/lib_ajax.js
+
1
−
1
View file @
13efdf6a
...
...
@@ -67,7 +67,7 @@ OC_onload.run=function(){
}
}
for
(
index
in
OC_onload
.
items
){
if
(
OC_onload
.
items
[
index
].
call
){
if
(
OC_onload
.
items
[
index
]
&&
OC_onload
.
items
[
index
]
.
call
){
OC_onload
.
items
[
index
].
call
();
}
}
...
...
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