summaryrefslogtreecommitdiff
path: root/topic_move.php
blob: eeef82b94e724567b59a3ba568a557c5c06fa4c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once( '../bit_setup_inc.php' );

require_once( BITBOARDS_PKG_PATH.'BitBoard.php' );

// Is package installed and enabled
$gBitSystem->verifyPackage( 'bitboards' );

// Now check permissions to access this page
$gBitSystem->verifyPermission( 'p_bitboard_edit' );


if( isset( $_REQUEST["confirm"] ) ) {
	require_once( BITBOARDS_PKG_PATH.'lookup_inc.php' );
	if( $gContent->moveTo($_REQUEST["target"]) ) {
		header ("location: ".$_REQUEST["ref"] );
		die;
	} else {
		vd( $gContent->mErrors );
	}
	die();
}

if( isset( $_REQUEST["target"] ) ) {
	$_REQUEST["content_id"] = $_REQUEST["target"];
	require_once( BITBOARDS_PKG_PATH.'lookup_inc.php' );
	$bitThread = $gContent;
	unset($gContent);
	require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
	$bitBoard = $gContent;

	$gBitSystem->setBrowserTitle( tra( 'Confirm moving' ).' "' .$bitThread->mInfo['flc_title'] .'" '. tra("to Board"). ' "'.$bitBoard->mInfo['title'].'"');
	$formHash=array();
	if (empty($_REQUEST["ref"])) {
		$_REQUEST["ref"]=$_SERVER['HTTP_REFERER'];
	} elseif ($_REQUEST["ref"]=="-") {
		$_REQUEST["ref"]=$bitThread->getDisplayUrl();
	}
	$formHash["ref"]=$_REQUEST["ref"];
	$formHash["target"]=$_REQUEST["target"];
	$formHash["t"]=$_REQUEST["t"];
	$msgHash = array(
	'label' => tra( "Move Thread" ).": ".$bitThread->mInfo['flc_title']  ,
	'confirm_item' => $bitThread->mInfo['flc_title'] ,
	'warning' => tra( "Move ".' "' .$bitThread->mInfo['flc_title'] .'" '. tra("to Board"). ' "'.$bitBoard->mInfo['title'].'"'."<br />This cannot be undone!" ),
	);
	$gBitSystem->confirmDialog( $formHash,$msgHash );
}

$board = new BitBoard();
$gBitSmarty->assign_by_ref('boards', $board->getForumBoardSelectList());
require_once( BITBOARDS_PKG_PATH .'lookup_bittopic_inc.php' );

$gBitSystem->display( 'bitpackage:bitboards/topic_move.tpl', tra('Category') );
?>