forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
already.php
47 lines (39 loc) · 1.33 KB
/
already.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once(dirname(dirname(__FILE__)) . '/config.php');
if (empty($CFG->enableportfolios)) {
print_error('disabled', 'portfolio');
}
require_once($CFG->libdir . '/portfoliolib.php');
$dataid = 0;
$currentinfo = null;
if (!$dataid = optional_param('id', '', PARAM_INT) ) {
if (isset($SESSION->portfolioexport)) {
$dataid = $SESSION->portfolioexport;
}
}
$table = new StdClass;
$table->head = array(
get_string('displayarea', 'portfolio'),
get_string('destination', 'portfolio'),
get_string('displayinfo', 'portfolio'),
);
$table->data = array();
if ($dataid) {
try {
$exporter = portfolio_exporter::rewaken_object($dataid);
$exporter->verify_rewaken();
$table->data[] = array(
$exporter->get('caller')->display_name(),
($exporter->get('instance') ? $exporter->get('instance')->get('name') : get_string('notyetselected', 'portfolio')),
$exporter->get('caller')->heading_summary(),
);
} catch (portfolio_exception $e) { }
}
$strheading = get_string('activeexport', 'portfolio');
print_header($strheading, $strheading);
notice_yesno(get_string('alreadyexporting', 'portfolio'), $CFG->wwwroot . '/portfolio/add.php', $CFG->wwwroot . '/portfolio/add.php?cancel=1');
if (count($table->data) > 0) {
print_table($table);
}
print_footer();
?>