Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #990 from gburton/1.0.7.5
Browse files Browse the repository at this point in the history
1.0.7.5
  • Loading branch information
gburton authored Jul 4, 2020
2 parents c3e9d27 + bbf8576 commit 8c36429
Show file tree
Hide file tree
Showing 38 changed files with 287 additions and 408 deletions.
15 changes: 9 additions & 6 deletions admin/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
} else {
require 'includes/functions/password_funcs.php';
}
$customer_data->update($customer_details, ['id' => $customer_details['id']]);

$customer_data->update($customer_details, [
'id' => $customer_details['id'],
'address_book_id' => (int)$_POST['default_address_id'],
]);
tep_db_query("UPDATE customers_info SET customers_info_date_account_last_modified = NOW() WHERE customers_info_id = " . (int)$customer_details['id']);

$OSCOM_Hooks->call('customers', 'updateAction');
Expand Down Expand Up @@ -89,7 +93,9 @@
</div>
<div class="col text-right align-self-center">
<?php
if (!isset($_GET['action'])) {
if (isset($_GET['action'])) {
echo tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('customers.php', tep_get_all_get_params(['action'])), null, null, 'btn-light');
} else {
echo tep_draw_form('search', 'customers.php', '', 'get');
echo '<div class="input-group">';
echo '<div class="input-group-prepend">';
Expand All @@ -100,9 +106,6 @@
echo tep_hide_session_id();
echo '</form>';
}
else {
echo tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('customers.php', tep_get_all_get_params(array('action'))), null, null, 'btn-light');
}
?>
</div>
</div>
Expand All @@ -112,7 +115,7 @@
$hooks =& $OSCOM_Hooks;
$oscTemplate = new oscTemplate();
echo tep_draw_form('customers', 'customers.php', tep_get_all_get_params(['action']) . 'action=update', 'post');
echo tep_draw_hidden_field('default_address_id', $customer_data->get('address_id', $customer_details));
echo tep_draw_hidden_field('default_address_id', $customer_data->get('default_address_id', $customer_details));

$cwd = getcwd();
chdir(DIR_FS_CATALOG);
Expand Down
13 changes: 8 additions & 5 deletions admin/includes/classes/box.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@

