$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';
*/
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()) {
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));
}
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();
?>