summaryrefslogtreecommitdiffstats
path: root/apps/files_external/templates/settings.php
blob: e34c0322390642dd5a10217ac708e1739ca71592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<form id="files_external">
	<fieldset class="personalblock">
	<legend><strong><?php echo $l->t('External Storage'); ?></strong></legend>
		<?php if (isset($_['storage'])): ?>
		<table id="externalStorage">
			<thead>
				<tr>
					<th><?php echo $l->t('Type'); ?></th>
					<th><?php echo $l->t('Configuration'); ?></th>
					<th><?php echo $l->t('Mount Location'); ?></th>
					<th><?php echo $l->t('Options'); ?></th>
					<?php if ($_['isAdminPage'] == true) echo '<th>'.$l->t('Applicable').'</th>'; ?>
					<th>&nbsp;</th>
				</tr>
			</thead>
			<tbody>
			<?php $_['storage'] = array_merge($_['storage'], array(array('id' => 'addStorage', 'mount' => ''))); ?>
			<?php foreach($_['storage'] as $storage): ?>
				<tr <?php if ($storage['id'] == 'addStorage') echo 'id="addStorage"'; ?> data-storage-id="<?php echo $storage['id']; ?>">
					<?php if ($storage['id'] == 'addStorage'): ?>
						<td class="selectStorage">
							<select id="selectStorage" data-configurations="<?php echo $_['configurations']; ?>">
								<option value="" disabled selected style="display:none;"><?php echo $l->t('Add storage'); ?></option>
								<?php foreach($_['backends'] as $backend): ?>
									<option value="<?php echo $backend; ?>"><?php echo $backend; ?></option>
								<?php endforeach; ?>
							</select>
						</td>
					<?php else: ?>
						<td class="type" <?php if ($storage['status'] == 'error') echo 'class="error"'; ?>><?php echo $storage['type']; ?></td>
					<?php endif; ?>
					<td class ="configuration">
					<?php if (isset($storage['configuration'])): ?>
						<?php foreach($storage['configuration'] as $parameter => $value): ?>
							<?php if (strpos($parameter, '*') !== false): ?>
								<input type="password" value="<?php echo $value; ?>" placeholder="<?php echo $l->t(substr($parameter, 1)); ?>" />
							<?php else: ?>
								<input type="text" value="<?php echo $value; ?>" placeholder="<?php echo $l->t($parameter); ?>" />
							<?php endif; ?>
						<?php endforeach; ?>
					<?php endif; ?>
					</td>
					<td class="mount"><input type="text" name="storageMountLocation" value="<?php echo $storage['mount']; ?>" placeholder="<?php echo $l->t('Mount Location'); ?>" /></td>
					<td class="options">
						<select class="selectOptions" title="<?php echo $l->t('None set')?>" multiple="multiple">
							<?php if (OCP\App::isEnabled('files_encryption')) echo '<option value="Encrypt">Encrypt</option>'; ?>
							<?php if (OCP\App::isEnabled('files_versions')) echo '<option value="Version control">Version control</option>'; ?>
							<?php if (OCP\App::isEnabled('files_sharing')) echo '<option value="Allow sharing">Allow sharing</option>'; ?>
						</select>
					</td>
					<?php if ($_['isAdminPage'] == true): ?>
						<td class="applicable">
							<select class="selectApplicable" data-storage-applicable="<?php echo $storage['applicable']; ?>" title="<?php echo $l->t('None set'); ?>" multiple="multiple">
								<option value="Global"><?php echo $l->t('Global'); ?></option>
								<?php foreach($_['groups'] as $group): ?>
									<option value="<?php echo $group; ?>"><?php echo $group; ?></option>
								<?php endforeach; ?>
							</select>
						</td>
					<?php endif; ?>
					<td <?php if ($storage['id'] != 'addStorage') 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>
				</tr>
			<?php endforeach; ?>
			</tbody>
		</table>
		<?php endif; ?>
		<?php if ($_['isAdminPage'] == true): ?>
			<br />
			<input type="checkbox" name="allowUserMounting" id="allowUserMounting" value="1" <?php if ($_['allowUserMounting'] == 'yes') echo ' checked="checked"'; ?> />
			<label for="allowUserMounting"><?php echo $l->t('Enable User External Storage'); ?></label><br/>
			<em><?php echo $l->t('Allow users to mount their own external storage'); ?></em>
		<?php endif; ?>
	</fieldset>
</form>