<?php
/*
Simple:Press Forum Admin
Ahah form loader - Integration
$LastChangedDate: 2009-11-08 21:27:41 +0000 (Sun, 08 Nov 2009) $
$Rev: 2939 $
*/

if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
{
	die('Access Denied');
}

sfa_admin_ahah_support();

global $SFSTATUS;
if($SFSTATUS != 'ok')
{
	echo($SFSTATUS);
	die();
}

include_once (SF_PLUGIN_DIR.'/admin/panel-integration/sfa-integration-display.php');
include_once (SF_PLUGIN_DIR.'/admin/panel-integration/support/sfa-integration-prepare.php');
include_once (SF_PLUGIN_DIR.'/admin/panel-integration/support/sfa-integration-save.php');
include_once (SF_PLUGIN_DIR.'/admin/library/sfa-tab-support.php');

global $adminhelpfile, $sfglobals;
$adminhelpfile = 'admin-integration';
# --------------------------------------------------------------------

# ----------------------------------
# Check Whether User Can Manage Options
sf_initialise_globals();
$modchk = $sfglobals['member']['moderator'] && ($_GET['saveform'] == 'youradmin' || $_GET['loadform'] == 'youradmin');
if (!sfc_current_user_can('SPF Manage Options') && !$modchk)
{
	echo (__('Access Denied', "sforum"));
	die();
}

if(isset($_GET['loadform']))
{
	sfa_render_integration_container($_GET['loadform']);
	die();
}

if(isset($_GET['saveform']))
{
	if($_GET['saveform'] == 'page')
	{
		echo sfa_save_integration_page_data();
		die();
	}
}

die();

?>