Exemplo n.º 1
0
            $optionskeys = array_keys($options);
            $instance = array_shift($optionskeys);
            redirect($CFG->wwwroot . '/portfolio/add.php?id= ' . $exporter->get('id') . '&instance=' . $instance . '&sesskey=' . sesskey());
        }
    }
    // be very selective about not including this unless we really need to
    require_once $CFG->libdir . '/portfolio/forms.php';
    $mform = new portfolio_instance_select('', array('id' => $exporter->get('id'), 'caller' => $exporter->get('caller'), 'options' => $options));
    if ($mform->is_cancelled()) {
        $exporter->cancel_request();
    } else {
        if ($fromform = $mform->get_data()) {
            redirect($CFG->wwwroot . '/portfolio/add.php?instance=' . $fromform->instance . '&id=' . $exporter->get('id'));
            exit;
        } else {
            $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;
Exemplo n.º 2
0
    $SESSION->portfolioexport = $exporter->get('id');
}
if (!$exporter->get('instance')) {
    // we've just arrived but have no instance
    // in this case the exporter object and the caller object have been set up above
    // so just make a little form to select the portfolio plugin instance,
    // which is the last thing to do before starting the export.
    $mform = new portfolio_instance_select('', array('caller' => $exporter->get('caller')));
    if ($mform->is_cancelled()) {
        $exporter->cancel_request();
    } else {
        if ($fromform = $mform->get_data()) {
            redirect($CFG->wwwroot . '/portfolio/add.php?instance=' . $fromform->instance . '&id=' . $exporter->get('id'));
            exit;
        } else {
            $exporter->print_header('selectplugin');
            print_simple_box_start();
            $mform->display();
            print_simple_box_end();
            print_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;