summaryrefslogtreecommitdiffstats
path: root/settings/templates
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-09 17:46:34 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-16 09:50:20 +0200
commitc8f670dd8f2982f455662a24be67ad89f8ca2915 (patch)
tree296e14353e3a94b33b97c50646974840d1b3c4bd /settings/templates
parent7de6c06c66df859f6e5ffcd4e0c85580b3c4d365 (diff)
downloadnextcloud-server-c8f670dd8f2982f455662a24be67ad89f8ca2915.tar.gz
nextcloud-server-c8f670dd8f2982f455662a24be67ad89f8ca2915.zip
Settings to vuejs
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/templates')
-rw-r--r--settings/templates/settings.php34
-rw-r--r--settings/templates/users/main.php80
-rw-r--r--settings/templates/users/part.createuser.php3
-rw-r--r--settings/templates/users/part.grouplist.php69
-rw-r--r--settings/templates/users/part.setquota.php35
-rw-r--r--settings/templates/users/part.userlist.php149
6 files changed, 26 insertions, 344 deletions
diff --git a/settings/templates/settings.php b/settings/templates/settings.php
index 44011af2884..b3589a60cd4 100644
--- a/settings/templates/settings.php
+++ b/settings/templates/settings.php
@@ -1,9 +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.
- */?>
+<?php
+/**
+ * @copyright Copyright (c) 2018, John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
+ * @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This is the default empty template to load Vue!
+ * Do your cbackend computations into a php files
+ * then serve this file as template and include your data into
+ * the $serverData template variable
+ *
+ * $tmpl = new OC_Template('settings', 'settings', 'user');
+ * $tmpl->assign('serverData', $serverData);
+ * $tmpl->printPage();
-<?php foreach($_['forms'] as $form) {
- print_unescaped($form);
-}
+ */
+
+script('settings', 'main');
+style('settings', 'settings');
+
+// Did we have some data to inject ?
+if(is_array($_['serverData'])) {
+ $serverData = json_encode($_['serverData']);
+?>
+<span id="serverData" data-server="<?php p($serverData);?>"></span>
+<?php } ?>
diff --git a/settings/templates/users/main.php b/settings/templates/users/main.php
deleted file mode 100644
index 2d40f0fbb64..00000000000
--- a/settings/templates/users/main.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
- * Copyright (c) 2017, John Molakvoæ <skjnldsv@protonmail.com>
- * This file is licensed under the Affero General Public License version 3 or later.
- * See the COPYING-README file.
- */
-
-script('settings', [
- 'users/deleteHandler',
- 'users/filter',
- 'users/users',
- 'users/groups'
-]);
-script('core', [
- 'multiselect',
- 'singleselect'
-]);
-style('settings', 'settings');
-
-$userlistParams = array();
-$allGroups=array();
-foreach($_["adminGroup"] as $group) {
- $allGroups[$group['id']] = array('displayName' => $group['name']);
-}
-foreach($_["groups"] as $group) {
- $allGroups[$group['id']] = array('displayName' => $group['name']);
-}
-$userlistParams['subadmingroups'] = $allGroups;
-$userlistParams['allGroups'] = json_encode($allGroups);
-$items = array_flip($userlistParams['subadmingroups']);
-unset($items['admin']);
-$userlistParams['subadmingroups'] = array_flip($items);
-
-translation('settings');
-?>
-
-<div id="app-navigation">
- <?php print_unescaped($this->inc('users/part.createuser')); ?>
- <?php print_unescaped($this->inc('users/part.grouplist')); ?>
- <div id="app-settings">
- <div id="app-settings-header">
- <button class="settings-button" tabindex="0" data-apps-slide-toggle="#app-settings-content"><?php p($l->t('Settings'));?></button>
- </div>
- <div id="app-settings-content">
- <?php print_unescaped($this->inc('users/part.setquota')); ?>
-
- <div id="userlistoptions">
- <p>
- <input type="checkbox" name="StorageLocation" value="StorageLocation" id="CheckboxStorageLocation"
- class="checkbox" <?php if ($_['show_storage_location'] === 'true') print_unescaped('checked="checked"'); ?> />
- <label for="CheckboxStorageLocation">
- <?php p($l->t('Show storage location')) ?>
- </label>
- </p>
- <p>
- <input type="checkbox" name="UserBackend" value="UserBackend" id="CheckboxUserBackend"
- class="checkbox" <?php if ($_['show_backend'] === 'true') print_unescaped('checked="checked"'); ?> />
- <label for="CheckboxUserBackend">
- <?php p($l->t('Show user backend')) ?>
- </label>
- </p>
- <p>
- <input type="checkbox" name="LastLogin" value="LastLogin" id="CheckboxLastLogin"
- class="checkbox" <?php if ($_['show_last_login'] === 'true') print_unescaped('checked="checked"'); ?> />
- <label for="CheckboxLastLogin">
- <?php p($l->t('Show last login')) ?>
- </label>
- </p>
- <p class="info-text">
- <?php p($l->t('When the password of a new user is left empty, an activation email with a link to set the password is sent.')) ?>
- </p>
- </div>
- </div>
- </div>
-</div>
-
-<div id="app-content">
- <?php print_unescaped($this->inc('users/part.userlist', $userlistParams)); ?>
-</div>
diff --git a/settings/templates/users/part.createuser.php b/settings/templates/users/part.createuser.php
deleted file mode 100644
index 57fe8e8b63f..00000000000
--- a/settings/templates/users/part.createuser.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="app-navigation-new">
- <button type="button" id="new-user-button" class="icon-add"><?php p($l->t('Add user'))?></button>
-</div>
diff --git a/settings/templates/users/part.grouplist.php b/settings/templates/users/part.grouplist.php
deleted file mode 100644
index 4128a6b76e4..00000000000
--- a/settings/templates/users/part.grouplist.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<ul id="usergrouplist" data-sort-groups="<?php p($_['sortGroups']); ?>">
- <!-- Add new group -->
- <?php if ($_['isAdmin']) { ?>
- <li id="newgroup-entry">
- <a href="#" class="icon-add" id="newgroup-init"><?php p($l->t('Add group'))?></a>
- <div class="app-navigation-entry-edit" id="newgroup-form">
- <form>
- <input type="text" id="newgroupname" placeholder="<?php p($l->t('Add group'))?>">
- <input type="submit" value="" class="icon-checkmark">
- </form>
- </div>
- </li>
- <?php } ?>
- <!-- Everyone -->
- <li id="everyonegroup" data-gid="_everyone" data-usercount="" class="isgroup">
- <a href="#">
- <span class="groupname">
- <?php p($l->t('Everyone')); ?>
- </span>
- </a>
- <div class="app-navigation-entry-utils">
- <ul>
- <li class="usercount app-navigation-entry-utils-counter" id="everyonecount"></li>
- </ul>
- </div>
- </li>
-
- <!-- The Admin Group -->
- <?php foreach($_["adminGroup"] as $adminGroup): ?>
- <li data-gid="admin" data-usercount="<?php if($adminGroup['usercount'] > 0) { p($adminGroup['usercount']); } ?>" class="isgroup">
- <a href="#"><span class="groupname"><?php p($l->t('Admins')); ?></span></a>
- <div class="app-navigation-entry-utils">
- <ul>
- <li class="app-navigation-entry-utils-counter"><?php if($adminGroup['usercount'] > 0) { p($adminGroup['usercount']); } ?></li>
- </ul>
- </div>
- </li>
- <?php endforeach; ?>
-
- <!-- Disabled Users -->
- <?php $disabledUsersGroup = $_["disabledUsersGroup"] ?>
- <li data-gid="_disabledUsers" data-usercount="<?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?>" class="isgroup">
- <a href="#"><span class="groupname"><?php p($l->t('Disabled')); ?></span></a>
- <div class="app-navigation-entry-utils">
- <ul>
- <li class="app-navigation-entry-utils-counter"><?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?></li>
- </ul>
- </div>
- </li>
-
- <!--List of Groups-->
- <?php foreach($_["groups"] as $group): ?>
- <li data-gid="<?php p($group['id']) ?>" data-usercount="<?php p($group['usercount']) ?>" class="isgroup">
- <a href="#" class="dorename">
- <span class="groupname"><?php p($group['name']); ?></span>
- </a>
- <div class="app-navigation-entry-utils">
- <ul>
- <li class="app-navigation-entry-utils-counter"><?php if($group['usercount'] > 0) { p($group['usercount']); } ?></li>
- <?php if($_['isAdmin']): ?>
- <li class="app-navigation-entry-utils-menu-button delete">
- <button class="icon-delete"></button>
- </li>
- <?php endif; ?>
- </ul>
- </div>
- </li>
- <?php endforeach; ?>
-</ul>
diff --git a/settings/templates/users/part.setquota.php b/settings/templates/users/part.setquota.php
deleted file mode 100644
index a0231ddace2..00000000000
--- a/settings/templates/users/part.setquota.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<div class="quota">
- <!-- Default storage -->
- <span><?php p($l->t('Default quota'));?></span>
- <?php if((bool) $_['isAdmin']): ?>
- <select id='default_quota' data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>" data-tipsy-gravity="s">
- <option <?php if($_['default_quota'] === 'none') print_unescaped('selected="selected"');?> value='none'>
- <?php p($l->t('Unlimited'));?>
- </option>
- <?php foreach($_['quota_preset'] as $preset):?>
- <?php if($preset !== 'default'):?>
- <option <?php if($_['default_quota']==$preset) print_unescaped('selected="selected"');?> value='<?php p($preset);?>'>
- <?php p($preset);?>
- </option>
- <?php endif;?>
- <?php endforeach;?>
- <?php if($_['defaultQuotaIsUserDefined']):?>
- <option selected="selected" value='<?php p($_['default_quota']);?>'>
- <?php p($_['default_quota']);?>
- </option>
- <?php endif;?>
- <option data-new value='other'>
- <?php p($l->t('Other'));?>
- ...
- </option>
- </select>
- <?php endif; ?>
- <?php if((bool) !$_['isAdmin']): ?>
- :
- <?php if( $_['default_quota'] === 'none'): ?>
- <?php p($l->t('Unlimited'));?>
- <?php else: ?>
- <?php p($_['default_quota']);?>
- <?php endif; ?>
- <?php endif; ?>
-</div>
diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php
deleted file mode 100644
index 5a37c968d1e..00000000000
--- a/settings/templates/users/part.userlist.php
+++ /dev/null
@@ -1,149 +0,0 @@
-<form class="newUserMenu" id="newuser" autocomplete="off">
- <table id="userlist" class="grid" data-groups="<?php p($_['allGroups']);?>">
- <thead>
- <tr>
- <th id="headerAvatar" scope="col"></th>
- <th id="headerName" scope="col"><?php p($l->t('Username'))?></th>
- <th id="headerDisplayName" scope="col"><?php p($l->t( 'Full name' )); ?></th>
- <th id="headerPassword" scope="col"><?php p($l->t( 'Password' )); ?></th>
- <th class="mailAddress" scope="col"><?php p($l->t( 'Email' )); ?></th>
- <th id="headerGroups" scope="col"><?php p($l->t( 'Groups' )); ?></th>
- <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
- <th id="headerSubAdmins" scope="col"><?php p($l->t('Group admin for')); ?></th>
- <?php endif;?>
- <?php if((bool)$_['recoveryAdminEnabled']): ?>
- <th id="recoveryPassword" scope="col"><?php p($l->t('Recovery password')); ?></th>
- <?php endif; ?>
- <th id="headerQuota" scope="col"><?php p($l->t('Quota')); ?></th>
- <th class="storageLocation" scope="col"><?php p($l->t('Storage location')); ?></th>
- <th class="userBackend" scope="col"><?php p($l->t('User backend')); ?></th>
- <th class="lastLogin" scope="col"><?php p($l->t('Last login')); ?></th>
- <th class="userActions"></th>
- </tr>
- <tr id="newuserHeader" style="display:none">
- <td class="icon-add"></td>
- <td class="name">
- <input id="newusername" type="text" required
- placeholder="<?php p($l->t('Username'))?>" name="username"
- autocomplete="off" autocapitalize="none" autocorrect="off" />
- </td>
- <td class="displayName">
- <input id="newdisplayname" type="text"
- placeholder="<?php p($l->t('Full name'))?>" name="displayname"
- autocomplete="off" autocapitalize="none" autocorrect="off" />
- </td>
- <td class="password">
- <input id="newuserpassword" type="password"
- placeholder="<?php p($l->t('Password'))?>" name="password"
- autocomplete="new-password" autocapitalize="none" autocorrect="off" />
- </td>
- <td class="mailAddress">
- <input id="newemail" type="email"
- placeholder="<?php p($l->t('E-Mail'))?>" name="email"
- autocomplete="off" autocapitalize="none" autocorrect="off" />
- </td>
- <td class="groups">
- <div class="groupsListContainer multiselect button" data-placeholder="<?php p($l->t('Groups'))?>">
- <span class="title groupsList"></span>
- <span class="icon-triangle-s"></span>
- </div>
- </td>
- <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
- <td></td>
- <?php endif;?>
- <?php if((bool)$_['recoveryAdminEnabled']): ?>
- <td class="recoveryPassword">
- <input id="recoveryPassword"
- type="password"
- placeholder="<?php p($l->t('Admin Recovery Password'))?>"
- title="<?php p($l->t('Enter the recovery password in order to recover the users files during password change'))?>"
- alt="<?php p($l->t('Enter the recovery password in order to recover the users files during password change'))?>"/>
- </td>
- <?php endif; ?>
- <td class="quota"></td>
- <td class="storageLocation" scope="col"></td>
- <td class="userBackend" scope="col"></td>
- <td class="lastLogin" scope="col"></td>
- <td class="userActions">
- <input type="submit" id="newsubmit" class="button primary icon-checkmark-white has-tooltip" value="" title="<?php p($l->t('Add user'))?>" />
- <input type="reset" id="newreset" class="button icon-close has-tooltip" value="" title="<?php p($l->t('Cancel'))?>" />
- </td>
- </tr>
- </thead>
- <tbody>
- <!-- the following <tr> is used as a template for the JS part -->
- <tr style="display:none">
- <td class="avatar"><div class="avatardiv"></div></td>
- <td class="name" scope="row"></td>
- <td class="displayName"><span></span> <img class="action"
- src="<?php p(image_path('core', 'actions/rename.svg'))?>"
- alt="<?php p($l->t('change full name'))?>" title="<?php p($l->t('change full name'))?>"/>
- </td>
- <td class="password"><span>●●●●●●●</span> <img class="action"
- src="<?php print_unescaped(image_path('core', 'actions/rename.svg'))?>"
- alt="<?php p($l->t('set new password'))?>" title="<?php p($l->t('set new password'))?>"/>
- </td>
- <td class="mailAddress"><span></span><div class="loading-small hidden"></div> <img class="action"
- src="<?php p(image_path('core', 'actions/rename.svg'))?>"
- alt="<?php p($l->t('change email address'))?>" title="<?php p($l->t('change email address'))?>"/>
- </td>
- <td class="groups"><div class="groupsListContainer multiselect button"
- ><span class="title groupsList"></span><span class="icon-triangle-s"></span></div>
- </td>
- <?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
- <td class="subadmins"><div class="groupsListContainer multiselect button"
- ><span class="title groupsList"></span><span class="icon-triangle-s"></span></div>
- </td>
- <?php endif;?>
- <?php if((bool)$_['recoveryAdminEnabled']): ?>
- <td></td>
- <?php endif; ?>
- <td class="quota">
- <select class="quota-user" data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>">
- <option value='default'>
- <?php p($l->t('Default'));?>
- </option>
- <option value='none'>
- <?php p($l->t('Unlimited'));?>
- </option>
- <?php foreach($_['quota_preset'] as $preset):?>
- <option value='<?php p($preset);?>'>
- <?php p($preset);?>
- </option>
- <?php endforeach;?>
- <option value='other' data-new>
- <?php p($l->t('Other'));?> ...
- </option>
- </select>
- <progress class="quota-user-progress" value="" max="100"></progress>
- </td>
- <td class="storageLocation"></td>
- <td class="userBackend"></td>
- <td class="lastLogin"></td>
- <td class="userActions">
- <div class="toggleUserActions">
- <a class="action"><span class="icon-more"></span></a>
- <div class="popovermenu">
- <ul class="userActionsMenu">
- <li>
- <a href="#" class="menuitem action-togglestate permanent" data-action="togglestate"></a>
- </li>
- <li>
- <a href="#" class="menuitem action-remove permanent" data-action="remove">
- <span class="icon icon-delete"></span>
- <span><?php p($l->t('Delete')); ?></span>
- </a>
- </li>
- </ul>
- </div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
-</form>
-
-<div class="emptycontent" style="display:none">
- <div class="icon-search"></div>
- <h2></h2>
-</div>