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 #1031 from gburton/1.0.7.12
Browse files Browse the repository at this point in the history
Pre PR 107.12
  • Loading branch information
gburton authored Dec 22, 2020
2 parents 589beea + 97d302c commit ea152f8
Show file tree
Hide file tree
Showing 107 changed files with 1,900 additions and 1,410 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ If you wish to help steer the future direction of the software you need to join
Channel | URL
------------ | -------------
Phoenix Club | https://forums.oscommerce.com/forum/117-topics/
Youtube | https://www.youtube.com/channel/UCjJe0ZX3-nGzeJFEzcVUyIA/
Discord | https://discord.gg/3pzfrtMAX4
External Libraries | https://github.com/gburton/Responsive-osCommerce/wiki/External-Libraries
Phoenix Cart Wiki | https://phoenixcart.org/phoenixcartwiki/index.php
Phoenix Cart Forum | https://phoenixcart.org/forum/
Phoenix (Youtube) | https://www.youtube.com/channel/UCjJe0ZX3-nGzeJFEzcVUyIA/
Zipurman Coding (Youtube) | https://www.youtube.com/user/zipurman/videos
Support (Discord) | https://discord.gg/3pzfrtMAX4
Phoenix Cart (Wiki) | https://phoenixcart.org/phoenixcartwiki/index.php
Phoenix Cart (Forum) | https://phoenixcart.org/forum/
Github (Discussions) | https://github.com/gburton/CE-Phoenix/discussions

# Credits

Expand Down
30 changes: 15 additions & 15 deletions admin/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
$currencies = new currencies();

