1: <?php
2: /**
3: * $Horde: trean/lib/Views/BookmarkList.php,v 1.2 2009/06/10 05:25:17 slusarz Exp $
4: *
5: * @package Trean
6: */
7:
8: /** Star rating helper */
9: require_once TREAN_TEMPLATES . '/star_rating_helper.php';
10:
11: /**
12: * $Horde: trean/lib/Views/BookmarkList.php,v 1.2 2009/06/10 05:25:17 slusarz Exp $
13: */
14: class Trean_View_BookmarkList {
15:
16: var $showFolder = false;
17:
18: var $sortby;
19: var $sortdir;
20: var $sortdirclass;
21:
22: var $bookmarks = array();
23: var $target;
24: var $redirectUrl;
25:
26: function Trean_View_BookmarkList($bookmarks)
27: {
28: if (!is_a($bookmarks, 'PEAR_Error')) {
29: $this->bookmarks = $bookmarks;
30: }
31: $this->target = $GLOBALS['prefs']->getValue('show_in_new_window') ? '_blank' : '';
32: $this->redirectUrl = Horde::url('redirect.php');
33:
34: $this->sortby = $GLOBALS['prefs']->getValue('sortby');
35: $this->sortdir = $GLOBALS['prefs']->getValue('sortdir');
36: $this->sortdirclass = $this->sortdir ? 'sortup' : 'sortdown';
37: }
38:
39: function folder($bookmark)
40: {
41: $folder = $GLOBALS['trean_shares']->getFolder($bookmark->folder);
42: return Horde::link(Horde_Util::addParameter(Horde::url('browse.php'), 'f', $bookmark->folder)) . htmlspecialchars($folder->get('name')) . '</a>';
43: }
44:
45: function render()
46: {
47: include TREAN_TEMPLATES . '/views/BookmarkList.php';
48: }
49:
50: }
51: