Esempio n. 1
0
function boards_content_edit($pContent, $pParamHash)
{
    global $gBitSmarty;
    // topic service
    if (!$pContent->isContentType(BITBOARDTOPIC_CONTENT_TYPE_GUID)) {
        if ($pContent->isValid()) {
            $gBitSmarty->assign('boardInfo', BitBoard::getLinkedBoard($pContent->mContentId));
        } else {
            $boardInfo['board_content_id'] = $pParamHash['linked_board_cid'];
            $gBitSmarty->assign('boardInfo', $boardInfo);
        }
        require_once BOARDS_PKG_PATH . 'BitBoard.php';
        $board = new BitBoard();
        $boardList = $board->getBoardSelectList(TRUE);
        $gBitSmarty->assign('boardList', $boardList);
    }
}
Esempio n. 2
0
// Is package installed and enabled
$gBitSystem->verifyPackage('boards');
// Look up Topic (lookup_inc is universal, gContent == BitBoardTopic)
require_once BOARDS_PKG_PATH . 'lookup_inc.php';
// Make sure topic exists since we only run through here for existing topics. New topics are created via comment system.
if (!$gContent->isValid()) {
    $gBitSystem->fatalError('No topic specified');
}
// Load up the Topic's board - we'll respect its permissions
$board = new BitBoard($gContent->mInfo['board_id']);
$board->load();
$board->verifyAdminPermission();
if (isset($_REQUEST["target"])) {
    // Check the user's ticket
    $gBitUser->verifyTicket();
    $targetBoard = new BitBoard(null, $_REQUEST["target"]);
    $targetBoard->load();
    if (!$targetBoard->hasAdminPermission()) {
        $gBitSystem->fatalError('You do not have permission to move topics to the Board' . $targetBoard->mInfo['title']);
    }
    if ($gContent->moveTo($_REQUEST["target"])) {
        bit_redirect($gContent->getDisplayUrl());
    } else {
        $gBitSystem->fatalError("There was an error moving the topic: " . vc($gContent->mErrors));
    }
}
// get list of boards we can move the topic to
$boards = $board->getBoardSelectList();
$gBitSmarty->assignByRef('boards', $boards);
$gBitSmarty->assign('fromBoardId', $board->mContentId);
$gBitSystem->display('bitpackage:boards/topic_move.tpl', tra('Move Topic') . ':' . $gContent->getTitle(), array('display_mode' => 'display'));
Esempio n. 3
0
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// is this used?
//if (isset($_REQUEST["boardset"]) && isset($_REQUEST["homeBitBoards"])) {
//	$gBitSystem->storeConfig("home_bitboard", $_REQUEST["homeBitBoards"]);
//	$gBitSmarty->assign('home_bitboard', $_REQUEST["homeBitBoards"]);
//}
require_once BOARDS_PKG_PATH . 'BitBoard.php';
$formBitBoardsLists = array('boards_thread_track' => array('label' => 'Enable Topic Status Tracking', 'note' => 'Allow users to see what topic have been changed since they last logged on.'), 'boards_thread_notification' => array('label' => 'Enable Topic Reply Notification', 'note' => 'Allow users to be sent emails when topics they are interested in receive replies.'), 'boards_posts_anon_moderation' => array('label' => 'Require Anonymous Post Moderation', 'note' => 'Require that ALL Anonymous posts must be validated before they are shown.'), 'boards_hide_edit_tpl' => array('label' => 'Hide Linked Boards Option', 'note' => 'Hide the <em>Linked Boards</em> option on edit pages to link any given content to a forum thread. If you hide this, you will have to manually assign content to a forum thread if you want to make full use of the boards.'), 'boards_link_by_pigeonholes' => array('label' => 'Link by Pigeonholes', 'note' => 'Link content to boards based on pigeonholes. This is useful when you have only one board in a given pigeonhole and want all content in the same pigeonhole to be shown in the board. Note that you MUST run the following SQL on your database to allow content in more than one board: "alter table boards_map drop constraint boards_map_pkey;" This is therfore a very advanced option.'));
$gBitSmarty->assign('formBitBoardsLists', $formBitBoardsLists);
$formBitBoardsSync = array('boards_sync_mail_server' => array('label' => 'Email Server', 'note' => 'Internet address of your mail server.'), 'boards_sync_user' => array('label' => 'Email Username', 'note' => 'Username used to login to the board sync email account.'), 'boards_sync_password' => array('label' => 'Email Password', 'note' => 'Password used to login to the board sync email account.'));
$gBitSmarty->assign('formBitBoardsSync', $formBitBoardsSync);
$processForm = set_tab();
$formBoardsEmailList = array("boards_email_list" => array('label' => 'Group Email List', 'note' => 'Enable groups to have an associated email list'));
$gBitSmarty->assign('formBoardsEmailList', $formBoardsEmailList);
$formBoardsEmailText = array('boards_email_host', 'boards_email_admin', 'server_mailman_bin', 'server_mailman_cmd', 'server_newaliases_cmd', 'server_aliases_file');
if ($processForm) {
    $bitboardToggles = array_merge($formBitBoardsLists, $formBoardsEmailList);
    foreach ($bitboardToggles as $item => $data) {
        simple_set_toggle($item, BOARDS_PKG_NAME);
    }
    foreach ($formBitBoardsSync as $key => $data) {
        $gBitSystem->storeConfig($key, !empty($_REQUEST[$key]) ? $_REQUEST[$key] : NULL, BOARDS_PKG_NAME);
    }
    foreach ($formBoardsEmailText as $text) {
        $gBitSystem->storeConfig($text, !empty($_REQUEST[$text]) ? trim($_REQUEST[$text]) : NULL, BOARDS_PKG_NAME);
    }
}
$board = new BitBoard();
$boards = $board->getBoardSelectList($_REQUEST);
$gBitSmarty->assignByRef(BOARDS_PKG_NAME, $boards['data']);