Permalink
Browse files

Modularize boxes; remove column_left/right.php

  • Loading branch information...
1 parent c2066d2 commit beae7015bb74416e0919d26b7f43789cd9a2475c @haraldpdl haraldpdl committed Nov 6, 2010
Showing with 1,691 additions and 794 deletions.
  1. +5 −0 catalog/admin/includes/boxes/modules.php
  2. +1 −0 catalog/admin/includes/languages/english.php
  3. +1 −0 catalog/admin/includes/languages/english/modules.php
  4. +9 −1 catalog/admin/modules.php
  5. +0 −35 catalog/includes/boxes/best_sellers.php
  6. +0 −131 catalog/includes/boxes/categories.php
  7. +0 −44 catalog/includes/boxes/currencies.php
  8. +0 −27 catalog/includes/boxes/information.php
  9. +0 −36 catalog/includes/boxes/languages.php
  10. +0 −34 catalog/includes/boxes/manufacturer_info.php
  11. +0 −56 catalog/includes/boxes/manufacturers.php
  12. +0 −43 catalog/includes/boxes/order_history.php
  13. +0 −40 catalog/includes/boxes/product_notifications.php
  14. +0 −47 catalog/includes/boxes/product_social_bookmarks.php
  15. +0 −46 catalog/includes/boxes/reviews.php
  16. +0 −26 catalog/includes/boxes/search.php
  17. +0 −65 catalog/includes/boxes/shopping_cart.php
  18. +0 −30 catalog/includes/boxes/specials.php
  19. +0 −35 catalog/includes/boxes/whats_new.php
  20. +0 −34 catalog/includes/column_left.php
  21. +0 −53 catalog/includes/column_right.php
  22. +15 −9 catalog/includes/functions/cache.php
  23. +15 −0 catalog/includes/languages/english/modules/boxes/bm_best_sellers.php
  24. +15 −0 catalog/includes/languages/english/modules/boxes/bm_categories.php
  25. +15 −0 catalog/includes/languages/english/modules/boxes/bm_currencies.php
  26. +15 −0 catalog/includes/languages/english/modules/boxes/bm_information.php
  27. +15 −0 catalog/includes/languages/english/modules/boxes/bm_languages.php
  28. +15 −0 catalog/includes/languages/english/modules/boxes/bm_manufacturer_info.php
  29. +15 −0 catalog/includes/languages/english/modules/boxes/bm_manufacturers.php
  30. +15 −0 catalog/includes/languages/english/modules/boxes/bm_order_history.php
  31. +15 −0 catalog/includes/languages/english/modules/boxes/bm_product_notifications.php
  32. +15 −0 catalog/includes/languages/english/modules/boxes/bm_product_social_bookmarks.php
  33. +15 −0 catalog/includes/languages/english/modules/boxes/bm_reviews.php
  34. +15 −0 catalog/includes/languages/english/modules/boxes/bm_search.php
  35. +15 −0 catalog/includes/languages/english/modules/boxes/bm_shopping_cart.php
  36. +15 −0 catalog/includes/languages/english/modules/boxes/bm_specials.php
  37. +15 −0 catalog/includes/languages/english/modules/boxes/bm_whats_new.php
  38. +82 −0 catalog/includes/modules/boxes/bm_best_sellers.php
  39. +187 −0 catalog/includes/modules/boxes/bm_categories.php
  40. +87 −0 catalog/includes/modules/boxes/bm_currencies.php
  41. +71 −0 catalog/includes/modules/boxes/bm_information.php
  42. +81 −0 catalog/includes/modules/boxes/bm_languages.php
  43. +79 −0 catalog/includes/modules/boxes/bm_manufacturer_info.php
  44. +113 −0 catalog/includes/modules/boxes/bm_manufacturers.php
  45. +88 −0 catalog/includes/modules/boxes/bm_order_history.php
  46. +85 −0 catalog/includes/modules/boxes/bm_product_notifications.php
  47. +89 −0 catalog/includes/modules/boxes/bm_product_social_bookmarks.php
  48. +91 −0 catalog/includes/modules/boxes/bm_reviews.php
  49. +70 −0 catalog/includes/modules/boxes/bm_search.php
  50. +110 −0 catalog/includes/modules/boxes/bm_shopping_cart.php
  51. +70 −0 catalog/includes/modules/boxes/bm_specials.php
  52. +78 −0 catalog/includes/modules/boxes/bm_whats_new.php
  53. +6 −2 catalog/includes/template_bottom.php
  54. +48 −0 catalog/install/oscommerce.sql
