aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/settings-admin.php
blob: cbc500c21852f3b74240d0c5fb8919b355a55295 (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
47
48
49
50
51
52
53
<?php
/**
 * Copyright (c) 2011 Robin Appelman <icewind@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

\OC_Util::checkAdminUser();

if (\OC_Util::getTheme()) {
	$mailTemplatePath = \OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/core/templates/mail.php';
}

if (!isset($mailTemplatePath) || !file_exists($mailTemplatePath) ) {
	$mailTemplatePath = \OC::$SERVERROOT . '/core/templates/mail.php';
}

if (file_exists($mailTemplatePath)) {
	$mailTemplate = file_get_contents($mailTemplatePath);
} else {
	//log no mail template found
}


\OCP\Util::addStyle('files_sharing', 'settings-admin');
\OCP\Util::addScript('files_sharing', 'settings-admin');
//\OCP\Util::addScript('settings', 'personal');

$themes = array('default');

if ($handle = opendir(\OC::$SERVERROOT.'/themes')) {
	while (false !== ($entry = readdir($handle))) {
		if ($entry != '.' && $entry != '..') {
			if (is_dir(\OC::$SERVERROOT.'/themes/'.$entry)) {
				$themes[] = $entry;
			}
		}
	}
	closedir($handle);
}

$editableTemplates = \OCA\Files_Sharing\MailTemplate::getEditableTemplates();

$tmpl = new OCP\Template('files_sharing', 'settings-admin');
$tmpl->assign('themes', $themes);
$tmpl->assign('editableTemplates', $editableTemplates);


//\OCP\Util::addscript('files_settings', 'settings');
//\OCP\Util::addscript('core', 'multiselect');

return $tmpl->fetchPage();