<?php
/**
 * @version $Header$
 * @package contact
 * @subpackage functions
 */

/**
 * Initialization
 */
use Bitweaver\Contact\Contact;

require_once '../kernel/includes/setup_inc.php';

$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );

$gContent = new Contact();

$gBitSmarty->assign( 'xref_type_info', $gContent->mInfo);

if( isset( $_REQUEST["fSubmitSaveXrefType"] ) ) {
	$gContent->storeXrefType( $_REQUEST );
	$gContent->loadXrefType();
	header( "Location: " . CONTACT_PKG_URL . "admin/admin_xref_type.php" );
} elseif( isset( $_REQUEST['fRemoveXref'] ) ) {
	$gContent->expungeXrefType();
}

$gBitSystem->display( 'bitpackage:contact/edit_xref_type.tpl' , NULL, [ 'display_mode' => 'edit' ]);
