summaryrefslogtreecommitdiff
path: root/edit.php
blob: a82ddc1f8aac4b60a32a4fe1d2a40062147f17a8 (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
<?php
/**
 * @version $Header: /cvsroot/bitweaver/_bit_tags/edit.php,v 1.7 2010/02/08 21:27:26 wjames5 Exp $
 * @package tags
 * @subpackage functions
 * 
 * @copyright Copyright (c) 2004-2006, bitweaver.org
 * 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.
 */

/**
 * required setup
 */
require_once( "../kernel/setup_inc.php" );
require_once( TAGS_PKG_PATH."LibertyTag.php" );

$gBitSystem->verifyPackage( 'tags' );

if ( !$gBitUser->hasPermission('p_tags_admin') ){
	$gBitSystem->fatalError( 'You do not have permission to edit Tags' );
}

$tag = new LibertyTag();

if ( $tag->loadTag ( $_REQUEST ) ){
	$gBitSmarty->assign( 'tagData', $tag->mInfo );	
}

if( !empty( $_REQUEST["save"] ) ) {
	if( $tag->storeOneTag( $_REQUEST ) ) {
		header ( "location: " . TAGS_PKG_URL. "index.php?tags=".$tag->mInfo['tag'] );
	}
}

$gBitSystem->display( 'bitpackage:tags/edit_tag.tpl', tra( "Edit Tag" ) , array( 'display_mode' => 'edit' ));
?>