Caravel CMS PHP Cross Reference Content Management Systems

Source: /apps/Navigator/Navigator.php - 1495 lines - 71276 bytes - Summary - Text - Print

   1  <?php
   2  
   3  require_once (T_CODE_BASE . 'App.php');
   4  require_once(T_WIDGET_BASE . 'FormWidget/FormWidget.php');
   5  
   6  /**
   7  * navigation menu CBA
   8  *
   9  * @author   David Glick <davidig@goshen.edu>
  10  */
  11  class Navigator extends App
  12      {
  13      var $tpl;
  14      var $backComp;
  15      var $strLength;
  16      var $navMaxLen = array();
  17      // used in list building
  18      var $count = false;
  19      var $indent = 0;
  20      var $useIndents = false;
  21  
  22      function ignoreAllCSS()
  23          {
  24          return null;
  25          }
  26  
  27      function onInit()
  28          {
  29          if (!isset($this->settingsVars['title'])) $this->settingsVars['title'] = '';
  30          }
  31      
  32      function onSave()
  33          {
  34          if ($this->httpVars['cWidthHiddencss'] != '')
  35              {
  36              $values = explode(';', $this->httpVars['cWidthHiddencss']);
  37              $this->httpVars['cWidthHiddencss'] = array();
  38              for($i=0;$i < count($values);$i= $i + 2)
  39                  {
  40                  $this->httpVars['cWidthHiddencss'][$values[$i]] = $values[$i+1]; 
  41                  }    
  42              $settings['cWidthHiddencss'] = $this->httpVars['cWidthHiddencss'];
  43              }
  44          if($this->httpVars['style'] == 'ccaravel')
  45              {
  46              $settings['backComp'] = 1;
  47              $settings['title'] = " ";
  48              $settings['titleVAlign']= $this->settingsVars['titleVAlign'];
  49              $settings['titleVOffset'] = $this->settingsVars['titleVOffset'];
  50              $settings['titleHOffset'] = $this->settingsVars['titleHOffset'];
  51  
  52              $this->httpVars['classic_height'] = ereg_replace("[^0-9.]", "", $this->httpVars['classic_height']);
  53              $settings['height'] = $this->httpVars['classic_height'];
  54              $settings['alternatemarkup'] = $this->httpVars['classic_alternate'];
  55              }
  56              
  57          if($this->httpVars['style'] == 'ccaravel')
  58              {
  59              require_once('HTML/CSS.php');
  60              $this->settingsVars['style'] = 'ccaravel';
  61              $file = DN::dnToCSSFile($this->section->ldapDN);
  62              $css = new HTML_CSS(array('filename' => $file), array('error_handler' => 'Navigator::ignoreCSSErrors'));
  63              $newcss = new HTML_CSS(array(), array('error_handler' => 'Navigator::ignoreCSSErrors'));
  64              $mstyles = $css->toArray();
  65  
  66              $mstyles['.appNavigator .navButton:link, .appNavigator .navTab:link, .appNavigator .navButton:visited, .appNavigator .navTab:visited']['background-color'] = $this->httpVars['classic_standardbg'];
  67              $mstyles['.appNavigator .navButton:link, .appNavigator .navTab:link, .appNavigator .navButton:visited, .appNavigator .navTab:visited']['color'] = $this->httpVars['classic_standardtext'];
  68              $mstyles['.appNavigator #current, .appNavigator .navTab:hover, .appNavigator .navButton:hover']['background-color'] = $this->httpVars['classic_hoverbg'];
  69              $mstyles['.appNavigator #current, .appNavigator .navTab:hover, .appNavigator .navButton:hover']['color'] = $this->httpVars['classic_hovertext']; 
  70              $mstyles['.appNavigator .navButton#active, .appNavigator .navTab#active']['background-color'] = $this->httpVars['classic_activebg'];
  71              $mstyles['.appNavigator .navButton#active, .appNavigator .navTab#active']['color'] = $this->httpVars['classic_activetext'];
  72  
  73              if(is_numeric($this->httpVars['classic_indent']))
  74                      $this->httpVars['classic_indent'] .= "px"; 
  75              $mstyles['.tabDiv, .subsections td']['padding-left'] = $this->httpVars['classic_indent'];
  76              if($this->httpVars['style'] == 'ccaravel' && $this->httpVars['classic_bgimg'] != "")
  77                      {
  78                      $mstyles['#' . $this->blockID . ' .blockContent']['background-image'] = "url('" . DN::dnToUrl($this->httpVars['classic_bgimg'], true) . "')";
  79                      $mstyles['#' . $this->blockID . ' .blockContent']['background-repeat'] = "no-repeat";
  80                      }
  81              else
  82                      {
  83                      unset($mstyles['#' . $this->blockID . ' .blockContent']['background-image']);    
  84                      $mstyles['#' . $this->blockID . ' .blockContent']['background-repeat'] = "no-repeat";
  85                      }
  86  
  87              $mstyles['#' . $this->blockID . ' .subsections']['background-color'] = $this->httpVars['classic_leveltwobg'];
  88              
  89              foreach($mstyles as $selector => $styles)
  90               if(is_array($styles))
  91                       foreach($styles as $k => $k1)
  92                              {
  93                              if(!isset($k1))
  94                                      continue;
  95                              if(strpos($selector, ','))
  96                                      {
  97                                      if(!isset($createdgroup[$selector]))
  98                                              {
  99                                              $gid = $newcss->createGroup($selector);
 100                                              $createdgroup[$selector] = $gid;
 101                                              }
 102                                      else
 103                                              $gid = $createdgroup[$selector];
 104                                      $newcss->setGroupStyle($gid, $k, $k1);
 105                                      }
 106                              else
 107                                      $newcss->setStyle($selector, $k, $k1);
 108                              }
 109  
 110              $res = $newcss->toFile($file);
 111              }    
 112          $settings['buttonwidth'] = $this->httpVars['buttonwidth'];
 113          if(is_numeric($settings['buttonwidth']))
 114            $settings['buttonwidth'] .= 'px';
 115  
 116          $settings['buttonheight'] = $this->httpVars['buttonheight'];
 117          if(is_numeric($settings['buttonheight']))
 118            $settings['buttonheight'] .= 'px';
 119          
 120          $fields = array('base', 'style', 'separator','bgcolorNav', 'bgcolorNavHover',  'borderNavPrimary', 'borderNavSecondary', 'textColor', 'textHoverColor');
 121          
 122          foreach($fields as $field)
 123              $settings[$field] = @$this->httpVars[$field];
 124  
 125          $list = array('self', 'sibs', 'child', 'desc', 'pedigree', 'family', 'custombox');
 126          $after = array();
 127        
 128          if (isset($this->httpVars['custombox']))
 129            {
 130              $menu = explode(';', $this->httpVars['customCreatedMenu']);
 131              $newMenu = array();
 132              for($i=0; $i < count($menu)-1;$i=$i+3)
 133              {
 134                $newMenu[$i] = array('link' => $menu[$i], 'lvl' => $menu[$i + 1], 'name' => $menu[$i + 2]);
 135              }
 136              $settings['customMenu'] = serialize($newMenu);
 137            }
 138          else
 139            $settings['customMenu'] = $this->settingsVars['customMenu'];
 140        
 141          foreach($list as $key)
 142              if (isset($this->httpVars[$key]))
 143                  array_push($after , $key);
 144  
 145          $settings['list'] = serialize($after);                                                         
 146          $settings['smartWidth'] = $this->httpVars['smartWidth'];
 147          $settings['hmaxWidth'] = $this->httpVars['hmaxWidth'];
 148  
 149          if(isset($this->httpVars['bgimage'.$settings['style']]))
 150              $settings['bgimage'] = $this->httpVars['bgimage'.$settings['style']];
 151          if(isset($this->httpVars['rollimage'.$settings['style']]))
 152              $settings['rollimage'] = $this->httpVars['rollimage'.$settings['style']];
 153  
 154          if(isset($this->httpVars['repeat'.$settings['style']]))
 155              $settings['repeat'] = $this->httpVars['repeat'.$settings['style']];
 156    
 157          if(isset($this->httpVars['alignment'.$settings['style']]))
 158              $settings['alignment'] = $this->httpVars['alignment'.$settings['style']];
 159          else
 160              $settings['alignment'] = "";    
 161  
 162          $this->saveSettings($settings);
 163          }
 164          
 165      function getHeader($calledFromDisplay = false)
 166          {
 167          static $loadedStyles = array();
 168          
 169          $style = isset($this->settingsVars['style']) ? $this->settingsVars['alignment'] . $this->settingsVars['style'] : 'vbuttons';
 170          $this->backComp = isset($this->settingsVars['backComp']) ? $this->settingsVars['backComp'] : 0;
 171          $header = isset($this->settingsVars['header']) ? $this->settingsVars['header'] : 'none';
 172          $this->tpl = new Template_PHPLIB(T_APP_BASE . 'Navigator/');
 173          
 174          if ($style == 'custom')
 175              {
 176              $this->tpl->setVar('header', '');
 177              $templateDN = @$this->settingsVars['styleTemplate'];
 178              if ($templateDN && $this->ldap->dnExists($templateDN))
 179                  {
 180                  $listTpl = oFile::load($this->ldap, $templateDN);
 181                  if(mnError::isError($listTpl))
 182                      { return new mnError("Navigator::getHeader(): Error loading custom template $templateDN: " . $listTpl->getMessage(), __FILE__, __LINE__); }
 183                  $this->tpl->setVar('list', $listTpl->read());
 184                  return '';
 185                  }
 186              else
 187                  {
 188                  $this->tpl->setVar('list', 'Navigation error: Custom template not found.');
 189                  return '';
 190                  }
 191              }
 192          
 193          $files = array();
 194          if ($this->backComp)
 195              {
 196              $files['classic'] = 'banner_classic.tpl.html';
 197              $files['header2'] = 'header.list.tpl.html';    
 198              $style = 'tabs';
 199              }
 200             
 201          if($style == "tabs" && isset($this->settingsVars['alternatemarkup']))    
 202              $style = "tabs2";    
 203          
 204          $files['list'] = 'list.' . $style . '.tpl.html';
 205          $files['header'] = 'header.' . $style . '.tpl.html';
 206          
 207          if ($header == 'custom')
 208              $files['banner'] = 'banner.tpl.html';
 209          $this->tpl->setFile($files);
 210  
 211          if (($style == 'vcss' || $style == 'hcss') || !isset($loadedStyles[$style]) or ($style == 'tabs' and $this->backComp and !isset($loadedStyles['header2'])))
 212              {
 213              $loading2 = isset($loadedStyles[$style]);
 214              
 215              if($style == 'vcss' || $style == 'hcss')
 216                  {
 217                  $this->tpl->setVar($this->settingsVars['alignment'] . 'nav', $this->paramName($this->settingsVars['alignment'] . 'nav'));
 218                  $this->tpl->setVar('toplevelbg', $this->settingsVars['bgcolorNav']);
 219                  $this->tpl->setVar('toplevelhover', $this->settingsVars['textHoverColor']);
 220                  $this->tpl->setVar('lowerlevelbg', $this->settingsVars['bgcolorNav']);
 221                  $this->tpl->setVar('lowerlevelhover', $this->settingsVars['bgcolorNavHover']);
 222                  if (!$this->settingsVars['borderNavPrimary'] || $this->settingsVars['borderNavPrimary'] == 'transparent')
 223                      $this->tpl->setVar('borders', 'none;');
 224                  else
 225                      $this->tpl->setVar('borders', 'solid 1px ' . $this->settingsVars['borderNavPrimary']);
 226                  $this->tpl->setVar('textcolor', $this->settingsVars['textColor']);
 227                  }
 228  
 229              if($style = 'list')
 230                  {
 231                  $this->tpl->setVar('textlinkcolor', $this->settingsVars['textColor']);
 232                  $this->tpl->setVar('textlinkhovercolor', $this->settingsVars['textHoverColor']);
 233                  }    
 234              
 235              if(!(@$GLOBALS['CV_PUBLISHING'] == true))
 236                  $loadedStyles[$style] = 1;
 237  
 238              if ($loading2) $loadedStyles['header2'] = true;     
 239              return $loading2 && !($style == 'vcss' || $style == 'hcss') ? @$this->tpl->subst('header2') : (@$this->tpl->subst('header') . ($this->backComp ? @$this->tpl->subst('header2') : ''));
 240              }
 241              
 242          return '';
 243          }
 244    
 245      function getContent()
 246          {
 247          if ($this->backComp)
 248              return $this->getClassic($this->section->buttonRows, $this->section->style, $this->auth, "100%");
 249              
 250          if(($this->settingsVars['bgcolorNavHover'] == "" && $this->settingsVars['style'] != ""))
 251              {
 252              require_once('HTML/CSS.php');
 253              // a one time fix for the navigators
 254              $file = DN::dnToCSSFile($this->section->inheritTemplate());
 255              $css = new HTML_CSS(array('filename' => $file), array('error_handler' => 'Navigator::ignoreAllCSS'));
 256              
 257              $this->settingsVars['bgcolorNavHover'] = $css->getStyle('.appNavigator #current', 'background-color');
 258              $this->settingsVars['textHoverColor'] = $css->getStyle('.appNavigator #current', 'color');
 259              $this->settingsVars['bgcolorNav'] = $css->getStyle('.appNavigator .navButton:link', 'background-color');
 260              $this->settingsVars['textColor'] = $css->getStyle('.appNavigator .navButton:link', 'color');          
 261              $this->settingsVars['borderNavPrimary'] = '#333333';
 262              $this->settingsVars['borderNavSecondary'] = 'transparent';
 263              if(!is_array(@unserialize($this->settingsVars['list'])))
 264                  $this->settingsVars['list'] = serialize(array($this->settingsVars['list']));
 265                  
 266              $this->saveSettings($this->settingsVars);
 267              }    
 268  
 269          $origBase = $base = isset($this->settingsVars['base']) ? $this->settingsVars['base'] : $this->pageDN;
 270          $list = isset($this->settingsVars['list']) ? $this->settingsVars['list'] : array('sibs');
 271          $unser_list = unserialize($list);
 272          $list = $unser_list ? $unser_list : array($list);
 273          $style = isset($this->settingsVars['style']) ? $this->settingsVars['style'] : 'vlist';
 274          $header = isset($this->settingsVars['header']) ? $this->settingsVars['header'] : 'none';
 275  
 276          $skipLevel = false;
 277          $currentDN = $base;
 278          
 279          // determine our base of navigation
 280          if (!strpos($base, '='))
 281              {
 282              $currentDN = $this->pageDN;
 283              switch($base)
 284                  {
 285                  case 'top':
 286                  case 'lib':
 287                      $library = ($base == 'lib');
 288                      $origBase = $base = 'mnT=index,' . DN::dnToOrg($currentDN);
 289                      break;
 290                  default:
 291                  case 'this':
 292                      $origBase = $base = $currentDN;
 293                      break;
 294                  case '2up':
 295                  case '1up':
 296                      $n = $base{0};
 297                      $origBase = $base = $currentDN;
 298                      $i = $n;
 299                      while ($n--)
 300                          $origBase = $base = DN::dnToBase($base);
 301                      $type = DN::dnToType($base);
 302                      if ($type != C_LDAP_SECTION && $type != C_LDAP_SITE)
 303                          return "Navigation error: There is no page $i level(s) up from this page.";
 304                      break;
 305                  case '1dn':
 306                      $origBase = $base = $currentDN;
 307                      $skipLevel = true;
 308                      break;
 309                  }
 310              }
 311              
 312          // make sure we can build this list
 313          //if ($skipLevel and $list[0] != 'sibs')
 314          //    return "Navigation error: With a base below the current page, only a sibling list can be built.";
 315  
 316          // make sure we can display this list properly
 317          //if (($list[0] == 'desc' or $list[0] == 'family') and $style != 'vlist' && $style != 'dropdown' && $style != 'vbuttons' && $style != 'custom')
 318          //    return "Navigation error: Descendant and Tree From Top Level lists can only be shown using
 319          //    the Vertical List/Tree, Vertical Buttons, or Dropdown styles.";
 320  
 321  
 322          // set scope of search
 323          $i=0;
 324          $newBase = array();
 325          $checkSibs = false;
 326          $startingself = false;
 327          foreach($list as $type)
 328              {
 329              switch($type)
 330              {
 331              case 'self':
 332                  $startingself = true;
 333                  $newBase[$i] = $origBase;
 334                  $scope[$i] = LDAP_SCOPE_BASE;
 335                  break;
 336              case 'sibs':
 337                  if (ereg('^' . C_LDAP_SECTION, $base) && !$skipLevel)
 338                      $newBase[$i] = DN::dnToBase($base);
 339                  else
 340                      $newBase[$i] = $base;
 341                  $scope[$i] = LDAP_SCOPE_ONELEVEL;
 342                  $checkSibs = true;
 343                  break;
 344              case 'child':
 345                  $newBase[$i] = $base;
 346                  $scope[$i] = LDAP_SCOPE_ONELEVEL;
 347                  break;
 348              case 'desc':
 349                  $newBase[$i] = $base;
 350                  $scope[$i] = LDAP_SCOPE_SUBTREE;
 351                  $this->useIndents = true;
 352                  break;
 353              case 'pedigree':
 354                  //$newBase[$i] = $base;
 355                  $newBase[$i] = 'mnT=index,' . DN::dnToOrg($currentDN);
 356                  $scope[$i] = LDAP_SCOPE_SUBTREE;
 357                  break;
 358              case 'family':
 359                  $origBase = $base;
 360                  $newBase[$i] = 'mnT=index,' . DN::dnToOrg($currentDN);
 361                  $scope[$i] = LDAP_SCOPE_SUBTREE;
 362                  $this->useIndents = true;
 363                  break;
 364              }
 365             $i++;
 366               }
 367  
 368  /*
 369         //Preload all rollover images
 370             $this->addHeader('               
 371              <SCRIPT type="text/javascript" language="JavaScript">
 372              <!--
 373  
 374              if (document.images)
 375              {
 376                preload_image_object = new Image();
 377                // set image url
 378                image_url = new Array();
 379                image_url[0] = "'. DN::dnToUrl($this->settingsVars['bgimage']) .'";
 380                image_url[1] = "'. DN::dnToUrl($this->settingsVars['rollimage']) .'";
 381                image_url[2] = "/.cWimg/icons/minus_node.gif";
 382                image_url[3] = "/.cWimg/icons/plus_node.gif";
 383  
 384                 var i = 0;
 385                 for(i=0; i<=3; i++) 
 386                   preload_image_object.src = image_url[i];
 387              }
 388              //-->
 389              </SCRIPT>     ');
 390  
 391  */
 392          if($list[0] != 'custombox' && is_array($scope))
 393              {
 394              foreach($scope as $key => $sub)
 395                  {
 396                  $pages[$key] = $this->ldap->search('(objectclass=' . C_LDAP_SECTION_OBJECT . ')', array('dn', C_LDAP_SECTION, 'mennodisplayname', 'mennoorder', 'mennostatus', 'mennotitle'), $newBase[$key], $sub);
 397  
 398                  if(mnError::isError($pages[$key]))
 399                      { if (!ereg('No such object', $pages[$key]->getMessage())) return new mnError('Navigator::getContent(): Error loading page info: ' . $pages[$key]->getMessage(), __FILE__, __LINE__); }
 400                  unset($pages['count']);          
 401                  }
 402               
 403              if ($checkSibs)
 404                  {
 405                  foreach($pages as $key1 => $index)
 406                      {
 407                      foreach ($index as $key2 => $page)
 408                            {
 409                             if ($page['mennostatus'][0] == 'menu') 
 410                                 {
 411                               $pages[$key1][$key2]['mennostatus'][0] = 'library';
 412                               }
 413                           if ($page['dn'] == $origBase) 
 414                               {
 415                               $library = ($page['mennostatus'][0] == 'library');
 416                               }  
 417                           }
 418                      }
 419                  }
 420  
 421              $map = array();
 422              $i=0;
 423              
 424              if(!is_array($pages))
 425                  $pages = array();
 426  
 427              foreach($pages as $subpage)
 428                  {
 429                  $count = 0;
 430                  foreach($subpage as $page)
 431                      {
 432                      if ($list[0] == 'pedigree' && strpos($origBase, $page['dn']) === false)
 433                          continue;
 434                      if ($list[0] == 'family' && strpos($origBase, $page['dn']) === false and strpos($origBase, $pageBase) === false)
 435                          continue;
 436                      if (isset($library) && ($library xor $page['mennostatus'][0] == 'library'))
 437                          continue;
 438                      if(!is_array($page) || $page['mennostatus'][0] == 'template')
 439                          continue;
 440                      if (!isset($page['dn']))
 441                          continue;
 442                      if (!Security::can($page['dn'], 'visible'))
 443                          continue;
 444                       $count++;
 445                      }             
 446                  foreach($subpage as $page)
 447                      {
 448                      $pageBase = DN::dnToBase($page['dn']);
 449                      // make sure page is visible
 450                      if ($list[0] == 'pedigree' && strpos($origBase, $page['dn']) === false)
 451                          continue;
 452                          
 453                      if (!isset($page['dn']))
 454                          continue;
 455                      if ($list[0] == 'family' && strpos($origBase, $page['dn']) === false and strpos($origBase, $pageBase) === false)
 456                          continue;
 457                      if (isset($library) && ($library xor $page['mennostatus'][0] == 'library'))
 458                          continue;
 459                      if(!is_array($page) || $page['mennostatus'][0] == 'template')
 460                          continue;
 461                      if (!isset($page['dn']))
 462                          continue;
 463                      if (!Security::can($page['dn'], 'visible'))
 464                          continue;
 465  
 466                      $double = false;
 467                      foreach($map as $pbase)
 468                          {
 469                          foreach($pbase as $k => $v)
 470                              {
 471                              if($v['dn'] == $page['dn']) 
 472                                  $double = true;  
 473                              }
 474                          }
 475  
 476                      if($double)
 477                          continue;
 478                          
 479                      $tmppg = unserialize($page['mennodisplayname'][0]);
 480                          
 481  
 482                      $pageInfo['dn'] = $page['dn'];
 483                      
 484                      $tmparr = unserialize($page['mennotitle'][0]);
 485                      $pageInfo['displayname'] = $tmparr[$GLOBALS['CV_CURR_LANG']] ? $tmparr[$GLOBALS['CV_CURR_LANG']] : $page[strtolower(C_LDAP_SECTION)][0];
 486                      $pageInfo['displaystatus'] = $page['dn'] == $currentDN ? 'active' : (@ereg($page['dn'], $currentDN) ? 'current' : '');
 487                      
 488                      if ($this->settingsVars['bgimage'] != '')
 489                       $pageInfo['bgimage'] = $this->settingsVars['bgimage'];
 490                      if ($this->settingsVars['rollimage'] != '')
 491                       $pageInfo['rollimage'] = $this->settingsVars['rollimage'];
 492                      $pageInfo['align'] = $this->settingsVars['alignment'];                
 493                      if($count != 0 && $pageInfo['align'] != 'v')
 494                           $pageInfo['size'] = 100/($count);
 495                      else
 496                           $pageInfo['size'] = '100%';
 497                      $pageInfo['style'] = $this->settingsVars['style'];
 498                      
 499                      $pageInfo['texthovercolor'] = $this->settingsVars['textHoverColor'];
 500                      if($page['dn'] == $this->pageDN) {
 501                          $pageInfo['bgcolor'] = $this->settingsVars['bgcolorNavHover'];
 502                          $pageInfo['textcolor'] = $this->settingsVars['textHoverColor'];
 503                      } else {
 504                          $pageInfo['bgcolor'] = $this->settingsVars['bgcolorNav'];  
 505                          $pageInfo['textcolor'] = $this->settingsVars['textColor'];
 506                      }
 507                      $pageInfo['rollcolor'] = $this->settingsVars['bgcolorNavHover'];
 508                      $pageInfo['level'] = substr_count($page['dn'], ',');        
 509              
 510                      if (!isset($map[$pageBase][$page['mennoorder'][0]]))
 511                          $map[$pageBase][$page['mennoorder'][0]] = $pageInfo;
 512                      else
 513                          $map[$pageBase][] = $pageInfo;
 514                      }
 515                  $i++;
 516                  }
 517                  
 518              }
 519  
 520          if($list[0] != 'custombox' && is_array($map))
 521              { 
 522              $tot = 0;
 523              $minlvl = 1000;
 524              foreach($map as $pbase)
 525                  {
 526                  foreach($pbase as $k => $v)
 527                      {
 528                      $tot++;
 529                      if($minlvl > $v['level'] && $v['displaystatus'] != 'active')
 530                          $minlvl = $v['level'];
 531                      }
 532                  }
 533  
 534              foreach($map as $pkey => $pbase)
 535                  {
 536                  foreach($pbase as $k => $v)
 537                      {
 538                      $map[$pkey][$k]['end'] = $tot;
 539                      $map[$pkey][$k]['level'] = $map[$pkey][$k]['level'] - ($minlvl);
 540                      }        
 541                  }
 542              } 
 543  
 544          # workaround for some obscure bug I don't have time to hunt down at the moment - davidig
 545          if (!is_object($this->tpl)) return;
 546          
 547          $this->tpl->setBlock('list', 'linkBlock', 'linkB');
 548          $this->tpl->setVar('linkB', '');
 549          if ($list[0] == 'custombox')
 550              {
 551              $menu = unserialize($this->settingsVars['customMenu']);        
 552              $last = "";
 553              // figure out if these have children
 554              foreach($menu as $k => $link)
 555                  {
 556                  if($last == "")
 557                      $last = $k;
 558                  if($menu[$last]['lvl'] < $menu[$k]['lvl'])
 559                      $menu[$last]['children'] = 1;
 560                  else
 561                      $menu[$last]['children'] = 0;    
 562  
 563                  if($menu[$last]['lvl'] > $menu[$k]['lvl'])
 564                      $menu[$last]['lastchild'] = 1;
 565                  else
 566                      $menu[$last]['lastchild'] = 0;
 567  
 568                  $last = $k;                
 569                  }
 570  
 571              $menu[$last]['lastchild'] = 1;
 572              foreach($menu as $k => $link)
 573                  if($link['lvl'] == 0)
 574                      $last = $k;
 575              $menu[$last]['lastchild'] = 1;
 576  
 577              $item = array();
 578              $size = 100 / count($menu);
 579              $num = 0;
 580              if($this->settingsVars['style'] == 'css')
 581                  $text = "<ul id='" . $this->paramName($this->settingsVars['alignment'] . "nav") . "'>\n";
 582                          $this->count = 0;
 583              foreach($menu as $link)
 584                  {
 585                  $item['displayname'] = $link['name'];
 586                  if (strpos($link['link'], '='))
 587                    $item['dn'] = $link['link'];
 588                  else
 589                    $item['link'] = $link['link'];
 590                  $item['size'] = $size;  
 591                  $item['align'] = $this->settingsVars['alignment'];
 592                  if ($this->settingsVars['bgimage'] != '')
 593                     $item['bgimage'] = $this->settingsVars['bgimage'];
 594                  if ($this->settingsVars['rollimage'] != '')
 595                     $item['rollimage'] = $this->settingsVars['rollimage'];            
 596                  $item['count'] = $num;
 597                  $item['end'] = count($menu);
 598                  $item['bgcolor'] = $this->settingsVars['bgcolorNav'];
 599                  $item['textcolor'] = $this->settingsVars['textColor'];
 600                  $item['rollcolor'] = $this->settingsVars['bgcolorNavHover'];
 601                  $item['texthovercolor'] = $this->settingsVars['textHoverColor'];
 602                  $item['style'] = $this->settingsVars['style']; 
 603                  $item['level'] = $link['lvl'];
 604                  $item['children'] = $link['children'];
 605                  
 606                  if($this->settingsVars['style'] == 'css')
 607                      {
 608                      if($lastlvl != "" && $lastlvl == $link['lvl'])
 609                          $text .= "</li>\n";
 610                      else if($lastlvl != "" && $lastlvl > $link['lvl'])
 611                          $text .= "</ul></li>\n";
 612                      else if($lastlvl != "" && $lastlvl < $link['lvl'])
 613                          $text .= "<ul>\n";
 614                         
 615                      if(substr($link['link'], 0, 4) != "mnTS")
 616                          $rightlink = $link['link'];
 617                      else
 618                          $rightlink = Utility::link(DN::dnToSectionArray($link['link']));
 619                        
 620                      if($link['lvl'] != 0)
 621                          $rightsize = "100%";
 622                      else
 623                          $rightsize = $size . "%";
 624  
 625                      if($this->settingsVars['alignment'] == 'h')
 626                          $text .= "<li style='width: " . $rightsize . ";'><a href='" . $rightlink . "'>" . $link['name'] . "</a>\n";
 627                      else
 628                          $text .= "<li" . ($link['lastchild'] ? " style='border-bottom: solid 1px " . $this->settingsVars['borderNavPrimary'] . ";'" : "")  . "><a style='height:8px; line-height:8px;' href='" . $rightlink . "'>" . $link['name'] . "</a>\n"; 
 629  
 630                      $lastlvl = $link['lvl'];
 631                      }
 632                  else
 633                      $this->getItemHtml($item);
 634  
 635                  unset($item);
 636                  $num++;
 637                  $this->count++;
 638                  }
 639              if($this->settingsVars['style'] == 'css') 
 640                  {
 641                  $text .= "</li>\n";
 642                  for($i = 0; $i < $lastlvl; $i++)
 643                      $text .= "</ul></li>\n";
 644  
 645                  $text .= "</ul>\n";
 646              
 647                  $this->tpl->setVar('menumarkup', $text);
 648                  }
 649              }
 650          else
 651              {
 652              if($startingself && $base != 'mnT=index,' . DN::dnToOrg($currentDN))
 653                  $newBase[0] = DN::dnToParent($newBase[0]);
 654              
 655              if(!($this->settingsVars['style'] == 'css'))
 656                    $this->buildList($map, $newBase[0]);
 657              else
 658                  $this->tpl->setVar('menumarkup', $this->buildMenu($map, $newBase[0]));
 659   
 660              }
 661              
 662          //@$textsize = (@$this->section->blocks[$this->blockID]->blockStyle['text_size']) ? $this->section->blocks[$this->blockID]->blockStyle['text_size'] : $this->section->style->params['textsize'];
 663          //if ($this->backComp) $textsize = 11;
 664          $this->safariHack = strstr($_SERVER['HTTP_USER_AGENT'], 'Safari') ? 2 : 0;
 665          $this->tpl->setVar('safariHack', $this->safariHack);
 666          $this->tpl->setVar('fixOffset', 1); //($textsize > 14 ? 0 : 1));
 667          /*
 668          if ($header == 'custom')
 669              {
 670              $pageStyle =& $this->section->style;
 671              $this->tpl->setVar('width', $this->colWidth);
 672              $borderwidth = @$this->params['border'] ? $this->params['border'] : 0;
 673              $this->tpl->setVar('border', 'border-width: ' . $borderwidth . 'px; border-bottom:none;');
 674              $this->tpl->setVar('height', @$this->params['height'] ? $this->params['height'] : 87);
 675  
 676              $headerpic = @$this->params['bgimage'] ? T_WEB_TOOLS.'/download.php/'. T_ORG_DN . '/' . $this->params['bgimage'] : '';
 677              // For whatever reason, Mac IE 5.2 can't have quotes in the background-image, but removing quotes
 678              // breaks all other browsers
 679              if ($headerpic && ereg("Mac", $_SERVER['HTTP_USER_AGENT']) && ereg("IE 5.2", $_SERVER['HTTP_USER_AGENT']))
 680                  $this->tpl->setVar('image', "background-image: url($headerpic);");
 681              elseif ($headerpic)
 682                  $this->tpl->setVar('image', "background-image: url('$headerpic');");
 683              else
 684                  $this->tpl->setVar('image', '');
 685              $this->tpl->setVar('image_attrs', 'background-repeat: '
 686                  . @$this->params['bgrepeat'] . '; background-position: '
 687                  . @$this->params['bgx'] . ' ' . @$this->params['bgy'] . ';');
 688              
 689              $titleHOffset = @$this->params['titleHOffset'] == '' ? 160 : $this->params['titleHOffset'];
 690              $this->tpl->setVar('titleHOffset', $titleHOffset);
 691              $this->tpl->setVar('titleVAlign', @$this->params['titleVAlign']);
 692              $this->tpl->setVar('titleVOffset', @$this->params['titleVOffset'] ? ($this->params['titleVAlign'] == 'bottom' ? -1 : 1) * $this->params['titleVOffset'] : 0);
 693              $this->tpl->setVar('tabOffset', $this->params['tabOffset'] == '' ? $titleHOffset : $this->params['tabOffset']);
 694  
 695              if ($this->settingsVars['title'] == '')
 696                  $title = $org->get('longname');
 697              elseif ($this->settingsVars['title'] == ' ')
 698                  $title = '';
 699              else
 700                  $title = $this->settingsVars['title'];
 701              $this->tpl->setVar('title', $title);
 702              
 703              $this->tpl->parse($style == 'tabs' ? 'tabs' : 'nav', 'list');
 704              return $this->tpl->subst('banner');
 705              }
 706          else*/
 707          return $this->tpl->subst('list');
 708          }
 709          
 710      function buildList(&$map, $startDN, $first = true)
 711          {
 712          if ($first)
 713              {
 714              $this->count = 0;
 715              $this->indent = 0;
 716              }
 717  
 718          if (isset($map[$startDN]) && is_array($map[$startDN]))
 719              {
 720              ksort($map[$startDN]);
 721              foreach($map[$startDN] as $kid)
 722                  {
 723                  $kid['count'] = $this->count;
 724                  $kid['children'] = isset($map[$kid['dn']]);
 725                  $this->getItemHtml($kid);
 726                  $this->count++;
 727                  $this->indent++;
 728                  $this->buildList($map, $kid['dn'], false);
 729                  $this->indent--;
 730                  }
 731              }
 732          }
 733  
 734      function checkNextLevel(&$map, $startDN, $topParent)
 735          {
 736          foreach ($map[$startDN] as $child)
 737              {
 738              if (isset($map[$child['dn']]))
 739                 $this->checkNextLevel($map, $child['dn'], $topParent);
 740              if (strlen($child['displayname']) > $this->navMaxLen[$topParent])
 741                  $this->navMaxLen[$topParent] = strlen($child['displayname']);
 742              }
 743          return '';
 744          }
 745  
 746  
 747      function buildMenu(&$map, $startDN, $first = true)
 748          {
 749          if ($first)
 750              {
 751              $this->count = 0;
 752              $this->indent = 0;
 753              if($this->settingsVars['alignment'] == 'h')
 754                  {
 755                  $length = 0;
 756                  if ($this->settingsVars['smartWidth'] == 'on')
 757                      {
 758                      foreach ($map[$startDN] as $kid)
 759                          {
 760                          $this->navMaxLen[$kid['displayname']] = strlen($kid['displayname']);
 761                          if (isset($map[$kid['dn']]))
 762                              {
 763                              $this->checkNextLevel($map, $kid['dn'], $kid['displayname']);
 764                              }
 765                          $this->strLength = $this->strLength + $this->navMaxLen[$kid['displayname']];
 766                          }
 767                      $this->strLength = $this->strLength + 2;    
 768                      }
 769                  else
 770                    $this->strLength = (100/count($map[$startDN]))-.5;
 771  
 772                  }
 773              }
 774          
 775          $num = 0;
 776          if (isset($map[$startDN]) && is_array($map[$startDN]))
 777              {
 778              $text = '<ul class="cv_nav_hcss"' . ($first ? " id='" . $this->paramName($this->settingsVars['alignment'] . "nav") . "'" : "") . ">\n";
 779              ksort($map[$startDN]);
 780              $i = 0;
 781              foreach($map[$startDN] as $kid)
 782                  {
 783                  if ($this->settingsVars['smartWidth'] == 'on')
 784                      {
 785                      $width = 100*$this->navMaxLen[$kid['displayname']]/$this->strLength;
 786                      $width = $width;
 787                      }
 788                  else
 789                      $width = $this->strLength;
 790  
 791                  if($this->settingsVars['alignment'] == 'h' && $this->settingsVars['hmaxWidth'] != "" && is_numeric($this->settingsVars['hmaxWidth']) && $width > $this->settingsVars['hmaxWidth'])
 792                     $width = $this->settingsVars['hmaxWidth'];
 793  
 794                  $width .= "%";
 795  
 796                  if ($this->settingsVars['cWidthHiddencss'][$kid['dn']] != '')
 797                      {
 798                      if (strpos($this->settingsVars['cWidthHiddencss'][$kid['dn']], 'px') === false)
 799                         $addpx = 'px';
 800                      else
 801                         $addpx = '';
 802                      $width = $this->settingsVars['cWidthHiddencss'][$kid['dn']].$addpx;
 803                      }
 804                  
 805                  if($this->settingsVars['alignment'] == 'h' && $first && !isset($this->setFirst))
 806                      {
 807                      $text .= '<li id="hcss' . $i++ . '" class="firstli" style="width: ' . $width . '"><a href="' . Utility::link(DN::dnToSectionArray($kid['dn'])) . '">&nbsp;' . $kid['displayname'] . "</a>\n";
 808                      $this->setFirst = true;
 809                      }
 810                  else if($this->settingsVars['alignment'] == 'h' && $first)
 811                      $text .= '<li id="hcss' . $i++ . '" style="width: ' . $width . '"><a href="' . Utility::link(DN::dnToSectionArray($kid['dn'])) . '">&nbsp;' . $kid['displayname'] . "</a>\n";
 812                  else if($this->settingsVars['alignment'] == 'h')
 813                      $text .= '<li id="hcss' . $i++ . '"><a href="' . Utility::link(DN::dnToSectionArray($kid['dn'])) . '">&nbsp;' . $kid['displayname'] . "</a>\n";    
 814                  else
 815                      $text .= '<li id="hcss' . $i++ . '" ' .  (($num == (count($map[$startDN]) - 1)) ? ' style="border-bottom: solid 1px ' . $this->settingsVars['borderNavPrimary'] . ';"' : '' ) . '><a style="height:8px; line-height:8px;" href="' . Utility::link(DN::dnToSectionArray($kid['dn'])) . '">&nbsp;' . $kid['displayname'] . "</a>\n";    
 816                  $kid['count'] = $this->count;
 817                  $kid['children'] = isset($map[$kid['dn']]);
 818                  
 819                  $this->count++;
 820                  $this->indent++;
 821                  
 822                  $text .= $this->buildMenu($map, $kid['dn'], false) . "</li>\n";
 823                  
 824                  $this->indent--;
 825                  $num++;
 826                  }
 827              $text .= "</ul>\n";
 828              }
 829          return $text;
 830          }
 831          
 832      function getItemHtml(&$item)
 833          {
 834          if ($item['style'] == 'sections')
 835            {
 836               if ($item['level'] == '0')
 837               {
 838                  $img_src = '/.cWimg/icons/minus_node.gif';
 839                  $div_display = 'style="display:block;"';
 840                  if (isset($_COOKIE[$this->paramName('sectionMenu'.$item['count'])]))
 841                  {
 842                    if($_COOKIE[$this->paramName('sectionMenu'.$item['count'])] == 'closed')
 843                    {
 844                      $img_src = '/.cWimg/icons/plus_node.gif';
 845                      $div_display = 'style="display:none;"';
 846                    }
 847                  }
 848  
 849                 if ($item['count'] != 0)
 850                   $this->tpl->setVar('sectionEndParent','</div>');
 851                 else
 852                   $this->tpl->setVar('sectionEndParent','');
 853                
 854                 $this->tpl->setVar('sectionBegin','<div '. $div_display .' id="'.$this->paramName('sectionMenu'.$item['count']).'">');
 855                 $closeAction = 'onclick="displaySection(\''.$this->paramName('sectionMenu'.$item['count']).'\', \''.$this->paramName('sectionMenuImg'.$item['count']).'\');return false;"';
 856               }
 857               else
 858               {
 859                 $this->tpl->setVar('sectionBegin','');
 860                 $this->tpl->setVar('sectionEndParent','');
 861               }
 862               if (($item['count']+1) == $item['end'])
 863               {
 864                 $this->tpl->setVar('sectionEnd', '</div>');
 865               }
 866            }
 867  
 868          if($this->count != 0)
 869              $this->tpl->setVar('sep', '&nbsp;' . @$this->settingsVars['separator'] . ' &nbsp;');
 870          else
 871              $this->tpl->setVar('sep', '');    
 872          
 873          $this->tpl->setVar('attrs', $item['displaystatus'] ? 'id="' .$item['displaystatus']. '"' : '');
 874          $this->tpl->setVar('selected', $item['displaystatus'] == 'active' ? 'selected' : '');
 875          $this->tpl->setVar('indent', $this->useIndents ? ($this->indent ? str_repeat('&nbsp;', $this->indent * 3) : '') : '');
 876          $this->tpl->setVar('indentAmt', $this->useIndents ? $this->indent : 0);
 877          $this->tpl->setVar('bgcolor', 'background-color:'.$item['bgcolor'].';');
 878          $this->tpl->setVar('textcolor', 'color:'.$item['textcolor'].';');
 879  
 880          $rollColor = "onMouseOver=\"this.style.backgroundColor = '".$item['rollcolor']."';" . "this.style.color = '".$item['texthovercolor']."';";
 881          $origColor = "onMouseOut=\"this.style.backgroundColor = '".$item['bgcolor']."';" . "this.style.color = '".$item['textcolor']."';";
 882          if (@$item['bgimage']) {
 883             $this->tpl->setVar('image', 'background-image: url(' . str_replace(' ' , '%20', DN::dnToUrl($item['bgimage'], true)) . ');' );
 884             $spacing=8;
 885             for($i=0; $i < $item['level'];$i++) {
 886                 $spacing = $spacing + 8;
 887             }
 888          } else {
 889              $this->tpl->setVar('image', '');
 890          }
 891          if (@$item['rollimage']) {
 892              $rollimage =  "this.style.backgroundImage = 'url(".str_replace(' ' , '%20', DN::dnToUrl($item['rollimage'], true)).")';";
 893              $bgimage   =  "this.style.backgroundImage = 'url(".str_replace(' ' , '%20', DN::dnToUrl($item['bgimage'], true)).")';";
 894          } else {
 895              $bgimage   =  "";
 896              $rollimage =  "";
 897          }           
 898          $this->tpl->setVar('rollimage', $rollColor . $rollimage . "\"" . $origColor . $bgimage . "\"" );
 899          
 900          if($this->settingsVars['alignment'] . $this->settingsVars['style'] == 'vbuttons')
 901              {
 902              $extrat = ($this->count == 0) ? "" : "border-top: none;";
 903              $this->tpl->setVar('border', 'border:1px solid '.$this->settingsVars['borderNavPrimary'].';' . $extrat);
 904              }
 905          else
 906              $this->tpl->setVar('border', 'border:1px solid '.$this->settingsVars['borderNavPrimary'].';');
 907              
 908          if($this->settingsVars['borderNavSecondary'] == "" || $this->settingsVars['borderNavSecondary'] == "transparent")    
 909              $this->tpl->setVar('borderInner', 'border: none;');
 910          else    
 911              $this->tpl->setVar('borderInner', 'border:1px solid '.$this->settingsVars['borderNavSecondary'].';');
 912          if (isset($this->settingsVars['repeat']))
 913            $this->tpl->setVar('backgroundRepeat', 'background-repeat:'.$this->settingsVars['repeat'].';');
 914          else
 915            $this->tpl->setVar('backgroundRepeat', '');
 916  
 917             $this->tpl->setVar('class', 'nav'.$item['style'].'B');
 918             $this->tpl->setVar('classInner', 'nav'.$item['style'].'BInner');           
 919  
 920             if($this->settingsVars['buttonwidth'] != "")
 921               $this->tpl->setVar('navWidth', 'width:'. $this->settingsVars['buttonwidth'] . ';');
 922             else if($item['style'] == 'buttons' && $item['align'] == 'h')
 923               $this->tpl->setVar('navWidth', 'width:'.$item['size'].'%;');
 924             else
 925               $this->tpl->setVar('navWidth', 'width:100%;');  
 926               
 927             if($this->settingsVars['buttonheight'] != "")
 928               $this->tpl->setVar('navHeight', 'height:'. $this->settingsVars['buttonheight'] . ';');
 929             else
 930               $this->tpl->setVar('navHeight', '');
 931              if ($item['style'] == 'sections')
 932              {
 933                if ($item['level'] == '0' && $item['children'] == 1)
 934                {
 935                 $this->tpl->setVar('img', '<a href="#"><img id="'.$this->paramName('sectionMenuImg'.$item['count']).'" style="border:0px;float:right;margin-top:1px;margin-right:1px;" src="'. $img_src .'" '. $closeAction .'></a>');
 936                 if ($item['count'] != 0)
 937                 $this->tpl->setVar('<div id="'.$this->paramName('sectionMenu'.$item['count']).'">');
 938                }
 939                else
 940                 $this->tpl->setVar('img', '');
 941              }
 942               $spacing=8;
 943               for($i=0; $i < $item['level'];$i++)
 944               {
 945               $spacing = $spacing + 8;
 946               }
 947          if (isset($item['dn']))
 948           $this->tpl->setVar('link', Utility::link(DN::dnToSectionArray($item['dn'])));
 949          else
 950           $this->tpl->setVar('link', $item['link']);
 951             $this->tpl->setVar('margin', $spacing);
 952          $this->tpl->setVar('title', $item['displayname']);
 953  
 954          $this->tpl->parse('linkB', 'linkBlock', true);
 955          }
 956          
 957      function getClassic(&$buttonRows, &$style, &$auth, $colWidth)
 958          {
 959          $tpl = new Template_PHPLIB(T_APP_BASE .'Navigator/');
 960          if(isset($this->settingsVars['alternatemarkup']))
 961              {
 962              $tpl->setFile(array(
 963                  'classic' => 'banner_classic.tpl.html',
 964                  'l_tabs' => 'list.tabs2.tpl.html',
 965                  'l_list' => 'list.list.tpl.html'
 966                  ));
 967              }
 968          else
 969              {
 970              $tpl->setFile(array(
 971                  'classic' => 'banner_classic.tpl.html',
 972                  'l_tabs' => 'list.tabs.tpl.html',
 973                  'l_list' => 'list.list.tpl.html'
 974                  ));
 975              }    
 976          $tpl->setBlock('l_tabs', 'linkBlock', 'tLinkB');
 977          $tpl->setVar('tLinkB', '');
 978  
 979          $this->tpl->setBlock('list', 'linkBlock', 'linkB');
 980          $this->tpl->setVar('linkB', '');
 981          $tabs =& $buttonRows[0];
 982          foreach ($tabs as $section)
 983              {
 984              if ($section['status'] == 'library')
 985                  {
 986                  continue;
 987                  }
 988              $tpl->setVar('attrs', ($section['dn'] == $this->pageDN) ? 'id="active"' : ($section['current'] ? 'id="current"' : ''));
 989              $tpl->setVar('selected', $section['display'] ? 'selected' : '');
 990              $tpl->setVar('title', $section['title'] != "" ? $section['title'] : $section['displayname']);
 991              $tpl->setVar('link', Utility::link($section['path']));
 992              $tpl->parse('tLinkB', 'linkBlock', true);
 993              }
 994  
 995          $tpl->setBlock('l_list', 'linkBlock', 'lLinkB');
 996          $tpl->setVar('lLinkB', '');           
 997          $subsections =& $buttonRows[1];
 998          $count = 0;
 999          if (is_array($subsections)) {
1000              foreach ($subsections as $section)
1001                  {
1002                  if ($section['status'] == 'library')
1003                      continue;
1004                  
1005                  if (++$count > 1)
1006                      $tpl->setVar('sep', ' | ');
1007                  $tpl->setVar('attrs', $section['display'] ? 'id="active"' : '');
1008                  $tpl->setVar('selected', $section['display'] ? 'selected' : '');
1009                  $tpl->setVar('title', $section['title'] != "" ? $section['title'] : $section['displayname']);
1010                  $tpl->setVar('link', Utility::link($section['path']));
1011                  $tpl->parse('lLinkB', 'linkBlock', true);
1012                  }
1013              }
1014  
1015          //header stuff
1016          $tpl->setVar('width', $colWidth);
1017          $tpl->setVar('height', @$this->settingsVars['height'] == '' ? 87 : $this->settingsVars['height']);
1018  
1019          // header img
1020          $res = Plugins::doHook('cvhook_headerPicture', array($this->section->template, T_ORG_DN, ''));
1021          if ($res[0]) $bg_img = $res[0];
1022          $tpl->setVar('bg_img', $bg_img ? 'style="background-image: url(' . $bg_img . ');"' : '');
1023              
1024          $titleHOffset = @$this->settingsVars['titleHOffset'] == '' ? 160 : $this->settingsVars['titleHOffset'];
1025  
1026          $tpl->setVar('titleHOffset', $titleHOffset);
1027          $tpl->setVar('titleVAlign', @$this->settingsVars['titleVAlign']);
1028          $tpl->setVar('titleVOffset', @$this->settingsVars['titleVOffset'] ? (@$this->settingsVars['titleVAlign'] == 'bottom' ? -1 : 1) * @$this->settingsVars['titleVOffset'] : 0);
1029          $tabOffset = $this->settingsVars['tabOffset'] == '' ? $titleHOffset : $this->settingsVars['tabOffset'];
1030          $tpl->setVar('tabOffset', isset($this->settingsVars['tabOffset']) ? ('padding-left:' . $tabOffset . 'px;') : '');
1031  
1032          $tpl->setVar('title', @$this->settingsVars['title'] == '' ? $this->section->siteName : @$this->settingsVars['title']);
1033  
1034          $this->safariHack = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') or strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) ? 2 : 0;
1035          $tpl->setVar('safariHack', $this->safariHack);
1036          $tpl->setVar('bottomBorder', '<div class="navTabDivider"><img alt="spacer img" width=0 height=0 src="/.cWimg/g.png"></div>');
1037  
1038          $tpl->parse('tabs', 'l_tabs');
1039          $tpl->parse('subsections', 'l_list');
1040          return $tpl->subst('classic');
1041          }
1042  
1043      function getConfig()
1044          {
1045          if ($this->backComp)
1046              $this->settingsVars['style'] = 'ccaravel';
1047              
1048          require_once('HTML/CSS.php');
1049             
1050          $file = DN::dnToCSSFile($this->section->ldapDN); 
1051          $css = new HTML_CSS(array('filename' => $file), array('error_handler' => 'Navigator::ignoreCSSErrors'));
1052          $style = $css->toArray();
1053  
1054          $classic_standardbg   = $style['.appNavigator .navButton:link, .appNavigator .navTab:link, .appNavigator .navButton:visited, .appNavigator .navTab:visited']['background-color'];
1055          $classic_standardtext = $style['.appNavigator .navButton:link, .appNavigator .navTab:link, .appNavigator .navButton:visited, .appNavigator .navTab:visited']['color'];
1056          $classic_hoverbg      = $style['.appNavigator #current, .appNavigator .navTab:hover, .appNavigator .navButton:hover']['background-color'];
1057          $classic_hovertext    = $style['.appNavigator #current, .appNavigator .navTab:hover, .appNavigator .navButton:hover']['color'];
1058          $classic_activebg     = $style['.appNavigator .navButton#active, .appNavigator .navTab#active']['background-color'];
1059          $classic_activetext   = $style['.appNavigator .navButton#active, .appNavigator .navTab#active']['color'];
1060          $classic_leveltwobg   = $style['#' . $this->blockID . ' .subsections']['background-color'];
1061          $classic_indent       = $style['.tabDiv, .subsections td']['padding-left'];
1062          $classic_bgimg        = str_replace(array("url('/.cWtools/download.php/", "')"), array("", ""), $style['#' . $this->blockID . ' .blockContent']['background-image']);
1063          
1064          if($classic_indent == "")
1065              $classic_indent = $this->settingsVars['tabOffset'];
1066  
1067          $tpl = new Template_PHPLib($this->appBase);
1068          $tpl->setFile('main', 'navigatorConfig.tpl.html');
1069          $tpl->setVar('linktoself', $this->linktoself());
1070          $tpl->setVar('appName', $this->paramName('appName'));
1071          
1072          $listitems = array('Button&nbsp;', 'Collapsible&nbsp;Buttons' , 'Hierarchical&nbsp;Menu' , 'Text&nbsp;Links', 'Tabs' , 'Dropdown', 'Classic Caravel');
1073          $menuTypes = array('buttons', 'sections', 'css' , 'list', 'tabs', 'dropdown', 'ccaravel');
1074          $menuLvl   = array('2', '2' , '', '1', '1', '');
1075          
1076          $cur_page = array_search(   $this->settingsVars['style'], $menuTypes);
1077  
1078          if($cur_page === false)
1079              $cur_page = array_search(substr($this->settingsVars['style'], 1), $menuTypes);
1080            
1081          if($cur_page === false)
1082              $cur_page = 0;  
1083          
1084          $baseOpts = array();
1085          $pages = $this->ldap->search( 'objectclass=' . C_LDAP_SECTION_OBJECT, array('dn', C_LDAP_SECTION), 'mnT=index,'. T_ORG_DN, LDAP_SCOPE_SUBTREE);
1086          if (mnError::isError($pages))
1087              return new mnError('FormWidget::folderList: ' . $pages->getMessage(), __FILE__, __LINE__);
1088          array_shift($pages);
1089          foreach ($pages as $page)
1090              $baseOpts[$page['dn']] = DN::dnToPageId($page['dn'], true);
1091          natcasesort($baseOpts);
1092          foreach ($pages as $page)
1093              $baseOpts[$page['dn']] = preg_replace('{[^/]+/}', '&nbsp;&nbsp;&nbsp;', $baseOpts[$page['dn']]);
1094  
1095  
1096          $f = FormWidget::init();
1097          $none = false;
1098          $f->name('main');
1099          $f->hidden('style', isset($this->settingsVars['style']) ? $this->settingsVars['style'] : 'buttons');
1100       //jasonay 11/29/05
1101       //error in here   ///
1102          $f->html('<div id="customizeDivContents" style="display:none;">');
1103          $f->Section();
1104          $f->field('<span style="font-size:13px;color:#555;">Custom Menu Creation:</span>');
1105          $result = " <div id='navigationCreator' style='width:50%;font-size:small;float:left;padding-right:6px;'>";
1106          $result .= "</div>";
1107          $f->endSection();
1108          $f->hidden('customCreatedMenu', '');
1109          $f->hidden('restrictions', '2');
1110          $f->html($result);
1111          if (isset($this->settingsVars['customMenu']))
1112              $customMenu = unserialize($this->settingsVars['customMenu']);
1113          $javaList = '';
1114          if (count($customMenu) > 0)
1115              foreach($customMenu as $key => $val)
1116                    $javaList .= $val['link'] .';'. $val['lvl'] .';'. $val['name'] .';';
1117          $f->html('<input type="hidden" value="" id="addIndex">');
1118          $result = " <div id='navigationCreatorAdd' style='font-size:small;float:right;display:none;'>
1119             <table cellpadding=0 cellspacing=0 style=\"background-color: #ffffff;border:solid 1px #000;\"><tr>";
1120  
1121          $result .= '<td style="text-align:center;background-color: #EEE;border-bottom: solid 1px #000000;"><span id="addText">Add</span></td></tr>';
1122          $onchange = 'onChange="if(this.selectedIndex == 0)
1123                        {
1124                          document.getElementById(\'caravelCustomLink\').style.display=\'none\';
1125                          document.getElementById(\'caravelCustomPages\').style.display=\'block\';
1126                        }
1127                        else
1128                        {
1129                          document.getElementById(\'caravelCustomPages\').style.display=\'none\';
1130                          document.getElementById(\'caravelCustomLink\').style.display=\'block\';
1131                        }";';
1132          $result .= '<tr><td><div style="padding:2px;float:left;width:70px;"><b>&nbsp;Type:</b></div><div style="float:left;padding:2px;">'.FormWidget::dropdown('navTypeAdd', array('Create from Caravel Page', 'Create Custom Link'),'','',array($onchange)).'</div><div style="clear:both;font-size:1px;"></div></td></tr>';
1133          $result .= '<tr><td><div id="caravelCustomPages"><div style="padding:2px;float:left;width:70px;"><b>&nbsp;Pages:</b></div><div style="float:left;padding:2px;">'.FormWidget::dropdown('navCaravelAdd', $baseOpts ,'', 'this').'</div><div style="clear:both;font-size:1px;"></div></div></td></tr>';
1134          $result .= '<tr><td><div id="caravelCustomLink" style="display:none;"><div style="padding:2px;float:left;width:70px;"><b>&nbsp;Url:</b></div><div style="float:left;padding:2px;">'.FormWidget::text('customUrl', 'http://' ,30).'</div><div style="clear:both;font-size:1px;"></div></div></td></tr>';
1135          $result .= '<tr><td><div style="padding:2px;float:left;width:70px;"><b>&nbsp;Name:</b></div><div style="float:left;padding:2px;">'.FormWidget::text('customName', '' ,30).'</div><div style="clear:both;font-size:1px;"></div></td></tr>';
1136          $result .= '<tr><td><div id="caravelBA" style="display:none;"><div style="padding:2px;float:left;width:70px;"><b>&nbsp;Placement:&nbsp;</b></div><div style="float:left;padding:2px;">'.FormWidget::radio('placementItem', array(0 =>'Before', 1 => 'After'),'','','&nbsp;').'</div><div style="clear:both;font-size:1px;"></div></div></td></tr>';
1137          $result .= '<tr><td style="text-align:right;padding:2px;">'.FormWidget::button('closeAddMenuItem', 'Cancel', 'document.getElementById(\'navigationCreatorAdd\' ).style.display=\'none\';').'&nbsp;'.
1138                      FormWidget::button('addMenuItem', 'Add', 'addMenuItem(document.getElementById(\'addIndex\').value,
1139                                                                            document.main.'.$this->paramName('navCaravelAdd').'.value,
1140                                                                            document.main.'.$this->paramName('customName').'.value,
1141                                                                            document.main.'.$this->paramName('placementItem').'[0].checked,
1142                                                                            document.main.'.$this->paramName('customUrl').'.value);
1143                                                                            document.getElementById(\'navigationCreatorAdd\' ).style.display=\'none\';').'</td></tr>';
1144          
1145          $result .= '</table></div><div style="clear:both;font-size:1px;"></div><br /><div style="text-align:right;">'.FormWidget::button('applyCustom', 'Apply', 'applyMenu(); hideNavMenu();').'&nbsp;'.FormWidget::button('cancelCustom', 'Cancel', 'hideNavMenu();').'</div>';
1146          
1147          $f->html($result);
1148          $f->html('</div>');
1149          $f->html('<div id="cc" style="visibility: hidden;">');
1150          $f->color('maincolor', "#666666", 'main');
1151          $f->html('</div>');
1152          $extra = ($this->settingsVars['style'] == 'ccaravel') ? ' style="display: none;"' : '';
1153          $f->html('<div id="mainDivContents"' . $extra .'>');
1154          $f->section();
1155          $f->field('<span style="font-family: verdana; font-size:13px;color:#555;font-weight: bold;">Standard Navigator Settings:</span>', '', '');
1156          $f->html('&nbsp;');
1157          $f->field('Navigator:', '', '', array('style'=> 'width:32%;'));
1158          $f->html('<div id="nav_type">'. $listitems[$cur_page] .'</div>');
1159          $cWidthList = $baseOpts;
1160          $baseOpts = array(
1161              '2up'    => '2 levels up',
1162              '1up'    => '1 level up',
1163              'this'    => 'this page',
1164              '1dn'    => '1 level down',
1165              ''        => '-------------',
1166              'top'    => '< top level >',
1167              'lib'    => '< page library >'
1168              ) + $baseOpts;
1169          if (!isset($this->settingsVars['base'])) $this->settingsVars['base'] = 'this';
1170          $f->field('Base page:'); 
1171          $f->dropdown('base', $baseOpts, @$this->settingsVars['base'], 'this');
1172          
1173          $listOpts = array(
1174              'self'  => 'self',
1175              'sibs'    => 'siblings',
1176              'child'  => 'children',
1177              'desc'    => 'descendants',
1178              'pedigree'    => 'path from top level',
1179              'family'    => 'tree from top level',
1180              'custombox'    => 'custom menu'
1181              );
1182          $f->field('Build list from:'); 
1183          $tpl->setVar('menuBase', $this->paramName(''));
1184          $checkedBoxes = unserialize($this->settingsVars['list']);
1185          foreach($listOpts as $key => $val)
1186              {
1187                if (isset($this->settingsVars['list']))
1188                  {
1189                  foreach($checkedBoxes as $check)
1190                      {
1191                      if ($check == $key)
1192                          {
1193                          $add = '1'; break;
1194                          }
1195                      else
1196                          $add = '0';
1197                      }
1198                  }
1199              else
1200                  $add = '0';
1201              $f->checkbox($key, $add , $val . '<br />', array('onclick' => 'updateMenuSelection(\''.$this->paramName($key).'\')'));
1202              }
1203          
1204          //the navigator now keeps track of the list using javascript variables, this will set its initial valuse from settingsvars
1205          //jasonay 11/29/50    
1206          $tpl->setVar('customMenu', "'" . $javaList . "'" );
1207          
1208          $f->button('custom', 'Customize Menu', 'updateMenuSelection(\''.$this->paramName('custombox').'\');generateCustomMenuPreview();document.getElementById(\'mainDivContents\').style.display = \'none\';document.getElementById(\'optcontainer\').style.display = \'none\';document.getElementById(\'customizeDivContents\').style.display = \'block\'');
1209          $f->field('Background Color:');
1210          $f->color('bgcolorNav', isset($this->settingsVars['bgcolorNav'])? $this->settingsVars['bgcolorNav'] : "#EEEEEE" , 'Background Color');
1211          $f->field('Hover Color:');
1212          $f->color('bgcolorNavHover', isset($this->settingsVars['bgcolorNavHover'])?$this->settingsVars['bgcolorNavHover'] : "#CCDDFF", 'Hover Color');
1213          $f->field('Primary Border:');
1214          $f->color('borderNavPrimary', isset($this->settingsVars['borderNavPrimary'])? $this->settingsVars['borderNavPrimary']  : "#DDDDDD", 'Primary Border');
1215          $f->field('Secondary Border:');
1216          $f->color('borderNavSecondary', isset($this->settingsVars['borderNavSecondary'])? $this->settingsVars['borderNavSecondary'] :"transparent" , 'Secondary Border');
1217          $f->field('Text Color:');
1218          $f->color('textColor', isset($this->settingsVars['textColor'])? $this->settingsVars['textColor']:"#666666", 'Text Color');
1219          $f->field('Text Hover Color:');
1220          $f->color('textHoverColor', isset($this->settingsVars['textHoverColor'])? $this->settingsVars['textHoverColor']:"#666666", 'Text Color');
1221                  
1222  
1223          $f->field('<span style="font-family: verdana; font-size:13px;color:#555;font-weight: bold;">Type Specific Settings:</span>');
1224          $f->html('&nbsp;');
1225          $tpl->setVar('generateOnLoad', "addCvOnLoadEvent(function() { generateCustomMenuPreview();applyMenu(); })");
1226          $f->endSection();
1227          $f->html('</div>');
1228          $f->html('<div id="optcontainer">');
1229          $anum = 0;
1230          foreach($listitems as $key)
1231              {
1232              if ($anum == $cur_page)
1233                  $display = 'display:block; font: 11px Verdana;';
1234              else
1235                  $display = 'display:none; font: 11px Verdana;';
1236  
1237              $f->html('<div style="'. $display .'" id="'. $this->paramName('page'.$anum) .'">');
1238              
1239              if ($anum == 0 || $anum == 2)
1240                  {
1241                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1242                  $f->html('Alignment:');
1243                  $f->html('</div>');
1244                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1245                  $f->radio('alignment'.$menuTypes[$anum] , array('v' => 'Vertical', 'h' => 'Horizontal'), $this->settingsVars['alignment'], 'v', '&nbsp;');
1246                  $f->html('</div>');
1247                  }
1248              if ($anum == 2)
1249                  {
1250                  /*$f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1251                  $f->html('Expand Up:');
1252                  $f->html('</div>');
1253                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1254                  $f->checkbox('expandup', $this->settingsVars['expandup']);
1255                  $f->html('</div>');*/
1256                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;margin: 6px;">');
1257                  $f->html('Horizontal options');
1258                  $f->html('</div>');
1259                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1260                  $f->html('&nbsp;');
1261                  $f->html('</div>');
1262                
1263                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1264                  $f->html('Maximum Width(%):');
1265                  $f->html('</div>');
1266                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1267                  $f->text('hmaxWidth', $this->settingsVars['hmaxWidth']);
1268                  $f->html('</div>');
1269                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1270                  $f->html('Smart Width:');
1271                  $f->html('</div>');
1272                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1273                  $f->checkbox('smartWidth', $this->settingsVars['smartWidth']);
1274                  $f->html('</div>');
1275  
1276                  $onchangescript = '<script>
1277                                         function changeCustomWidth(dn)
1278                                             {
1279                                             switch(dn)
1280                                                 {';
1281                  foreach($cWidthList as $key => $val)
1282                      {
1283                      $onchangescript .= 'case \''. $key .'\':
1284                                            if (\''.$this->settingsVars['cWidthHiddencss'][$key].'\' == \'\')
1285                                                var pixel = \'\';
1286                                            else
1287                                                var pixel = \'px\';
1288                                            var numValue = \''.$this->settingsVars['cWidthHiddencss'][$key].'\';
1289                                            numValue.replace(\'px\', \'\');
1290                                            document.getElementById(\''.$this->paramName('cWidthAmtcss').'\').value=numValue+pixel;
1291                                          break;';
1292                                      
1293                      
1294                      }
1295                   $onchangescript .= '    }
1296                                      }
1297                                      </script>';
1298                  $f->html($onchangescript);
1299                  if (count($this->settingsVars['cWidthHiddencss']) > 0)
1300                      {
1301                      foreach ($this->settingsVars['cWidthHiddencss'] as $k => $v)
1302                          $hiddenoriginal .= $k .';'. $v .';';
1303                      }
1304                  $f->hidden('cWidthHidden'.$menuTypes[$anum], $hiddenoriginal, array('id' => $this->paramName('cWidthHidden'.$menuTypes[$anum])));
1305                    $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1306                  $f->html('Custom Width:');
1307                  $f->html('</div>');
1308                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1309                  foreach($cWidthList as $j => $g)
1310                      {
1311                      $initialValue = $j; 
1312                      break;
1313                      }
1314  
1315                  $initialValue = $this->settingsVars['cWidthHiddencss'][$initialValue];
1316                  if ($initialValue != '')
1317                      {
1318                      if (strpos($initialValue, 'px') === false)
1319                          $initialValue = $initialValue .'px';
1320                      }
1321                  $f->dropdown('cWidth'.$menuTypes[$anum] , $cWidthList, '','',array('onchange' => 'changeCustomWidth(this.value);'));
1322                  $f->text('cWidthAmt'.$menuTypes[$anum], $initialValue ,'5', array('id' => $this->paramName('cWidthAmt'.$menuTypes[$anum])));
1323                  $f->button('cWidthApply'.$menuTypes[$anum],'Apply', 'var dn=document.getElementById(\''.  $this->paramName('cWidth'.$menuTypes[$anum]) .'\').value;var dnwidth=document.getElementById(\''. $this->paramName('cWidthAmt'.$menuTypes[$anum]) .'\').value;var element=document.getElementById(\''.  $this->paramName('cWidthHidden'.$menuTypes[$anum]) .'\'); element.value=element.value+dn+\';\'+dnwidth+\';\';');
1324                  $f->html('</div>');
1325                  }
1326              if ($anum == 0)
1327                  {
1328                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1329                  $f->html('Force Width:');
1330                  $f->html('</div>');
1331                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1332                  $f->text('buttonwidth', $this->settingsVars['buttonwidth']);         
1333                  $f->html('</div>');               
1334                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1335                  $f->html('Force Height:');
1336                  $f->html('</div>');
1337                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1338                  $f->text('buttonheight', $this->settingsVars['buttonheight']);
1339                  $f->html('</div>');
1340                  }    
1341              if ($anum != 5 && $anum != 3 && $anum != 2 && $anum != 6)
1342                  {
1343                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1344                  $f->html('Background Image:');
1345                  $f->html('</div>');
1346                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1347                  $f->filePicker('bgimage'.$menuTypes[$anum] , @$this->settingsVars['bgimage'], 'jpg', '', '', 1, '', 1);
1348                  $f->html('</div>');
1349                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1350                  $f->html('Rollover Image:');
1351                  $f->html('</div>');
1352                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1353                  $f->filePicker('rollimage'.$menuTypes[$anum] , @$this->settingsVars['rollimage'], 'jpg', '', '', 1, '', 1);
1354                  $f->html('</div>');
1355                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1356                  $f->html('Background Repeat:');
1357                  $f->html('</div>');
1358                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1359                  $f->radio('repeat'.$menuTypes[$anum], array('repeat-x' => 'Vertical Repeat', 'repeat-y' => 'Horizontal Repeat', 'no-repeat' => 'No Repeat'), $this->settingsVars['repeat'], 'repeat-x', '&nbsp;');
1360                  $f->html('</div>');
1361                  }
1362              if ($anum == 3)
1363                  {
1364                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1365                  $f->html('Separator:');
1366                  $f->html('</div>');
1367                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1368                  $f->text('separator' , @$this->settingsVars['separator'], 3);
1369                   $f->html('</div>');
1370                  }
1371              if($anum == 6)
1372                  {                
1373                  $f->html('<span style="font-family: verdana; font-size:13px;color:#555;font-weight: bold;text-align: right; margin-left: 110px;">Classic Settings:</span>');
1374                  $f->html('&nbsp;<br />');
1375                  
1376                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1377                  $f->html('Background Image:');
1378                  $f->html('</div>');
1379                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1380                  $f->filePicker('classic_bgimg' , $classic_bgimg, 'jpg', '', '', 1, '', 1);
1381                  $f->html('</div>');
1382                  $f->html('<div style="font-weight: bold;float:left; width: 33%; text-align: right;">');
1383                  $f->html('Tab background color:');
1384                  $f->html('</div>');
1385                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1386                  $f->color('classic_standardbg', ($classic_standardbg != "")? $classic_standardbg :"transparent", 'Tab color');
1387                  $f->html('</div>');
1388                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1389                  $f->html('Tab rollover color:');
1390                  $f->html('</div>');
1391                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1392                  $f->color('classic_hoverbg', ($classic_hoverbg != "")? $classic_hoverbg :"transparent", 'Text rollover');
1393                  $f->html('</div>');
1394  
1395                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1396                  $f->html('Tab active color:');
1397                  $f->html('</div>');
1398                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1399                  $f->color('classic_activebg', ($classic_activebg != "")? $classic_activebg :"transparent", 'Text rollover');
1400                  $f->html('</div>');
1401                  
1402                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1403                  $f->html('Second level background color');
1404                  $f->html('</div>');
1405                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1406                  $f->color('classic_leveltwobg', ($classic_leveltwobg != "")? $classic_leveltwobg :"transparent", 'Text rollover');
1407                  $f->html('</div>');
1408  
1409                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1410                  $f->html('Tab text color:');
1411                  $f->html('</div>');
1412                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1413                  $f->color('classic_standardtext', ($classic_standardtext != "")? $classic_standardtext :"#666666", 'Text rollover');
1414                  $f->html('</div>');
1415  
1416                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1417                  $f->html('Tab text hover color:');
1418                  $f->html('</div>');
1419                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1420                  $f->color('classic_hovertext', ($classic_hovertext != "")? $classic_hovertext :"#666666", 'Text rollover');
1421                  $f->html('</div>');
1422                  
1423                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1424                  $f->html('Tab active text:');
1425                  $f->html('</div>');
1426                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1427                  $f->color('classic_activetext', ($classic_activetext != "")? $classic_activetext :"#666666", 'Text rollover');
1428                  $f->html('</div>');
1429  
1430  
1431                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1432                  $f->html('Left Offset:');
1433                  $f->html('</div>');
1434                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1435                  $f->text('classic_indent', $classic_indent);
1436                  $f->html('</div>');
1437                  
1438                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1439                  $f->html('Height:');
1440                  $f->html('</div>');
1441                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1442                  $f->text('classic_height', $this->settingsVars['height'] . "px");
1443                  $f->html('</div>');
1444                  
1445                  $f->html('<div style="clear: both;font-weight: bold;float:left; width: 33%; text-align: right;">');
1446                  $f->html('Use alternate markup:');
1447                  $f->html('</div>');
1448                  $f->html('<div style="float:left; width: 46%; margin-left: 8px;">');
1449                  $f->checkbox('classic_alternate', isset($this->settingsVars['alternatemarkup']), 'Use markup without any relative positioning. (can help with IE Z-Index problems)');
1450                  $f->html('</div>');
1451                  } 
1452              $f->html('</div>');
1453              /*
1454              if ($anum == 5)
1455                  {
1456                  $f->html('<div style="padding-left:1em;text-indent:-1em;"><b>Template:</b> ');
1457                  $defaultTemplate = 'mnF=default.customnav.tpl,' . C_LDAP_CARAVEL_PUBLIC_FOLDER;
1458                  $defaultFolder = C_LDAP_FOLDER .'='. 'Templates' .','. C_LDAP_FOLDER .'='. 'Settings' .','. C_LDAP_BASE_FOLDER;
1459                  $f->filePicker('styleTemplate', @$this->settingsVars['styleTemplate'], $defaultFolder, 'tpl', $defaultTemplate);
1460                  $f->html('</div>');
1461                  }*/    
1462              // generate the stuff needed for the menu
1463              if($anum == 6)
1464                  {
1465                  
1466                  $listonclick[$anum] = "document.main.".$this->paramName('restrictions').".value = '".$menuLvl[$anum]."';
1467                                        selectorHideShowPages(" . $anum . ", '".$this->paramName('page')."', '".(count($listitems))."', '".$this->paramName('menu')."');
1468                                        document.main.". $this->paramName('style').".value='". $menuTypes[$anum]."';
1469                                        document.getElementById('nav_type').innerHTML = '". $key ."';
1470                                        document.getElementById('mainDivContents').style.display = 'none';";
1471                  $listattrs[$anum] = array('id' => $this->paramName('menu'.$anum));
1472                  }
1473              else
1474                  {    
1475                  $listonclick[$anum] = "document.main.".$this->paramName('restrictions').".value = '".$menuLvl[$anum]."';
1476                                        selectorHideShowPages(" . $anum . ", '".$this->paramName('page')."', '".(count($listitems))."', '".$this->paramName('menu')."');
1477                                        document.main.". $this->paramName('style').".value='". $menuTypes[$anum]."';
1478                                        document.getElementById('nav_type').innerHTML = '". $key ."';
1479                                        if (document.getElementById('mainDivContents').style.display == 'none')
1480                                           { document.getElementById('mainDivContents').style.display = 'block';document.getElementById('customizeDivContents').style.display = 'none';}";
1481                  $listattrs[$anum] = array('id' => $this->paramName('menu'.$anum));
1482                  }
1483              $anum++;
1484              }
1485          $f->html('<div style="float: right; margin-top: 20px;">');
1486          $f->defaultButtons();
1487          $f->html('</div>');
1488          $f->html('</div>');
1489          $tpl->setVar('options', $f->get());
1490          $menu = Widget::getWizardMenu($listitems, 0, $cur_page, $listonclick, $listattrs);
1491          $tpl->setVar('menu', $menu);
1492          return $tpl->subst('main');
1493         }
1494      } // end class Navigator 
1495  ?>

title

Description

title

Description

title

Description

title

title

Body