MDL-16520 - print info about current export
[moodle.git] / portfolio / already.php
CommitLineData
a4763136 1<?php
2require_once(dirname(dirname(__FILE__)) . '/config.php');
3
4if (empty($CFG->enableportfolios)) {
5 print_error('disabled', 'portfolio');
6}
6e6cf8a3 7require_once($CFG->libdir . '/portfoliolib.php');
8
9$dataid = 0;
10$currentinfo = null;
11if (!$dataid = optional_param('id', '', PARAM_INT) ) {
12 if (isset($SESSION->portfolioexport)) {
13 $dataid = $SESSION->portfolioexport;
14 }
15}
16
17$table = new StdClass;
18$table->head = array(
19 get_string('displayarea', 'portfolio'),
20 get_string('plugin', 'portfolio'),
21 get_string('displayinfo', 'portfolio'),
22);
23$table->data = array();
24if ($dataid) {
25 try {
26 $exporter = portfolio_exporter::rewaken_object($dataid);
27 $exporter->verify_rewaken();
28 $table->data[] = array(
29 $exporter->get('caller')->display_name(),
30 $exporter->get('instance')->get('name'),
31 $exporter->get('caller')->heading_summary(),
32 );
33 } catch (portfolio_exception $e) { }
34}
a4763136 35
36$strheading = get_string('activeexport', 'portfolio');
37print_header($strheading, $strheading);
38
39notice_yesno(get_string('alreadyexporting', 'portfolio'), $CFG->wwwroot . '/portfolio/add.php', $CFG->wwwroot . '/portfolio/add.php?cancel=1');
40
6e6cf8a3 41if (count($table->data) > 0) {
42 print_table($table);
43}
44
a4763136 45print_footer();
46
47?>