--- /dev/null
+<h3>Manage your collections</h3>
+<h4>Add or modify a collection</h4>
+<blockquote>
+ Any default field or any option which needs a field get its content after the fields are configured.
+</blockquote>
+
+<form method="post">
+ <div class="sunken-panel">
+ <table width="100%">
+ <thead>
+ <tr>
+ <th width="200px"></th>
+ <th></th>
+ <th>Note</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><label for="name">Name *</label>
+ <td>
+ <input id="name" type="text" autocomplete="off" name="fdata[name]"
+ placeholder="Unique name. No special chars." size="30"
+ value="<?php echo Summoner::ifset($TemplateData['editData'], 'name'); ?>">
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label for="description">Description</label></td>
+ <td>
+ <input id="description" type="text" autocomplete="off" size="30" name="fdata[description]"
+ value="<?php echo Summoner::ifset($TemplateData['editData'], 'description'); ?>">
+ </td>
+ <td></td>
+ </tr>
+ <tr >
+ <td><label for="defaultSearchField">Default global search field</label></td>
+ <td>
+ <select id="defaultSearchField" name="fdata[defaultSearchField]">
+ <option value="">Please select</option>
+ <?php foreach($TemplateData['simpleSearchFields'] as $k=>$v) { ?>
+ <option value="<?php echo $v['identifier']; ?>"
+ <?php if(Summoner::ifsetValue($TemplateData['editData'], 'defaultSearchField', $v['identifier'])) echo 'selected'; ?>
+ ><?php echo $v['displayname']; ?> (<?php echo $v['type']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td>
+ The field is used in the global search. Altering the default search field results in
+ a DB reindex. This could take some time, depending on the amount of data.
+ </td>
+ </tr>
+ <tr>
+ <td><label for="defaultSortField">Default sort field</label></td>
+ <td>
+ <select id="defaultSortField" name="fdata[defaultSortField]">
+ <option value="">Please select</option>
+ <?php foreach($TemplateData['simpleSearchFields'] as $k=>$v) { ?>
+ <option value="<?php echo $v['identifier']; ?>"
+ <?php if(Summoner::ifsetValue($TemplateData['editData'], 'defaultSortField', $v['identifier'])) echo 'selected'; ?>
+ ><?php echo $v['displayname']; ?> (<?php echo $v['type']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label for="defaultSortOrder">Default sort order</label></td>
+ <td>
+ <select id="defaultSortOrder" name="fdata[defaultSortOrder]">
+ <option value="ASC" <?php if(Summoner::ifsetValue($TemplateData['editData'], 'defaultSortOrder', 'ASC')) echo 'selected'; ?>>ASCENDING</option>
+ <option value="DESC" <?php if(Summoner::ifsetValue($TemplateData['editData'], 'defaultSortOrder', 'DESC')) echo 'selected'; ?>>DESCENDING</option>
+ </select>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label for="advancedSearchTableFields">Table advanced search view</label></td>
+ <td>
+ <select id="advancedSearchTableFields" name="fdata[advancedSearchTableFields][]" multiple="multiple" size="5">
+ <?php foreach($TemplateData['existingFields'] as $k=>$v) { ?>
+ <option value="<?php echo $v['id']; ?>"
+ <?php if(Summoner::ifset($TemplateData['editData']['advancedSearchTableFields'], $v['id'])) echo 'selected'; ?>
+ ><?php echo $v['displayname']; ?> (<?php echo $v['type']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td>Make sure that the default global search field is in this list. This does not limit the fields to search in.</td>
+ </tr>
+ <tr>
+ <td><label for="tool">Tools</label></td>
+ <td>
+ <select id="tool" name="fdata[tool][]" multiple="multiple" size="5">
+ <option value="">None</option>
+ <?php foreach($TemplateData['toolSelection'] as $k=>$v) { ?>
+ <option value="<?php echo $k; ?>"
+ <?php if(Summoner::ifset($TemplateData['editData']['tool'],$k)) echo 'selected'; ?>
+ ><?php echo $v['name']; ?> (<?php echo $v['description']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label for="owner">Owner *</label></td>
+ <td>
+ <select id="owner" name="fdata[owner]">
+ <option value="">Please select</option>
+ <?php foreach($TemplateData['ownerSelection'] as $k=>$v) { ?>
+ <option value="<?php echo $k; ?>"
+ <?php if(Summoner::ifsetValue($TemplateData['editData'], 'owner',$k)) echo 'selected'; ?>
+ ><?php echo $v['login']; ?> (<?php echo $v['name']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label for="group">Group *</label></td>
+ <td>
+ <select id="group" name="fdata[group]">
+ <option value="">Please select</option>
+ <?php foreach($TemplateData['groupSelection'] as $k=>$v) { ?>
+ <option value="<?php echo $k; ?>"
+ <?php if(Summoner::ifsetValue($TemplateData['editData'], 'group',$k)) echo 'selected'; ?>
+ ><?php echo $v['name']; ?> (<?php echo $v['description']; ?>)</option>
+ <?php } ?>
+ </select>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td><label>Rights *</label></td>
+ <td>
+ <div class="sunken-panel">
+ <table>
+ <thead>
+ <tr>
+ <th>User</th>
+ <th>Group</th>
+ <th>Other</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <input id="user_read" type="checkbox" name="fdata[rights][user][read]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['user'], 'read', 'r')) echo "checked"; ?>>
+ <label for="user_read">r </label>
+
+ <input id="user_write" type="checkbox" name="fdata[rights][user][write]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['user'], 'write', 'w')) echo "checked"; ?>>
+ <label for="user_write">w </label>
+
+ <input id="user_delete" type="checkbox" name="fdata[rights][user][delete]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['user'], 'delete', 'x')) echo "checked"; ?>>
+ <label for="user_delete">x </label>
+ </td>
+ <td>
+ <input id="group_read" type="checkbox" name="fdata[rights][group][read]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['group'], 'read', 'r')) echo "checked"; ?>>
+ <label for="group_read">r </label>
+
+ <input id="group_write" type="checkbox" name="fdata[rights][group][write]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['group'], 'write', 'w')) echo "checked"; ?>>
+ <label for="group_write">w </label>
+
+ <input id="group_delete" type="checkbox" name="fdata[rights][group][delete]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['group'], 'delete', 'x')) echo "checked"; ?>>
+ <label for="group_delete">x </label>
+ </td>
+ <td>
+ <input id="other_read" type="checkbox" name="fdata[rights][other][read]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['other'], 'read', 'r')) echo "checked"; ?>>
+ <label for="other_read">r </label>
+
+ <input id="other_write" type="checkbox" name="fdata[rights][other][write]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['other'], 'write', 'w')) echo "checked"; ?>>
+ <label for="other_write">w </label>
+
+ <input id="other_delete" type="checkbox" name="fdata[rights][other][delete]" value="1"
+ <?php if(Summoner::ifsetValue($TemplateData['editData']['rights']['other'], 'delete', 'x')) echo "checked"; ?>>
+ <label for="other_delete">x </label>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </td>
+ <td></td>
+ </tr>
+ <?php if(Summoner::ifset($TemplateData['editData'], 'name')) { ?>
+ <tr>
+ <td>Update entry with collection rights</td>
+ <td>
+ <input id="doRightsForEntries" type="checkbox" name="fdata[doRightsForEntries]" value="1">
+ <label for="doRightsForEntries"> </label>
+ </td>
+ <td>
+ Warning: This will overwrite existing entry rights (user, group, rights) with the ones from the collection!
+ </td>
+ </tr>
+ <tr>
+ <td>Delete</td>
+ <td>
+ <input id="doDelete" type="checkbox" name="fdata[doDelete]" value="1">
+ <label for="doDelete"> </label>
+ </td>
+ <td>Warning: This will delete ALL the data in this collection!</td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+ </div>
+
+ <div class="field-row">
+ <input type="submit" name="submitForm" value="Save" />
+ </div>
+</form>
+
+<h4 class="uk-h4">Available collections</h4>
+<div class="sunken-panel">
+ <table width="100%">
+ <thead>
+ <tr>
+ <th width="200px">Name</th>
+ <th>Description</th>
+ <th>Owner</th>
+ <th>Group</th>
+ <th>Rights</th>
+ <th>Collection</th>
+ <th>Fields</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach($TemplateData['existingCollections'] as $k=>$v) { ?>
+ <tr>
+ <td>
+ <?php echo $v['name']; ?><br/>
+ <small><?php echo $v['created']; ?></small>
+ </td>
+ <td><?php echo $v['description']; ?></td>
+ <td><?php echo $v['username']; ?></td>
+ <td><?php echo $v['groupname']; ?></td>
+ <td><?php echo $v['rights']; ?></td>
+ <td><a href="index.php?p=managecolletions&m=edit&id=<?php echo $k; ?>">Edit</a></td>
+ <td><a href="index.php?p=managecollectionfields&id=<?php echo $k; ?>">Edit</a></td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+</div>