PageRenderTime 25ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/osCommerce/OM/Core/Site/Admin/Application/product_types/pages/entries.php

http://github.com/osCommerce/oscommerce
PHP | 129 lines | 92 code | 28 blank | 9 comment | 6 complexity | 84444c44969067c7c4a896b827a35f15 MD5 | raw file
  1. <?php
  2. /*
  3. osCommerce Online Merchant $osCommerce-SIG$
  4. Copyright (c) 2009 osCommerce (http://www.oscommerce.com)
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License v2 (1991)
  7. as published by the Free Software Foundation.
  8. */
  9. ?>
  10. <h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
  11. <?php
  12. if ( $osC_MessageStack->exists($osC_Template->getModule()) ) {
  13. echo $osC_MessageStack->get($osC_Template->getModule());
  14. }
  15. ?>
  16. <div>
  17. <span style="float: left;"><form id="liveSearchForm"><input type="text" id="liveSearchField" name="search" class="searchField fieldTitleAsDefault" title="Search.." /><?php echo osc_draw_button(array('type' => 'button', 'params' => 'onclick="osC_DataTable.reset();"', 'title' => 'Reset')); ?></form></span>
  18. <span style="float: right;"><?php echo osc_draw_button(array('href' => osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))) . ' ' . osc_draw_button(array('href' => osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . $_GET[$osC_Template->getModule()] . '&action=entry_save'), 'icon' => 'plus', 'title' => OSCOM::getDef('button_insert'))); ?></span>
  19. </div>
  20. <div style="clear: right; padding: 10px;"></div>
  21. <div style="padding: 2px; height: 16px;">
  22. <span id="batchTotalPages"></span>
  23. <span id="batchPageLinks"></span>
  24. </div>
  25. <form name="batch" action="#" method="post">
  26. <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="productTypesAssignmentsDataTable">
  27. <thead>
  28. <tr>
  29. <th><?php echo OSCOM::getDef('table_heading_actions'); ?></th>
  30. <th><?php echo OSCOM::getDef('table_heading_modules'); ?></th>
  31. <th width="150"><?php echo OSCOM::getDef('table_heading_action'); ?></th>
  32. <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th>
  33. </tr>
  34. </thead>
  35. <tfoot>
  36. <tr>
  37. <th align="right" colspan="3"><?php echo '<input type="image" src="' . osc_icon_raw('trash.png') . '" title="' . OSCOM::getDef('icon_trash') . '" onclick="document.batch.action=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . $_GET[$osC_Template->getModule()] . '&action=batch_delete_entries') . '\';" />'; ?></th>
  38. <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th>
  39. </tr>
  40. </tfoot>
  41. <tbody>
  42. </tbody>
  43. </table>
  44. </form>
  45. <div style="padding: 2px;">
  46. <span id="dataTableLegend"><?php echo '<b>' . OSCOM::getDef('table_action_legend') . '</b> ' . osc_icon('edit.png') . '&nbsp;' . OSCOM::getDef('icon_edit') . '&nbsp;&nbsp;' . osc_icon('trash.png') . '&nbsp;' . OSCOM::getDef('icon_trash'); ?></span>
  47. <span id="batchPullDownMenu"></span>
  48. </div>
  49. <script type="text/javascript"><!--
  50. var moduleParamsCookieName = 'oscadmin_module_' + pageModule;
  51. var moduleParams = new Object();
  52. moduleParams.page = 1;
  53. moduleParams.search = '';
  54. if ( $.cookie(moduleParamsCookieName) != null ) {
  55. var p = $.secureEvalJSON($.cookie(moduleParamsCookieName));
  56. moduleParams.page = parseInt(p.page);
  57. moduleParams.search = String(p.search);
  58. }
  59. var dataTableName = 'productTypesAssignmentsDataTable';
  60. var dataTableDataURL = '<?php echo osc_href_link_admin('rpc.php', $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&action=getAllAssignments'); ?>';
  61. var entryEditLink = '<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&aID=ACTIONID&action=entry_save'); ?>';
  62. var entryEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
  63. var entryDeleteLink = '<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&aID=ACTIONID&action=entry_delete'); ?>';
  64. var entryDeleteLinkIcon = '<?php echo osc_icon('trash.png'); ?>';
  65. var osC_DataTable = new osC_DataTable();
  66. osC_DataTable.load();
  67. function feedDataTable(data) {
  68. var rowCounter = 0;
  69. for ( var r in data.entries ) {
  70. var record = data.entries[r];
  71. var newRow = $('#' + dataTableName)[0].tBodies[0].insertRow(rowCounter);
  72. newRow.id = 'row' + record.action;
  73. $('#row' + record.action).mouseover( function() { $(this).addClass('mouseOver'); }).mouseout( function() { $(this).removeClass('mouseOver'); }).click(function(event) {
  74. if (event.target.type !== 'checkbox') {
  75. $(':checkbox', this).trigger('click');
  76. }
  77. }).css('cursor', 'pointer');
  78. var newCell = newRow.insertCell(0);
  79. newCell.innerHTML = htmlSpecialChars(record.action_title);
  80. newCell.style.verticalAlign = 'top';
  81. var modules_list = '';
  82. for ( var m in record.modules ) {
  83. var module = record.modules[m];
  84. modules_list += htmlSpecialChars(module.module_title) + '<br />';
  85. }
  86. newCell = newRow.insertCell(1);
  87. newCell.innerHTML = modules_list;
  88. newCell.style.verticalAlign = 'top';
  89. newCell = newRow.insertCell(2);
  90. newCell.innerHTML = '<a href="' + entryEditLink.replace('ACTIONID', htmlSpecialChars(record.action)) + '">' + entryEditLinkIcon + '</a>&nbsp;<a href="' + entryDeleteLink.replace('ACTIONID', htmlSpecialChars(record.action)) + '">' + entryDeleteLinkIcon + '</a>';
  91. newCell.align = 'right';
  92. newCell.style.verticalAlign = 'top';
  93. newCell = newRow.insertCell(3);
  94. newCell.innerHTML = '<input type="checkbox" name="batch[]" value="' + htmlSpecialChars(record.action) + '" id="batch' + htmlSpecialChars(record.action) + '" />';
  95. newCell.align = 'center';
  96. newCell.style.verticalAlign = 'top';
  97. rowCounter++;
  98. }
  99. }
  100. //--></script>