Skip to content

Commit

Permalink
Cloud plugin release 2016022600
Browse files Browse the repository at this point in the history
  • Loading branch information
anzeljg committed Feb 27, 2016
1 parent e61fed1 commit 0b81426
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 50 deletions.
2 changes: 1 addition & 1 deletion cloud/blocktype/box/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/box/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/box/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion cloud/blocktype/dropbox/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/dropbox/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/dropbox/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion cloud/blocktype/googledrive/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/googledrive/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
7 changes: 6 additions & 1 deletion cloud/blocktype/googledrive/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
}


$smarty = smarty();
$smarty = smarty(
array(),
array(),
array(),
array('sidebars' => false)
);

$smarty->assign('SERVICE', 'googledrive');
$smarty->assign('id', $id);
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/googledrive/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion cloud/blocktype/microsoftdrive/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/microsoftdrive/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/microsoftdrive/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
5 changes: 0 additions & 5 deletions cloud/blocktype/owncloud/details.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/owncloud/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 4 additions & 6 deletions cloud/blocktype/owncloud/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/owncloud/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion cloud/blocktype/picasa/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/picasa/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/picasa/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion cloud/blocktype/zotero/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/zotero/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cloud/blocktype/zotero/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
4 changes: 2 additions & 2 deletions cloud/theme/raw/service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<h3 class="panel-heading profile-block">
<span class="user-icon" id="cloudservice_{$service->name}">
{if $service->subservice}
<img src="{theme_url filename="$service->subservice/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}">
<img src="{theme_url filename="$service->subservice/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}" width="72">
{else}
<img src="{theme_url filename="images/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}">
<img src="{theme_url filename="images/icon.png" plugin="artefact/cloud/blocktype/$service->name"}" alt="{$service->name}" width="72">
{/if}
</span>
<a href="{$service->url}">
Expand Down
4 changes: 2 additions & 2 deletions cloud/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 0b81426

Please sign in to comment.