server/settings/index.php

36 lines
1 KiB
PHP
Raw Normal View History

2010-03-10 12:03:40 +00:00
<?php
require_once('../lib/base.php');
2011-04-16 08:12:53 +00:00
require( 'template.php' );
if( !OC_USER::isLoggedIn()){
2011-03-02 22:58:46 +00:00
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
exit();
}
// Highlight navigation entry
2011-04-17 18:00:07 +00:00
OC_APP::setActiveNavigationEntry( "settings" );
OC_UTIL::addScript( "settings", "main" );
OC_UTIL::addStyle( "settings", "settings" );
// calculate the disc space
2011-04-17 11:47:45 +00:00
$used=OC_FILESYSTEM::filesize('/');
2011-04-17 14:40:44 +00:00
$free=OC_FILESYSTEM::free_space();
2011-04-17 11:47:45 +00:00
$total=$free+$used;
$relative=round(($used/$total)*100);
$lang=OC_PREFERENCES::getValue( OC_USER::getUser(), 'core', 'lang', 'en' );
2011-06-20 12:33:02 +00:00
$languages=OC_L10N::findAvailableLanguages();
//put the current language in the front
unset($languages[array_search($lang,$languages)]);
array_unshift($languages,$lang);
// Return template
$tmpl = new OC_TEMPLATE( "settings", "index", "admin");
2011-04-17 11:47:45 +00:00
$tmpl->assign('usage',OC_HELPER::humanFileSize($used));
$tmpl->assign('total_space',OC_HELPER::humanFileSize($total));
$tmpl->assign('usage_relative',$relative);
2011-06-20 12:33:02 +00:00
$tmpl->assign('languages',$languages);
$tmpl->printPage();
2010-03-10 12:03:40 +00:00
?>