Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manage_custom_nav_elements.php 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <?php
  2. define('IN_SCRIPT', 1);
  3. define('HESK_PATH', '../');
  4. define('PAGE_TITLE', 'ADMIN_CUSTOM_NAV_ELEMENTS');
  5. define('MFH_PAGE_LAYOUT', 'TOP_ONLY');
  6. define('EXTRA_JS', '<script src="'.HESK_PATH.'internal-api/js/manage-custom-nav-elements.js"></script>');
  7. /* Get all the required files and functions */
  8. require(HESK_PATH . 'hesk_settings.inc.php');
  9. require(HESK_PATH . 'inc/common.inc.php');
  10. require(HESK_PATH . 'inc/admin_functions.inc.php');
  11. require(HESK_PATH . 'inc/mail_functions.inc.php');
  12. hesk_load_database_functions();
  13. hesk_session_start();
  14. hesk_dbConnect();
  15. hesk_isLoggedIn();
  16. //hesk_checkPermission('can_man_custom_nav');
  17. /* Print header */
  18. require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
  19. /* Print main manage users page */
  20. require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
  21. ?>
  22. <div class="content-wrapper">
  23. <section class="content">
  24. <div class="box">
  25. <div class="box-header with-border">
  26. <h1 class="box-title">
  27. <?php echo $hesklang['custom_nav_menu_elements']; ?>
  28. </h1>
  29. <div class="box-tools pull-right">
  30. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  31. <i class="fa fa-minus"></i>
  32. </button>
  33. </div>
  34. </div>
  35. <div class="box-body">
  36. <div class="row">
  37. <div class="col-md-12 text-right">
  38. <button id="create-button" class="btn btn-success">
  39. <i class="fa fa-plus-circle"></i>&nbsp;
  40. <?php echo $hesklang['create_new']; ?>
  41. </button>
  42. </div>
  43. <div class="col-md-12">
  44. <table class="table table-striped">
  45. <thead>
  46. <tr>
  47. <th><?php echo $hesklang['id']; ?></th>
  48. <th><?php echo $hesklang['custom_nav_text']; ?></th>
  49. <th><?php echo $hesklang['custom_nav_subtext']; ?></th>
  50. <th><?php echo $hesklang['image_url_slash_font_icon']; ?></th>
  51. <th><?php echo $hesklang['url']; ?></th>
  52. <th><?php echo $hesklang['actions']; ?></th>
  53. </tr>
  54. </thead>
  55. <tbody id="table-body">
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="overlay" id="overlay">
  62. <i class="fa fa-spinner fa-spin"></i>
  63. </div>
  64. </div>
  65. </section>
  66. </div>
  67. <div class="modal fade" id="nav-element-modal" tabindex="-1" role="dialog" style="overflow: hidden">
  68. <div class="modal-dialog modal-lg" role="document">
  69. <div class="modal-content">
  70. <div class="modal-header" style="cursor: move">
  71. <button type="button" class="close cancel-callback" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  72. <h4 class="modal-title" id="edit-label">
  73. <?php echo $hesklang['edit_custom_nav_element_title_case']; ?>
  74. </h4>
  75. <h4 class="modal-title" id="create-label">
  76. <?php echo $hesklang['create_custom_nav_element_title_case']; ?>
  77. </h4>
  78. </div>
  79. <form id="manage-nav-element" class="form-horizontal" data-toggle="validator">
  80. <input type="hidden" name="id">
  81. <div class="modal-body">
  82. <div class="row">
  83. <div class="col-md-12">
  84. <div class="form-group">
  85. <label for="place" class="col-md-4 col-sm-12 control-label">
  86. <?php echo $hesklang['place']; ?>
  87. <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
  88. title="<?php echo $hesklang['place']; ?>"
  89. data-content="<?php echo $hesklang['place_help']; ?>"></i>
  90. </label>
  91. <div class="col-md-8 col-sm-12">
  92. <select name="place" id="place" class="form-control"
  93. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  94. required>
  95. <option value="1"><?php echo $hesklang['homepage_block']; ?></option>
  96. <option value="2"><?php echo $hesklang['customer_navigation']; ?></option>
  97. <option value="3"><?php echo $hesklang['staff_navigation']; ?></option>
  98. </select>
  99. <div class="help-block with-errors"></div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="col-md-6 col-sm-12">
  106. <h4><?php echo $hesklang['custom_nav_text']; ?></h4>
  107. <?php foreach ($hesk_settings['languages'] as $language => $value): ?>
  108. <div class="form-group">
  109. <label for="text[<?php echo $language; ?>]" class="col-md-4 col-sm-12 control-label">
  110. <?php echo $language; ?>
  111. </label>
  112. <div class="col-md-8 col-sm-12">
  113. <input type="text" name="text" class="form-control"
  114. data-text-language="<?php echo $language; ?>"
  115. id="text[<?php echo $language; ?>" placeholder="<?php echo $hesklang['custom_nav_text']; ?>"
  116. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  117. required>
  118. <div class="help-block with-errors"></div>
  119. </div>
  120. </div>
  121. <?php endforeach; ?>
  122. <div id="subtext">
  123. <h4><?php echo $hesklang['custom_nav_subtext']; ?></h4>
  124. <?php foreach ($hesk_settings['languages'] as $language => $value): ?>
  125. <div class="form-group">
  126. <label for="subtext[<?php echo $language; ?>]" class="col-md-4 col-sm-12 control-label">
  127. <?php echo $language; ?>
  128. </label>
  129. <div class="col-md-8 col-sm-12">
  130. <input type="text" name="subtext" class="form-control"
  131. data-subtext-language="<?php echo $language; ?>"
  132. id="subtext[<?php echo $language; ?>" placeholder="<?php echo $hesklang['custom_nav_subtext']; ?>"
  133. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  134. required>
  135. <div class="help-block with-errors"></div>
  136. </div>
  137. </div>
  138. <?php endforeach; ?>
  139. </div>
  140. </div>
  141. <div class="col-md-6 col-sm-12">
  142. <h4><?php echo $hesklang['url']; ?></h4>
  143. <div class="form-group">
  144. <label for="image-type" class="col-md-4 col-sm-12 control-label">
  145. <?php echo $hesklang['url']; ?>
  146. <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
  147. title="<?php echo $hesklang['url']; ?>"
  148. data-content="<?php echo $hesklang['url_help']; ?>"></i>
  149. </label>
  150. <div class="col-md-8 col-sm-12">
  151. <input type="text" name="url" class="form-control"
  152. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  153. placeholder="<?php echo $hesklang['url']; ?>" required>
  154. <div class="help-block with-errors"></div>
  155. </div>
  156. </div>
  157. <h4><?php echo $hesklang['image']; ?></h4>
  158. <div class="form-group">
  159. <label for="image-type" class="col-md-4 col-sm-12 control-label"><?php echo $hesklang['image_type']; ?></label>
  160. <div class="col-md-8 col-sm-12">
  161. <select name="image-type" id="image-type" class="form-control"
  162. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  163. required>
  164. <option value="image-url"><?php echo $hesklang['image_url']; ?></option>
  165. <option value="font-icon"><?php echo $hesklang['font_icon']; ?></option>
  166. </select>
  167. <div class="help-block with-errors"></div>
  168. </div>
  169. </div>
  170. <div class="form-group" id="image-url-group">
  171. <label for="image-url" class="col-md-4 col-sm-12 control-label">
  172. <?php echo $hesklang['image_url']; ?>
  173. <i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
  174. title="<?php echo $hesklang['image_url']; ?>"
  175. data-content="<?php echo $hesklang['image_url_help']; ?>"></i>
  176. </label>
  177. <div class="col-md-8 col-sm-12">
  178. <input type="text" name="image-url" class="form-control"
  179. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  180. placeholder="<?php echo $hesklang['image_url']; ?>" required>
  181. <div class="help-block with-errors"></div>
  182. </div>
  183. </div>
  184. <div class="form-group" id="font-icon-group">
  185. <p style="display:none" id="no-icon"><?php echo $hesklang['sm_no_icon']; ?></p>
  186. <p style="display:none" id="search-icon"><?php echo $hesklang['sm_search_icon']; ?></p>
  187. <p style="display:none"
  188. id="footer-icon"><?php echo $hesklang['sm_iconpicker_footer_label']; ?></p>
  189. <label for="font-icon" class="col-md-4 col-sm-12 control-label"><?php echo $hesklang['font_icon']; ?></label>
  190. <div class="col-md-8 col-sm-12">
  191. <div class="btn btn-default iconpicker-container" data-toggle="nav-iconpicker">
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="modal-footer">
  199. <div class="btn-group" id="action-buttons">
  200. <button type="button" class="btn btn-default cancel-button" data-dismiss="modal">
  201. <i class="fa fa-times-circle"></i>
  202. <span><?php echo $hesklang['cancel']; ?></span>
  203. </button>
  204. <button type="submit" class="btn btn-success save-button">
  205. <i class="fa fa-check-circle"></i>
  206. <span><?php echo $hesklang['save']; ?></span>
  207. </button>
  208. </div>
  209. </div>
  210. </form>
  211. </div>
  212. </div>
  213. </div>
  214. <?php
  215. echo mfh_get_hidden_fields_for_language(
  216. array(
  217. 'edit',
  218. 'delete',
  219. 'no_custom_nav_elements_found',
  220. 'failed_to_load_custom_nav_elements',
  221. 'custom_nav_element_deleted',
  222. 'error_deleting_custom_nav_element',
  223. 'error_sorting_custom_nav_elements',
  224. 'custom_nav_element_created',
  225. 'custom_nav_element_saved',
  226. 'homepage_block',
  227. 'customer_navigation',
  228. 'staff_navigation',
  229. 'error_saving_custom_nav_element',
  230. )
  231. );
  232. ?>
  233. <script type="text/html" id="nav-element-template">
  234. <tr>
  235. <td><span data-property="id" data-value="x"></span></td>
  236. <td><span>
  237. <ul data-property="text" class="list-unstyled"></ul>
  238. </span></td>
  239. <td><span>
  240. <ul data-property="subtext" class="list-unstyled"></ul>
  241. </span></td>
  242. <td><span data-property="image-or-font"></span></td>
  243. <td><span data-property="url"></span></td>
  244. <td>
  245. <a href="#" data-action="sort"
  246. data-direction="up">
  247. <i class="fa fa-fw fa-arrow-up icon-link green"
  248. data-toggle="tooltip" title="<?php echo $hesklang['move_up']; ?>"></i>
  249. </a>
  250. <a href="#" data-action="sort"
  251. data-direction="down">
  252. <i class="fa fa-fw fa-arrow-down icon-link green"
  253. data-toggle="tooltip" title="<?php echo $hesklang['move_dn'] ?>"></i>
  254. </a>
  255. <a href="#" data-action="edit">
  256. <i class="fa fa-fw fa-pencil icon-link orange"
  257. data-toggle="tooltip" title="<?php echo $hesklang['edit']; ?>"></i>
  258. </a>
  259. <a href="#" data-action="delete">
  260. <i class="fa fa-fw fa-times icon-link red"
  261. data-toggle="tooltip" title="<?php echo $hesklang['delete']; ?>"></i>
  262. </a>
  263. </td>
  264. </tr>
  265. </script>
  266. <?php
  267. require_once(HESK_PATH . 'inc/footer.inc.php');