Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Author: Marko Djukic (marko@oblo.com)
Author: Jan Schneider (jan@horde.org)
Author: Duck (duck@obala.net)
示例#1
0
 /**
  */
 public function menu($menu)
 {
     $scope = Horde_Util::getGet('scope', 'agora');
     /* Agora Home. */
     $url = Horde::url('forums.php')->add('scope', $scope);
     $menu->add($url, _("_Forums"), 'forums.png', null, null, null, dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
     /* Thread list, if applicable. */
     if (isset($GLOBALS['forum_id'])) {
         $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png');
         if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
             $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png');
         }
     }
     if ($scope == 'agora' && Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', null, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
     }
     if (Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $url = Horde::url('moderate.php')->add('scope', $scope);
         $menu->add($url, _("_Moderate"), 'moderate.png');
     }
     if ($GLOBALS['registry']->isAdmin()) {
         $menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png');
     }
     $url = Horde::url('search.php')->add('scope', $scope);
     $menu->add($url, _("_Search"), 'search.png');
 }
示例#2
0
 /**
  * Constructor
  */
 public function __construct($scope)
 {
     parent::__construct($scope);
     /* trick table name */
     if ($scope != 'agora') {
         $this->_threads_table = 'agora_messages_' . $scope;
         $this->_forums_table = 'agora_forums_' . $scope;
     }
 }
示例#3
0
文件: move.php 项目: jubinpatel/horde
$form->setButtons(array(_("Move"), _("Cancel")));
$form->addHidden('', 'agora', 'text', false);
$form->addHidden('', 'scope', 'text', false);
$forums_list = Agora::formatCategoryTree($messages->getForums(0, false));
$v =& $form->addVariable(_("Forum"), 'new_forum_id', 'enum', true, false, null, array($forums_list));
$v->setDefault($forum_id);
/* Validate the form. */
if ($form->validate()) {
    $form->getInfo($vars, $info);
    if ($vars->get('submitbutton') == _("Move")) {
        $move = $messages->moveThread($message_id, $info['new_forum_id']);
        if ($move instanceof PEAR_Error) {
            $notification->push($move->getMessage(), 'horde.error');
        } else {
            $notification->push(sprintf(_("Thread %s moved to from forum %s to %s."), $message_id, $forum_id, $info['new_forum_id']), 'horde.success');
            header('Location: ' . Agora::setAgoraId($info['new_forum_id'], $message_id, Horde::url('messages/index.php', true), $scope));
            exit;
        }
    }
}
/* Template object. */
$view = new Agora_View();
Horde::startBuffer();
$form->renderActive(null, $vars, Horde::url('messages/move.php'), 'post');
$view->formbox = Horde::endBuffer();
$view->message_subject = $message['message_subject'];
$view->message_author = $message['message_author'];
$view->message_body = Agora_Driver::formatBody($message['body']);
$page_output->header();
echo $view->render('messages/edit');
$page_output->footer();
示例#4
0
文件: threads.php 项目: horde/horde
if ($threads_list instanceof PEAR_Error) {
    $notification->push($threads_list->getMessage(), 'horde.error');
    Horde::url('forums.php', true)->redirect();
}
if (empty($threads_list)) {
    $threads_count = 0;
} else {
    $threads_count = $threads->_forum['thread_count'];
}
/* Set up the column headers. */
$col_headers = array('message_subject' => _("Subject"), 'message_seq' => _("Posts"), 'view_count' => _("Views"), 'message_author' => _("Started"), 'message_modifystamp' => _("Last post"));
$col_headers = Agora::formatColumnHeaders($col_headers, $sort_by, $sort_dir, 'threads');
/* Set up the template tags. */
$view = new Agora_View();
$view->col_headers = $col_headers;
$view->threads = $threads_list;
$view->forum_name = sprintf(_("Threads in %s"), $forum_array['forum_name']);
$view->forum_description = Agora_Driver::formatBody($forum_array['forum_description']);
$view->actions = $threads->getThreadActions();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$view->notify = Horde::endBuffer();
$view->rss = Horde::url('rss/threads.php', true, -1)->add(array('scope' => $scope, 'forum_id' => $forum_id));
/* Set up pager. */
$vars = Horde_Variables::getDefaultVariables();
$pager_ob = new Horde_Core_Ui_Pager('thread_page', $vars, array('num' => $threads_count, 'url' => 'threads.php', 'perpage' => $threads_per_page));
$pager_ob->preserve('agora', Horde_Util::getFormData('agora'));
$view->pager_link = $pager_ob->render();
$page_output->header(array('title' => sprintf(_("Threads in %s"), $forum_array['forum_name'])));
echo $view->render('threads');
$page_output->footer();