Welcome to mirror list, hosted at ThFree Co, Russian Federation.

public.php - github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 002e915e998ba25df83169f37789137908c69ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

/**
 * ownCloud - Documents App
 *
 * @author Victor Dubiniuk
 * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 */


namespace OCA\Documents;

\OCP\JSON::checkAppEnabled('documents');

\OCP\Util::addStyle( 'documents', 'style' );

if (isset($_GET['t'])) {
	$token = $_GET['t'];
	$linkItem = \OCP\Share::getShareByToken($token);
	if (is_array($linkItem) && isset($linkItem['uid_owner'])) {
		// seems to be a valid share
		$type = $linkItem['item_type'];
		$fileSource = $linkItem['file_source'];
		$shareOwner = $linkItem['uid_owner'];
		$path = null;
		$rootLinkItem = \OCP\Share::resolveReShare($linkItem);
		$fileOwner = $rootLinkItem['uid_owner'];

	}
}


$tmpl = new \OCP\Template('documents', 'public', 'guest');
if (isset($fileOwner)) {
	\OCP\Util::addStyle( 'documents', '3rdparty/webodf/dojo-app');
	\OCP\Util::addStyle( 'documents', '3rdparty/webodf/editor' );
	\OCP\Util::addScript('documents', 'documents');
	$tmpl->assign('document', $token);
} else {
	$tmpl->assign('notFound', true);
}

$tmpl->printPage();