From 0b814265841926826beccf46f4e8a2affca907dc Mon Sep 17 00:00:00 2001 From: Gregor Anzelj Date: Fri, 26 Feb 2016 23:07:29 +0100 Subject: [PATCH] Cloud plugin release 2016022600 --- cloud/blocktype/box/account.php | 2 +- cloud/blocktype/box/callback.php | 4 ++-- cloud/blocktype/box/version.php | 4 ++-- cloud/blocktype/dropbox/account.php | 2 +- cloud/blocktype/dropbox/callback.php | 4 ++-- cloud/blocktype/dropbox/version.php | 4 ++-- cloud/blocktype/googledrive/account.php | 2 +- cloud/blocktype/googledrive/callback.php | 4 ++-- cloud/blocktype/googledrive/details.php | 7 ++++++- cloud/blocktype/googledrive/version.php | 4 ++-- cloud/blocktype/microsoftdrive/account.php | 2 +- cloud/blocktype/microsoftdrive/callback.php | 4 ++-- cloud/blocktype/microsoftdrive/version.php | 4 ++-- cloud/blocktype/owncloud/details.php | 5 ----- cloud/blocktype/owncloud/download.php | 4 ++-- cloud/blocktype/owncloud/lib.php | 10 ++++------ cloud/blocktype/owncloud/version.php | 4 ++-- cloud/blocktype/picasa/account.php | 2 +- cloud/blocktype/picasa/callback.php | 4 ++-- cloud/blocktype/picasa/version.php | 4 ++-- cloud/blocktype/zotero/account.php | 2 +- cloud/blocktype/zotero/callback.php | 4 ++-- cloud/blocktype/zotero/version.php | 4 ++-- cloud/theme/raw/service.tpl | 4 ++-- cloud/version.php | 4 ++-- 25 files changed, 48 insertions(+), 50 deletions(-) diff --git a/cloud/blocktype/box/account.php b/cloud/blocktype/box/account.php index 7564c2e..87f745d 100644 --- a/cloud/blocktype/box/account.php +++ b/cloud/blocktype/box/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/box/callback.php b/cloud/blocktype/box/callback.php index 91bf710..f7d110f 100644 --- a/cloud/blocktype/box/callback.php +++ b/cloud/blocktype/box/callback.php @@ -34,8 +34,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/box/version.php b/cloud/blocktype/box/version.php index 9d31e63..ed679f1 100644 --- a/cloud/blocktype/box/version.php +++ b/cloud/blocktype/box/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 2.0'; diff --git a/cloud/blocktype/dropbox/account.php b/cloud/blocktype/dropbox/account.php index 03991a2..0884e3a 100644 --- a/cloud/blocktype/dropbox/account.php +++ b/cloud/blocktype/dropbox/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/dropbox/callback.php b/cloud/blocktype/dropbox/callback.php index 41be3c5..d667859 100644 --- a/cloud/blocktype/dropbox/callback.php +++ b/cloud/blocktype/dropbox/callback.php @@ -34,8 +34,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/dropbox/version.php b/cloud/blocktype/dropbox/version.php index 1878d2d..90984d8 100644 --- a/cloud/blocktype/dropbox/version.php +++ b/cloud/blocktype/dropbox/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 2.0'; diff --git a/cloud/blocktype/googledrive/account.php b/cloud/blocktype/googledrive/account.php index 4401891..e2d9901 100644 --- a/cloud/blocktype/googledrive/account.php +++ b/cloud/blocktype/googledrive/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/googledrive/callback.php b/cloud/blocktype/googledrive/callback.php index 421cec0..abacf3a 100644 --- a/cloud/blocktype/googledrive/callback.php +++ b/cloud/blocktype/googledrive/callback.php @@ -34,8 +34,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/googledrive/details.php b/cloud/blocktype/googledrive/details.php index 34c06a6..d65956c 100644 --- a/cloud/blocktype/googledrive/details.php +++ b/cloud/blocktype/googledrive/details.php @@ -43,7 +43,12 @@ } -$smarty = smarty(); +$smarty = smarty( + array(), + array(), + array(), + array('sidebars' => false) +); $smarty->assign('SERVICE', 'googledrive'); $smarty->assign('id', $id); diff --git a/cloud/blocktype/googledrive/version.php b/cloud/blocktype/googledrive/version.php index 533dbb8..c728e88 100644 --- a/cloud/blocktype/googledrive/version.php +++ b/cloud/blocktype/googledrive/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 2.0'; diff --git a/cloud/blocktype/microsoftdrive/account.php b/cloud/blocktype/microsoftdrive/account.php index a3915b2..17b851d 100644 --- a/cloud/blocktype/microsoftdrive/account.php +++ b/cloud/blocktype/microsoftdrive/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/microsoftdrive/callback.php b/cloud/blocktype/microsoftdrive/callback.php index cbbfabe..3842965 100644 --- a/cloud/blocktype/microsoftdrive/callback.php +++ b/cloud/blocktype/microsoftdrive/callback.php @@ -34,8 +34,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/microsoftdrive/version.php b/cloud/blocktype/microsoftdrive/version.php index ba317b2..564d412 100644 --- a/cloud/blocktype/microsoftdrive/version.php +++ b/cloud/blocktype/microsoftdrive/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 2.0'; diff --git a/cloud/blocktype/owncloud/details.php b/cloud/blocktype/owncloud/details.php index 3d68196..1e77668 100644 --- a/cloud/blocktype/owncloud/details.php +++ b/cloud/blocktype/owncloud/details.php @@ -56,11 +56,6 @@ array('sidebars' => false) ); -if (get_config('viewmicroheaders')) { - $smarty->assign('microheaders', true); - $smarty->assign('microheadertitle', $view->display_title(true, false)); -} - $smarty->assign('SERVICE', 'owncloud'); $smarty->assign('id', $id); $smarty->assign('type', $type); diff --git a/cloud/blocktype/owncloud/download.php b/cloud/blocktype/owncloud/download.php index 3575036..5d9320b 100644 --- a/cloud/blocktype/owncloud/download.php +++ b/cloud/blocktype/owncloud/download.php @@ -69,7 +69,7 @@ } $file = PluginBlocktypeOwncloud::get_file_info($id, $ownerid); $content = PluginBlocktypeOwncloud::download_file($id, $ownerid); - + header('Pragma: no-cache'); header('Content-disposition: attachment; filename="' . $file['name'] . '"'); header('Content-Transfer-Encoding: binary'); @@ -127,7 +127,7 @@ function saveform_submit(Pieform $form, $values) { insert_record('artefact_file_files', $fileartefact); // Write file content to local Mahara file repository - $content = PluginBlocktypeOwncloud::download_file($file['id'], null, false); + $content = PluginBlocktypeOwncloud::download_file($file['id']); if (!file_exists(get_config('dataroot') . 'artefact/file/originals/' . $artefactid)) { mkdir(get_config('dataroot') . 'artefact/file/originals/' . $artefactid, 0777); } diff --git a/cloud/blocktype/owncloud/lib.php b/cloud/blocktype/owncloud/lib.php index 84d9ee6..11dc1bc 100644 --- a/cloud/blocktype/owncloud/lib.php +++ b/cloud/blocktype/owncloud/lib.php @@ -215,8 +215,10 @@ private function get_service_consumer($owner=null) { if (!isset($owner) || is_null($owner)) { $owner = $USER->get('id'); } + $webdavurl = get_config_plugin('blocktype', 'owncloud', 'webdavurl'); + $url = parse_url($webdavurl); $service = new StdClass(); - $service->ssl = true; + $service->ssl = ($url['scheme'] == 'https' ? true : false); $service->version = ''; // API Version $service->title = get_config_plugin('blocktype', 'owncloud', 'servicetitle'); $service->webdavurl = get_config_plugin('blocktype', 'owncloud', 'webdavurl'); @@ -723,12 +725,8 @@ public function get_file_info($file_id='/remote.php/webdav/', $owner=null) { } } - public function download_file($file_id='/remote.php/webdav/', $owner=null, $fix=true) { + public function download_file($file_id='/remote.php/webdav/', $owner=null) { global $SESSION; - if ($fix) { - // Fix: everything except / gets urlencoded - $file_id = implode('/', array_map('rawurlencode', explode('/', $file_id))); - } $consumer = self::get_service_consumer($owner); if (isset($consumer->usrprefs['token']) && !empty($consumer->usrprefs['token'])) { $webdavurl = parse_url($consumer->webdavurl); diff --git a/cloud/blocktype/owncloud/version.php b/cloud/blocktype/owncloud/version.php index a36ced5..3cb6cd0 100644 --- a/cloud/blocktype/owncloud/version.php +++ b/cloud/blocktype/owncloud/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'Custom auth, OAuth 2.0 like'; diff --git a/cloud/blocktype/picasa/account.php b/cloud/blocktype/picasa/account.php index ff10a5d..aa9bc4e 100644 --- a/cloud/blocktype/picasa/account.php +++ b/cloud/blocktype/picasa/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/picasa/callback.php b/cloud/blocktype/picasa/callback.php index 2178f30..42bb865 100644 --- a/cloud/blocktype/picasa/callback.php +++ b/cloud/blocktype/picasa/callback.php @@ -34,8 +34,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/picasa/version.php b/cloud/blocktype/picasa/version.php index 9cb854e..c7e4256 100644 --- a/cloud/blocktype/picasa/version.php +++ b/cloud/blocktype/picasa/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 2.0'; diff --git a/cloud/blocktype/zotero/account.php b/cloud/blocktype/zotero/account.php index f8d2c24..3814ea3 100644 --- a/cloud/blocktype/zotero/account.php +++ b/cloud/blocktype/zotero/account.php @@ -26,7 +26,7 @@ $USER->set_account_preference('lasteditedview', $viewid); } else { - $USER->set_account_preference('lasteditedview', null); + $USER->set_account_preference('lasteditedview', 0); } switch ($action) { diff --git a/cloud/blocktype/zotero/callback.php b/cloud/blocktype/zotero/callback.php index 18cf6a1..71892a4 100644 --- a/cloud/blocktype/zotero/callback.php +++ b/cloud/blocktype/zotero/callback.php @@ -37,8 +37,8 @@ // If user edited a page, then return to that page $viewid = $USER->get_account_preference('lasteditedview'); -if (isset($viewid) && !empty($viewid)) { - $USER->set_account_preference('lasteditedview', null); +if (isset($viewid) && $viewid > 0) { + $USER->set_account_preference('lasteditedview', 0); redirect(get_config('wwwroot').'view/blocks.php?id='.$viewid); } diff --git a/cloud/blocktype/zotero/version.php b/cloud/blocktype/zotero/version.php index 08401b1..b3da91e 100644 --- a/cloud/blocktype/zotero/version.php +++ b/cloud/blocktype/zotero/version.php @@ -12,6 +12,6 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1'; $config->auth = 'OAuth 1.0'; diff --git a/cloud/theme/raw/service.tpl b/cloud/theme/raw/service.tpl index 1b803e2..d75dd1a 100644 --- a/cloud/theme/raw/service.tpl +++ b/cloud/theme/raw/service.tpl @@ -2,9 +2,9 @@

{if $service->subservice} - subservice/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}"> + subservice/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}" width="72"> {else} - {$service->name} + {$service->name} {/if} diff --git a/cloud/version.php b/cloud/version.php index 28d986c..7648fdd 100644 --- a/cloud/version.php +++ b/cloud/version.php @@ -12,5 +12,5 @@ defined('INTERNAL') || die(); $config = new StdClass; -$config->version = 2016022200; -$config->release = '16.02.0'; +$config->version = 2016022600; +$config->release = '16.02.1';