public function processRequest(Horde_Controller_Request $request, Horde_Controller_Response $response) { $path = $request->getPath(); $pathParts = explode('/', $path); $tag = urldecode(array_pop($pathParts)); $tagBrowser = new Trean_TagBrowser($this->getInjector()->getInstance('Trean_Tagger'), $tag); $view = new Trean_View_BookmarkList(null, $tagBrowser); $page_output = $this->getInjector()->getInstance('Horde_PageOutput'); $notification = $this->getInjector()->getInstance('Horde_Notification'); if ($GLOBALS['conf']['content_index']['enabled']) { $topbar = $this->getInjector()->getInstance('Horde_View_Topbar'); $topbar->search = true; $topbar->searchAction = Horde::url('search.php'); } Trean::addFeedLink(); $title = sprintf(_("Tagged with %s"), urldecode($tag)); $page_output->header(array('title' => $title)); $notification->notify(array('listeners' => 'status')); echo $view->render($title); $page_output->footer(); }
$vars = Horde_Variables::getDefaultVariables(); $bookmarks = null; if (strlen($vars->searchfield)) { // Get the bookmarks. try { $bookmarks = $trean_gateway->searchBookmarks($vars->searchfield); } catch (Trean_Exception $e) { $notification->push($e); } } if ($GLOBALS['conf']['content_index']['enabled']) { $topbar = $GLOBALS['injector']->getInstance('Horde_View_Topbar'); $topbar->search = true; $topbar->searchAction = Horde::url('search.php'); } Trean::addFeedLink(); $page_output->header(array('title' => _("Search"))); $notification->notify(array('listeners' => 'status')); // Display the results. if (strlen($vars->searchfield)) { if (!$bookmarks) { echo '<p><em>' . _("No bookmarks found") . '</em></p>'; } else { $view = new Trean_View_BookmarkList($bookmarks); $view->showTagBrowser(false); echo $view->render(sprintf(_("Search results (%s)"), count($bookmarks))); } } else { echo '<p><em>' . _("No search") . '</em></p>'; } $page_output->footer();
<?php /** * Copyright 2002-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. * * @author Mike Cochrane <*****@*****.**> * @author Michael J Rubinsky <*****@*****.**> * @package Trean */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('trean'); /* Get bookmarks to display. */ $view = new Trean_View_BookmarkList(); if (!$view->hasBookmarks()) { $notification->push(_("No bookmarks yet."), 'horde.message'); require __DIR__ . '/add.php'; exit; } if ($GLOBALS['conf']['content_index']['enabled']) { $topbar = $GLOBALS['injector']->getInstance('Horde_View_Topbar'); $topbar->search = true; $topbar->searchAction = Horde::url('search.php'); } Trean::addFeedLink(); $page_output->header(array('title' => _("Browse"))); $notification->notify(array('listeners' => 'status')); echo $view->render(); $page_output->footer();