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(tra('No topic specified.')); } // Check the user's ticket $gBitUser->verifyTicket(); // Load up the Topic's board - we'll respect its permissions $board = new BitBoard($gContent->mInfo['board_id']); $board->load(); $rslt = false; // Edit calls // Set locked or sticky if (isset($_REQUEST['is_locked']) || isset($_REQUEST['is_sticky'])) { // Check permissions to edit this topic $board->verifyUpdatePermission(); if (isset($_REQUEST['is_locked']) && is_numeric($_REQUEST['is_locked'])) { $rslt = $gContent->lock($_REQUEST['is_locked']); } elseif (isset($_REQUEST['is_sticky']) && is_numeric($_REQUEST['is_sticky'])) { $rslt = $gContent->sticky($_REQUEST['is_sticky']); } // Remove a topic } elseif (isset($_REQUEST['remove'])) { // Check permissions to edit this topic if the root object is the board check its perms, otherwise check general comment admin perms if (!($gContent->mInfo['root_id'] == $gContent->mInfo['board_content_id'] && $board->hasAdminPermission() || $gBitUser->hasPermission('p_liberty_admin_comments'))) { $gBitSystem->fatalError(tra('You do not have permission to delete this topic.')); } if (!empty($_REQUEST['cancel'])) { // user cancelled - just continue on, doing nothing } elseif (empty($_REQUEST['confirm'])) { $formHash['remove'] = TRUE;
foreach ($content_ids as $content_id => $remove) { if ($remove) { $b->removeContent($content_id); } } } else { // @TODO assign error and report back to user which were not processed } } } if (!empty($_REQUEST['assign']) && @BitBase::verifyId($_REQUEST['to_board_id'])) { $b = new BitBoard($_REQUEST['to_board_id']); $b->load(); if ($b->verifyUpdatePermission()) { foreach ($_REQUEST['assign'] as $content_id) { $b->addContent($content_id); } } } if (!empty($_REQUEST['integrity'])) { $board_id = $_REQUEST['integrity']; $b = new BitBoard($board_id); $b->load(); if ($b->verifyUpdatePermission()) { $b->fixContentMap(); } } $data = BitBoard::getAllMap(); $gBitSmarty->assignByRef('data', $data); // Display the template $gBitSystem->display('bitpackage:boards/board_assign.tpl', tra('Assign content to Board'), array('display_mode' => 'display'));