public static function hcimport_card($inbound, $outbound) { global $config; require $config->base . 'php/hcimport.php'; $outbound['result'] = HCImport::import_card($inbound['id'], $inbound['seq']); return $outbound; }
/* Returns the results of handling the supplied AJAX request. */ if (isset($_REQUEST['io'])) { require $config->base . 'php/gateway.php'; Gateway::handle_request(); exit; } /* Handles the upload of a HyperCard stack and initial preparation for the import of it's content, structure and art in co-operation with the client. */ if (isset($_REQUEST['hcimport'])) { Util::response_is_ajax_only(); require $config->base . 'php/hcimport.php'; HCImport::handle_upload(); exit; } /* Returns a static page for the specified stack, along with appropriate data and instructions to invoke the client-side application if the environment is sufficient. The static page is search-engine-friendly. */ if (isset($_REQUEST['stack'])) { require $config->base . 'php/application.php'; Application::open_stack(); exit; } /* If the request is anything else, the client has err'd.
private static function index_blocks() { $block_index = array(); while ($info = HCImport::read_next_block()) { if (count($block_index) == 0 && $info['type'] != 'STAK') { throw new Exception("Not a stack."); } if (!isset($block_index[$info['type']])) { $block_index[$info['type']] = array(); } $block_index[$info['type']][$info['id']] = $info; } HCImport::$block_index = $block_index; }