MDL-14591 adding standard access control
[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}
98335b2d 7
6e6cf8a3 8require_once($CFG->libdir . '/portfoliolib.php');
9
98335b2d 10require_login();
11
6e6cf8a3 12$dataid = 0;
13$currentinfo = null;
14if (!$dataid = optional_param('id', '', PARAM_INT) ) {
15 if (isset($SESSION->portfolioexport)) {
16 $dataid = $SESSION->portfolioexport;
17 }
18}
19
20$table = new StdClass;
21$table->head = array(
22 get_string('displayarea', 'portfolio'),
1369d8e1 23 get_string('destination', 'portfolio'),
6e6cf8a3 24 get_string('displayinfo', 'portfolio'),
25);
26$table->data = array();
27if ($dataid) {
28 try {
29 $exporter = portfolio_exporter::rewaken_object($dataid);
30 $exporter->verify_rewaken();
31 $table->data[] = array(
32 $exporter->get('caller')->display_name(),
612a14c5 33 ($exporter->get('instance') ? $exporter->get('instance')->get('name') : get_string('notyetselected', 'portfolio')),
6e6cf8a3 34 $exporter->get('caller')->heading_summary(),
35 );
36 } catch (portfolio_exception $e) { }
37}
a4763136 38
39$strheading = get_string('activeexport', 'portfolio');
40print_header($strheading, $strheading);
41
42notice_yesno(get_string('alreadyexporting', 'portfolio'), $CFG->wwwroot . '/portfolio/add.php', $CFG->wwwroot . '/portfolio/add.php?cancel=1');
43
6e6cf8a3 44if (count($table->data) > 0) {
45 print_table($table);
46}
47
a4763136 48print_footer();
49
50?>