[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/includes/boxes/ -> categories_dhtml.php (source)

   1  <!-- categories //-->
   2  
   3  <?php
   4  
   5  /*
   6    Dynamic DHTL MenuBar for category listing v 0.2.1
   7    This is a combination of modified categories.php and
   8    HV Menu javacript written by Ger Versluis (c) 2000 version 5.411 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
   9  *    HV Menu found on Dynamic Drive ONLY may be used on both commercial and non commerical sites    *
  10  *    For info about HV Menu write to [email protected]            
  11  
  12    Modifications for osCommerce menuBar_0_2 made by John Guerra 2/9/2003
  13    [email protected]
  14  */
  15    define('LEFT_LINK_HEIGHT',20);
  16    define('LEFT_LINK_WIDTH',110);
  17  
  18    $boxHeading = BOX_HEADING_CATEGORIES;
  19    $corner_left = 'square';
  20    $corner_right = 'square';
  21    $box_base_name = 'categories'; // for easy unique box template setup (added BTSv1.2)
  22  
  23    $box_id = $box_base_name . 'Box';  // for CSS styling paulm (editted BTSv1.2)
  24  
  25  ?>
  26  <script type='text/javascript'><!-- categories_dhtml_bof //-->
  27  /*********************************************************************************************************************************************
  28  *    (c) Ger Versluis 2000 version 5.411 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
  29  *    HV Menu found on Dynamic Drive ONLY may be used on both commercial and non commerical sites    *
  30  *    For info write to [email protected]                                    *
  31  *       This script featured on Dynamic Drive DHTML code library: http://www.dynamicdrive.com
  32  **********************************************************************************************************************************************/
  33  
  34      var LowBgColor='transparent';            // Background color when mouse is not over
  35      var LowSubBgColor='white';            // Background color when mouse is not over on subs
  36      var HighBgColor='transparent';            // Background color when mouse is over
  37      var HighSubBgColor='white';            // Background color when mouse is over on subs
  38      var FontLowColor='black';            // Font color when mouse is not over
  39      var FontSubLowColor='black';            // Font color subs when mouse is not over
  40      var FontHighColor='#6699cc';            // Font color when mouse is over
  41      var FontSubHighColor='#6699cc';            // Font color subs when mouse is over
  42      var BorderColor='transparent';            // Border color
  43      var BorderSubColor='#6699cc';            // Border color for subs
  44      var BorderWidth=1;                // Border width
  45      var BorderBtwnElmnts=0;            // Border between elements 1 or 0
  46      var FontFamily="Verdana, Arial, sans-serif"    // Font family menu items
  47      var FontSize=8;                // Font size menu items
  48      var FontBold=0;                // Bold menu items 1 or 0
  49      var FontItalic=0;                // Italic menu items 1 or 0
  50      var MenuTextCentered='left';            // Item text position 'left', 'center' or 'right'
  51      var MenuCentered='left';            // Menu horizontal position 'left', 'center' or 'right'
  52      var MenuVerticalCentered='top';        // Menu vertical position 'top', 'middle','bottom' or static
  53      var ChildOverlap=.0;                // horizontal overlap child/ parent
  54      var ChildVerticalOverlap=.0;            // vertical overlap child/ parent
  55      var StartTop=0;                // Menu offset x coordinate
  56      var StartLeft=0;                // Menu offset y coordinate
  57      var VerCorrect=0;                // Multiple frames y correction
  58      var HorCorrect=0;                // Multiple frames x correction
  59      var LeftPaddng=1;                // Left padding
  60      var TopPaddng=0;                // Top padding
  61      var DissapearDelay=500;            // delay before menu folds in
  62  
  63      var FirstLineHorizontal=0;            // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
  64      var MenuFramesVertical=1;            // Frames in cols or rows 1 or 0
  65      var TakeOverBgColor=1;            // Menu frame takes over background color subitem frame
  66      var FirstLineFrame='navig';            // Frame where first level appears
  67      var SecLineFrame='space';            // Frame where sub levels appear
  68      var DocTargetFrame='space';            // Frame where target documents appear
  69      var TargetLoc='MenuBar';                // span id for relative positioning
  70      var HideTop=0;                // Hide first level when loading new document 1 or 0
  71      var MenuWrap=1;                // enables/ disables menu wrap 1 or 0
  72      var RightToLeft=0;                // enables/ disables right to left unfold 1 or 0
  73      var UnfoldsOnClick=0;            // Level 1 unfolds onclick/ onmouseover
  74      var WebMasterCheck=0;            // menu tree checking on or off 1 or 0
  75      var ShowArrow=0;                // Uses arrow gifs when 1
  76      var KeepHilite=1;                // Keep selected path highligthed
  77      var Arrws=['<?php echo DIR_WS_IMAGES; ?>tri.gif',5,10,'<?php echo DIR_WS_IMAGES; ?>tridown.gif',10,5,'<?php echo DIR_WS_IMAGES; ?>trileft.gif',5,10];    // Arrow source, width and height
  78  
  79  function BeforeStart(){return}
  80  function AfterBuild(){return}
  81  function BeforeFirstOpen(){return}
  82  function AfterCloseAll(){return}
  83  function Go(){return}
  84  
  85  <?php  
  86  
  87   $number_top_levels = 0;
  88   $categories_string='';
  89    $number_top_levels = build_menus(0,'','');
  90    echo 'var NoOffFirstLineMenus= ' . $number_top_levels. ';'    ;        // Number of first level items
  91    echo $categories_string;
  92  
  93  function build_menus($currentParID,$menustr,$catstr) {
  94      global $categories_string, $id, $languages_id;
  95      $tmpCount;
  96     
  97     $tmpCount = 0;
  98     $haschildren = 0; //default
  99  
 100  // BOF Enable - Disable Categories Contribution-------------------------------------- 
 101  // BOF Original line
 102       $categories_query_catmenu = 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 = '" . $currentParID . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
 103  // EOF Original line
 104  
 105  // BOF Enable - Disable Categories
 106  //   $categories_query_catmenu = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $currentParID . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
 107  // EOF Enable - Disable Categories
 108  // EOF Enable - Disable Categories Contribution-------------------------------------- 
 109  
 110     
 111     while ($categories = tep_db_fetch_array($categories_query_catmenu))  {
 112       $tmpString = '';
 113       $tmpCount += 1;
 114       $haschildren=tep_has_category_subcategories($categories['categories_id']);
 115  
 116       if ($haschildren) {
 117           if($menustr != ''){
 118             $menu_tmp = $menustr . '_' . $tmpCount;
 119           } else {
 120             $menu_tmp = $tmpCount;
 121           }
 122           if($catstr != ''){
 123             $cat_tmp = $catstr . '_' . $categories['categories_id'];
 124           } else {
 125             $cat_tmp = $categories['categories_id'];
 126           }
 127         $NumChildren = build_menus($categories['categories_id'],$menu_tmp,$cat_tmp);     } else {
 128         $NumChildren = 0; 
 129        }
 130  
 131      if ($id==$categories['categories_id']) {
 132        $tmpString .= '<b>';
 133      }
 134      // display category name
 135      $tmpString .= $categories['categories_name'];
 136  
 137      if ( $id==$categories['categories_id'] ) {
 138        $tmpString .= '</b>';
 139      }
 140      if (SHOW_COUNTS == 'true') {
 141        $products_in_category = tep_count_products_in_category($categories['categories_id']);
 142        if ($products_in_category > 0) {
 143          $tmpString .= ' (' . $products_in_category . ')';
 144        }
 145      }
 146  
 147       if($catstr != ''){
 148          $cPath_new = 'cPath=' . $catstr . '_' . $categories['categories_id'];
 149       } else {
 150          $cPath_new = 'cPath=' . $categories['categories_id'];
 151       }
 152  
 153    // Menu tree
 154  //    Menu1_1_1=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
 155           if($menustr != ''){
 156             $menu_tmp = $menustr . '_' . $tmpCount;
 157           } else {
 158             $menu_tmp = $tmpCount;
 159           }
 160  $categories_string .=  'Menu' . ($menustr!=''?$menustr.'_':'') . $tmpCount;
 161  $categories_string .=  '= new Array("' . $tmpString . '","';
 162  $categories_string .=  tep_href_link(FILENAME_DEFAULT, $cPath_new);
 163  $categories_string .= '","",' ;
 164  $categories_string .= $NumChildren;
 165  $categories_string .= ',' . LEFT_LINK_HEIGHT . ',' . LEFT_LINK_WIDTH ;
 166  $categories_string .= '); ';
 167     
 168      }// end while
 169      return $tmpCount;
 170    }  //end build menus
 171  
 172  echo '</script>';
 173  
 174  $tabletext ="<table><tr><td><div id='MenuBar' style='position:relative; width: " . LEFT_LINK_WIDTH . "; height: " . ($number_top_levels*LEFT_LINK_HEIGHT) . ";'>&nbsp;</div></td></tr></table>";
 175  
 176  //  $info_box_contents = array();
 177  //$info_box_contents[] = array('align' => 'left',
 178  //                               'text'  => $tabletext
 179  //                              );
 180  // new infoBox($info_box_contents);
 181  $boxContent = $tabletext;
 182  
 183  include (bts_select('boxes', $box_base_name)); // BTS 1.5
 184  
 185  ?>
 186  <SCRIPT LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
 187  
 188             
 189  <!-- categories_dhtml_eof //-->


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7