[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/template/inc_script/frontend_render/disabled/ -> deluxe-menu.com.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // This is a menu generator helping to create correct array values 
  24  // for the excellent JavaScript menu at http://deluxe-menu.com
  25  
  26  
  27  if(strpos($content["all"],'{DELUXE_MENU') !== false) {
  28  
  29  
  30      // now lets define some default array values
  31      $DeluxeMenuParam = array(); // <---- do not edit this
  32      
  33      /*
  34      var menuItems = [
  35              [text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
  36              [text, link, iconNormal, iconOver, tip, target, itemStyleInd, submenuStyleInd, jsFilename],
  37              ...
  38      ]; 
  39      */
  40      
  41      // base path - recommend phpwcms_template/inc_js/deluxe-menu
  42      $DeluxeMenuParam['base_path'] = TEMPLATE_PATH.'inc_js/deluxe-menu/';
  43      
  44      // create new array for each level - 0 = root, > 0 is sub menu
  45      $DeluxeMenuParam['icon'][0]    = array('iconNormal' => '', 'iconOver' => '');
  46      $DeluxeMenuParam['icon'][1]    = array('iconNormal' => '', 'iconOver' => '');
  47      $DeluxeMenuParam['icon'][2]    = array('iconNormal' => '', 'iconOver' => '');
  48      $DeluxeMenuParam['icon'][3]    = array('iconNormal' => '', 'iconOver' => '');
  49      $DeluxeMenuParam['icon'][4]    = array('iconNormal' => '', 'iconOver' => '');
  50  
  51      
  52      // change general values for menu here (Hint: do not use any ' here or escape it)
  53      $DeluxeMenuParam['js'] = '
  54      //--- Common
  55      var isHorizontal=1;
  56      var smColumns=1;
  57      var smOrientation=0;
  58      var smViewType=0;
  59      var dmRTL=0;
  60      var pressedItem=-2;
  61      var itemCursor="pointer";
  62      var itemTarget="_self";
  63      var statusString="link";
  64      var blankImage="img/leer.gif";
  65      
  66      //--- Dimensions
  67      var menuWidth="400px";
  68      var menuHeight="";
  69      var smWidth="";
  70      var smHeight="";
  71      
  72      //--- Positioning
  73      var absolutePos=0;
  74      var posX="0";
  75      var posY="0";
  76      var topDX=0;
  77      var topDY=0;
  78      var DX=-2;
  79      var DY=0;
  80      
  81      //--- Font
  82      var fontStyle="normal 11px Tahoma, Arial";
  83      var fontColor=["#000000","#FFFFFF"];
  84      var fontDecoration=["none","none"];
  85      var fontColorDisabled="#AAAAAA";
  86      
  87      //--- Appearance
  88      var menuBackColor="#FCEEB0";
  89      var menuBackImage="";
  90      var menuBackRepeat="repeat";
  91      var menuBorderColor="#C0AF62";
  92      var menuBorderWidth=1;
  93      var menuBorderStyle="solid";
  94      
  95      //--- Item Appearance
  96      var itemBackColor=["#FCEEB0","#65BDDC"];
  97      var itemBackImage=["",""];
  98      var itemBorderWidth=1;
  99      var itemBorderColor=["#FCEEB0","#4C99AB"];
 100      var itemBorderStyle=["solid","solid"];
 101      var itemSpacing=2;
 102      var itemPadding="3px";
 103      var itemAlignTop="left";
 104      var itemAlign="left";
 105      var subMenuAlign="left";
 106      
 107      //--- Icons
 108      var iconTopWidth=16;
 109      var iconTopHeight=16;
 110      var iconWidth=16;
 111      var iconHeight=16;
 112      var arrowWidth=8;
 113      var arrowHeight=16;
 114      var arrowImageMain=["images/arrowmain.gif","images/arrowmaino.gif"];
 115      var arrowImageSub=["images/arrowsub.gif","images/arrowsubo.gif"];
 116      
 117      //--- Separators
 118      var separatorImage="images/sep.gif";
 119      var separatorWidth="100%";
 120      var separatorHeight="3";
 121      var separatorAlignment="left";
 122      var separatorVImage="images/sep2.gif";
 123      var separatorVWidth="2";
 124      var separatorVHeight="100%";
 125      var separatorPadding="2px";
 126      
 127      //--- Floatable Menu
 128      var floatable=0;
 129      var floatIterations=6;
 130      var floatableX=1;
 131      var floatableY=1;
 132      
 133      //--- Movable Menu
 134      var movable=0;
 135      var moveWidth=12;
 136      var moveHeight=20;
 137      var moveColor="#DECA9A";
 138      var moveImage="";
 139      var moveCursor="move";
 140      var smMovable=0;
 141      var closeBtnW=15;
 142      var closeBtnH=15;
 143      var closeBtn="";
 144      
 145      //--- Transitional Effects & Filters
 146      var transparency="80";
 147      var transition=24;
 148      var transOptions="";
 149      var transDuration=350;
 150      var transDuration2=200;
 151      var shadowLen=3;
 152      var shadowColor="#B1B1B1";
 153      var shadowTop=0;
 154      
 155      //--- CSS Support (CSS-based Menu)
 156      var cssStyle=0;
 157      var cssSubmenu="";
 158      var cssItem=["",""];
 159      var cssItemText=["",""];
 160      
 161      //--- Advanced
 162      var dmObjectsCheck=0;
 163      var saveNavigationPath=1;
 164      var showByClick=0;
 165      var noWrap=1;
 166      var pathPrefix_img="";
 167      var pathPrefix_link="";
 168      var smShowPause=200;
 169      var smHidePause=1000;
 170      var smSmartScroll=1;
 171      var smHideOnClick=1;
 172      var dm_writeAll=1;
 173      
 174      //--- AJAX-like Technology
 175      var dmAJAX=0;
 176      var dmAJAXCount=0;
 177      
 178      //--- Dynamic Menu
 179      var dynamic=0;
 180      
 181      //--- Keystrokes Support
 182      var keystrokes=0;
 183      var dm_focus=1;
 184      var dm_actKey=113;
 185      
 186      var menuItems = [
 187      ';
 188  
 189  
 190      // stop editing here
 191      
 192      
 193      
 194      
 195      
 196      /*******************************************************************************/
 197  	function createDeluxeMenuJSCode($start_id=0, $counter=0, & $param) {
 198      
 199          $li                = '';
 200          $TAB            = str_repeat('  ', $counter);
 201          
 202          foreach($GLOBALS['content']['struct'] as $key => $value) {
 203      
 204              // ["Product Info","", "default.files/icon1.gif", "default.files/icon1o.gif", , , , , , ],
 205      
 206              if($GLOBALS['content']['struct'][$key]["acat_struct"] == $start_id && $key    && (!$GLOBALS['content']['struct'][$key]['acat_hidden'] || ($GLOBALS['content']['struct'][$key]["acat_hidden"] == 2 && isset($GLOBALS['LEVEL_KEY'][$key])))) {
 207              
 208                  $li .= $TAB.'  ["'.str_repeat('|', $counter);
 209                  $link = '';
 210                  if(!$GLOBALS['content']['struct'][$key]["acat_redirect"]) {
 211                      $link .= 'index.php?';
 212                      if($GLOBALS['content']['struct'][$key]['acat_alias']) {
 213                          $link .= $GLOBALS['content']['struct'][$key]['acat_alias'];
 214                      } else {
 215                          $link .= 'id='.$key.',0,0,1,0,0';
 216                      }
 217                      $target = '';
 218                  } else {
 219                      $link     = explode(' ', $GLOBALS['content']['struct'][$key]["acat_redirect"]);
 220                      $link    = empty($link[0]) ? '#' : $link[0];
 221                      $target    = empty($link[1]) ? ''  :strtolower($link[1]);
 222                  }
 223                  $li .= html_specialchars($GLOBALS['content']['struct'][$key]['acat_name']);
 224                  
 225                  $inorm = empty($param['icon'][$counter]['iconNormal']) ? '' : trim($param['icon'][$counter]['iconNormal']);
 226                  $iover = empty($param['icon'][$counter]['iconOver']) ? '' : trim($param['icon'][$counter]['iconOver']);
 227                  
 228                  $li .= '", "'.$link.'", "'.$inorm.'", "'.$iover.'", , "'.$target.'", , , , ],'.LF;
 229                  $li .= createDeluxeMenuJSCode($key, $counter+1, $param);
 230      
 231              }
 232          }
 233      
 234          return $li;
 235      }
 236      /*******************************************************************************/
 237      
 238      $GLOBALS['DeluxeMenuParam']['start_at_ID'] = 0;
 239      $content['all'] = str_replace('{DELUXE_MENU}', '{DELUXE_MENU:0}', $content['all']);
 240      $content['all'] = preg_replace_callback('/\{DELUXE_MENU:(.*?)\}/', create_function('$matches', '$GLOBALS["DeluxeMenuParam"]["start_at_ID"]=$matches[1]; return "{DELUXE_MENU}";'), $content['all']);
 241  
 242      $DeluxeMenuParam['start_at_ID'] = intval($GLOBALS['DeluxeMenuParam']['start_at_ID']);
 243      
 244      $DeluxeMenuParam['js'] .= createDeluxeMenuJSCode($DeluxeMenuParam['start_at_ID'], $counter=0, $DeluxeMenuParam);
 245      
 246      $DeluxeMenuParam['js'] .= LF.'   ]'.LF;
 247      
 248      
 249      
 250      
 251      $DeluxeMenuParam['text']  = '<script language="javascript">'.LF.SCRIPT_CDATA_START;
 252      $DeluxeMenuParam['text'] .= LF.'dm_init();'.LF;
 253      $DeluxeMenuParam['text'] .= SCRIPT_CDATA_END.LF.'</script><noscript>';
 254      $DeluxeMenuParam['text'] .= buildCascadingMenu( ',' . $DeluxeMenuParam['start_at_ID'] );
 255      $DeluxeMenuParam['text'] .= '</noscript>';
 256      
 257      
 258      $block['custom_htmlhead']['DeluxeMenu']  = '  <script language="javascript">'.LF.'  '.SCRIPT_CDATA_START.LF;
 259      $block['custom_htmlhead']['DeluxeMenu'] .= '    var dmWorkPath="'.$DeluxeMenuParam['base_path'].'";';
 260      $block['custom_htmlhead']['DeluxeMenu'] .= LF.'  '.SCRIPT_CDATA_END.LF.'  </script>'.LF;
 261      $block['custom_htmlhead']['DeluxeMenu'] .= '  <script type="text/javascript" src="'.$DeluxeMenuParam['base_path'].'dmenu.js"></script>';
 262      $block['custom_htmlhead']['DeluxeMenu'] .= LF.'  <script language="javascript">'.LF.'  '.SCRIPT_CDATA_START.LF;
 263      $block['custom_htmlhead']['DeluxeMenu'] .= $DeluxeMenuParam['js'];
 264      $block['custom_htmlhead']['DeluxeMenu'] .= LF.'  '.SCRIPT_CDATA_END.LF.'  </script>'.LF;
 265      
 266      $content['all'] = str_replace('{DELUXE_MENU}', $DeluxeMenuParam['text'], $content['all']);
 267  
 268  
 269  
 270  }
 271  
 272  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7