/admin/view/template/module/slideshow.tpl

https://github.com/smadi/arabian-land · Smarty Template · 141 lines · 138 code · 3 blank · 0 comment · 22 complexity · 0a71333e922059a795bf3bba38d7b490 MD5 · raw file

  1. <?php echo $header; ?>
  2. <div id="content">
  3. <div class="breadcrumb">
  4. <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  5. <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  6. <?php } ?>
  7. </div>
  8. <?php if ($error_warning) { ?>
  9. <div class="warning"><?php echo $error_warning; ?></div>
  10. <?php } ?>
  11. <div class="box">
  12. <div class="heading">
  13. <h1><img src="view/image/module.png" alt="" /> <?php echo $heading_title; ?></h1>
  14. <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  15. </div>
  16. <div class="content">
  17. <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
  18. <table id="module" class="list">
  19. <thead>
  20. <tr>
  21. <td class="left"><?php echo $entry_banner; ?></td>
  22. <td class="left"><?php echo $entry_dimension; ?></td>
  23. <td class="left"><?php echo $entry_layout; ?></td>
  24. <td class="left"><?php echo $entry_position; ?></td>
  25. <td class="left"><?php echo $entry_status; ?></td>
  26. <td class="right"><?php echo $entry_sort_order; ?></td>
  27. <td></td>
  28. </tr>
  29. </thead>
  30. <?php $module_row = 0; ?>
  31. <?php foreach ($modules as $module) { ?>
  32. <tbody id="module-row<?php echo $module_row; ?>">
  33. <tr>
  34. <td class="left"><select name="slideshow_module[<?php echo $module_row; ?>][banner_id]">
  35. <?php foreach ($banners as $banner) { ?>
  36. <?php if ($banner['banner_id'] == $module['banner_id']) { ?>
  37. <option value="<?php echo $banner['banner_id']; ?>" selected="selected"><?php echo $banner['name']; ?></option>
  38. <?php } else { ?>
  39. <option value="<?php echo $banner['banner_id']; ?>"><?php echo $banner['name']; ?></option>
  40. <?php } ?>
  41. <?php } ?>
  42. </select></td>
  43. <td class="left"><input type="text" name="slideshow_module[<?php echo $module_row; ?>][width]" value="<?php echo $module['width']; ?>" size="3" />
  44. <input type="text" name="slideshow_module[<?php echo $module_row; ?>][height]" value="<?php echo $module['height']; ?>" size="3"/>
  45. <?php if (isset($error_dimension[$module_row])) { ?>
  46. <span class="error"><?php echo $error_dimension[$module_row]; ?></span>
  47. <?php } ?></td>
  48. <td class="left"><select name="slideshow_module[<?php echo $module_row; ?>][layout_id]">
  49. <?php foreach ($layouts as $layout) { ?>
  50. <?php if ($layout['layout_id'] == $module['layout_id']) { ?>
  51. <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
  52. <?php } else { ?>
  53. <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
  54. <?php } ?>
  55. <?php } ?>
  56. </select></td>
  57. <td class="left"><select name="slideshow_module[<?php echo $module_row; ?>][position]">
  58. <?php if ($module['position'] == 'content_top') { ?>
  59. <option value="content_top" selected="selected"><?php echo $text_content_top; ?></option>
  60. <?php } else { ?>
  61. <option value="content_top"><?php echo $text_content_top; ?></option>
  62. <?php } ?>
  63. <?php if ($module['position'] == 'content_bottom') { ?>
  64. <option value="content_bottom" selected="selected"><?php echo $text_content_bottom; ?></option>
  65. <?php } else { ?>
  66. <option value="content_bottom"><?php echo $text_content_bottom; ?></option>
  67. <?php } ?>
  68. <?php if ($module['position'] == 'column_left') { ?>
  69. <option value="column_left" selected="selected"><?php echo $text_column_left; ?></option>
  70. <?php } else { ?>
  71. <option value="column_left"><?php echo $text_column_left; ?></option>
  72. <?php } ?>
  73. <?php if ($module['position'] == 'column_right') { ?>
  74. <option value="column_right" selected="selected"><?php echo $text_column_right; ?></option>
  75. <?php } else { ?>
  76. <option value="column_right"><?php echo $text_column_right; ?></option>
  77. <?php } ?>
  78. </select></td>
  79. <td class="left"><select name="slideshow_module[<?php echo $module_row; ?>][status]">
  80. <?php if ($module['status']) { ?>
  81. <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
  82. <option value="0"><?php echo $text_disabled; ?></option>
  83. <?php } else { ?>
  84. <option value="1"><?php echo $text_enabled; ?></option>
  85. <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
  86. <?php } ?>
  87. </select></td>
  88. <td class="right"><input type="text" name="slideshow_module[<?php echo $module_row; ?>][sort_order]" value="<?php echo $module['sort_order']; ?>" size="3" /></td>
  89. <td class="left"><a onclick="$('#module-row<?php echo $module_row; ?>').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>
  90. </tr>
  91. </tbody>
  92. <?php $module_row++; ?>
  93. <?php } ?>
  94. <tfoot>
  95. <tr>
  96. <td colspan="6"></td>
  97. <td class="left"><a onclick="addModule();" class="button"><span><?php echo $button_add_module; ?></span></a></td>
  98. </tr>
  99. </tfoot>
  100. </table>
  101. </form>
  102. </div>
  103. </div>
  104. <script type="text/javascript"><!--
  105. var module_row = <?php echo $module_row; ?>;
  106. function addModule() {
  107. html = '<tbody id="module-row' + module_row + '">';
  108. html += ' <tr>';
  109. html += ' <td class="left"><select name="slideshow_module[' + module_row + '][banner_id]">';
  110. <?php foreach ($banners as $banner) { ?>
  111. html += ' <option value="<?php echo $banner['banner_id']; ?>"><?php echo addslashes($banner['name']); ?></option>';
  112. <?php } ?>
  113. html += ' </select></td>';
  114. html += ' <td class="left"><input type="text" name="slideshow_module[' + module_row + '][width]" value="" size="3" /> <input type="text" name="slideshow_module[' + module_row + '][height]" value="" size="3" /></td>';
  115. html += ' <td class="left"><select name="slideshow_module[' + module_row + '][layout_id]">';
  116. <?php foreach ($layouts as $layout) { ?>
  117. html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
  118. <?php } ?>
  119. html += ' </select></td>';
  120. html += ' <td class="left"><select name="slideshow_module[' + module_row + '][position]">';
  121. html += ' <option value="content_top"><?php echo $text_content_top; ?></option>';
  122. html += ' <option value="content_bottom"><?php echo $text_content_bottom; ?></option>';
  123. html += ' <option value="column_left"><?php echo $text_column_left; ?></option>';
  124. html += ' <option value="column_right"><?php echo $text_column_right; ?></option>';
  125. html += ' </select></td>';
  126. html += ' <td class="left"><select name="slideshow_module[' + module_row + '][status]">';
  127. html += ' <option value="1" selected="selected"><?php echo $text_enabled; ?></option>';
  128. html += ' <option value="0"><?php echo $text_disabled; ?></option>';
  129. html += ' </select></td>';
  130. html += ' <td class="right"><input type="text" name="slideshow_module[' + module_row + '][sort_order]" value="" size="3" /></td>';
  131. html += ' <td class="left"><a onclick="$(\'#module-row' + module_row + '\').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>';
  132. html += ' </tr>';
  133. html += '</tbody>';
  134. $('#module tfoot').before(html);
  135. module_row++;
  136. }
  137. //--></script>
  138. <?php echo $footer; ?>