"MDL-16539, fix warning when create new foler"
[moodle.git] / portfolio / already.php
1 <?php
2 require_once(dirname(dirname(__FILE__)) . '/config.php');
4 if (empty($CFG->enableportfolios)) {
5     print_error('disabled', 'portfolio');
6 }
7 require_once($CFG->libdir . '/portfoliolib.php');
9 $dataid = 0;
10 $currentinfo = null;
11 if (!$dataid = optional_param('id', '', PARAM_INT) ) {
12     if (isset($SESSION->portfolioexport)) {
13         $dataid = $SESSION->portfolioexport;
14     }
15 }
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();
24 if ($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') ? $exporter->get('instance')->get('name') : get_string('notyetselected', 'portfolio')),
31             $exporter->get('caller')->heading_summary(),
32         );
33     } catch (portfolio_exception $e) { }
34 }
36 $strheading = get_string('activeexport', 'portfolio');
37 print_header($strheading, $strheading);
39 notice_yesno(get_string('alreadyexporting', 'portfolio'), $CFG->wwwroot . '/portfolio/add.php', $CFG->wwwroot . '/portfolio/add.php?cancel=1');
41 if (count($table->data) > 0) {
42     print_table($table);
43 }
45 print_footer();
47 ?>