// calculate category path
$cPath = $_GET['cPath'] ?? '';
if (tep_not_null($cPath)) {
$cPath_array = tep_parse_category_path($cPath);
if (empty($_GET['cPath'])) {
$current_category_id = 0;
$cPath = '';
} else {
$cPath_array = tep_parse_category_path($_GET['cPath']);
$cPath = implode('_', $cPath_array);
$current_category_id = end($cPath_array);
} else {
$current_category_id = 0;
}

const DIR_FS_CATALOG_IMAGES = DIR_FS_CATALOG . 'images/';
Expand Down Expand Up @@ -623,8 +623,8 @@ function updateNet() {
<div class="tab-pane fade" id="section_general_content" role="tabpanel">
<div class="accordion" id="productLanguageAccordion">
<?php
$show = ' show';
foreach ($languages as $l) {
$show = ($i == 0) ? ' show' : null;
?>
<div class="card">
<div class="card-header" id="heading<?= $l['directory'] ?>">
Expand Down Expand Up @@ -690,6 +690,10 @@ function updateNet() {
</div>
<?php
echo $OSCOM_Hooks->call('categories', 'injectLanguageForm');

if ('' !== $show) {
$show = '';
}
}
?>
</div>
Expand Down Expand Up @@ -990,23 +994,19 @@ function addNewPiForm() {
<?php
}

$cPath_back = '';
if (isset($cPath_array) && count($cPath_array) > 0) {
$cPath_back .= $cPath_array[0];
for ($i=1, $n=count($cPath_array)-1; $i<$n; $i++) {
$cPath_back .= '_' . $cPath_array[$i];
}
if (isset($cPath_array) && count($cPath_array) > 1) {
$cPath_back = 'cPath=' . implode('_', array_slice($cPath_array, 0, -1)) . '&';
} else {
$cPath_back = '';
}

$cPath_back = (tep_not_null($cPath_back)) ? 'cPath=' . $cPath_back . '&' : '';
?>
</tbody>
</table>
</div>

<div class="row my-1">
<div class="col"><?= TEXT_CATEGORIES . '&nbsp;' . $categories_count . '<br>' . TEXT_PRODUCTS . '&nbsp;' . $products_count ?></div>
<div class="col text-right mr-2"><?php if (isset($cPath_array) && (count($cPath_array) > 0)) echo tep_draw_bootstrap_button(IMAGE_BACK, 'fas fa-angle-left', tep_href_link('categories.php', $cPath_back), null, null, 'btn-light mr-2'); if (!isset($_GET['search'])) echo tep_draw_bootstrap_button(IMAGE_NEW_CATEGORY, 'fas fa-sitemap', tep_href_link('categories.php', 'cPath=' . $cPath . '&action=new_category'), null, null, 'btn-danger mr-2') . tep_draw_bootstrap_button(IMAGE_NEW_PRODUCT, 'fas fa-boxes', tep_href_link('categories.php', 'cPath=' . $cPath . '&action=new_product'), null, null, 'btn-danger') ?></div>
<div class="col text-right mr-2"><?php if (isset($cPath_array) && (count($cPath_array) > 0)) echo tep_draw_bootstrap_button(IMAGE_BACK, 'fas fa-angle-left', tep_href_link('categories.php', $cPath_back), null, null, 'btn-light mr-2'); if (!isset($_GET['search'])) echo tep_draw_bootstrap_button(IMAGE_NEW_CATEGORY, 'fas fa-sitemap', tep_href_link('categories.php', 'cPath=' . $cPath . '&action=new_category'), null, null, 'btn-danger mr-2') . tep_draw_bootstrap_button(IMAGE_NEW_PRODUCT, 'fas fa-boxes', tep_href_link('categories.php', 'cPath=' . $cPath . '&action=new_product'), null, null, 'btn-danger'); ?></div>
</div>

</div>
Expand Down
20 changes: 10 additions & 10 deletions admin/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
if (tep_not_null($action)) {
switch ($action) {
case 'save':
$configuration_value = tep_db_prepare_input($_POST['configuration_value']);
$configuration_value = tep_db_prepare_input($_POST['configuration_value'] ?? NULL);
$cID = tep_db_prepare_input($_GET['cID']);

tep_db_query("UPDATE configuration SET configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = NOW() WHERE configuration_id = " . (int)$cID);

$OSCOM_Hooks->call('configuration', 'saveAction');

tep_redirect(tep_href_link('configuration.php', 'gID=' . $_GET['gID'] . '&cID=' . $cID));
tep_redirect(tep_href_link('configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . $cID));
break;
}
}
Expand All @@ -41,17 +41,17 @@
require 'includes/template_top.php';
?>

<h1 class="display-4 mb-2"><?= $cfg_group['configuration_group_title']; ?></h1>
<h1 class="display-4 mb-2"><?= $cfg_group['configuration_group_title'] ?></h1>

<div class="row no-gutters">
<div class="col-12 col-sm-8">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th><?= TABLE_HEADING_CONFIGURATION_TITLE; ?></th>
<th><?= TABLE_HEADING_CONFIGURATION_VALUE; ?></th>
<th class="text-right"><?= TABLE_HEADING_ACTION; ?></th>
<th><?= TABLE_HEADING_CONFIGURATION_TITLE ?></th>
<th><?= TABLE_HEADING_CONFIGURATION_VALUE ?></th>
<th class="text-right"><?= TABLE_HEADING_ACTION ?></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -96,11 +96,11 @@
$icon = '<i class="fas fa-chevron-circle-right text-info"></i>';
} else {
echo '<tr onclick="document.location.href=\'' . tep_href_link('configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . (int)$configuration['configuration_id']) . '\'">' . "\n";
$icon = '<a href="' . tep_href_link('configuration.php', 'gID=' . $_GET['gID'] . '&cID=' . $configuration['configuration_id']) . '"><i class="fas fa-info-circle text-muted"></i></a>';
$icon = '<a href="' . tep_href_link('configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . (int)$configuration['configuration_id']) . '"><i class="fas fa-info-circle text-muted"></i></a>';
}
?>
<td><?= $configuration['configuration_title']; ?></td>
<td><?= htmlspecialchars($cfgValue); ?></td>
<td><?= $configuration['configuration_title'] ?></td>
<td><?= htmlspecialchars($cfgValue) ?></td>
<td class="text-right"><?= $icon ?>&nbsp;</td>
</tr>
<?php
Expand All @@ -124,7 +124,7 @@
$value_field = tep_draw_input_field('configuration_value', $cInfo->configuration_value);
}

$contents = ['form' => tep_draw_form('configuration', 'configuration.php', 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save')];
$contents = ['form' => tep_draw_form('configuration', 'configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save')];
$contents[] = ['text' => TEXT_INFO_EDIT_INTRO];
$contents[] = ['text' => '<strong>' . $cInfo->configuration_title . '</strong><br>' . $cInfo->configuration_description . '<br>' . $value_field];
$contents[] = ['class' => 'text-center', 'text' => tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', null, 'btn-success mr-2') . tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', tep_href_link('configuration.php', 'gID=' . (int)$_GET['gID'] . '&cID=' . (int)$cInfo->configuration_id), null, null, 'btn-light')];
Expand Down
26 changes: 13 additions & 13 deletions admin/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<div class="row">
<div class="col">
<h1 class="display-4 mb-2"><?php echo HEADING_TITLE; ?></h1>
<h1 class="display-4 mb-2"><?= HEADING_TITLE ?></h1>
</div>
<div class="col text-right align-self-center">
<?php
Expand Down Expand Up @@ -134,7 +134,7 @@
}
?>

<h5><?php echo $customer_data_group['customer_data_groups_name']; ?></h5>
<h5><?= $customer_data_group['customer_data_groups_name'] ?></h5>

<?php
foreach ((array)$grouped_modules[$customer_data_group['customer_data_groups_id']] as $module) {
Expand Down Expand Up @@ -164,9 +164,9 @@
<table class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th><?php echo TABLE_HEADING_NAME; ?></th>
<th class="text-right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></th>
<th class="text-right"><?php echo TABLE_HEADING_ACTION; ?></th>
<th><?= TABLE_HEADING_NAME ?></th>
<th class="text-right"><?= TABLE_HEADING_ACCOUNT_CREATED ?></th>
<th class="text-right"><?= TABLE_HEADING_ACTION ?></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -204,19 +204,19 @@
$customer_data->get([ 'sortable_name', 'name', 'email_address', 'country_id', 'id' ], $cInfo_array);
$cInfo = new objectInfo($cInfo_array);

$href = tep_href_link('customers.php', tep_get_all_get_params(['cID', 'action']) . 'cID=' . $cInfo->customers_id . '&action=edit');
$href = tep_href_link('customers.php', addslashes(tep_get_all_get_params(['cID', 'action'])) . 'cID=' . $cInfo->customers_id . '&action=edit');
$icon = '<i class="fas fa-chevron-circle-right text-info"></i>';
$css = 'class="table-active" ';
} else {
$href = tep_href_link('customers.php', tep_get_all_get_params(['cID']) . 'cID=' . $customer_data->get('id', $customers));
$href = tep_href_link('customers.php', addslashes(tep_get_all_get_params(['cID'])) . 'cID=' . $customer_data->get('id', $customers));
$icon = '<a href="' . $href . '"><i class="fas fa-info-circle text-muted"></i></a>';
$css = null;
}
?>
<tr <?php echo $css; ?>onclick="document.location.href='<?php echo $href; ?>'">
<td><?php echo $customer_data->get('sortable_name', $customers); ?></td>
<td class="text-right"><?php echo tep_date_short($info['date_account_created']); ?></td>
<td class="text-right"><?php echo $icon; ?></td>
<tr <?= $css ?>onclick="document.location.href='<?= $href ?>'">
<td><?= $customer_data->get('sortable_name', $customers) ?></td>
<td class="text-right"><?= tep_date_short($info['date_account_created']) ?></td>
<td class="text-right"><?= $icon ?></td>
</tr>
<?php
}
Expand All @@ -226,8 +226,8 @@
</div>

<div class="row my-1">
<div class="col"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></div>
<div class="col text-right mr-2"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], tep_get_all_get_params(['page', 'info', 'x', 'y', 'cID'])); ?></div>
<div class="col"><?= $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS) ?></div>
<div class="col text-right mr-2"><?= $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], tep_get_all_get_params(['page', 'info', 'x', 'y', 'cID'])) ?></div>
</div>

<?php
Expand Down
13 changes: 2 additions & 11 deletions admin/includes/application_top.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

// make a connection to the database... now
tep_db_connect() or die('Unable to connect to database server!');

$OSCOM_Hooks = new hooks('admin');
$OSCOM_Hooks->register('system');
$OSCOM_Hooks->generate('system', 'startApplication');
Expand Down Expand Up @@ -69,16 +69,7 @@

// set the language
if (!isset($_SESSION['language']) || isset($_GET['language'])) {
$lng = new language();

if (tep_not_null($_GET['language'] ?? '')) {
$lng->set_language($_GET['language']);
} else {
$lng->get_browser_language();
}

$_SESSION['language'] = $lng->language['directory'];
$_SESSION['languages_id'] = $lng->language['id'];
$lng = language::build();
}

// register session variables globally
Expand Down
114 changes: 0 additions & 114 deletions admin/includes/classes/language.php

This file was deleted.

Loading

0 comments on commit ea152f8

Please sign in to comment.