123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?php
- if(!empty($TemplateData['editFields'])) {
- $_entry = '';
- if(!empty($TemplateData['editData']) && isset($TemplateData['editData']['id'])) {
- $_entry = $TemplateData['editData']['id'];
- ?>
- <h3><?php echo $I18n->t('manageentry.updateentry'); ?> <a href="index.php?p=collections&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>"><?php echo $TemplateData['loadedCollection']['name']; ?></a></h3>
- <p>
- <a href="index.php?p=entry&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>&id=<?php echo $TemplateData['editData']['id']; ?>"><?php echo $I18n->t('manageentry.viewentry'); ?></a>
- </p>
- <?php if(!empty($TemplateData['possibleDuplicates'])) { ?>
- <?php echo $I18n->t('manageentry.possibleduplicate'); ?>
- <ul>
- <?php
- foreach($TemplateData['possibleDuplicates'] as $key=>$entry) {
- echo '<li><a href="index.php?p=entry&collection='.$TemplateData['loadedCollection']['id'].'&id='.$entry['id'].'" target="_blank">'.$entry['title'].'</a></li>';
- }
- ?>
- </ul>
- <?php } ?>
- <?php } else { ?>
- <h3><?php echo $I18n->t('manageentry.addentry'); ?> <a href="index.php?p=collections&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>"><?php echo $TemplateData['loadedCollection']['name']; ?></a></h3>
- <?php } ?>
- <?php if(!empty($TemplateData['availableTools'])) { ?>
- <h4><?php echo $I18n->t('manageentry.availabletools'); ?></h4>
- <ul>
- <?php foreach($TemplateData['availableTools'] as $tool) { ?>
- <li><a href="index.php?p=tool&t=<?php echo $tool['action']; ?>&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>&id=<?php echo $_entry; ?>"
- target="<?php echo $tool['target']; ?>"><?php echo $tool['name']; ?> (<?php echo $tool['description']; ?>)</a></li>
- <?php } ?>
- </ul>
- <?php } ?>
- <script type="text/javascript" src="view/98/ui/js/suggest-tag.js"></script>
- <form class="maxSizeForm" method="post" enctype="multipart/form-data">
- <?php
- foreach($TemplateData['editFields'] as $field) {
- $_editFieldView = Summoner::themefile('manageentry/field-'.$field['type'].'.html', UI_THEME);
- if(file_exists($_editFieldView)) {
- require $_editFieldView;
- }
- else {
- require $TemplateData['_editFieldViewDefault'];
- }
- }
- if(!empty($TemplateData['editData']['_isOwner'])) {
- ?>
- <div class="field-row-stacked">
- <label><?php echo $I18n->t('global.rights'); ?> *</label>
- <table>
- <thead>
- <tr>
- <th><?php echo $I18n->t('global.user'); ?></th>
- <th><?php echo $I18n->t('global.group'); ?></th>
- <th><?php echo $I18n->t('global.other'); ?></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <input id="user_read" type="checkbox" name="fdata[rights][user][read]" value="1"
- <?php echo ($TemplateData['editData']['rights']['user']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
- <label for="user_read">r </label>
- <input id="user_write" type="checkbox" name="fdata[rights][user][write]" value="1"
- <?php echo ($TemplateData['editData']['rights']['user']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
- <label for="user_write">w </label>
- <input id="user_delete" type="checkbox" name="fdata[rights][user][delete]" value="1"
- <?php echo ($TemplateData['editData']['rights']['user']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
- <label for="user_delete">x </label>
- </td>
- <td>
- <input id="group_read" type="checkbox" name="fdata[rights][group][read]" value="1"
- <?php echo ($TemplateData['editData']['rights']['group']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
- <label for="group_read">r </label>
- <input id="group_write" type="checkbox" name="fdata[rights][group][write]" value="1"
- <?php echo ($TemplateData['editData']['rights']['group']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
- <label for="group_write">w </label>
- <input id="group_delete" type="checkbox" name="fdata[rights][group][delete]" value="1"
- <?php echo ($TemplateData['editData']['rights']['group']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
- <label for="group_delete">x </label>
- </td>
- <td>
- <input id="other_read" type="checkbox" name="fdata[rights][other][read]" value="1"
- <?php echo ($TemplateData['editData']['rights']['other']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
- <label for="other_read">r </label>
- <input id="other_write" type="checkbox" name="fdata[rights][other][write]" value="1"
- <?php echo ($TemplateData['editData']['rights']['other']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
- <label for="other_write">w </label>
- <input id="other_delete" type="checkbox" name="fdata[rights][other][delete]" value="1"
- <?php echo ($TemplateData['editData']['rights']['other']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
- <label for="other_delete">x </label>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <?php } ?>
- <?php if(!empty($TemplateData['editData']['_canDelete'])) { ?>
- <div class="field-row-stacked">
- <input id="doDelete" type="checkbox" name="fdata[doDelete]" value="1">
- <label for="doDelete"><?php echo $I18n->t('global.delete'); ?></label>
- </div>
- <?php } ?>
- <div class="field-row-stacked">
- <input type="submit" name="submitForm" value="<?php echo $I18n->t('global.save'); ?>">
- </div>
- </form>
- <?php } else { ?>
- <h3><?php echo $I18n->t('global.collection.select.notice'); ?></h3>
- <div class="sunken-panel">
- <table width="100%">
- <thead>
- <tr>
- <th width="100px"><?php echo $I18n->t('global.name'); ?></th>
- <th><?php echo $I18n->t('global.description'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($TemplateData['existingCollections'] as $k=>$v) { ?>
- <tr>
- <td><a href="index.php?p=manageentry&collection=<?php echo $k; ?>"><?php echo $v['name']; ?></a></td>
- <td><?php echo $v['description']; ?></td>
- <tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php } ?>
|