portfolio/mahara tighter url for continuing to portfolio to enter the folder and highlight the new file

This commit is contained in:
mjollnir_ 2008-10-21 09:55:04 +00:00
parent 047c0f78aa
commit 14cb94ebfe

View file

@ -20,6 +20,7 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
private $sendtype; // whatever mahara has said it can handle (immediate or queued) 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) private $filesmanifest; // manifest of files to send to mahara (set during prepare_package and sent later)
private $totalsize; // total size of all included files added together private $totalsize; // total size of all included files added together
private $continueurl; // if we've been sent back a specific url to continue to (eg folder id)
public static function get_name() { public static function get_name() {
return get_string('pluginname', 'portfolio_mahara'); return get_string('pluginname', 'portfolio_mahara');
@ -191,6 +192,9 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
if ($response->type =='queued') { if ($response->type =='queued') {
$this->exporter->set_forcequeue(); $this->exporter->set_forcequeue();
} }
if (isset($response->querystring)) {
$this->continueurl = $response->querystring;
}
} }
public function get_continue_url() { public function get_continue_url() {
@ -198,6 +202,9 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base {
$this->ensure_environment(); $this->ensure_environment();
$mnetauth = get_auth_plugin('mnet'); $mnetauth = get_auth_plugin('mnet');
$remoteurl = '/artefact/file/';// @todo penny this might change later when we change formats. $remoteurl = '/artefact/file/';// @todo penny this might change later when we change formats.
if (isset($this->continueurl)) {
$remoteurl .= $this->continueurl;
}
if (!$url = $mnetauth->start_jump_session($this->get_config('mnethostid'), $remoteurl)) { if (!$url = $mnetauth->start_jump_session($this->get_config('mnethostid'), $remoteurl)) {
return false; return false;
} }