summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/settings-admin.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-02-21 10:01:02 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-06-02 19:22:58 +0200
commit37afab87b56fa7b2a1b0e751df72e9624663f94f (patch)
tree11252d05738f7d7ee4bdad333ee762a8a63dfad6 /apps/files_sharing/settings-admin.php
parentc88c0b9a13231478c626296d78aac7c1f66d87d9 (diff)
downloadnextcloud-server-37afab87b56fa7b2a1b0e751df72e9624663f94f.tar.gz
nextcloud-server-37afab87b56fa7b2a1b0e751df72e9624663f94f.zip
minimal mail template editor for administrators, refs #7177
Diffstat (limited to 'apps/files_sharing/settings-admin.php')
-rw-r--r--apps/files_sharing/settings-admin.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/apps/files_sharing/settings-admin.php b/apps/files_sharing/settings-admin.php
new file mode 100644
index 00000000000..cbc500c2185
--- /dev/null
+++ b/apps/files_sharing/settings-admin.php
@@ -0,0 +1,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();