aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
Diffstat (limited to 'settings')
-rw-r--r--settings/apps.php92
-rw-r--r--settings/js/apps-custom.php26
-rw-r--r--settings/js/isadmin.php20
-rw-r--r--settings/js/users.js15
-rw-r--r--settings/l10n/ro.php3
-rw-r--r--settings/personal.php16
-rw-r--r--settings/routes.php4
-rw-r--r--settings/templates/apps.php11
-rw-r--r--settings/templates/help.php23
-rw-r--r--settings/templates/users.php8
10 files changed, 73 insertions, 145 deletions
diff --git a/settings/apps.php b/settings/apps.php
index 99a3094399d..b6426a31c97 100644
--- a/settings/apps.php
+++ b/settings/apps.php
@@ -26,99 +26,8 @@ OC_App::loadApps();
// Load the files we need
OC_Util::addStyle( "settings", "settings" );
-OC_Util::addScript( "settings", "apps" );
OC_App::setActiveNavigationEntry( "core_apps" );
-$installedApps = OC_App::getAllApps();
-
-//TODO which apps do we want to blacklist and how do we integrate blacklisting with the multi apps folder feature?
-
-$blacklist = array('files');//we dont want to show configuration for these
-
-$appList = array();
-
-foreach ( $installedApps as $app ) {
-
- if ( array_search( $app, $blacklist ) === false ) {
-
- $info=OC_App::getAppInfo($app);
-
- if (!isset($info['name'])) {
-
- OC_Log::write('core', 'App id "'.$app.'" has no name in appinfo', OC_Log::ERROR);
-
- continue;
-
- }
-
- if ( OC_Appconfig::getValue( $app, 'enabled', 'no') == 'yes' ) {
-
- $active = true;
-
- } else {
-
- $active = false;
-
- }
-
- $info['active'] = $active;
-
- if(isset($info['shipped']) and ($info['shipped']=='true')) {
-
- $info['internal']=true;
-
- $info['internallabel']='Internal App';
-
- }else{
-
- $info['internal']=false;
-
- $info['internallabel']='3rd Party App';
-
- }
-
- $info['preview'] = OC_Helper::imagePath('settings', 'trans.png');
-
- $info['version'] = OC_App::getAppVersion($app);
-
- $appList[] = $info;
-
- }
-}
-
-$remoteApps = OC_App::getAppstoreApps();
-
-if ( $remoteApps ) {
-
- // Remove duplicates
- foreach ( $appList as $app ) {
-
- foreach ( $remoteApps AS $key => $remote ) {
-
- if (
- $app['name'] == $remote['name']
- // To set duplicate detection to use OCS ID instead of string name,
- // enable this code, remove the line of code above,
- // and add <ocs_id>[ID]</ocs_id> to info.xml of each 3rd party app:
- // OR $app['ocs_id'] == $remote['ocs_id']
- ) {
-
- unset( $remoteApps[$key]);
-
- }
-
- }
-
- }
-
- $combinedApps = array_merge( $appList, $remoteApps );
-
-} else {
-
- $combinedApps = $appList;
-
-}
-
function app_sort( $a, $b ) {
if ($a['active'] != $b['active']) {
@@ -131,6 +40,7 @@ function app_sort( $a, $b ) {
}
+$combinedApps = OC_App::listAllApps();
usort( $combinedApps, 'app_sort' );
$tmpl = new OC_Template( "settings", "apps", "user" );
diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php
new file mode 100644
index 00000000000..9ec2a758ee3
--- /dev/null
+++ b/settings/js/apps-custom.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+// Check if admin user
+OC_Util::checkAdminUser();
+
+// Set the content type to JSON
+header('Content-type: application/json');
+
+// Disallow caching
+header("Cache-Control: no-cache, must-revalidate");
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
+
+$combinedApps = OC_App::listAllApps();
+
+foreach($combinedApps as $app) {
+ echo("appData_".$app['id']."=".json_encode($app));
+ echo("\n");
+}
+
+echo ("var appid =\"".$_GET['appid']."\";"); \ No newline at end of file
diff --git a/settings/js/isadmin.php b/settings/js/isadmin.php
new file mode 100644
index 00000000000..8b31f8a7cf9
--- /dev/null
+++ b/settings/js/isadmin.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+// Set the content type to Javascript
+header("Content-type: text/javascript");
+
+// Disallow caching
+header("Cache-Control: no-cache, must-revalidate");
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
+
+if (OC_User::isAdminUser(OC_User::getUser())) {
+ echo("var isadmin = true;");
+} else {
+ echo("var isadmin = false;");
+} \ No newline at end of file
diff --git a/settings/js/users.js b/settings/js/users.js
index fa6f058d923..9f0c1ffd111 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -26,9 +26,8 @@ var UserList = {
UserList.deleteCanceled = false;
// Provide user with option to undo
- $('#notification').html(t('users', 'deleted') + ' ' + uid + '<span class="undo">' + t('users', 'undo') + '</span>');
$('#notification').data('deleteuser', true);
- $('#notification').fadeIn();
+ OC.Notification.showHtml(t('users', 'deleted') + ' ' + uid + '<span class="undo">' + t('users', 'undo') + '</span>');
},
/**
@@ -53,7 +52,7 @@ var UserList = {
success:function (result) {
if (result.status == 'success') {
// Remove undo option, & remove user from table
- $('#notification').fadeOut();
+ OC.Notification.hide();
$('tr').filterAttr('data-uid', UserList.deleteUid).remove();
UserList.deleteCanceled = true;
if (ready) {
@@ -197,7 +196,7 @@ var UserList = {
checked:checked,
oncheck:checkHandeler,
onuncheck:checkHandeler,
- minWidth:100,
+ minWidth:100
});
}
if ($(element).attr('class') == 'subadminsselect') {
@@ -232,7 +231,7 @@ var UserList = {
checked:checked,
oncheck:checkHandeler,
onuncheck:checkHandeler,
- minWidth:100,
+ minWidth:100
});
}
}
@@ -389,7 +388,7 @@ $(document).ready(function () {
{
username:username,
password:password,
- groups:groups,
+ groups:groups
},
function (result) {
if (result.status != 'success') {
@@ -402,13 +401,13 @@ $(document).ready(function () {
);
});
// Handle undo notifications
- $('#notification').hide();
+ OC.Notification.hide();
$('#notification .undo').live('click', function () {
if ($('#notification').data('deleteuser')) {
$('tbody tr').filterAttr('data-uid', UserList.deleteUid).show();
UserList.deleteCanceled = true;
}
- $('#notification').fadeOut();
+ OC.Notification.hide();
});
UserList.useUndo = ('onbeforeunload' in window)
$(window).bind('beforeunload', function () {
diff --git a/settings/l10n/ro.php b/settings/l10n/ro.php
index a96a7368499..1166f9587e9 100644
--- a/settings/l10n/ro.php
+++ b/settings/l10n/ro.php
@@ -10,6 +10,7 @@
"Unable to delete user" => "Nu s-a putut șterge utilizatorul",
"Language changed" => "Limba a fost schimbată",
"Invalid request" => "Cerere eronată",
+"Admins can't remove themself from the admin group" => "Administratorii nu se pot șterge singuri din grupul admin",
"Unable to add user to group %s" => "Nu s-a putut adăuga utilizatorul la grupul %s",
"Unable to remove user from group %s" => "Nu s-a putut elimina utilizatorul din grupul %s",
"Disable" => "Dezactivați",
@@ -27,6 +28,7 @@
"Forum" => "Forum",
"Bugtracker" => "Urmărire bug-uri",
"Commercial Support" => "Suport comercial",
+"You have used <strong>%s</strong> of the available <strong>%s</strong>" => "Ați utilizat <strong>%s</strong> din <strong>%s</strong> disponibile",
"Clients" => "Clienți",
"Download Desktop Clients" => "Descarcă client desktop",
"Download Android Client" => "Descarcă client Android",
@@ -44,6 +46,7 @@
"Language" => "Limba",
"Help translate" => "Ajută la traducere",
"WebDAV" => "WebDAV",
+"Use this address to connect to your ownCloud in your file manager" => "Folosește această adresă pentru a conecta ownCloud cu managerul de fișiere",
"Version" => "Versiunea",
"Developed by the <a href=\"http://ownCloud.org/contact\" target=\"_blank\">ownCloud community</a>, the <a href=\"https://github.com/owncloud\" target=\"_blank\">source code</a> is licensed under the <a href=\"http://www.gnu.org/licenses/agpl-3.0.html\" target=\"_blank\"><abbr title=\"Affero General Public License\">AGPL</abbr></a>." => "Dezvoltat de the <a href=\"http://ownCloud.org/contact\" target=\"_blank\">comunitatea ownCloud</a>, <a href=\"https://github.com/owncloud\" target=\"_blank\">codul sursă</a> este licențiat sub <a href=\"http://www.gnu.org/licenses/agpl-3.0.html\" target=\"_blank\"><abbr title=\"Affero General Public License\">AGPL</abbr></a>.",
"Name" => "Nume",
diff --git a/settings/personal.php b/settings/personal.php
index 47dbcc53ebc..4624bda8397 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -15,15 +15,7 @@ OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );
-// calculate the disc space
-$rootInfo=OC_FileCache::get('');
-$sharedInfo=OC_FileCache::get('/Shared');
-$used=$rootInfo['size'];
-if($used<0) $used=0;
-$free=OC_Filesystem::free_space();
-$total=$free+$used;
-if($total==0) $total=1; // prevent division by zero
-$relative=round(($used/$total)*10000)/100;
+$storageInfo=OC_Helper::getStorageInfo();
$email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
@@ -50,9 +42,9 @@ foreach($languageCodes as $lang) {
// Return template
$tmpl = new OC_Template( 'settings', 'personal', 'user');
-$tmpl->assign('usage', OC_Helper::humanFileSize($used));
-$tmpl->assign('total_space', OC_Helper::humanFileSize($total));
-$tmpl->assign('usage_relative', $relative);
+$tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
+$tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total']));
+$tmpl->assign('usage_relative', $storageInfo['relative']);
$tmpl->assign('email', $email);
$tmpl->assign('languages', $languages);
diff --git a/settings/routes.php b/settings/routes.php
index 9b5bf809230..1c766837dd1 100644
--- a/settings/routes.php
+++ b/settings/routes.php
@@ -53,6 +53,8 @@ $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
->actionInclude('settings/ajax/disableapp.php');
$this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
->actionInclude('settings/ajax/navigationdetect.php');
+$this->create('apps_custom', '/settings/js/apps-custom.js')
+ ->actionInclude('settings/js/apps-custom.php');
// admin
$this->create('settings_ajax_getlog', '/settings/ajax/getlog.php')
->actionInclude('settings/ajax/getlog.php');
@@ -60,3 +62,5 @@ $this->create('settings_ajax_setloglevel', '/settings/ajax/setloglevel.php')
->actionInclude('settings/ajax/setloglevel.php');
$this->create('settings_ajax_setsecurity', '/settings/ajax/setsecurity.php')
->actionInclude('settings/ajax/setsecurity.php');
+$this->create('isadmin', '/settings/js/isadmin.js')
+ ->actionInclude('settings/js/isadmin.php');
diff --git a/settings/templates/apps.php b/settings/templates/apps.php
index 0490f63fb67..d418b9a66a1 100644
--- a/settings/templates/apps.php
+++ b/settings/templates/apps.php
@@ -3,9 +3,9 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/?>
-<script type='text/javascript'>
- var appid = '<?php echo $_['appid']; ?>';
-</script>
+ <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('apps_custom');?>?appid=<?php echo $_['appid']; ?>"></script>
+ <script type="text/javascript" src="<?php echo OC_Helper::linkTo('settings/js', 'apps.js');?>"></script>
+
<div id="controls">
<a class="button" target="_blank" href="http://owncloud.org/dev/apps/getting-started/"><?php echo $l->t('Add your App');?></a>
<a class="button" target="_blank" href="http://apps.owncloud.com"><?php echo $l->t('More Apps');?></a>
@@ -15,9 +15,6 @@
<li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>" <?php if ( isset( $app['ocs_id'] ) ) { echo "data-id-ocs=\"{$app['ocs_id']}\""; } ?>
data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1">
<a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a>
- <script>
- appData_<?php echo $app['id'] ?>=<?php OC_JSON::encodedPrint($app, false) ?>;
- </script>
<?php if(!$app['internal']) echo '<small class="externalapp list">3rd party</small>' ?>
</li>
<?php endforeach;?>
@@ -32,4 +29,4 @@
<p class="license hidden"><?php echo $l->t('<span class="licence"></span>-licensed by <span class="author"></span>');?></p>
<input class="enable hidden" type="submit" />
</div>
-</div>
+</div> \ No newline at end of file
diff --git a/settings/templates/help.php b/settings/templates/help.php
index 8f51cd87017..7383fdcf56a 100644
--- a/settings/templates/help.php
+++ b/settings/templates/help.php
@@ -11,25 +11,4 @@
<a class="button newquestion" href="http://owncloud.com" target="_blank"><?php echo $l->t( 'Commercial Support' ); ?></a>
</div>
<br /><br />
-<iframe src="<?php echo($_['url']); ?>" width="100%" id="ifm" ></iframe>
-
-
-<script language="JavaScript">
-<!--
-
-function pageY(elem) {
- return elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop;
-}
-var buffer = 5; //scroll bar buffer
-function resizeIframe() {
- var height = document.documentElement.clientHeight;
- height -= pageY(document.getElementById('ifm'))+ buffer ;
- height = (height < 0) ? 0 : height;
- document.getElementById('ifm').style.height = height + 'px';
-}
-
-document.getElementById('ifm').onload=resizeIframe;
-window.onresize = resizeIframe;
-
-//-->
-</script>
+<iframe src="<?php echo($_['url']); ?>" width="100%" id="ifm" ></iframe> \ No newline at end of file
diff --git a/settings/templates/users.php b/settings/templates/users.php
index 6cbbca24049..c88966f7137 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -13,9 +13,9 @@ $items = array_flip($_['subadmingroups']);
unset($items['admin']);
$_['subadmingroups'] = array_flip($items);
?>
-<script>
-var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
-</script>
+
+<script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('isadmin');?>"></script>
+
<div id="controls">
<form id="newuser" autocomplete="off">
<input id="newusername" type="text" placeholder="<?php echo $l->t('Name')?>" /> <input
@@ -73,8 +73,6 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
</div>
</div>
-<div id='notification'></div>
-
<table data-groups="<?php echo implode(', ', $allGroups);?>">
<thead>
<tr>