Last change
on this file since 25027 was 25027, checked in by jmt12, 12 years ago |
Adding the packages directory, and within it a configured version of dokuwiki all ready to run
|
File size:
1.5 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | class ap_enable extends ap_manage {
|
---|
4 |
|
---|
5 | var $enabled = array();
|
---|
6 |
|
---|
7 | function process() {
|
---|
8 | global $plugin_protected;
|
---|
9 | $count_enabled = $count_disabled = 0;
|
---|
10 |
|
---|
11 | $this->enabled = isset($_REQUEST['enabled']) ? $_REQUEST['enabled'] : array();
|
---|
12 |
|
---|
13 | foreach ($this->manager->plugin_list as $plugin) {
|
---|
14 | if (in_array($plugin, $plugin_protected)) continue;
|
---|
15 |
|
---|
16 | $new = in_array($plugin, $this->enabled);
|
---|
17 | $old = !plugin_isdisabled($plugin);
|
---|
18 |
|
---|
19 | if ($new != $old) {
|
---|
20 | switch ($new) {
|
---|
21 | // enable plugin
|
---|
22 | case true :
|
---|
23 | if(plugin_enable($plugin)){
|
---|
24 | msg(sprintf($this->lang['enabled'],$plugin),1);
|
---|
25 | $count_enabled++;
|
---|
26 | }else{
|
---|
27 | msg(sprintf($this->lang['notenabled'],$plugin),-1);
|
---|
28 | }
|
---|
29 | break;
|
---|
30 | case false:
|
---|
31 | if(plugin_disable($plugin)){
|
---|
32 | msg(sprintf($this->lang['disabled'],$plugin),1);
|
---|
33 | $count_disabled++;
|
---|
34 | }else{
|
---|
35 | msg(sprintf($this->lang['notdisabled'],$plugin),-1);
|
---|
36 | }
|
---|
37 | break;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | // refresh plugins, including expiring any dokuwiki cache(s)
|
---|
43 | if ($count_enabled || $count_disabled) {
|
---|
44 | $this->refresh();
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | }
|
---|
49 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.