php7 fixes
[Pman.Builder] / Modules.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_Builder_Modules extends Pman
6 {
7   
8     // getAuth - everyone allowed in...
9     function getAuth() {
10         if (!$this->hasPerm('Builder.Builder', 'S')) {
11             $this->jerr("Permission denied");
12         }
13         
14         
15     }
16     
17     function get($base, $opts = array())
18     {
19         // should just list the enabled modules.. - in theory we can not create modules???
20         
21         // or should this be totally database related...
22         
23         
24         $this->init();
25         $enabled =  array('Core') ;
26         $enabled = !empty($this->appModules) ?  array_merge($enabled, explode(',',  $this->appModules)) :  $enabled;
27         
28         sort($enabled);
29         $enabled = array_unique($enabled);
30         $ret = array();
31         foreach($enabled as $r) {
32             $ret[] = array('name' => $r);
33         }
34         $this->jdata($ret);
35         
36     }
37   
38 }