From 1e4432c5d5b5cd26247e9fec6a82f3cef800fd68 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 12 Aug 2010 17:30:20 +0200 Subject: [PATCH] new settings page that allows plugins to integrate their own settings dialogs more with the existing ones --- css/default.php | 18 +++++++++++++++++ inc/lib_config.php | 25 ++++++++++++++---------- inc/templates/adminform.php | 10 +++++++++- inc/templates/configform.php | 3 ++- inc/templates/settings.php | 38 ++++++++++++++++++++++++++++++++++++ settings/index.php | 7 ++++++- 6 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 inc/templates/settings.php diff --git a/css/default.php b/css/default.php index 6500b31cb6d..dd96b97a86e 100644 --- a/css/default.php +++ b/css/default.php @@ -62,6 +62,11 @@ h1 { text-align:center; } +.body>.center { + height:100%; + width:100%; +} + .center * { margin-left:auto; margin-right:auto; @@ -419,4 +424,17 @@ div.moreActionsList td{ div.moreActionsList tr:hover{ background-color:#DDD; +} + +#settingsNav{ + background-color:#EEEEEE; + float:left; + height:100%; + overflow:auto; + text-align:left; +} + +#settingsNav ul{ + padding-left:20px; + padding-right:20px; } \ No newline at end of file diff --git a/inc/lib_config.php b/inc/lib_config.php index ff4ead8b6be..a6b8fba7020 100644 --- a/inc/lib_config.php +++ b/inc/lib_config.php @@ -1,18 +1,23 @@ -
+') +?> - +
+function showForm(id){ + hideAllForms(); + form=document.getElementById('settingsContent_'+id); + form.setAttribute('class','settingsContent'); +} + +function hideAllForms(){ + forms=document.getElementById('settingsHolder').childNodes; + for(var i=0;i +
+
    +$url){ + $clean=strtolower(str_replace(' ','_',$name)); + echo("
  • $name
  • \n"); +} +?> +
+
+
+
Settings
+$url){ + $clean=strtolower(str_replace(' ','_',$name)); + echo("\n"); +} +?> +
diff --git a/settings/index.php b/settings/index.php index d5e7451d08b..582e7601e51 100644 --- a/settings/index.php +++ b/settings/index.php @@ -30,8 +30,13 @@ OC_UTIL::showheader(); $FIRSTRUN=false; +OC_CONFIG::addForm('System Settings','/inc/templates/adminform.php'); +if(OC_USER::ingroup($_SESSION['username'],'admin')){ + OC_CONFIG::addForm('User Settings','/inc/templates/configform.php'); +} + echo('
'); -OC_CONFIG::showconfigform(); +OC_CONFIG::showSettings(); echo('
');