[TEP-COMMIT] [CVS admin] standards updates

hpdl-OfajU3CKLf1/[email protected] 25 Aug 2004 19:57:30 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin on MAIN

orders.php +9 -5 1.115 -> 1.116

templates/pages/banner_manager.php +23 -1 1.1 -> 1.2

/file_manager.php +1 -1 1.1 -> 1.2

/modules.php +20 -28 1.1 -> 1.2

/whos_online.php +6 -3 1.1 -> 1.2

+59 -38

5 modified files

standards updates

----------

admin /admin

orders.php 1.115 -> 1.116

diff -u -r1.115 -r1.116
--- orders.php 2004/07/22 23:29:47 1.115
+++ orders.php 2004/08/25 19:57:29 1.116
@@ -23,11 +23,15 @@

$orders_statuses = array();
$orders_status_array = array();

- $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
- while ($orders_status = tep_db_fetch_array($orders_status_query)) {
- $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
- 'text' => $orders_status['orders_status_name']);
- $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

+ $Qstatuses = $osC_Database->query('select orders_status_id, orders_status_name from :table_orders_status where language_id = :language_id');
+ $Qstatuses->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qstatuses->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qstatuses->execute();
+
+ while ($Qstatuses->next()) {
+ $orders_statuses[] = array('id' => $Qstatuses->valueInt('orders_status_id'),
+ 'text' => $Qstatuses->value('orders_status_name'));
+ $orders_status_array[$Qstatuses->valueInt('orders_status_id')] = $Qstatuses->value('orders_status_name');

}

if (!empty($action)) {

----------

admin /admin /templates /pages

banner_manager.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- banner_manager.php 2004/08/15 18:18:34 1.1
+++ banner_manager.php 2004/08/25 19:57:29 1.2
@@ -66,12 +66,18 @@

echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $Qbanners->valueInt('banners_id')) . '\';">' . "\n";
}
?>

- <td><?php echo '<a href="' . tep_href_link(FILENAME_POPUP_IMAGE, 'banner=' . $Qbanners->valueInt('banners_id')) . '" target="_blank">' . tep_image('templates/' . $template . '/images/icons/16x16/windows.png', 'View Banner', '16', '16') . '&nbsp;' . $Qbanners->valueProtected('banners_title') . '</a>'; ?></td>

+ <td><?php echo $Qbanners->valueProtected('banners_title'); ?></td>

<td><?php echo $Qbanners->valueProtected('banners_group'); ?></td>
<td><?php echo $Qstats->valueInt('banners_shown') . ' / ' . $Qstats->valueInt('banners_clicked'); ?></td>
<td align="center"><?php echo tep_image('templates/' . $template . '/images/icons/' . (($Qbanners->valueInt('status') === 1) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif')); ?></td>
<td align="right">
<?php

+ if (isset($bInfo) && ($Qbanners->valueInt('banners_id') == $bInfo->banners_id)) {
+ echo '<a href="#" onClick="toggleInfoBox(\'bPreview\');">' . tep_image('templates/' . $template . '/images/icons/16x16/windows.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;';
+ } else {
+ echo '<a href="' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $Qbanners->valueInt('banners_id') . '&action=bPreview') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/windows.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;';
+ }
+

echo '<a href="#" onClick="document.location.href=\'' . tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $Qbanners->valueInt('banners_id') . '&action=statistics') . '\';">' . tep_image('templates/' . $template . '/images/icons/16x16/graph.png', ICON_STATISTICS, '16', '16') . '</a>&nbsp;';

if (isset($bInfo) && ($Qbanners->valueInt('banners_id') == $bInfo->banners_id)) {

@@ -157,6 +163,22 @@

<?php
if (isset($bInfo)) {
?>

+
+<div id="infoBox_bPreview" <?php if ($action != 'bPreview') { echo 'style="display: none;"'; } ?>>
+ <div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $bInfo->banners_title; ?></div>
+ <div class="infoBoxContent">
+
+<?php
+ if (!empty($bInfo->banners_html_text)) {
+ echo $bInfo->banners_html_text;
+ } else {
+ echo tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $bInfo->banners_image, $bInfo->banners_title);
+ }
+?>
+
+ <p align="center"><?php echo '<input type="button" value="' . IMAGE_BACK . '" onClick="toggleInfoBox(\'bDefault\');" class="operationButton">'; ?></p>
+ </div>
+</div>

<div id="infoBox_bDelete" <?php if ($action != 'bDelete') { echo 'style="display: none;"'; } ?>>
<div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . ' ' . $bInfo->banners_title; ?></div>

----------

admin /admin /templates /pages

file_manager.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- file_manager.php 2004/08/15 18:16:09 1.1
+++ file_manager.php 2004/08/25 19:57:29 1.2
@@ -48,7 +48,7 @@

<?php
if ($current_path != OSC_ADMIN_FILE_MANAGER_ROOT_PATH) {
echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);">' . "\n" .

- ' <td colspan="8"><a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_array[sizeof($goto_array)-2]['id']) . '">' . tep_image('templates/' . $template . '/images/icons/16x16/previous_level.gif') . '&nbsp;--Parent--</a></td>' . "\n" .

+ ' <td colspan="8"><a href="' . tep_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_array[sizeof($goto_array)-2]['id']) . '">' . tep_image('templates/' . $template . '/images/icons/16x16/2uparrow.png', '', '16', '16') . '&nbsp;--Parent--</a></td>' . "\n" .

' </tr>' . "\n";
}