class box extends tableBlock {

//private $this->heading = [];
//private $this->contents = [];

function infoBox($heading, $contents) {
if (is_array($heading)) {
$heading = $heading[0]['text'];
}
$parameters = ['heading' => &$heading, 'contents' => &$contents];
$GLOBALS['OSCOM_Hooks']->call(pathinfo($GLOBALS['PHP_SELF'], PATHINFO_FILENAME), 'infoBox', $parameters);

//$this->table_row_parameters = '';
//$this->table_data_parameters = 'class="infoBoxContent"';
if (isset($contents['form'])) {
$form_start = $contents['form'] . PHP_EOL;
$form_close = '</form>' . PHP_EOL;
unset($contents['form']);
} else {
$form_start = '';
$form_close = '';
}
$contents = $this->tableBlock($contents);

ob_start();
Expand Down
23 changes: 7 additions & 16 deletions admin/includes/classes/table_block.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@
*/

class tableBlock {
var $table_parameters = '';
var $table_row_parameters = '';
var $table_data_parameters = '';

public $table_row_parameters = '';
public $table_data_parameters = '';

function __construct() {}

function tableBlock($contents) {
$tableBox_string = '';

$form_set = false;
if (isset($contents['form'])) {
$tableBox_string .= $contents['form'] . PHP_EOL;
$form_set = true;
array_shift($contents);
}

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
for ($i=0, $n=count($contents); $i<$n; $i++) {
$tableBox_string .= '<tr';
if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
$tableBox_string .= '>';

if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) {
for ($x=0, $y=count($contents[$i]); $x<$y; $x++) {
if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
$tableBox_string .= '<td';
if (isset($contents[$i][$x]['class']) && tep_not_null($contents[$i][$x]['class'])) $tableBox_string .= ' class="' . $contents[$i][$x]['class'] . '"';
Expand All @@ -47,7 +40,7 @@ function tableBlock($contents) {
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
$tableBox_string .= $contents[$i][$x]['text'];
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
$tableBox_string .= '</td>';
$tableBox_string .= '</td>' . PHP_EOL;
}
}
} else {
Expand All @@ -58,14 +51,12 @@ function tableBlock($contents) {
} elseif (tep_not_null($this->table_data_parameters)) {
$tableBox_string .= ' ' . $this->table_data_parameters;
}
$tableBox_string .= '>' . $contents[$i]['text'] . '</td>';
$tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . PHP_EOL;
}

$tableBox_string .= '</tr>';
}

if ($form_set == true) $tableBox_string .= '</form>';

return $tableBox_string;
}
}
Expand Down
10 changes: 10 additions & 0 deletions admin/includes/classes/templates/tpl_box.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<div class="table-responsive">
<?php
if ('' !== $form_start) {
echo $form_start;
}
?>
<table class="table table-striped table-hover">
<thead class="thead-light">
<tr>
Expand All @@ -9,6 +14,11 @@
<?php echo $contents ?>
</tbody>
</table>
<?php
if ('' !== $form_close) {
echo $form_close;
}
?>
</div>

<?php
Expand Down
2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_CATALOG', '<i title="Catalog" data-toggle="tooltip" data-placement="right" class="fas fa-cart-plus fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Catalog</span>');
define('BOX_HEADING_CATALOG', '<i data-content="Catalog" data-toggle="popover" data-placement="right" class="fas fa-cart-plus fa-fw mr-1"></i><span class="d-inline d-md-none">Catalog</span>');
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_CONFIGURATION', '<i title="Configuration" data-toggle="tooltip" data-placement="right" class="fas fa-cogs fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Configuration</span>');
define('BOX_HEADING_CONFIGURATION', '<i data-content="Configuration" data-toggle="popover" data-placement="right" class="fas fa-cogs fa-fw mr-1"></i><span class="d-inline d-md-none">Configuration</span>');
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_CUSTOMERS', '<i title="Customers" data-toggle="tooltip" data-placement="right" class="fas fa-users fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Customers</span>');
define('BOX_HEADING_CUSTOMERS', '<i data-content="Customers" data-toggle="popover" data-placement="right" class="fas fa-users fa-fw mr-1"></i><span class="d-inline d-md-none">Customers</span>');
2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_LAYOUT', '<i title="Layout Modules" data-toggle="tooltip" data-placement="right" class="fas fa-puzzle-piece fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Layout Modules</span>');
define('BOX_HEADING_LAYOUT', '<i data-content="Layout Modules" data-toggle="popover" data-placement="right" class="fas fa-puzzle-piece fa-fw mr-1"></i><span class="d-inline d-md-none">Layout Modules</span>');

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_LOCALIZATION', '<i title="Localization" data-toggle="tooltip" data-placement="right" class="fas fa-language fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Localization</span>');
define('BOX_HEADING_LOCALIZATION', '<i data-content="Localization" data-toggle="popover" data-placement="right" class="fas fa-language fa-fw mr-1"></i><span class="d-inline d-md-none">Localization</span>');

2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_MODULES', '<i title="Modules" data-toggle="tooltip" data-placement="right" class="fas fa-folder-open fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Modules</span>');
define('BOX_HEADING_MODULES', '<i data-content="Modules" data-toggle="popover" data-placement="left" class="fas fa-folder-open fa-fw mr-1"></i><span class="d-inline d-md-none">Modules</span>');

2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_ORDERS', '<i title="Orders" data-toggle="tooltip" data-placement="right" class="fas fa-credit-card fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Orders</span>');
define('BOX_HEADING_ORDERS', '<i data-content="Orders" data-toggle="popover" data-placement="left" class="fas fa-credit-card fa-fw mr-1"></i><span class="d-inline d-md-none">Orders</span>');
2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Released under the GNU General Public License
*/

define('MODULES_ADMIN_MENU_PAYPAL_HEADING', '<i title="Paypal" data-toggle="tooltip" data-placement="right" class="fab fa-paypal fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Paypal</span>');
define('MODULES_ADMIN_MENU_PAYPAL_HEADING', '<i data-content="Paypal" data-toggle="popover" data-placement="left" class="fab fa-paypal fa-fw mr-1"></i><span class="d-inline d-md-none">Paypal</span>');

define('MODULES_ADMIN_MENU_PAYPAL_BALANCE', 'Balance');
define('MODULES_ADMIN_MENU_PAYPAL_CONFIGURE', 'Configure');
Expand Down
2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_REPORTS', '<i title="Reports" data-toggle="tooltip" data-placement="right" class="fas fa-chart-bar fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Reports</span>');
define('BOX_HEADING_REPORTS', '<i data-content="Reports" data-toggle="popover" data-placement="left" class="fas fa-chart-bar fa-fw mr-1"></i><span class="d-inline d-md-none">Reports</span>');
2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/taxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_LOCATION_AND_TAXES', '<i title="Locations & Taxes" data-toggle="tooltip" data-placement="right" class="fas fa-comments-dollar fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Locations & Taxes</span>');
define('BOX_HEADING_LOCATION_AND_TAXES', '<i data-content="Locations & Taxes" data-toggle="popover" data-placement="right" class="fas fa-comments-dollar fa-fw mr-1"></i><span class="d-inline d-md-none">Locations & Taxes</span>');

2 changes: 1 addition & 1 deletion admin/includes/languages/english/modules/boxes/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
Released under the GNU General Public License
*/

define('BOX_HEADING_TOOLS', '<i title="Tools" data-toggle="tooltip" data-placement="right" class="fas fa-tools fa-fw mr-1"></i><span class="d-inline d-md-none d-xl-inline">Tools</span>');
define('BOX_HEADING_TOOLS', '<i data-content="Tools" data-toggle="popover" data-placement="left" class="fas fa-tools fa-fw mr-1"></i><span class="d-inline d-md-none">Tools</span>');

13 changes: 6 additions & 7 deletions admin/modules_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@

require 'includes/application_top.php';

$admin_hooks = $OSCOM_Hooks;
$OSCOM_Hooks = new hooks('shop');
$hooks = new hooks('shop');
$template_name = defined('TEMPLATE_SELECTION') ? TEMPLATE_SELECTION : 'default';
$template_name .= '_template';
$template = new $template_name();
$directories = $OSCOM_Hooks->get_hook_directories();
$OSCOM_Hooks = $admin_hooks;
$directories = $hooks->get_hook_directories();

function tep_find_contents($base, $test) {
$contents = [];
Expand Down Expand Up @@ -51,6 +49,7 @@ function tep_find_listeners($class) {
return $listeners;
}

$contents = [];
foreach ($directories as $directory) {
$directory = dirname($directory);
foreach (tep_find_contents($directory, 'is_dir') as $site) {
Expand All @@ -64,7 +63,7 @@ function tep_find_listeners($class) {
$class = "hook_{$site}_{$group}_{$pathinfo['filename']}";
foreach (tep_find_listeners($class) as $listener) {
tep_guarantee_all(
$hooks,
$contents,
$site,
$group,
$listener,
Expand Down Expand Up @@ -92,7 +91,7 @@ function tep_find_listeners($class) {
}

tep_guarantee_all(
$hooks,
$contents,
$hook['hooks_site'],
$hook['hooks_group'],
$hook['hooks_action'],
Expand All @@ -108,7 +107,7 @@ function tep_find_listeners($class) {
<div class="table-responsive">
<table class="table table-striped table-hover">
<?php
foreach ( $hooks as $site => $groups ) {
foreach ( $contents as $site => $groups ) {
?>
<thead class="thead-dark">
<tr>
Expand Down
30 changes: 30 additions & 0 deletions includes/hooks/admin/siteWide/popover.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2020 osCommerce
Released under the GNU General Public License
*/

class hook_admin_siteWide_popover {

public function listen_injectBodyEnd() {
$popover = <<<pp
<script>
$(function () {
$('[data-toggle="popover"]').popover({
container: 'body',
trigger: 'hover click'
})
})
</script>
pp;

return $popover;
}

}
Loading

0 comments on commit 8c36429

Please sign in to comment.