also fixed a small bug in 'cleanup' function. nico - your flickr plugin is missing a string for the name
$string['noticket'] = 'Could not retrieve a ticket from box.net to begin the authentication session';
$string['notarget'] = 'You must specify either an existing folder or a new folder to upload into';
$string['password'] = 'Your box.net password (will not be stored)';
+$string['pluginname'] = 'Box.net internet storage';
$string['sharedfolder'] = 'Shared';
$string['targetfolder'] = 'Target folder';
$string['username'] = 'Your box.net username (will not be stored)';
<?php
$string['downloadfile'] = 'Download your portfolio export file';
+$string['pluginname'] = 'File download';
?>
'<ul><li><em>Dependency</em>: You must also <strong>publish</strong> the SSO (Identify Provider) service to $a.</li>' .
'<li><em>Dependency</em>: You must also <strong>subscribe</strong> to the SSO (Service Provider) service on $a</li>' .
'<li><em>Dependency</em>: You must also enable the mnet authentication plugin.</li></ul><br />';
+$string['pluginname'] = 'Mahara ePortfolio';
?>
$row .= ' <a href="' . $this->baseurl . '&hide=' . $i->get('id') . '"><img src="' . $CFG->pixpath . '/t/'
. ($i->get('visible') ? 'hide' : 'show') . '.gif" alt="' . get_string($i->get('visible') ? 'hide' : 'show') . '" /></a>' . "\n";
}
- $table->data[] = array($i->get('name'), $i->get('plugin'), $row);
+ $table->data[] = array($i->get('name'), $i->get_name() . ' (' . $i->get('plugin') . ')', $row);
if (!in_array($i->get('plugin'), $alreadyplugins)) {
$alreadyplugins[] = $i->get('plugin');
}
continue;
}
- $instancehtml .= '<a href="' . $this->baseurl . '&new=' . $p . '">' . s($p) . '</a><br />' . "\n";
+ $instancehtml .= '<a href="' . $this->baseurl . '&new=' . $p . '">' . portfolio_static_function($p, 'get_name') . ' (' . s($p) . ')' . '</a><br />' . "\n";
$addable++;
}
*/
public abstract function is_push();
+ public static abstract function get_name();
+
/**
* check sanity of plugin
* if this function returns something non empty, ALL instances of your plugin
}
}
- if (is_array($insane)) {
+ if (isset($insane) && is_array($insane)) {
$insane = array_shift($insane);
}
if (isset($insane) && is_string($insane)) { // something went wrong, warn...
$data[$config] = $this->instance->get_config($config);
}
$this->set_data($data);
+ } else {
+ $this->set_data(array('name' => portfolio_static_function($this->plugin, 'get_name')));
}
+
$this->add_action_buttons(true, get_string('save', 'portfolio'));
}
unset($SESSION->portfolioexport);
return true;
}
- $this->get('instance')->cleanup();
+ if ($this->get('instance')) {
+ // might not be set - before export really starts
+ $this->get('instance')->cleanup();
+ }
$DB->delete_records('portfolio_tempdata', array('id' => $this->id));
$fs = get_file_storage();
$fs->delete_area_files(SYSCONTEXTID, 'portfolio_exporter', $this->id);
private $folders;
private $accounttree;
+ public static function get_name() {
+ return get_string('pluginname', 'portfolio_boxnet');
+ }
+
public function prepare_package() {
return true; // don't do anything else for this plugin, we want to send all files as they are.
}
protected $exportconfig;
+ public static function get_name() {
+ return get_string('pluginname', 'portfolio_download');
+ }
+
public static function allows_multiple() {
return false;
}
private $flickr;
+ public static function get_name() {
+ return get_string('pluginname', 'portfolio_flickr');
+ }
+
public function prepare_package() {
$this->flickr = new phpFlickr($this->get_config('apikey'), $this->get_config('sharedsecret'));
return true; // don't do anything else for this plugin, we want to send all files as they are.
private $sendtype; // whatever mahara has said it can handle (immediate or queued)
private $filesmanifest; // manifest of files to send to mahara (set during prepare_package and sent later)
+ public static function get_name() {
+ return get_string('pluginname', 'portfolio_mahara');
+ }
+
public static function get_allowed_config() {
return array('mnethostid');
}