----------

admin /admin /templates /pages

modules.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- modules.php 2004/07/22 23:29:31 1.1
+++ modules.php 2004/08/25 19:57:29 1.2
@@ -10,20 +10,10 @@

Released under the GNU General Public License
*/

- $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
-
- $directory_array = array();
- if ($dir = @dir('../includes/modules/' . $module_type)) {
- while ($file = $dir->read()) {
- if (!is_dir('../includes/modules/' . $module_type . '/' . $file)) {
- if (substr($file, strrpos($file, '.')) == $file_extension) {
- $directory_array[] = $file;
- }
- }
- }
- sort($directory_array);
- $dir->close();
- }

+ require('includes/classes/directory_listing.php');
+ $osC_DirectoryListing = new osC_DirectoryListing('../includes/modules/' . $module_type);
+ $osC_DirectoryListing->setIncludeDirectories(false);
+ $files = $osC_DirectoryListing->getFiles();

?>

<h1><?php echo HEADING_TITLE; ?></h1>

@@ -41,18 +31,18 @@

<tbody>
<?php
$installed_modules = array();

- foreach ($directory_array as $file) {
- include('../includes/languages/' . $osC_Session->value('language') . '/modules/' . $module_type . '/' . $file);
- include('../includes/modules/' . $module_type . '/' . $file);

+ foreach ($files as $file) {
+ include('../includes/languages/' . $osC_Session->value('language') . '/modules/' . $module_type . '/' . $file['name']);
+ include('../includes/modules/' . $module_type . '/' . $file['name']);

- $class = substr($file, 0, strrpos($file, '.'));

+ $class = substr($file['name'], 0, strrpos($file['name'], '.'));

if (class_exists($class)) {
$module = new $class;
if ($module->check() > 0) {
if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) {

- $installed_modules[$module->sort_order] = $file;

+ $installed_modules[$module->sort_order] = $file['name'];

} else {

- $installed_modules[] = $file;

+ $installed_modules[] = $file['name'];

}
}

@@ -67,14 +57,16 @@

$keys_extra = array();
foreach ($module_keys as $key) {

- $key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $key . "'");
- $key_value = tep_db_fetch_array($key_value_query);
-
- $keys_extra[$key]['title'] = $key_value['configuration_title'];
- $keys_extra[$key]['value'] = $key_value['configuration_value'];
- $keys_extra[$key]['description'] = $key_value['configuration_description'];
- $keys_extra[$key]['use_function'] = $key_value['use_function'];
- $keys_extra[$key]['set_function'] = $key_value['set_function'];

+ $Qkeys = $osC_Database->query('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
+ $Qkeys->bindTable(':table_configuration', TABLE_CONFIGURATION);
+ $Qkeys->bindValue(':configuration_key', $key);
+ $Qkeys->execute();
+
+ $keys_extra[$key]['title'] = $Qkeys->value('configuration_title');
+ $keys_extra[$key]['value'] = $Qkeys->value('configuration_value');
+ $keys_extra[$key]['description'] = $Qkeys->value('configuration_description');
+ $keys_extra[$key]['use_function'] = $Qkeys->value('use_function');
+ $keys_extra[$key]['set_function'] = $Qkeys->value('set_function');

}

$module_info['keys'] = $keys_extra;

----------

admin /admin /templates /pages

whos_online.php 1.1 -> 1.2

diff -u -r1.1 -r1.2
--- whos_online.php 2004/08/15 18:13:22 1.1
+++ whos_online.php 2004/08/25 19:57:29 1.2
@@ -58,9 +58,12 @@

while ($Qwho->next()) {
if (STORE_SESSIONS == 'mysql') {

- $session_data = tep_db_query("select value from " . TABLE_SESSIONS . " WHERE sesskey = '" . $Qwho->value('session_id') . "'");
- $session_data = tep_db_fetch_array($session_data);
- $session_data = trim($session_data['value']);

+ $Qsession = $osC_Database->query('select value from :table_sessions where sesskey = :sesskey');
+ $Qsession->bindTable(':table_sessions', TABLE_SESSIONS);
+ $Qsession->bindValue(':sesskey', $Qwho->value('session_id'));
+ $Qsession->execute();
+
+ $session_data = trim($Qsession->value('value'));

} else {
if ( (file_exists(tep_session_save_path() . '/sess_' . $Qwho->value('session_id'))) && (filesize(tep_session_save_path() . '/sess_' . $Qwho->value('session_id')) > 0) ) {
$session_data = trim(file_get_contents(tep_session_save_path() . '/sess_' . $Qwho->value('session_id')));

CVSspam 0.2.9

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285