manageentry.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. if(!empty($TemplateData['editFields'])) {
  3. $_entry = '';
  4. if(!empty($TemplateData['editData']) && isset($TemplateData['editData']['id'])) {
  5. $_entry = $TemplateData['editData']['id'];
  6. ?>
  7. <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>
  8. <p>
  9. <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>
  10. </p>
  11. <?php if(!empty($TemplateData['possibleDuplicates'])) { ?>
  12. <?php echo $I18n->t('manageentry.possibleduplicate'); ?>
  13. <ul>
  14. <?php
  15. foreach($TemplateData['possibleDuplicates'] as $key=>$entry) {
  16. echo '<li><a href="index.php?p=entry&collection='.$TemplateData['loadedCollection']['id'].'&id='.$entry['id'].'" target="_blank">'.$entry['title'].'</a></li>';
  17. }
  18. ?>
  19. </ul>
  20. <?php } ?>
  21. <?php } else { ?>
  22. <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>
  23. <?php } ?>
  24. <?php if(!empty($TemplateData['availableTools'])) { ?>
  25. <h4><?php echo $I18n->t('manageentry.availabletools'); ?></h4>
  26. <ul>
  27. <?php foreach($TemplateData['availableTools'] as $tool) { ?>
  28. <li><a href="index.php?p=tool&t=<?php echo $tool['action']; ?>&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>&id=<?php echo $_entry; ?>"
  29. target="<?php echo $tool['target']; ?>"><?php echo $tool['name']; ?> (<?php echo $tool['description']; ?>)</a></li>
  30. <?php } ?>
  31. </ul>
  32. <?php } ?>
  33. <script type="text/javascript" src="view/98/ui/js/suggest-tag.js"></script>
  34. <form class="maxSizeForm" method="post" enctype="multipart/form-data">
  35. <?php
  36. foreach($TemplateData['editFields'] as $field) {
  37. $_editFieldView = Summoner::themefile('manageentry/field-'.$field['type'].'.html', UI_THEME);
  38. if(file_exists($_editFieldView)) {
  39. require $_editFieldView;
  40. }
  41. else {
  42. require $TemplateData['_editFieldViewDefault'];
  43. }
  44. }
  45. if(!empty($TemplateData['editData']['_isOwner'])) {
  46. ?>
  47. <div class="field-row-stacked">
  48. <label><?php echo $I18n->t('global.rights'); ?> *</label>
  49. <table>
  50. <thead>
  51. <tr>
  52. <th><?php echo $I18n->t('global.user'); ?></th>
  53. <th><?php echo $I18n->t('global.group'); ?></th>
  54. <th><?php echo $I18n->t('global.other'); ?></th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <tr>
  59. <td>
  60. <input id="user_read" type="checkbox" name="fdata[rights][user][read]" value="1"
  61. <?php echo ($TemplateData['editData']['rights']['user']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
  62. <label for="user_read">r &nbsp; &nbsp; &nbsp;</label>
  63. <input id="user_write" type="checkbox" name="fdata[rights][user][write]" value="1"
  64. <?php echo ($TemplateData['editData']['rights']['user']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
  65. <label for="user_write">w &nbsp; &nbsp; &nbsp;</label>
  66. <input id="user_delete" type="checkbox" name="fdata[rights][user][delete]" value="1"
  67. <?php echo ($TemplateData['editData']['rights']['user']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
  68. <label for="user_delete">x &nbsp; &nbsp; &nbsp;</label>
  69. </td>
  70. <td>
  71. <input id="group_read" type="checkbox" name="fdata[rights][group][read]" value="1"
  72. <?php echo ($TemplateData['editData']['rights']['group']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
  73. <label for="group_read">r &nbsp; &nbsp; &nbsp;</label>
  74. <input id="group_write" type="checkbox" name="fdata[rights][group][write]" value="1"
  75. <?php echo ($TemplateData['editData']['rights']['group']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
  76. <label for="group_write">w &nbsp; &nbsp; &nbsp;</label>
  77. <input id="group_delete" type="checkbox" name="fdata[rights][group][delete]" value="1"
  78. <?php echo ($TemplateData['editData']['rights']['group']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
  79. <label for="group_delete">x &nbsp; &nbsp; &nbsp;</label>
  80. </td>
  81. <td>
  82. <input id="other_read" type="checkbox" name="fdata[rights][other][read]" value="1"
  83. <?php echo ($TemplateData['editData']['rights']['other']['read'] ?? '') == 'r' ? "checked" : ""; ?>>
  84. <label for="other_read">r &nbsp; &nbsp; &nbsp;</label>
  85. <input id="other_write" type="checkbox" name="fdata[rights][other][write]" value="1"
  86. <?php echo ($TemplateData['editData']['rights']['other']['write'] ?? '') == 'w' ? "checked" : ""; ?>>
  87. <label for="other_write">w &nbsp; &nbsp; &nbsp;</label>
  88. <input id="other_delete" type="checkbox" name="fdata[rights][other][delete]" value="1"
  89. <?php echo ($TemplateData['editData']['rights']['other']['delete'] ?? '') == 'x' ? "checked" : ""; ?>>
  90. <label for="other_delete">x &nbsp; &nbsp; &nbsp;</label>
  91. </td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. </div>
  96. <?php } ?>
  97. <?php if(!empty($TemplateData['editData']['_canDelete'])) { ?>
  98. <div class="field-row-stacked">
  99. <input id="doDelete" type="checkbox" name="fdata[doDelete]" value="1">
  100. <label for="doDelete"><?php echo $I18n->t('global.delete'); ?></label>
  101. </div>
  102. <?php } ?>
  103. <div class="field-row-stacked">
  104. <input type="submit" name="submitForm" value="<?php echo $I18n->t('global.save'); ?>">
  105. </div>
  106. </form>
  107. <?php } else { ?>
  108. <h3><?php echo $I18n->t('global.collection.select.notice'); ?></h3>
  109. <div class="sunken-panel">
  110. <table width="100%">
  111. <thead>
  112. <tr>
  113. <th width="100px"><?php echo $I18n->t('global.name'); ?></th>
  114. <th><?php echo $I18n->t('global.description'); ?></th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <?php foreach($TemplateData['existingCollections'] as $k=>$v) { ?>
  119. <tr>
  120. <td><a href="index.php?p=manageentry&collection=<?php echo $k; ?>"><?php echo $v['name']; ?></a></td>
  121. <td><?php echo $v['description']; ?></td>
  122. <tr>
  123. <?php } ?>
  124. </tbody>
  125. </table>
  126. </div>
  127. <?php } ?>