Просмотр файла htmly-2.9.8/system/admin/views/static-subpages.html.php

Размер файла: 2.75Kb
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <ul class="nav nav-tabs">
  3. <li class="nav-item">
  4. <a class="nav-link" aria-current="page" href="<?php echo $static->url;?>"><?php echo i18n('View');?></a>
  5. </li>
  6. <li class="nav-item">
  7. <a class="nav-link" href="<?php echo $static->url;?>/edit?destination=admin/pages"><?php echo i18n('Edit');?></a>
  8. </li>
  9. </ul>
  10. <br>
  11. <div>
  12. <h2 class="post-index"><?php echo $static->title ?></h2>
  13. <div><?php echo $static->description;?></div>
  14. </div>
  15. <br>
  16. <a class="btn btn-primary right" href="<?php echo $static->url;?>/add?destination=admin/pages/<?php echo $static->slug;?>"><?php echo i18n('Add_sub');?></a>
  17. <br><br>
  18. <script>
  19. $(function() {
  20. var order;
  21. $( "tbody" ).sortable({update: function(e, ui) {
  22. order = $(this).sortable('toArray');
  23. $("#saveButton").css({"display": "block"});
  24. }});
  25.  
  26. $("#saveButton").click(function(){
  27. $.ajax({
  28. type: 'POST',
  29. url: '<?php echo site_url();?>admin/pages/<?php echo $static->slug;?>',
  30. dataType: 'json',
  31. data: {'json': order},
  32. success: function (response) {
  33. alert(response.message);
  34. location.reload();
  35. },
  36. });
  37. });
  38. });
  39. </script>
  40. <?php $posts = find_subpage($p->slug);?>
  41. <?php if (!empty($posts)) { ?>
  42. <table class="table post-list">
  43. <thead>
  44. <tr class="head">
  45. <th><?php echo i18n('Title');?></th>
  46. <th><?php echo i18n('Description');?></th>
  47. <?php if (config("views.counter") == "true"): ?>
  48. <th><?php echo i18n('Views');?></th>
  49. <?php endif; ?>
  50. <th><?php echo i18n('Operations');?></th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <?php foreach ($posts as $sp): ?>
  55. <tr id="<?php echo $sp->parent;?>/<?php echo $sp->md;?>" style="cursor:move;">
  56. <td><a href="<?php echo $sp->url ?>"><?php echo $sp->title ?></a></td>
  57. <td><?php echo $sp->description;?></td>
  58. <?php if (config("views.counter") == "true"):?><td><?php echo $sp->views;?></td><?php endif;?>
  59. <td><span><a class="btn btn-primary btn-xs" href="<?php echo $sp->url;?>/edit?destination=admin/pages/<?php echo $static->slug;?>"><?php echo i18n('Edit');?></a> <a class="btn btn-danger btn-xs" href="<?php echo $sp->url;?>/delete?destination=admin/pages/<?php echo $static->slug;?>"><?php echo i18n('Delete');?></a></span></td>
  60. </tr>
  61. <?php endforeach; ?>
  62. </tbody>
  63. </table>
  64. <br>
  65. <button class="btn btn-primary" style="display:none" id="saveButton"><?php echo i18n('save_config');?></button>
  66. <?php } else {
  67. echo i18n('No_posts_found') . '!';
  68. } ?>