File: tree_menu.php

package info (click to toggle)
mnemo2 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,400 kB
  • ctags: 854
  • sloc: php: 2,718; xml: 842; sql: 211; makefile: 65
file content (52 lines) | stat: -rw-r--r-- 1,854 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
41
42
43
44
45
46
47
48
49
50
51
52
<?php

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

/**
 * $Horde: mnemo/lib/Block/tree_menu.php,v 1.4.2.2 2008/01/02 16:50:49 chuck Exp $
 *
 * @package Horde_Block
 */
class Horde_Block_mnemo_tree_menu extends Horde_Block {

    var $_app = 'mnemo';

    function _buildTree(&$tree, $indent = 0, $parent = null)
    {
        require_once dirname(__FILE__) . '/../base.php';

        global $registry;

        $tree->addNode($parent . '__new',
                       $parent,
                       _("New Note"),
                       $indent + 1,
                       false,
                       array('icon' => 'add.png',
                             'icondir' => $registry->getImageDir(),
                             'url' => Horde::applicationUrl('memo.php?actionID=add_memo')));

        foreach (Mnemo::listNotepads() as $name => $notepad) {
            $tree->addNode($parent . $name . '__new',
                           $parent . '__new',
                           sprintf(_("in %s"), $notepad->get('name')),
                           $indent + 2,
                           false,
                           array('icon' => 'add.png',
                                 'icondir' => $registry->getImageDir(),
                                 'url' => Util::addParameter(Horde::applicationUrl('memo.php?memolist=' . urlencode($name)),
                                                             'actionID', 'add_memo')));
        }

        $tree->addNode($parent . '__search',
                       $parent,
                       _("Search"),
                       $indent + 1,
                       false,
                       array('icon' => 'search.png',
                             'icondir' => $registry->getImageDir('horde'),
                             'url' => Horde::applicationUrl('search.php')));
    }

}