require_once( '../inc/header.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPFM.php' ); require_once( BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php' ); send_headers_page_changed(); $logged['admin'] = member_auth( 1, true, true ); switch( $_REQUEST['action'] ) { case 'getArea': genAreaJSON( (int)$_REQUEST['id'] ); break; case 'createNewBlock': createNewBlock(); break; case 'createNewItem': createNewItem(); break; case 'savePositions': savePositions( (int)$_REQUEST['id'] ); break; case 'loadEditForm': showEditForm( (int)$_REQUEST['id'], (int)$_REQUEST['area'] ); break; case 'dummy': echo 'Dummy!'; break; case 'Save'://save item saveItem( (int)$_POST['area'], $_POST ); break; case 'Delete'://delete item deleteItem( (int)$_POST['id'], (int)$_POST['area'] ); break; } function createNewBlock() { $oFields = new BxDolPFM( 1 ); $iNewID = $oFields -> createNewBlock(); header('Content-Type:text/javascript'); echo '{id:' . $iNewID . '}'; } function createNewItem() { $oFields = new BxDolPFM( 1 ); $iNewID = $oFields -> createNewField(); header('Content-Type:text/javascript'); echo '{id:' . $iNewID . '}'; } function genAreaJSON( $iAreaID ) { $oFields = new BxDolPFM( $iAreaID ); header( 'Content-Type:text/javascript' ); echo $oFields -> genJSON(); } function savePositions( $iAreaID ) { $oFields = new BxDolPFM( $iAreaID ); header( 'Content-Type:text/javascript' ); $oFields -> savePositions( $_POST ); $oCacher = new BxDolPFMCacher(); $oCacher -> createCache(); } function saveItem( $iAreaID, $aData ) { $oFields = new BxDolPFM( $iAreaID ); $oFields -> saveItem( $_POST ); $oCacher = new BxDolPFMCacher(); $oCacher -> createCache(); } function deleteItem( $iItemID, $iAreaID ) { $oFields = new BxDolPFM( $iAreaID ); $oFields -> deleteItem( $iItemID ); $oCacher = new BxDolPFMCacher(); $oCacher -> createCache(); } function showEditForm( $iItemID, $iAreaID ) { $oFields = new BxDolPFM( $iAreaID ); ?>
} ?>