File: tree_menu.php

package info (click to toggle)
chora2 2.1.1%2Bdebian0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,928 kB
  • ctags: 351
  • sloc: php: 1,479; xml: 384; makefile: 66
file content (40 lines) | stat: -rw-r--r-- 1,290 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

$block_name = _("Menu List");
$block_type = 'tree';

/**
 * $Horde: chora/lib/Block/tree_menu.php,v 1.5.2.1 2008/10/09 17:40:05 jan Exp $
 */
class Horde_Block_chora_tree_menu extends Horde_Block {

    var $_app = 'chora';

    function _buildTree(&$tree, $indent = 0, $parent = null)
    {
        global $perms, $sourceroots;

        define('CHORA_ERROR_HANDLER', true);
        require_once dirname(__FILE__) . '/../base.php';

        $arr = array();
        asort($sourceroots);
        foreach ($sourceroots as $key => $val) {
            if ((!$perms->exists('chora:sourceroots:' . $key) ||
                 $perms->hasPermission('chora:sourceroots:' . $key,
                                       Auth::getAuth(),
                                       PERMS_READ | PERMS_SHOW))) {
                $tree->addNode($parent . $key,
                               $parent,
                               $val['name'],
                               $indent + 1,
                               false,
                               array('icon' => 'folder.png',
                                     'icondir' => $registry->getImageDir('horde') . '/tree',
                                     'url' => Chora::url('', '', array('rt' => $key))));
            }
        }

    }

}