/osCommerce/OM/Core/Site/Admin/Application/product_types/pages/entries.php
PHP | 129 lines | 92 code | 28 blank | 9 comment | 6 complexity | 84444c44969067c7c4a896b827a35f15 MD5 | raw file
- <?php
- /*
- osCommerce Online Merchant $osCommerce-SIG$
- Copyright (c) 2009 osCommerce (http://www.oscommerce.com)
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License v2 (1991)
- as published by the Free Software Foundation.
- */
- ?>
- <h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
- <?php
- if ( $osC_MessageStack->exists($osC_Template->getModule()) ) {
- echo $osC_MessageStack->get($osC_Template->getModule());
- }
- ?>
- <div>
- <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>
- <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>
- </div>
- <div style="clear: right; padding: 10px;"></div>
- <div style="padding: 2px; height: 16px;">
- <span id="batchTotalPages"></span>
- <span id="batchPageLinks"></span>
- </div>
- <form name="batch" action="#" method="post">
- <table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="productTypesAssignmentsDataTable">
- <thead>
- <tr>
- <th><?php echo OSCOM::getDef('table_heading_actions'); ?></th>
- <th><?php echo OSCOM::getDef('table_heading_modules'); ?></th>
- <th width="150"><?php echo OSCOM::getDef('table_heading_action'); ?></th>
- <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <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>
- <th align="center" width="20"><?php echo osc_draw_checkbox_field('batchFlag', null, null, 'onclick="flagCheckboxes(this);"'); ?></th>
- </tr>
- </tfoot>
- <tbody>
- </tbody>
- </table>
- </form>
- <div style="padding: 2px;">
- <span id="dataTableLegend"><?php echo '<b>' . OSCOM::getDef('table_action_legend') . '</b> ' . osc_icon('edit.png') . ' ' . OSCOM::getDef('icon_edit') . ' ' . osc_icon('trash.png') . ' ' . OSCOM::getDef('icon_trash'); ?></span>
- <span id="batchPullDownMenu"></span>
- </div>
- <script type="text/javascript"><!--
- var moduleParamsCookieName = 'oscadmin_module_' + pageModule;
- var moduleParams = new Object();
- moduleParams.page = 1;
- moduleParams.search = '';
- if ( $.cookie(moduleParamsCookieName) != null ) {
- var p = $.secureEvalJSON($.cookie(moduleParamsCookieName));
- moduleParams.page = parseInt(p.page);
- moduleParams.search = String(p.search);
- }
- var dataTableName = 'productTypesAssignmentsDataTable';
- var dataTableDataURL = '<?php echo osc_href_link_admin('rpc.php', $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&action=getAllAssignments'); ?>';
- var entryEditLink = '<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&aID=ACTIONID&action=entry_save'); ?>';
- var entryEditLinkIcon = '<?php echo osc_icon('edit.png'); ?>';
- var entryDeleteLink = '<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '=' . (int)$_GET[$osC_Template->getModule()] . '&aID=ACTIONID&action=entry_delete'); ?>';
- var entryDeleteLinkIcon = '<?php echo osc_icon('trash.png'); ?>';
- var osC_DataTable = new osC_DataTable();
- osC_DataTable.load();
- function feedDataTable(data) {
- var rowCounter = 0;
- for ( var r in data.entries ) {
- var record = data.entries[r];
- var newRow = $('#' + dataTableName)[0].tBodies[0].insertRow(rowCounter);
- newRow.id = 'row' + record.action;
- $('#row' + record.action).mouseover( function() { $(this).addClass('mouseOver'); }).mouseout( function() { $(this).removeClass('mouseOver'); }).click(function(event) {
- if (event.target.type !== 'checkbox') {
- $(':checkbox', this).trigger('click');
- }
- }).css('cursor', 'pointer');
- var newCell = newRow.insertCell(0);
- newCell.innerHTML = htmlSpecialChars(record.action_title);
- newCell.style.verticalAlign = 'top';
- var modules_list = '';
- for ( var m in record.modules ) {
- var module = record.modules[m];
- modules_list += htmlSpecialChars(module.module_title) + '<br />';
- }
- newCell = newRow.insertCell(1);
- newCell.innerHTML = modules_list;
- newCell.style.verticalAlign = 'top';
- newCell = newRow.insertCell(2);
- newCell.innerHTML = '<a href="' + entryEditLink.replace('ACTIONID', htmlSpecialChars(record.action)) + '">' + entryEditLinkIcon + '</a> <a href="' + entryDeleteLink.replace('ACTIONID', htmlSpecialChars(record.action)) + '">' + entryDeleteLinkIcon + '</a>';
- newCell.align = 'right';
- newCell.style.verticalAlign = 'top';
- newCell = newRow.insertCell(3);
- newCell.innerHTML = '<input type="checkbox" name="batch[]" value="' + htmlSpecialChars(record.action) + '" id="batch' + htmlSpecialChars(record.action) + '" />';
- newCell.align = 'center';
- newCell.style.verticalAlign = 'top';
- rowCounter++;
- }
- }
- //--></script>