summaryrefslogtreecommitdiff
path: root/edit_topic.php
blob: b0277161c0f1ff62de45f4134dde22c51714a825 (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
<?php
/**
 * @version $Header$
 * @package articles
 * @subpackage functions
 */

/**
 * Initialization
 */
require_once '../kernel/setup_inc.php';
require_once( ARTICLES_PKG_PATH."BitArticle.php" );

include_once( ARTICLES_PKG_PATH."lookup_article_topic_inc.php" );

if ( !$gBitSystem->verifyPackage( 'articles' ) ) {
   $gBitSmarty->assign( 'msg', tra( "This package is disabled" ) . ": Articles" );
   $gBitSystem->display( "error.tpl" , NULL, array( 'display_mode' => 'edit' ));
   die;
}

if( !$gContent->isValid() ) {
	$gBitSmarty->assign( 'msg', tra("Article topic not found") );
	$gBitSystem->display('error.tpl', NULL, array( 'display_mode' => 'edit' ));
	die;
}

$gBitSmarty->assignByRef( 'topic_info', $gContent->mInfo);

if( isset( $_REQUEST["fSubmitSaveTopic"] ) ) {
    $gContent->storeTopic( $_REQUEST );
	$gContent->loadTopic();
    bit_redirect( ARTICLES_PKG_URL . "admin/admin_topics.php" );
} elseif( isset( $_REQUEST['fRemoveTopicImage'] ) ) {
	$gContent->removeTopicImage();
}

$gBitSystem->display( 'bitpackage:articles/edit_topic.tpl' , NULL, array( 'display_mode' => 'edit' ));