mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-16520 - print info about current export
This commit is contained in:
parent
b9c639d6c2
commit
6e6cf8a366
@ -2,7 +2,6 @@
|
||||
|
||||
$string['activeportfolios'] = 'Active portfolios';
|
||||
$string['alreadyalt'] = 'Already exporting - please click here to resolve this transfer';
|
||||
$string['alreadytext'] = 'Add to portfolio - needs attention';
|
||||
$string['addnewportfolio'] = 'Add a new portfolio';
|
||||
$string['addtoportfolio'] = 'Add to portfolio';
|
||||
$string['addalltoportfolio'] = 'Add all to portfolio';
|
||||
|
@ -189,7 +189,7 @@ class portfolio_add_button {
|
||||
*/
|
||||
public function to_html($format=null, $addstr=null) {
|
||||
if ($this->alreadyexporting) {
|
||||
return $this->already_exporting($format);
|
||||
return $this->already_exporting($format, $addstr);
|
||||
}
|
||||
global $CFG, $COURSE;
|
||||
if (!$this->is_renderable()) {
|
||||
@ -323,25 +323,28 @@ class portfolio_add_button {
|
||||
return $this->callbackclass;
|
||||
}
|
||||
|
||||
private function already_exporting($format) {
|
||||
private function already_exporting($format, $addstr) {
|
||||
global $CFG;
|
||||
$url = $CFG->wwwroot . '/portfolio/already.php';
|
||||
$icon = $CFG->pixpath . '/t/portfoliono.gif';
|
||||
$alt = get_string('alreadyalt', 'portfolio');
|
||||
$text = get_string('alreadytext', 'portfolio');
|
||||
if (empty($format)) {
|
||||
$format = PORTFOLIO_ADD_FULL_FORM;
|
||||
}
|
||||
if (empty($addstr)) {
|
||||
$addstr = get_string('addtoportfolio', 'portfolio');
|
||||
}
|
||||
switch ($format) {
|
||||
case PORTFOLIO_ADD_FULL_FORM:
|
||||
return '<form action="' . $url . '">' . "\n"
|
||||
. '<input type="submit" value="' . $text . '" />' . "\n"
|
||||
. '<input type="submit" value="' . $addstr . '" />' . "\n"
|
||||
. '<img src="' . $icon . '" alt="' . $alt . '" />' . "\n"
|
||||
. ' </form>';
|
||||
case PORTFOLIO_ADD_ICON_FORM:
|
||||
case PORTFOLIO_ADD_ICON_LINK:
|
||||
return '<a href="' . $url . '"><img src="' . $icon . '" alt="' . $alt . '" /></a>';
|
||||
case PORTFOLIO_ADD_TEXT_LINK:
|
||||
return '<a href="' . $url . '">' . $text . '</a>';
|
||||
return '<a href="' . $url . '">' . $addstr . '(!) </a>';
|
||||
default:
|
||||
debugging(get_string('invalidaddformat', 'portfolio', $format));
|
||||
}
|
||||
|
@ -4,12 +4,44 @@ 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('plugin', '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')->get('name'),
|
||||
$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();
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user