settings.php 5.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <form id="files_external">
  2. <fieldset class="personalblock">
  3. <legend><strong><?php echo $l->t('External Storage'); ?></strong></legend>
  4. <table id="externalStorage" data-admin="<?php echo json_encode($_['isAdminPage']); ?>">
  5. <thead>
  6. <tr>
  7. <th><?php echo $l->t('Mount point'); ?></th>
  8. <th><?php echo $l->t('Backend'); ?></th>
  9. <th><?php echo $l->t('Configuration'); ?></th>
  10. <!--<th><?php echo $l->t('Options'); ?></th> -->
  11. <?php if ($_['isAdminPage']) echo '<th>'.$l->t('Applicable').'</th>'; ?>
  12. <th>&nbsp;</th>
  13. </tr>
  14. </thead>
  15. <tbody width="100%">
  16. <?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?>
  17. <?php foreach ($_['mounts'] as $mountPoint => $mount): ?>
  18. <tr <?php if ($mountPoint == '') echo 'id="addMountPoint"'; ?>>
  19. <td class="mountPoint"><input type="text" name="mountPoint" value="<?php echo $mountPoint; ?>" placeholder="<?php echo $l->t('Mount point'); ?>" /></td>
  20. <?php if ($mountPoint == ''): ?>
  21. <td class="backend">
  22. <select id="selectBackend" data-configurations='<?php echo json_encode($_['backends']); ?>'>
  23. <option value="" disabled selected style="display:none;"><?php echo $l->t('Add mount point'); ?></option>
  24. <?php foreach ($_['backends'] as $class => $backend): ?>
  25. <option value="<?php echo $class; ?>"><?php echo $backend['backend']; ?></option>
  26. <?php endforeach; ?>
  27. </select>
  28. </td>
  29. <?php else: ?>
  30. <td class="backend" data-class="<?php echo $mount['class']; ?>"><?php echo $mount['backend']; ?></td>
  31. <?php endif; ?>
  32. <td class ="configuration" width="100%">
  33. <?php if (isset($mount['configuration'])): ?>
  34. <?php foreach ($mount['configuration'] as $parameter => $value): ?>
  35. <?php if (isset($_['backends'][$mount['class']]['configuration'][$parameter])): ?>
  36. <?php $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter]; ?>
  37. <?php if (strpos($placeholder, '*') !== false): ?>
  38. <input type="password" data-parameter="<?php echo $parameter; ?>" value="<?php echo $value; ?>" placeholder="<?php echo substr($placeholder, 1); ?>" />
  39. <?php elseif(strpos($placeholder, '!') !== false): ?>
  40. <label><input type="checkbox" data-parameter="<?php echo $parameter; ?>" <?php if ($value == 'true') echo ' checked="checked"'; ?> /><?php echo substr($placeholder, 1); ?></label>
  41. <?php elseif (strpos($placeholder, '&') !== false): ?>
  42. <input type="text" class="optional" data-parameter="<?php echo $parameter; ?>" value="<?php echo $value; ?>" placeholder="<?php echo substr($placeholder, 1); ?>" />
  43. <?php elseif (strpos($placeholder, '#') !== false): ?>
  44. <input type="hidden" data-parameter="<?php echo $parameter; ?>" value="<?php echo $value; ?>" />
  45. <?php else: ?>
  46. <input type="text" data-parameter="<?php echo $parameter; ?>" value="<?php echo $value; ?>" placeholder="<?php echo $placeholder; ?>" />
  47. <?php endif; ?>
  48. <?php endif; ?>
  49. <?php endforeach; ?>
  50. <?php if (isset($_['backends'][$mount['class']]['custom'])) OCP\Util::addScript('files_external', $_['backends'][$mount['class']]['custom']); ?>
  51. <?php endif; ?>
  52. </td>
  53. <!--<td class="options">
  54. <select class="selectOptions" title="<?php echo $l->t('None set')?>" multiple="multiple" disabled>
  55. <?php if (OCP\App::isEnabled('files_encryption')) echo '<option value="Encrypt">Encrypt</option>'; ?>
  56. <?php if (OCP\App::isEnabled('files_versions')) echo '<option value="Version control">Version control</option>'; ?>
  57. <?php if (OCP\App::isEnabled('files_sharing')) echo '<option value="Allow sharing">Allow sharing</option>'; ?>
  58. </select>
  59. </td>-->
  60. <?php if ($_['isAdminPage']): ?>
  61. <td class="applicable" align="right" data-applicable-groups='<?php if (isset($mount['applicable']['groups'])) echo json_encode($mount['applicable']['groups']); ?>' data-applicable-users='<?php if (isset($mount['applicable']['users'])) echo json_encode($mount['applicable']['users']); ?>'>
  62. <select class="chzn-select" multiple style="width:20em;" data-placeholder="<?php echo $l->t('None set'); ?>">
  63. <option value="all"><?php echo $l->t('All Users'); ?></option>
  64. <optgroup label="<?php echo $l->t('Groups'); ?>">
  65. <?php foreach ($_['groups'] as $group): ?>
  66. <option value="<?php echo $group; ?>(group)" <?php if (isset($mount['applicable']['groups']) && in_array($group, $mount['applicable']['groups'])) echo 'selected="selected"'; ?>><?php echo $group; ?></option>
  67. <?php endforeach; ?>
  68. </optgroup>
  69. <optgroup label="<?php echo $l->t('Users'); ?>">
  70. <?php foreach ($_['users'] as $user): ?>
  71. <option value="<?php echo $user; ?>" <?php if (isset($mount['applicable']['users']) && in_array($user, $mount['applicable']['users'])) echo 'selected="selected"'; ?>"><?php echo $user; ?></option>
  72. <?php endforeach; ?>
  73. </optgroup>
  74. </select>
  75. </td>
  76. <?php endif; ?>
  77. <td <?php if ($mountPoint != '') echo 'class="remove"'; ?>><img alt="<?php echo $l->t('Delete'); ?>" title="<?php echo $l->t('Delete'); ?>" class="svg action" src="<?php echo image_path('core', 'actions/delete.svg'); ?>" /></td>
  78. </tr>
  79. <?php endforeach; ?>
  80. </tbody>
  81. </table>
  82. <?php if ($_['isAdminPage']): ?>
  83. <br />
  84. <input type="checkbox" name="allowUserMounting" id="allowUserMounting" value="1" <?php if ($_['allowUserMounting'] == 'yes') echo ' checked="checked"'; ?> />
  85. <label for="allowUserMounting"><?php echo $l->t('Enable User External Storage'); ?></label><br/>
  86. <em><?php echo $l->t('Allow users to mount their own external storage'); ?></em>
  87. <?php endif; ?>
  88. </fieldset>
  89. </form>