diff --git a/lib/app.php b/lib/app.php index 51dcb8d573..30ebcf032b 100644 --- a/lib/app.php +++ b/lib/app.php @@ -225,10 +225,7 @@ class OC_App{ // admin log menu $settings[] = array( "id" => "core_log", "order" => 4, "href" => OC_Helper::linkTo( "settings", "log.php" ), "name" => $l->t("Log"), "icon" => OC_Helper::imagePath( "log", "apps.svg" )); - // if there're some admin forms - if(!empty(self::$adminForms)) - // admins menu - $settings[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" )); + $settings[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" )); } } diff --git a/settings/admin.php b/settings/admin.php index 81ed6aa951..9ee79002b5 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -9,10 +9,12 @@ require_once('../lib/base.php'); OC_Util::checkAdminUser(); OC_Util::addStyle( "settings", "settings" ); +OC_Util::addScript( "settings", "admin" ); OC_App::setActiveNavigationEntry( "admin" ); $tmpl = new OC_Template( 'settings', 'admin', 'user'); $forms=OC_App::getForms('admin'); +$tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 )); $tmpl->assign('forms',array()); foreach($forms as $form){ $tmpl->append('forms',$form); diff --git a/settings/ajax/setloglevel.php b/settings/ajax/setloglevel.php new file mode 100644 index 0000000000..298cbd6473 --- /dev/null +++ b/settings/ajax/setloglevel.php @@ -0,0 +1,15 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +require_once('../../lib/base.php'); +OC_Util::checkAdminUser(); + +OC_Config::setValue( 'loglevel', $_POST['level'] ); + +echo 'true'; + +?> \ No newline at end of file diff --git a/settings/js/admin.js b/settings/js/admin.js new file mode 100644 index 0000000000..a3585f7e1c --- /dev/null +++ b/settings/js/admin.js @@ -0,0 +1,5 @@ +$(document).ready(function(){ + $('#loglevel').change(function(){ + $.post(OC.filePath('settings','ajax','setloglevel.php'), { level: $(this).val() } ); + }) +}); \ No newline at end of file diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 98acd541e3..e3fd60fefc 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -2,8 +2,21 @@ * Copyright (c) 2011, Robin Appelman * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. - */?> + */ +$levels=array('Debug','Info','Warning','Error','Fatal'); +?> \ No newline at end of file +};?> +
+ t('Log level');?> + +
diff --git a/settings/templates/log.php b/settings/templates/log.php index 467f594186..bcf5258f5f 100644 --- a/settings/templates/log.php +++ b/settings/templates/log.php @@ -3,7 +3,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ -$levels=array('DEBUG','INFO','WARN','ERROR','FATAL'); +$levels=array('Debug','Info','Warning','Error','Fatal'); ?>