aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-23 01:40:13 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-23 01:41:18 +0200
commit391e064e67eaab5fb63ed568946af97b6a243fdd (patch)
tree9bf83f73b437e85f4f81d5cc86bd85b7df097946 /settings
parentf2229e0427774045328388d67e1b969525ca610f (diff)
downloadnextcloud-server-391e064e67eaab5fb63ed568946af97b6a243fdd.tar.gz
nextcloud-server-391e064e67eaab5fb63ed568946af97b6a243fdd.zip
allow apps to register form for the settings and admin pages
Diffstat (limited to 'settings')
-rw-r--r--settings/admin.php27
-rw-r--r--settings/apps.php1
-rw-r--r--settings/help.php5
-rw-r--r--settings/js/apps.js6
-rw-r--r--settings/js/personal.js6
-rw-r--r--settings/js/users.js6
-rw-r--r--settings/languageCodes.php8
-rw-r--r--settings/personal.php7
-rw-r--r--settings/settings.php23
-rw-r--r--settings/templates/admin.php9
-rw-r--r--settings/templates/apps.php6
-rw-r--r--settings/templates/help.php6
-rw-r--r--settings/templates/personal.php6
-rw-r--r--settings/templates/settings.php9
-rw-r--r--settings/templates/users.php7
-rw-r--r--settings/users.php24
16 files changed, 133 insertions, 23 deletions
diff --git a/settings/admin.php b/settings/admin.php
new file mode 100644
index 00000000000..15559a150e5
--- /dev/null
+++ b/settings/admin.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+require_once('../lib/base.php');
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
+ exit();
+}
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+ header( "Location: ".OC_Helper::linkTo( '', "index.php" ));
+ exit();
+}
+
+OC_Util::addStyle( "settings", "settings" );
+OC_App::setActiveNavigationEntry( "admin" );
+
+$tmpl = new OC_Template( 'settings', 'admin', 'user');
+$forms=OC_App::getForms('admin');
+$tmpl->assign('forms',array());
+foreach($forms as $form){
+ $tmpl->append('forms',$form);
+}
+$tmpl->printPage(); \ No newline at end of file
diff --git a/settings/apps.php b/settings/apps.php
index 05da4259768..d5aafd628e6 100644
--- a/settings/apps.php
+++ b/settings/apps.php
@@ -57,6 +57,7 @@ if(is_array($catagoryNames)){
'active'=>false,
'description'=>$app['description'],
'author'=>$app['personid'],
+ 'licence'=>$app['license'],
);
}
}
diff --git a/settings/help.php b/settings/help.php
index 39dd83acc74..f8a2f9b8bf9 100644
--- a/settings/help.php
+++ b/settings/help.php
@@ -1,4 +1,9 @@
<?php
+/**
+ * Copyright (c) 2011, Frank Karlitschek karlitschek@kde.org
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
require_once('../lib/base.php');
if( !OC_User::isLoggedIn()){
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 21b5d233f03..e2f882c6fec 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -1,3 +1,9 @@
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
$(document).ready(function(){
$('#leftcontent li').each(function(index,li){
var app=$.parseJSON($(this).children('span').text());
diff --git a/settings/js/personal.js b/settings/js/personal.js
index d16917d5393..b814d436e7c 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -1,3 +1,9 @@
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
$(document).ready(function(){
$("#passwordbutton").click( function(){
// Serialize the data
diff --git a/settings/js/users.js b/settings/js/users.js
index 0570263d300..c60fb32c40e 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -1,3 +1,9 @@
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
$(document).ready(function(){
function applyMultiplySelect(element){
var checked=[];
diff --git a/settings/languageCodes.php b/settings/languageCodes.php
index 5a6c734cfad..088ba5f29c6 100644
--- a/settings/languageCodes.php
+++ b/settings/languageCodes.php
@@ -1,4 +1,10 @@
-<?php return array(
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+return array(
'ab'=>'Abkhazian',
'aa'=>'Afar',
'af'=>'Afrikaans',
diff --git a/settings/personal.php b/settings/personal.php
index a31042bb53f..e6d2d44db76 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -1,4 +1,9 @@
<?php
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
require_once('../lib/base.php');
if( !OC_User::isLoggedIn()){
@@ -9,7 +14,7 @@ if( !OC_User::isLoggedIn()){
// Highlight navigation entry
OC_Util::addScript( "settings", "personal" );
OC_Util::addStyle( "settings", "settings" );
-OC_App::setActiveNavigationEntry( "settings" );
+OC_App::setActiveNavigationEntry( "personal" );
// calculate the disc space
$used=OC_Filesystem::filesize('/');
diff --git a/settings/settings.php b/settings/settings.php
new file mode 100644
index 00000000000..724cf63aaf7
--- /dev/null
+++ b/settings/settings.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+require_once('../lib/base.php');
+if( !OC_User::isLoggedIn()){
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
+ exit();
+}
+
+OC_Util::addStyle( "settings", "settings" );
+OC_App::setActiveNavigationEntry( "settings" );
+
+$tmpl = new OC_Template( 'settings', 'settings', 'user');
+$forms=OC_App::getForms('settings');
+$tmpl->assign('forms',array());
+foreach($forms as $form){
+ $tmpl->append('forms',$form);
+}
+$tmpl->printPage(); \ No newline at end of file
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
new file mode 100644
index 00000000000..98acd541e36
--- /dev/null
+++ b/settings/templates/admin.php
@@ -0,0 +1,9 @@
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */?>
+
+<?php foreach($_['forms'] as $form){
+ echo $form;
+};?> \ No newline at end of file
diff --git a/settings/templates/apps.php b/settings/templates/apps.php
index d420b6ad0ba..d8f3fb5e4f8 100644
--- a/settings/templates/apps.php
+++ b/settings/templates/apps.php
@@ -1,3 +1,9 @@
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */?>
+
<div id="controls">
<a class="button" target="_blank" href="http://apps.owncloud.com/"><?php echo $l->t('Add your application');?></a>
</div>
diff --git a/settings/templates/help.php b/settings/templates/help.php
index 8e54493764e..4e3cdd7b908 100644
--- a/settings/templates/help.php
+++ b/settings/templates/help.php
@@ -1,3 +1,9 @@
+<?php /**
+ * Copyright (c) 2011, Frank Karlitschek karlitschek@kde.org
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */?>
+
<div id="controls">
<a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
<?php
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index a64dee1cb60..4629c93b90e 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -1,3 +1,9 @@
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */?>
+
<div id="quota" class="personalblock"><div style="width:<?php echo $_['usage_relative'];?>%;">
<p><?php echo $l->t('You use');?> <strong><?php echo $_['usage'];?></strong> <?php echo $l->t('of the available');?> <strong><?php echo $_['total_space'];?></strong></p>
</div></div>
diff --git a/settings/templates/settings.php b/settings/templates/settings.php
new file mode 100644
index 00000000000..98acd541e36
--- /dev/null
+++ b/settings/templates/settings.php
@@ -0,0 +1,9 @@
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */?>
+
+<?php foreach($_['forms'] as $form){
+ echo $form;
+};?> \ No newline at end of file
diff --git a/settings/templates/users.php b/settings/templates/users.php
index 244f3632931..a97774cea0b 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -1,4 +1,9 @@
-<?php
+<?php /**
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
$allGroups=array();
foreach($_["groups"] as $group) {
$allGroups[]=$group['name'];
diff --git a/settings/users.php b/settings/users.php
index 8bf64e16fff..5aae4ce43ef 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -1,25 +1,9 @@
<?php
-
/**
-* ownCloud
-*
-* @author Frank Karlitschek
-* @copyright 2010 Frank Karlitschek karlitschek@kde.org
-*
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either
-* version 3 of the License, or any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-* License along with this library. If not, see <http://www.gnu.org/licenses/>.
-*
-*/
+ * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
require_once('../lib/base.php');
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){