]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16520 - print info about current export
authormjollnir_ <mjollnir_>
Tue, 16 Sep 2008 12:28:20 +0000 (12:28 +0000)
committermjollnir_ <mjollnir_>
Tue, 16 Sep 2008 12:28:20 +0000 (12:28 +0000)
lang/en_utf8/portfolio.php
lib/portfoliolib.php
portfolio/already.php

index f1e5adfa3eaad1205ac3ea2e634c3163aebdd32e..ef830e3c8f3947717beaba6ffd8f59aac21aab0b 100644 (file)
@@ -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';
index 6b612ba85bffd4fd516c7c151a67598afe5b5fd9..e7fa61053f834dabbcb4871c27cfd1a49e3a1b16 100644 (file)
@@ -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));
         }
index 4bbf4c4bd4b64fec5c364e633a6f8315d5c8e18c..668bec580f90d2d420aef69c6f6edfbdfc2cafa1 100644 (file)
@@ -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();
 
 ?>