PHP8
[web.mtrack] / MTrackWeb / Projects.php
1 <?php
2
3 /**
4  *
5  * public facing.. listing projects..
6  * and selecting active project..
7  *
8  * GET -> list of projects
9  * POST -> set active project..
10  * 
11  * 
12  */
13
14 require_once 'MTrackWeb.php';
15
16 class MTrackWeb_Projects extends MTrackWeb
17 {
18     
19     //function getAuth-- inherit
20     var $authUserArray;
21     
22     function get($pi='') {
23         
24         
25         $kv = $this->userProjects();
26         $ret = array();
27         foreach($kv as $k=>$v) {
28             $ret[] = array('id'=>$k, 'name' => $v);
29         }
30         $this->jdata($ret); 
31         
32     }
33      
34     /**
35      *
36      * Things that can change...
37      * - permission updates 
38      *
39      */
40     function post($id)
41     {
42           if (isset($id)) {
43             $this->currentProject($id);
44             return $this->jok($this->currentProject());
45         }
46         
47         
48         
49     }
50      
51     
52     
53     
54 }