$exporter->print_header(get_string('selectplugin', 'portfolio')); echo $OUTPUT->box_start(); $mform->display(); echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit; } } } // if we haven't been passed &stage= grab it from the exporter. if (!$stage) { $stage = $exporter->get('stage'); } // for places returning control to pass (rather than PORTFOLIO_STAGE_PACKAGE // which is unstable if they can't get to the constant (eg external system) $alreadystolen = false; if ($postcontrol) { // the magic request variable plugins must pass on returning here try { // allow it to read whatever gets sent back in the request // this is useful for plugins that redirect away and back again // adding a token to the end of the url, for example box.net $exporter->instance()->post_control($stage, array_merge($_GET, $_POST)); } catch (portfolio_plugin_exception $e) { portfolio_export_rethrow_exception($exporter, $e); } $alreadystolen = true; // remember this so we don't get caught in a steal control loop! } // actually do the work now.. $exporter->process_stage($stage, $alreadystolen);