-
Notifications
You must be signed in to change notification settings - Fork 15
/
metadata_types.php
68 lines (60 loc) · 2.24 KB
/
metadata_types.php
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
<div class="page-header">
<h2><?= t('Custom Fields') ?></h2>
</div>
<form id="metadata-type-creation-form" method="post" action="<?= $this->url->href('MetadataTypesController', 'config', ['plugin' => 'MetaMagik']) ?>" autocomplete="off">
<?= $this->form->label(t('Name'), 'human_name') ?>
<?= $this->form->text('human_name', $values, $errors, ['required']) ?>
<?= $this->form->label(t('Type'), 'data_type') ?>
<?= $this->form->select('data_type', [
'' => '--',
'text' => 'Text',
'list' => 'Dropdown List',
'radio' => 'Radio List',
'check' => 'Checkbox Group',
], $values, $errors, ['required']) ?>
<?= $this->form->label(t('Options - comma seperated list for dropdown, radio, or checkbox group. 255 chars max.'), 'options') ?>
<?= $this->form->text('options', $values, $errors) ?>
<?= $this->form->label(t('Attached Entity'), 'attach_to') ?>
<?= $this->form->select('attached_to', [
'' => '--',
//'user' => 'User',
//'project' => 'Project',
'task' => 'Task',
], $values, $errors, ['required']) ?>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
<?= $this->form->csrf() ?>
</form>
<hr>
<?php if (!empty($types)): ?>
<table class="table-stripped">
<tr>
<th>Field Name</th>
<th>Type</th>
<th>Options</th>
<th>Action</th>
</tr>
<?php
foreach ($types as $type):
$key = $type['id']
?>
<tr>
<td><?= $type['human_name'] ?></td>
<td><?= $type['data_type'] ?></td>
<td><?= $type['options'] ?></td>
<td>
<ul>
<li>
<?= $this->modal->small('remove', t('Remove'), 'MetadataTypesController', 'confirmTask', ['plugin' => 'metaMagik', 'key' => $key], false, 'popover') ?>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<?php else: ?>
<div class="listing">
<?= t('No types have been defined yet.') ?>
</div>
<?php endif ?>