Copyright 2002-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (BSD). If you did not did not receive this file, see http://www.horde.org/licenses/bsdl.php.
Author: Mike Cochrane (mike@graftonhall.co.nz)
Exemple #1
0
 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();
 }
Exemple #2
0
$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();
Exemple #3
0
    ?>
</p>
  <h4><?php 
    echo _("Internet Explorer");
    ?>
</h4>
  <p><?php 
    echo _("Drag the \"Add to Bookmarks\" link below onto your \"Links\" Bar");
    ?>
</p>
  <p><?php 
    echo _("While browsing you will be able to bookmark the current page by clicking your new \"Add to Bookmarks\" shortcut.");
    ?>
</p>
  <p>
    <strong><?php 
    echo _("Note:");
    ?>
</strong>
    <?php 
    printf(_("On newer versions of Internet Explorer, you may have to add %s://%s to your Trusted Zone for this to work."), !empty($_SERVER['HTTPS']) ? 'https' : 'http', $conf['server']['name']);
    ?>
  </p>
  <p>
    <?php 
    echo Trean::bookmarkletLink();
    ?>
  </p>
</div>
<?php 
}
Exemple #4
0
echo _("Clicks");
?>
</th>
  <th width="10%" class="horde-split-left nosort"></th>
 </tr>
</thead>
<tbody id="BookmarkList-body">
 <?php 
foreach ($this->bookmarks as $bookmark) {
    ?>
 <tr>
  <td>
   <div class="trean-bookmarks-title">
    <div class="trean-favicon-container">
     <?php 
    echo Horde::img(Trean::getFavicon($bookmark), '', array('class' => 'trean-favicon'));
    ?>
    </div>
    <?php 
    if ($bookmark->http_status == 'error') {
        echo Horde::img('http/error.png');
    } elseif ($bookmark->http_status) {
        echo Horde::img('http/' . (int) substr($bookmark->http_status, 0, 1) . 'xx.png');
    }
    ?>
    <?php 
    echo $this->redirectUrl->add('b', $bookmark->id)->link(array('target' => $this->target)) . $this->h($bookmark->title ? $bookmark->title : $bookmark->url);
    ?>
</a>
    <small>
      <?php 
Exemple #5
0
?>
}
</script>

<form name="bookmark_edit_form" action="<?php 
echo Horde::url('b/save');
?>
" method="post">
<input type="hidden" name="bookmark" value="<?php 
echo $bookmark->id;
?>
" />

<h1 class="header">
 <?php 
echo Horde::img(Trean::getFavicon($bookmark), '', 'class="trean-favicon"', '');
?>
 <?php 
echo htmlspecialchars($bookmark->title);
?>
</h1>

<div class="horde-content horde-form">
<table cellspacing="0">
 <tr>
  <td class="horde-form-label"><?php 
echo _("URL");
?>
</td>
  <td><input type="text" name="bookmark_url" size="40" value="<?php 
echo htmlspecialchars($bookmark->url);
Exemple #6
0
 * Copyright 2002-2016 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (BSD). If you did not
 * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
 *
 * @author Mike Cochrane <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('trean');
/* Deal with any action task. */
$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
    case 'add_bookmark':
        /* Check permissions. */
        if (Trean::hasPermission('max_bookmarks') !== true && Trean::hasPermission('max_bookmarks') <= $trean_gateway->countBookmarks()) {
            Horde::permissionDeniedError('trean', 'max_bookmarks', sprintf(_("You are not allowed to create more than %d bookmarks."), Trean::hasPermission('max_bookmarks')));
            Horde::url('browse.php', true)->redirect();
        }
        /* Create a new bookmark. */
        $properties = array('bookmark_url' => Horde_Util::getFormData('url'), 'bookmark_title' => Horde_Util::getFormData('title'), 'bookmark_description' => Horde_Util::getFormData('description'), 'bookmark_tags' => Horde_Util::getFormData('treanBookmarkTags'));
        try {
            $bookmark = $trean_gateway->newBookmark($properties, !empty($conf['content_index']['enabled']));
        } catch (Exception $e) {
            $notification->push(sprintf(_("There was an error adding the bookmark: %s"), $e->getMessage()), 'horde.error');
        }
        if (Horde_Util::getFormData('popup')) {
            echo Horde::wrapInlineScript(array('window.close();'));
        } elseif (Horde_Util::getFormData('iframe')) {
            $notification->push(_("Bookmark Added"), 'horde.success');
            $page_output->header();
            $notification->notify();