[TEP-COMMIT] [CVS admin] code cleanup
hpdl-OfajU3CKLf1/[email protected] 26 Oct 2004 20:20:33 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>admin/admin</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">categories.php</a></tt></td><td align="right" id="added">+32</td><td align="right" id="removed">-12</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php?rev=1.155&content-type=text/vnd.viewcvs-markup">1.155</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php.diff?r1=1.155&r2=1.156">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php?rev=1.156&content-type=text/vnd.viewcvs-markup">1.156</a></td></tr>
<tr class="alt"><td><tt>includes/functions/<a href="#file2">general.php</a></tt></td><td align="right" id="added">+6</td><td align="right" id="removed">-62</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.168&content-type=text/vnd.viewcvs-markup">1.168</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php.diff?r1=1.168&r2=1.169">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.169&content-type=text/vnd.viewcvs-markup">1.169</a></td></tr>
<tr><td><tt>includes/languages/<a href="#file3">english.php</a></tt></td><td align="right" id="added">+1</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php?rev=1.121&content-type=text/vnd.viewcvs-markup">1.121</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php.diff?r1=1.121&r2=1.122">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php?rev=1.122&content-type=text/vnd.viewcvs-markup">1.122</a></td></tr>
<tr class="alt"><td><tt> /<a href="#file4">espanol.php</a></tt></td><td align="right" id="added">+1</td><td></td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php?rev=1.116&content-type=text/vnd.viewcvs-markup">1.116</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php.diff?r1=1.116&r2=1.117">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php?rev=1.117&content-type=text/vnd.viewcvs-markup">1.117</a></td></tr>
<tr><td><tt> /<a href="#file5">german.php</a></tt></td><td align="right" id="added">+2</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php?rev=1.115&content-type=text/vnd.viewcvs-markup">1.115</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php.diff?r1=1.115&r2=1.116">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php?rev=1.116&content-type=text/vnd.viewcvs-markup">1.116</a></td></tr>
<tr class="alt"><td><tt>templates/pages/<a href="#file6">categories.php</a></tt></td><td align="right" id="added">+35</td><td align="right" id="removed">-27</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php.diff?r1=1.3&r2=1.4">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a></td></tr>
<tr><td></td><td align="right" id="added">+77</td><td align="right" id="removed">-102</td><td></td></tr>
</table>
<small id="info">6 modified files</small><br />
<pre class="comment">
code cleanup
replace calls to tep_get_category_tree() with the category tree class
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a><br /></span>
<div class="fileheader"><big><b>categories.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php?rev=1.155&content-type=text/vnd.viewcvs-markup">1.155</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php.diff?r1=1.155&r2=1.156">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/categories.php?rev=1.156&content-type=text/vnd.viewcvs-markup">1.156</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.155 -r1.156
--- categories.php 2004/08/27 22:13:11 1.155
+++ categories.php 2004/10/26 20:19:54 1.156
@@ -12,21 +12,36 @@
</small></pre><pre class="diff" id="context">
require('includes/application_top.php');
</pre><pre class="diff" id="removed">- $selected_box = 'catalog';
-
</pre><pre class="diff" id="context"> // calculate category path
$cPath = (isset($_GET['cPath']) ? $_GET['cPath'] : '');
</pre><pre class="diff" id="removed">- if (tep_not_null($cPath)) {
</pre><pre class="diff" id="added">+ if (!empty($cPath)) {
</pre><pre class="diff" id="context"> $cPath_array = tep_parse_category_path($cPath);
$cPath = implode('_', $cPath_array);
</pre><pre class="diff" id="removed">- $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
</pre><pre class="diff" id="added">+ $current_category_id = end($cPath_array);
</pre><pre class="diff" id="context"> } else {
$current_category_id = 0;
}
</pre><pre class="diff" id="added">+ require('../includes/classes/category_tree.php');
+ $osC_CategoryTree = new osC_CategoryTree();
+ $osC_CategoryTree->setSpacerString('&nbsp;', 2);
+
+ $categories_array = array();
+ foreach ($osC_CategoryTree->getTree() as $value) {
+ $categories_array[] = array('id' => $value['id'], 'text' => $value['title']);
+ }
+
</pre><pre class="diff" id="context"> $action = (isset($_GET['action']) ? $_GET['action'] : '');
</pre><pre class="diff" id="added">+ if (!isset($_GET['page']) || (isset($_GET['page']) && !is_numeric($_GET['page']))) {
+ $_GET['page'] = 1;
+ }
+
+ if (!isset($_GET['search'])) {
+ $_GET['search'] = '';
+ }
+
</pre><pre class="diff" id="context"> if (!empty($action)) {
switch ($action) {
case 'save_category':
</pre><pre class="diff"><small id="info">@@ -88,6 +103,7 @@
</small></pre><pre class="diff" id="context"> $osC_Database->commitTransaction();
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff"><small id="info">@@ -97,11 +113,13 @@
</small></pre><pre class="diff" id="context"> $messageStack->add_session(ERROR_DB_ROWS_NOT_UPDATED, 'error');
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $category_id));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, '<span id="addedchars">page=' . $_GET['page'] . '&</span>cPath=' . $cPath . '&cID=' . $category_id));
</pre><pre class="diff" id="context"> break;
case 'delete_category_confirm':
if (isset($_GET['cID']) && is_numeric($_GET['cID'])) {
</pre><pre class="diff" id="removed">- $categories = tep_get_category_tree($_GET['cID'], '', '0', '', true);
</pre><pre class="diff" id="added">+ $osC_CategoryTree->setBreadcrumbUsage(false);
+
+ $categories = array_merge(array(array('id' => $_GET['cID'], 'text' => '')), $osC_CategoryTree->getTree($_GET['cID']));
</pre><pre class="diff" id="context"> $products = array();
$products_delete = array();
</pre><pre class="diff"><small id="info">@@ -139,38 +157,40 @@
</small></pre><pre class="diff" id="context"> }
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']));
</pre><pre class="diff" id="context"> break;
case 'move_category_confirm':
</pre><pre class="diff" id="removed">- if (isset($_GET['cID']) && ($_GET['cID'] != $_POST['move_to_category_id'])) {
- $path = explode('_', tep_get_generated_category_path_ids($_POST['move_to_category_id']));
</pre><pre class="diff" id="added">+ if (isset($_GET['cID']) && ($_GET['cID'] != end(explode('_', $_POST['move_to_category_id'])))) {
+ $path = explode('_', $_POST['move_to_category_id']);
</pre><pre class="diff" id="context">
if (in_array($_GET['cID'], $path)) {
$messageStack->add_session(ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT, 'error');
} else {
$Qupdate = $osC_Database->query('update :table_categories set parent_id = :parent_id, last_modified = now() where categories_id = :categories_id');
$Qupdate->bindTable(':table_categories', TABLE_CATEGORIES);
</pre><pre class="diff" id="removed">- $Qupdate->bindInt(':parent_id', $_POST['move_to_category_id']);
</pre><pre class="diff" id="added">+ $Qupdate->bindInt(':parent_id', end(explode('_', $_POST['move_to_category_id'])));
</pre><pre class="diff" id="context"> $Qupdate->bindInt(':categories_id', $_GET['cID']);
$Qupdate->execute();
if ($Qupdate->affectedRows()) {
osC_Cache::clear('categories');
</pre><pre class="diff" id="added">+ osC_Cache::clear('category_tree');
</pre><pre class="diff" id="context"> osC_Cache::clear('also_purchased');
$messageStack->add_session(SUCCESS_DB_ROWS_UPDATED, 'success');
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_POST['move_to_category_id'] . '&cID=' . $_GET['cID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']));
</pre><pre class="diff" id="context"> }
}
}
</pre><pre class="diff" id="removed">- tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $_GET['cID']));
</pre><pre class="diff" id="added">+ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&cID=' . $_GET['cID']));
</pre><pre class="diff" id="context"> break;
}
}
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions">functions</a><br /></span>
<div class="fileheader"><big><b>general.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.168&content-type=text/vnd.viewcvs-markup">1.168</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php.diff?r1=1.168&r2=1.169">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/functions/general.php?rev=1.169&content-type=text/vnd.viewcvs-markup">1.169</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.168 -r1.169
--- general.php 2004/08/27 22:06:06 1.168
+++ general.php 2004/10/26 20:19:58 1.169
@@ -60,43 +60,6 @@
</small></pre><pre class="diff" id="context"> return $customers_values['customers_firstname'] . ' ' . $customers_values['customers_lastname'];
}
</pre><pre class="diff" id="removed">- function tep_get_path($current_category_id = '') {
- global $cPath_array;
-
- if ($current_category_id == '') {
- $cPath_new = implode('_', $cPath_array);
- } else {
- if (sizeof($cPath_array) == 0) {
- $cPath_new = $current_category_id;
- } else {
- $cPath_new = '';
- $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'");
- $last_category = tep_db_fetch_array($last_category_query);
-
- $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
- $current_category = tep_db_fetch_array($current_category_query);
-
- if ($last_category['parent_id'] == $current_category['parent_id']) {
- for ($i = 0, $n = sizeof($cPath_array) - 1; $i < $n; $i++) {
- $cPath_new .= '_' . $cPath_array[$i];
- }
- } else {
- for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
- $cPath_new .= '_' . $cPath_array[$i];
- }
- }
-
- $cPath_new .= '_' . $current_category_id;
-
- if (substr($cPath_new, 0, 1) == '_') {
- $cPath_new = substr($cPath_new, 1);
- }
- }
- }
-
- return 'cPath=' . $cPath_new;
- }
-
</pre><pre class="diff" id="context"> function tep_get_all_get_params($exclude_array = '') {
if (PHP_VERSION < 4.1) {
global $_GET;
</pre><pre class="diff"><small id="info">@@ -161,27 +124,6 @@
</small></pre><pre class="diff" id="context"> return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
}
</pre><pre class="diff" id="removed">- function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
- global $osC_Session;
-
- if (!is_array($category_tree_array)) $category_tree_array = array();
- if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
-
- if ($include_itself) {
- $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$osC_Session->value('languages_id') . "' and cd.categories_id = '" . (int)$parent_id . "'");
- $category = tep_db_fetch_array($category_query);
- $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
- }
-
- $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$osC_Session->value('languages_id') . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
- while ($categories = tep_db_fetch_array($categories_query)) {
- if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
- $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $exclude, $category_tree_array);
- }
-
- return $category_tree_array;
- }
-
</pre><pre class="diff" id="context"> function tep_draw_products_pull_down($name, $parameters = '', $exclude = '') {
global $osC_Session, $osC_Currencies;
</pre><pre class="diff"><small id="info">@@ -924,8 +866,9 @@
</small></pre><pre class="diff" id="context"> tep_db_query("delete from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "'");
tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$category_id . "'");
</pre><pre class="diff" id="removed">- osC_Cache::reset('categories');
- osC_Cache::reset('also_purchased');
</pre><pre class="diff" id="added">+ osC_Cache::clear('categories');
+ osC_Cache::clear('category_tree');
+ osC_Cache::clear('also_purchased');
</pre><pre class="diff" id="context"> }
function tep_remove_product($product_id) {
</pre><pre class="diff"><small id="info">@@ -955,8 +898,9 @@
</small></pre><pre class="diff" id="context"> }
tep_db_query("delete from " . TABLE_REVIEWS . " where products_id = '" . (int)$product_id . "'");
</pre><pre class="diff" id="removed">- osC_Cache::reset('categories');
- osC_Cache::reset('also_purchased');
</pre><pre class="diff" id="added">+ osC_Cache::clear('categories');
+ osC_Cache::clear('category_tree');
+ osC_Cache::clear('also_purchased');
</pre><pre class="diff" id="context"> }
function tep_remove_order($order_id, $restock = false) {
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a><br /></span>
<div class="fileheader"><big><b>english.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php?rev=1.121&content-type=text/vnd.viewcvs-markup">1.121</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php.diff?r1=1.121&r2=1.122">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/english.php?rev=1.122&content-type=text/vnd.viewcvs-markup">1.122</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.121 -r1.122
--- english.php 2004/08/29 22:22:07 1.121
+++ english.php 2004/10/26 20:20:02 1.122
@@ -265,6 +265,7 @@
</small></pre><pre class="diff" id="context"> // constants for use in tep_prev_next_display function
define('TEXT_RESULT_PAGE', 'Page&nbsp;%s&nbsp;of %d');
define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> banners)');
</pre><pre class="diff" id="added">+define('TEXT_DISPLAY_NUMBER_OF_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
</pre><pre class="diff" id="context"> define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> countries)');
define('TEXT_DISPLAY_NUMBER_OF_CREDIT_CARDS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> credit cards)');
define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> customers)');
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a><br /></span>
<div class="fileheader"><big><b>espanol.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php?rev=1.116&content-type=text/vnd.viewcvs-markup">1.116</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php.diff?r1=1.116&r2=1.117">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/espanol.php?rev=1.117&content-type=text/vnd.viewcvs-markup">1.117</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.116 -r1.117
--- espanol.php 2004/08/29 22:22:07 1.116
+++ espanol.php 2004/10/26 20:20:02 1.117
@@ -265,6 +265,7 @@
</small></pre><pre class="diff" id="context"> // constants for use in tep_prev_next_display function
define('TEXT_RESULT_PAGE', 'P&aacute;gina&nbsp;%s&nbsp;de %d');
define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> banners)');
</pre><pre class="diff" id="added">+define('TEXT_DISPLAY_NUMBER_OF_CATEGORIES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> categories)');
</pre><pre class="diff" id="context"> define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> paises)');
define('TEXT_DISPLAY_NUMBER_OF_CREDIT_CARDS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> credit cards)');
define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Viendo del <b>%d</b> al <b>%d</b> (de <b>%d</b> clientes)');
</pre></div>
<hr /><a name="file5" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages">languages</a><br /></span>
<div class="fileheader"><big><b>german.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php?rev=1.115&content-type=text/vnd.viewcvs-markup">1.115</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php.diff?r1=1.115&r2=1.116">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/includes/languages/german.php?rev=1.116&content-type=text/vnd.viewcvs-markup">1.116</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.115 -r1.116
--- german.php 2004/08/29 22:22:07 1.115
+++ german.php 2004/10/26 20:20:03 1.116
@@ -265,8 +265,9 @@
</small></pre><pre class="diff" id="context"> // constants for use in tep_prev_next_display function
define('TEXT_RESULT_PAGE', 'Seite&nbsp;%s&nbsp;von %d');
define('TEXT_DISPLAY_NUMBER_OF_BANNERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Bannern)');
</pre><pre class="diff" id="added">+define('TEXT_DISPLAY_NUMBER_OF_CATEGORIES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Kategorien)');
</pre><pre class="diff" id="context"> define('TEXT_DISPLAY_NUMBER_OF_COUNTRIES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> L&auml;ndern)');
</pre><pre class="diff" id="removed">-define('TEXT_DISPLAY_NUMBER_OF_CREDIT_CARDS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> credit cards)');
</pre><pre class="diff" id="added">+define('TEXT_DISPLAY_NUMBER_OF_CREDIT_CARDS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Kreditkarten)');
</pre><pre class="diff" id="context"> define('TEXT_DISPLAY_NUMBER_OF_CUSTOMERS', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Kunden)');
define('TEXT_DISPLAY_NUMBER_OF_CURRENCIES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> W&auml;hrungen)');
define('TEXT_DISPLAY_NUMBER_OF_LANGUAGES', 'Angezeigt werden <b>%d</b> bis <b>%d</b> (von insgesamt <b>%d</b> Sprachen)');
</pre></div>
<hr /><a name="file6" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin">admin</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates">templates</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages">pages</a><br /></span>
<div class="fileheader"><big><b>categories.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php?rev=1.3&content-type=text/vnd.viewcvs-markup">1.3</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php.diff?r1=1.3&r2=1.4">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/admin/admin/templates/pages/categories.php?rev=1.4&content-type=text/vnd.viewcvs-markup">1.4</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.3 -r1.4
--- categories.php 2004/08/27 22:13:15 1.3
+++ categories.php 2004/10/26 20:20:09 1.4
@@ -18,11 +18,12 @@
</small></pre><pre class="diff" id="context"> <?php
echo tep_draw_form('search', FILENAME_CATEGORIES, '', 'get') .
HEADING_TITLE_SEARCH . ' ' . osc_draw_input_field('search') .
</pre><pre class="diff" id="removed">- '<input type="submit" value="GO" class="operationButton"></form><br>' .
- tep_draw_form('goto', FILENAME_CATEGORIES, '', 'get') .
- HEADING_TITLE_GOTO . ' ' . osc_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"') .
</pre><pre class="diff" id="added">+ osc_draw_pull_down_menu('cPath', array_merge(array(array('id' => '', 'text' => '-- ' . TEXT_TOP . ' --')), $categories_array)) .
+ '<input type="submit" value="GO" class="operationButton">' .
+ '<input type="button" value="RESET" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES) . '\';" class="sectionButton"' . ((!empty($_GET['search']) || ($current_category_id > 0)) ? '' : ' disabled') . '>' .
</pre><pre class="diff" id="context"> '</form>';
?>
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context"> </td>
</tr>
</table>
</pre><pre class="diff"><small id="info">@@ -38,23 +39,25 @@
</small></pre><pre class="diff" id="context"> </thead>
<tbody>
<?php
</pre><pre class="diff" id="removed">- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id and cd.categories_name like :categories_name order by c.sort_order, cd.categories_name');
</pre><pre class="diff" id="added">+ $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id');
+
+ if (!empty($_GET['search'])) {
+ $Qcategories->appendQuery('and cd.categories_name like :categories_name');
</pre><pre class="diff" id="context"> $Qcategories->bindValue(':categories_name', '%' . $_GET['search'] . '%');
} else {
</pre><pre class="diff" id="removed">- $Qcategories = $osC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by c.sort_order, cd.categories_name');
</pre><pre class="diff" id="added">+ $Qcategories->appendQuery('and c.parent_id = :parent_id');
</pre><pre class="diff" id="context"> $Qcategories->bindInt(':parent_id', $current_category_id);
}
</pre><pre class="diff" id="added">+
+ $Qcategories->appendQuery('order by c.sort_order, cd.categories_name');
+
</pre><pre class="diff" id="context"> $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
$Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
$Qcategories->bindInt(':language_id', $osC_Session->value('languages_id'));
</pre><pre class="diff" id="added">+ $Qcategories->setBatchLimit($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
</pre><pre class="diff" id="context"> $Qcategories->execute();
while ($Qcategories->next()) {
</pre><pre class="diff" id="removed">- if (isset($_GET['search']) && !empty($_GET['search'])) {
- $cPath = $Qcategories->valueInt('parent_id');
- }
-
</pre><pre class="diff" id="context"> if (!isset($cInfo) && (!isset($_GET['cID']) && !isset($_GET['pID']) || (isset($_GET['cID']) && ($_GET['cID'] == $Qcategories->valueInt('categories_id')))) && ($action != 'cNew')) {
$cInfo_extra = array('childs_count' => tep_childs_in_category_count($Qcategories->valueInt('categories_id')),
'products_count' => tep_products_in_category_count($Qcategories->valueInt('categories_id')));
</pre><pre class="diff"><small id="info">@@ -65,21 +68,21 @@
</small></pre><pre class="diff" id="context"> if (isset($cInfo) && ($Qcategories->valueInt('categories_id') == $cInfo->categories_id)) {
echo ' <tr class="selected">' . "\n";
} else {
</pre><pre class="diff" id="removed">- echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, '<span id="removedchars">cPath=' . $cPath</span> . '&cID=' . $Qcategories->valueInt('categories_id')) . '\';">' . "\n";
</pre><pre class="diff" id="added">+ echo ' <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, '<span id="addedchars">page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']</span> . '&cID=' . $Qcategories->valueInt('categories_id')) . '\';">' . "\n";
</pre><pre class="diff" id="context"> }
?>
</pre><pre class="diff" id="removed">- <td><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, <span id="removedchars">tep_get_path</span>($Qcategories->valueInt('categories_id'))) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '&nbsp;<b>' . $Qcategories->value('categories_name') . '</b></a>'; ?></td>
</pre><pre class="diff" id="added">+ <td><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, <span id="addedchars">'cPath=' . $osC_CategoryTree->buildBreadcrumb</span>($Qcategories->valueInt('categories_id'))) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '&nbsp;<b>' . $Qcategories->value('categories_name') . '</b></a>'; ?></td>
</pre><pre class="diff" id="context"> <td align="center"><?php echo tep_image('templates/' . $template . '/images/icons/checkbox_ticked.gif'); ?></td>
<td align="right">
<?php
if (isset($cInfo) && ($Qcategories->valueInt('categories_id') == $cInfo->categories_id)) {
</pre><pre class="diff" id="removed">- echo '<a href="#" onClick="toggleInfoBox(\'cEdit\');">' . tep_image('templates/' . $template . '/images/icons/16x16/<span id="removedchars">configure</span>.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
</pre><pre class="diff" id="added">+ echo '<a href="#" onClick="toggleInfoBox(\'cEdit\');">' . tep_image('templates/' . $template . '/images/icons/16x16/<span id="addedchars">edit</span>.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
</pre><pre class="diff" id="context"> '<a href="#" onClick="toggleInfoBox(\'cMove\');">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a>&nbsp;' .
'<a href="#" onClick="toggleInfoBox(\'cDelete\');">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
} else {
</pre><pre class="diff" id="removed">- echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cEdit') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
- '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cMove') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '&nbsp;</a>' .
- '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
</pre><pre class="diff" id="added">+ echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cEdit') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/edit.png', IMAGE_EDIT, '16', '16') . '</a>&nbsp;' .
+ '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cMove') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . '</a>&nbsp;' .
+ '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=cDelete') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/trash.png', IMAGE_DELETE, '16', '16') . '</a>';
</pre><pre class="diff" id="context"> }
?>
</td>
</pre><pre class="diff"><small id="info">@@ -90,16 +93,21 @@
</small></pre><pre class="diff" id="context"> </tbody>
</table>
</pre><pre class="diff" id="added">+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="smallText"><?php echo $Qcategories->displayBatchLinksTotal(TEXT_DISPLAY_NUMBER_OF_CATEGORIES); ?></td>
+ <td class="smallText" align="right"><?php echo $Qcategories->displayBatchLinksPullDown('page', 'cPath=' . $cPath . '&search=' . $_GET['search']); ?></td>
+ </tr>
+ </table>
+
</pre><pre class="diff" id="context"> <p align="right">
<?php
</pre><pre class="diff" id="removed">- if (sizeof($cPath_array) > 0) {
- echo '<input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . implode('_', array_slice($cPath_array, 0, -1)) . '&cID=' . $current_category_id) . '\';" class="infoBoxButton"> ';
</pre><pre class="diff" id="added">+ if (!empty($cPath)) {
+ echo '<input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . implode('_', array_slice($cPath_array, 0, -1)) . '&search=' . $_GET['search'] . '&cID=' . $current_category_id) . '\';" class="infoBoxButton"> ';
</pre><pre class="diff" id="context"> }
</pre><pre class="diff" id="removed">- if (!isset($_GET['search'])) {
- if ($action != 'cNew') {
- echo '<input type="button" value="' . IMAGE_NEW_CATEGORY . '" onClick="toggleInfoBox(\'cNew\');" class="infoBoxButton"> ';
- }
</pre><pre class="diff" id="added">+ if (empty($_GET['search']) && ($action != 'cNew')) {
+ echo '<input type="button" value="' . IMAGE_NEW_CATEGORY . '" onClick="toggleInfoBox(\'cNew\');" class="infoBoxButton"> ';
</pre><pre class="diff" id="context"> }
?>
</p>
</pre><pre class="diff"><small id="info">@@ -108,7 +116,7 @@
</small></pre><pre class="diff" id="context"> <div id="infoBox_cNew" <?php if ($action != 'cNew') { echo 'style="display: none;"'; } ?>>
<div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/new.png', IMAGE_INSERT, '16', '16') . ' ' . TEXT_INFO_HEADING_NEW_CATEGORY; ?></div>
<div class="infoBoxContent">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('cNew', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&action=save_category', 'post', 'enctype="multipart/form-data"'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('cNew', FILENAME_CATEGORIES, '<span id="addedchars">page=' . $_GET['page'] . '&</span>cPath=' . $cPath . '&action=save_category', 'post', 'enctype="multipart/form-data"'); ?>
</pre><pre class="diff" id="context">
<p><?php echo TEXT_NEW_CATEGORY_INTRO; ?></p>
<p>
</pre><pre class="diff"><small id="info">@@ -136,10 +144,10 @@
</small></pre><pre class="diff" id="context"> <div id="infoBox_cMove" <?php if ($action != 'cMove') { echo 'style="display: none;"'; } ?>>
<div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/move.png', IMAGE_MOVE, '16', '16') . ' ' . $cInfo->categories_name; ?></div>
<div class="infoBoxContent">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('cMove', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category_confirm'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('cMove', FILENAME_CATEGORIES, 'page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search'] . '&cID=' . $cInfo->categories_id . '&action=move_category_confirm'); ?>
</pre><pre class="diff" id="context">
<p><?php echo sprintf(TEXT_MOVE_CATEGORIES_INTRO, $cInfo->categories_name); ?></p>
</pre><pre class="diff" id="removed">- <p><?php echo sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br>' . osc_draw_pull_down_menu('move_to_category_id', <span id="removedchars">tep_get_category_tree(), $current_category_id</span>); ?></p>
</pre><pre class="diff" id="added">+ <p><?php echo sprintf(TEXT_MOVE, $cInfo->categories_name) . '<br>' . osc_draw_pull_down_menu('move_to_category_id', <span id="addedchars">$categories_array</span>); ?></p>
</pre><pre class="diff" id="context">
<p align="center"><?php echo '<input type="submit" value="' . IMAGE_MOVE . '" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff"><small id="info">@@ -161,14 +169,14 @@
</small></pre><pre class="diff" id="context"> echo ' <p>' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $cInfo->products_count) . '</p>';
}
?>
</pre><pre class="diff" id="removed">- <p align="center"><?php echo '<input type="button" value="' . IMAGE_DELETE . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, '<span id="removedchars">cPath=' . $cPath</span> . '&cID=' . $cInfo->categories_id . '&action=delete_category_confirm') . '\'" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="added">+ <p align="center"><?php echo '<input type="button" value="' . IMAGE_DELETE . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, '<span id="addedchars">page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']</span> . '&cID=' . $cInfo->categories_id . '&action=delete_category_confirm') . '\'" class="operationButton"> <input type="button" value="' . IMAGE_CANCEL . '" onClick="toggleInfoBox(\'cDefault\');" class="operationButton">'; ?></p>
</pre><pre class="diff" id="context"> </div>
</div>
<div id="infoBox_cEdit" <?php if ($action != 'cEdit') { echo 'style="display: none;"'; } ?>>
<div class="infoBoxHeading"><?php echo tep_image('templates/' . $template . '/images/icons/16x16/configure.png', IMAGE_EDIT, '16', '16') . ' ' . $cInfo->categories_name; ?></div>
<div class="infoBoxContent">
</pre><pre class="diff" id="removed">- <?php echo tep_draw_form('cEdit', FILENAME_CATEGORIES, '<span id="removedchars">cPath=' . $cPath</span> . '&cID=' . $cInfo->categories_id . '&action=save_category', 'post', 'enctype="multipart/form-data"'); ?>
</pre><pre class="diff" id="added">+ <?php echo tep_draw_form('cEdit', FILENAME_CATEGORIES, '<span id="addedchars">page=' . $_GET['page'] . '&cPath=' . $cPath . '&search=' . $_GET['search']</span> . '&cID=' . $cInfo->categories_id . '&action=save_category', 'post', 'enctype="multipart/form-data"'); ?>
</pre><pre class="diff" id="context">
<p><?php echo TEXT_EDIT_INTRO; ?></p>
<p>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click