@@ -40,6 +40,11 @@
),
array(
'code' => FILENAME_MODULES,
+ 'title' => BOX_MODULES_BOXES,
+ 'link' => tep_href_link(FILENAME_MODULES, 'set=boxes')
+ ),
+ array(
+ 'code' => FILENAME_MODULES,
'title' => BOX_MODULES_SOCIAL_BOOKMARKS,
'link' => tep_href_link(FILENAME_MODULES, 'set=social_bookmarks')
),
@@ -71,6 +71,7 @@ function tep_date_raw($date, $reverse = false) {
define('BOX_MODULES_ORDER_TOTAL', 'Order Total');
define('BOX_MODULES_ACTION_RECORDER', 'Action Recorder');
define('BOX_MODULES_HEADER_TAGS', 'Header Tags');
+define('BOX_MODULES_BOXES', 'Boxes');
define('BOX_MODULES_SOCIAL_BOOKMARKS', 'Social Bookmarks');
define('BOX_MODULES_ADMIN_DASHBOARD', 'Admin Dashboard');
@@ -15,6 +15,7 @@
define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Order Total Modules');
define('HEADING_TITLE_MODULES_ACTION_RECORDER', 'Action Recorder Modules');
define('HEADING_TITLE_MODULES_HEADER_TAGS', 'Header Tag Modules');
+define('HEADING_TITLE_MODULES_BOXES', 'Box Modules');
define('HEADING_TITLE_MODULES_SOCIAL_BOOKMARKS', 'Social Bookmark Modules');
define('HEADING_TITLE_MODULES_ADMIN_DASHBOARD', 'Admin Dashboard Modules');
View
@@ -56,6 +56,14 @@
define('HEADING_TITLE', HEADING_TITLE_MODULES_HEADER_TAGS);
$template_integration = true;
break;
+ case 'boxes':
+ $module_type = 'boxes';
+ $module_directory = DIR_FS_CATALOG_MODULES . 'boxes/';
+ $module_language_directory = DIR_FS_CATALOG_LANGUAGES;
+ $module_key = 'MODULE_BOXES_INSTALLED';
+ define('HEADING_TITLE', HEADING_TITLE_MODULES_BOXES);
+ $template_integration = true;
+ break;
case 'dashboard':
$module_type = 'dashboard';
$module_directory = DIR_FS_ADMIN . 'includes/modules/dashboard/';
@@ -144,7 +152,7 @@
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
</tr>
<?php
- $modules_installed = explode(';', constant($module_key));
+ $modules_installed = (defined($module_key) ? explode(';', constant($module_key)) : array());
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
$directory_array = array();
@@ -1,35 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (isset($current_category_id) && ($current_category_id > 0)) {
- $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
- } else {
- $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
- }
-
- if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
- $bestsellers_list = '<ol style="margin: 0; padding-left: 25px;">';
- while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
- $bestsellers_list .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></li>';
- }
- $bestsellers_list .= '</ol>';
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_BESTSELLERS; ?></div>
-
- <div class="ui-widget-content infoBoxContents"><?php echo $bestsellers_list; ?></div>
-</div>
-
-<?php
- }
-?>
@@ -1,131 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-
- $categories_string = '';
-
- function tep_show_category($counter) {
- global $tree, $categories_string, $cPath_array;
-
- for ($i=0; $i<$tree[$counter]['level']; $i++) {
- $categories_string .= "&nbsp;&nbsp;";
- }
-
- $categories_string .= '<a href="';
-
- if ($tree[$counter]['parent'] == 0) {
- $cPath_new = 'cPath=' . $counter;
- } else {
- $cPath_new = 'cPath=' . $tree[$counter]['path'];
- }
-
- $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
-
- if (isset($cPath_array) && in_array($counter, $cPath_array)) {
- $categories_string .= '<strong>';
- }
-
-// display category name
- $categories_string .= $tree[$counter]['name'];
-
- if (isset($cPath_array) && in_array($counter, $cPath_array)) {
- $categories_string .= '</strong>';
- }
-
- if (tep_has_category_subcategories($counter)) {
- $categories_string .= '-&gt;';
- }
-
- $categories_string .= '</a>';
-
- if (SHOW_COUNTS == 'true') {
- $products_in_category = tep_count_products_in_category($counter);
- if ($products_in_category > 0) {
- $categories_string .= '&nbsp;(' . $products_in_category . ')';
- }
- }
-
- $categories_string .= '<br />';
-
- if ($tree[$counter]['next_id'] != false) {
- tep_show_category($tree[$counter]['next_id']);
- }
- }
-
- $categories_string = '';
- $tree = array();
-
- $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.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
- while ($categories = tep_db_fetch_array($categories_query)) {
- $tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
- 'parent' => $categories['parent_id'],
- 'level' => 0,
- 'path' => $categories['categories_id'],
- 'next_id' => false);
-
- if (isset($parent_id)) {
- $tree[$parent_id]['next_id'] = $categories['categories_id'];
- }
-
- $parent_id = $categories['categories_id'];
-
- if (!isset($first_element)) {
- $first_element = $categories['categories_id'];
- }
- }
-
- //------------------------
- if (tep_not_null($cPath)) {
- $new_path = '';
- reset($cPath_array);
- while (list($key, $value) = each($cPath_array)) {
- unset($parent_id);
- unset($first_id);
- $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.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
- if (tep_db_num_rows($categories_query)) {
- $new_path .= $value;
- while ($row = tep_db_fetch_array($categories_query)) {
- $tree[$row['categories_id']] = array('name' => $row['categories_name'],
- 'parent' => $row['parent_id'],
- 'level' => $key+1,
- 'path' => $new_path . '_' . $row['categories_id'],
- 'next_id' => false);
-
- if (isset($parent_id)) {
- $tree[$parent_id]['next_id'] = $row['categories_id'];
- }
-
- $parent_id = $row['categories_id'];
-
- if (!isset($first_id)) {
- $first_id = $row['categories_id'];
- }
-
- $last_id = $row['categories_id'];
- }
- $tree[$last_id]['next_id'] = $tree[$value]['next_id'];
- $tree[$value]['next_id'] = $first_id;
- $new_path .= '_';
- } else {
- break;
- }
- }
- }
- tep_show_category($first_element);
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_CATEGORIES; ?></div>
-
- <div class="ui-widget-content infoBoxContents">
- <?php echo $categories_string; ?>
- </div>
-</div>
@@ -1,44 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (isset($currencies) && is_object($currencies) && (count($currencies->currencies) > 1)) {
- reset($currencies->currencies);
- $currencies_array = array();
- while (list($key, $value) = each($currencies->currencies)) {
- $currencies_array[] = array('id' => $key, 'text' => $value['title']);
- }
-
- $hidden_get_variables = '';
- reset($HTTP_GET_VARS);
- while (list($key, $value) = each($HTTP_GET_VARS)) {
- if ( is_string($value) && ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
- $hidden_get_variables .= tep_draw_hidden_field($key, $value);
- }
- }
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_CURRENCIES; ?></div>
-
- <div class="ui-widget-content infoBoxContents">
-
-<?php
- echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') .
- tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>';
-?>
-
- </div>
-</div>
-
-<?php
- }
-?>
@@ -1,27 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_INFORMATION; ?></div>
-
- <div class="ui-widget-content infoBoxContents">
-
-<?php
- echo '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br />' .
- '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br />' .
- '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br />' .
- '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>';
-?>
-
- </div>
-</div>
@@ -1,36 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (!isset($lng) || (isset($lng) && !is_object($lng))) {
- include(DIR_WS_CLASSES . 'language.php');
- $lng = new language;
- }
-
- if (count($lng->catalog_languages) > 1) {
- $languages_string = '';
- reset($lng->catalog_languages);
- while (list($key, $value) = each($lng->catalog_languages)) {
- $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
- }
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_LANGUAGES; ?></div>
-
- <div class="ui-widget-content infoBoxContents">
- <?php echo $languages_string; ?>
- </div>
-</div>
-
-<?php
- }
-?>
@@ -1,34 +0,0 @@
-<?php
-/*
- $Id$
-
- osCommerce, Open Source E-Commerce Solutions
- http://www.oscommerce.com
-
- Copyright (c) 2010 osCommerce
-
- Released under the GNU General Public License
-*/
-
- if (isset($HTTP_GET_VARS['products_id'])) {
- $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
- if (tep_db_num_rows($manufacturer_query)) {
- $manufacturer = tep_db_fetch_array($manufacturer_query);
-
- $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0" class="ui-widget-content infoBoxContents">';
- if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';
- if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top">-&nbsp;</td><td valign="top"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';
- $manufacturer_info_string .= '<tr><td valign="top">-&nbsp;</td><td valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr>' .
- '</table>';
-?>
-
-<div class="ui-widget infoBoxContainer">
- <div class="ui-widget-header infoBoxHeading"><?php echo BOX_HEADING_MANUFACTURER_INFO; ?></div>
-
- <?php echo $manufacturer_info_string; ?>
-</div>
-
-<?php
- }
- }
-?>
Oops, something went wrong.

0 comments on commit beae701

Please sign in to comment.