form.edit.item.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. $ic = 'item-edit-input'; //input class.
  3. require('inc/json.item.icons.php');
  4. $exclude_debug_fieldlist = [
  5. 'icon','id','name','item_type','description',
  6. 'lore' ,'lore_equip' ,'stacklore' ,'temporary' ,
  7. 'artifact' ,'notrade' ,'nodestroy' ,'show_name',
  8. 'crafted','attuneable','heirloom','nozone','norepair',
  9. 'good_only','evil_only','novalue','ornate','etheral',
  10. 'appearance_only','reforged','refined','usable',
  11. 'collectable','tier','count','weight','slots'
  12. ];
  13. ?>
  14. <div class="row">
  15. <!-- Item Editor Controls -->
  16. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2 text-right">
  17. <button class="btn btn-md btn-default mr-2 item-save">
  18. <i class="fas fa-save text-success"></i> Save Changes <small>(CTRL+S)</small>
  19. </button>
  20. <button class="btn btn-md btn-warning mr-2 item-dupe">
  21. <i class="fad fa-copy"></i> Duplicate Item <small>(CTRL+D)</small>
  22. </button>
  23. <button class="btn btn-md btn-default item-del">
  24. <i class="fad fa-trash-alt text-danger"></i> Delete Item <small>(DEL)</small>
  25. </button>
  26. </div>
  27. <!-- Item Editor Controls -->
  28. <!-- Item Icon Edit -->
  29. <div class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 text-center">
  30. <div class="edit-item-ico-ctn">
  31. <img class="edit-item-ico vm" src="img/eq2/items/<?php echo $item['icon']; ?>.png"/>
  32. <br/>
  33. <small><strong>Icon ID</strong>: <?php echo $item['icon']; ?></small>
  34. </div>
  35. <button class="btn btn-xs btn-default ico-picker-btn">Icon Picker</button>
  36. </div>
  37. <!-- Item Icon Edit -->
  38. <!-- Item Basic Details -->
  39. <div class="col-xs-8 col-sm-9 col-md-9 col-lg-9 col-xl-10">
  40. <div class="row">
  41. <div class="col-sm-12 col-xl-12">
  42. <?php echo build_edit_input(['field'=>'name','value'=>$item['name'],'id'=>$item['id'],'title'=>'Name','icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']); ?>
  43. </div>
  44. <div class="col-sm-6 col-xl-6">
  45. <?php echo build_edit_input(['field'=>'icon','value'=>$item['icon'],'id'=>$item['id'],'title'=>'Icon ID','icon'=>'fad fa-images','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter icon id ...', 'type'=>'number']); ?>
  46. </div>
  47. <div class="col-sm-6 col-xl-6">
  48. <?php echo build_edit_input(['field'=>'item_type','value'=>$item['item_type'],'id'=>$item['id'],'title'=>'Item Type','icon'=>'fad fa-disease','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'select', 'options'=>$itemCategories]); ?>
  49. </div>
  50. </div>
  51. </div>
  52. <!-- Item Basic Details -->
  53. </div>
  54. <!-- Description Row -->
  55. <div class="col-xl-12">
  56. <?php echo build_edit_input(['field'=>'description','value'=>$item['description'],'id'=>$item['id'],'title'=>'Description','icon'=>'fad fa-file-signature','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an item description ...', 'field_type'=>'textarea']); ?>
  57. </div>
  58. <!-- Description Row -->
  59. <div class="col-xl-12">
  60. <div class="row">
  61. <!-- Stats & Reqs Panel -->
  62. <div class="col-xs-7 col-sm-7 col-md-7 col-lg-7 col-xl-7">
  63. <!-- Requirements -->
  64. <div id="itemeditor-props" class="panel">
  65. <div class="panel-hdr text-primary">
  66. <h2>
  67. <span class="icon-stack fs-xxl mr-2">
  68. <i class="base base-7 icon-stack-2x opacity-100 color-info-500"></i>
  69. <i class="fas fa-vial icon-stack-1x opacity-100 color-white"></i>
  70. </span>
  71. Requirements
  72. </h2>
  73. </div>
  74. <div class="panel-container show" style="">
  75. <div class="panel-content">
  76. <div class="row">
  77. Use get_skills function to populate skill requirements.
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- Stats -->
  83. <div id="itemeditor-props" class="panel">
  84. <div class="panel-hdr text-primary">
  85. <h2>
  86. <span class="icon-stack fs-xxl mr-2">
  87. <i class="base base-7 icon-stack-2x opacity-100 color-info-500"></i>
  88. <i class="fas fa-vial icon-stack-1x opacity-100 color-white"></i>
  89. </span>
  90. Stats
  91. </h2>
  92. </div>
  93. <div class="panel-container show" style="">
  94. <div class="panel-content">
  95. <div class="row">
  96. <div class="col-xl-12"><h1><small>Add item stats here</small><hr></hr></h1></div>
  97. <div class="col-xl-6">
  98. <?php echo build_edit_input(['field'=>'tier','value'=>$item['tier'],'id'=>$item['id'],'title'=>'Tier','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
  99. </div>
  100. <div class="col-xl-6">
  101. <?php echo build_edit_input(['field'=>'count','value'=>$item['count'],'id'=>$item['id'],'title'=>'Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
  102. </div>
  103. <div class="col-xl-6">
  104. <?php echo build_edit_input(['field'=>'weight','value'=>$item['weight'],'id'=>$item['id'],'title'=>'Weight','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
  105. </div>
  106. <div class="col-xl-6">
  107. <?php echo build_edit_input(['field'=>'stack_count','value'=>$item['stack_count'],'id'=>$item['id'],'title'=>'Stack Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Stack count (int)','type'=>'number']); ?>
  108. </div>
  109. <div class="col-xl-6">
  110. <?php echo build_edit_input(['field'=>'slots','value'=>$item['slots'],'id'=>$item['id'],'title'=>'Slots','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Slots (int)','type'=>'number']); ?>
  111. </div>
  112. </div>
  113. </div> <!-- fas fa-toilet-paper, fas fa-book-spells -->
  114. </div>
  115. </div>
  116. </div>
  117. <!-- Item Properties Panel -->
  118. <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5 col-xl-5">
  119. <div id="itemeditor-props" class="panel">
  120. <div class="panel-hdr text-primary">
  121. <h2>
  122. <span class="icon-stack fs-xxl mr-2">
  123. <i class="base base-7 icon-stack-2x opacity-100 color-primary-500"></i>
  124. <i class="fas fa-flag icon-stack-1x opacity-100 color-white"></i>
  125. </span>
  126. Flags
  127. </span>
  128. </h2>
  129. </div>
  130. <div class="panel-container show" style="">
  131. <div class="panel-content">
  132. <div class="row">
  133. <?php
  134. $_switches = [
  135. 'lore' => ['title'=>'Lore', 'ico'=>''],
  136. 'lore_equip' => ['title'=>'Lore Equip', 'ico'=>''],
  137. 'stacklore' => ['title'=>'Stack Lore', 'ico'=>''],
  138. 'temporary' => ['title'=>'Temporary', 'ico'=>''],
  139. 'artifact' => ['title'=>'Artifact', 'ico'=>''],
  140. 'notrade' => ['title'=>'Untradable', 'ico'=>''],
  141. 'nodestroy' => ['title'=>'Indestructible', 'ico'=>''],
  142. 'show_name' => ['title'=>'Show Name', 'ico'=>''],
  143. 'crafted' => ['title'=>'Crafted', 'ico'=>''],
  144. 'attuneable' => ['title'=>'Attuneable', 'ico'=>''],
  145. 'heirloom' => ['title'=>'Heirloom', 'ico'=>''],
  146. 'nozone' => ['title'=>'No Zone', 'ico'=>''],
  147. 'norepair' => ['title'=>'No Repair', 'ico'=>''],
  148. 'good_only' => ['title'=>'Good Only', 'ico'=>''],
  149. 'evil_only' => ['title'=>'Evil Only', 'ico'=>''],
  150. 'novalue' => ['title'=>'No Value', 'ico'=>''],
  151. 'ornate' => ['title'=>'Ornate', 'ico'=>''],
  152. 'etheral' => ['title'=>'Etheral', 'ico'=>''],
  153. 'appearance_only' => ['title'=>'Appearance Only', 'ico'=>''],
  154. 'reforged' => ['title'=>'Reforged', 'ico'=>''],
  155. 'refined' => ['title'=>'Refined', 'ico'=>''],
  156. 'usable' => ['title'=>'Usable', 'ico'=>''],
  157. 'collectable' => ['title'=>'Collectable', 'ico'=>'']
  158. ];
  159. foreach($_switches as $k => $v) {
  160. echo '
  161. <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
  162. '.build_edit_input(['field'=>$k,'value'=>$item[$k],'icon'=>$v['ico'],'title'=>$v['title'],'id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']).'
  163. </div>';
  164. }
  165. ?>
  166. </div>
  167. </div> <!-- fas fa-toilet-paper, fas fa-book-spells -->
  168. </div>
  169. </div>
  170. </div>
  171. <!-- Properties Panel -->
  172. </div>
  173. </div>