MTrackWeb/Browse.php
[web.mtrack] / MTrackWeb / Browse.php
1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
3
4 // Browse.php - only for rendering the body..
5 // Tree.php - the actually tree..
6
7 require_once 'MTrackWeb.php';
8
9 class MTrackWeb_Browse extends MTrackWeb
10 {
11     var $template = 'browse.html'; 
12  
13  
14      
15     function getAuth() 
16     {
17         parent::getAuth();
18         
19         MTrackACL::requireAllRights('Browser', 'read');
20         return true;
21   
22     }
23  
24     function get($pi)
25     {
26         
27         
28         $this->pi = '/'. $pi . (strlen($pi) ? $this->bootLoader->ext : '');
29         $this->pi = rtrim($this->pi, '/');
30       
31         $crumbs = MTrackSCM::makeBreadcrumbs($this->pi);  
32         
33         if (!strlen($this->pi) || $this->pi == '/') {
34             $this->pi = '';
35         }
36         if (count($crumbs) < 3) {
37             return; // no repo selected...
38         }
39         
40         $this->repo = DB_DataObject::factory('mtrack_repos');
41         $this->repo->parent = $crumbs[0] == 'default' ? '' : 'user:' . $crumbs[0]; 
42         $this->repo->get('shortname', $crumbs[1]);
43         
44        // $this->repo  = (count($crumbs) > 2) ?   MTrackSCM::factory($this->pi) : null ;
45          
46          
47         $this->object = null;
48         $this->ident = null;
49         
50         if (isset($_GET['jump']) && strlen($_GET['jump'])) {
51             list($this->object, $this->ident) = explode(':', $_GET['jump'], 2);
52         }
53         
54         $this->repoName = $this->repo ? $this->repo->displayName() : '';
55         
56   
57     }
58      
59     
60      
61    
62     
63 }
64     
65
66  
67     
68
69