Source for file edit.php
Documentation is available at edit.php
* Copyright (c) 2004 bitweaver Messageboards
* 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.
require_once( '../kernel/setup_inc.php' );
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
if( isset ( $_REQUEST['bitboard']['board_id'] ) ) {
$_REQUEST['b'] = $_REQUEST['bitboard']['board_id'];
require_once(BOARDS_PKG_PATH. 'lookup_inc.php' );
//must be owner or admin to edit an existing board
if( $gContent->isValid() ) {
$gContent->verifyUpdatePermission();
$gContent->verifyCreatePermission();
if( isset ( $_REQUEST['remove'] ) ) {
// @TODO: Change to verifyExpungePermission when that exists in LibertyContent
if ( $gContent->isValid() && $gContent->hasUserPermission( 'p_boards_remove', TRUE, TRUE ) ) {
if( empty( $_REQUEST['confirm'] ) ) {
$formHash['b'] = $_REQUEST['b'];
$formHash['remove'] = TRUE;
$gBitSystem->confirmDialog( $formHash, array( 'warning' => tra( 'Are you sure you want to remove the entire message board' ). ' "'. $gContent->getTitle(). '" ?', 'error' => 'This cannot be undone!' ) );
} elseif( !$gContent->expunge() ) {
$gBitSmarty->assign_by_ref( 'errors', $deleteComment->mErrors );
$gBitSystem->fatalPermission( 'p_boards_remove' );
// If we are in preview mode then preview it!
if( isset ( $_REQUEST["preview"] ) ) {
$gBitSmarty->assign('preview', 'y');
$previewHash = array_merge( $_REQUEST, $_REQUEST['bitboard'] );
$gContent->preparePreview( $previewHash );
$gContent->invokeServices( 'content_preview_function' );
$gContent->invokeServices( 'content_edit_function' );
// Check if the page has changed
if( !empty( $_REQUEST["save_bitboard"] ) ) {
// merge our arrays so our storage hash works with LibertyContent storage of LibertyContent add ons.
$storeHash = array_merge( $_REQUEST, $_REQUEST['bitboard'] );
// Check if all Request values are delivered, and if not, set them
// to avoid error messages. This can happen if some features are
if( $gContent->store( $storeHash ) ) {
$gContent->storePreference( 'board_sync_list_address', (!empty( $_REQUEST['bitboardconfig']['board_sync_list_address'] ) ? $_REQUEST['bitboardconfig']['board_sync_list_address'] : NULL) );
$gBitSmarty->assign_by_ref( 'errors', $gContent->mErrors );
$gBitSystem->display( 'bitpackage:boards/board_edit.tpl', tra('Board') , array( 'display_mode' => 'edit' ));
|