Changeset 1319

Show
Ignore:
Timestamp:
01/09/08 12:30:39 (1 year ago)
Author:
dana
Message:

Changed Menu coding so that its display location can be changed in the MainUI_Display template, instead of being hard coded to appear in main_content_top.
Moved the IE Javascript to its own js file, and included in MainUI_Display.tpl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wifidog-auth/wifidog/classes/MainUI.php

    r1312 r1319  
    559559            //Display main menu 
    560560            require_once('classes/Menu.php'); 
    561             $menu = Menu::getObject(); 
    562             $this->addContent('main_area_top', $menu->getUserUI()); 
    563                         $this->appendHtmlHeadContent(Menu::getIEWorkaroundJS()); 
     561            $this->smarty->assign('siteMenu', Menu::getObject()->getUserUI()); 
    564562        } 
    565563 
  • trunk/wifidog-auth/wifidog/classes/Menu.php

    r1312 r1319  
    206206     * @return HTML markup 
    207207     */ 
    208     static public function getIEWorkaroundJS() { 
    209         $html = <<<EOT 
    210         <script type="text/javascript"><!--//--><![CDATA[//><!-- 
    211  
    212 sfHover = function() { 
    213         var sfEls = document.getElementById("nav").getElementsByTagName("LI"); 
    214         for (var i=0; i<sfEls.length; i++) { 
    215                 sfEls[i].onmouseover=function() { 
    216                         this.className+=" sfhover"; 
    217                 } 
    218                 sfEls[i].onmouseout=function() { 
    219                         //alert(this.className); 
    220                         this.className=this.className.replace(new RegExp(" sfhover"), ""); 
    221                         //alert(this.className); 
    222                 } 
    223         } 
    224 
    225 if (window.attachEvent) window.attachEvent("onload", sfHover); 
    226  
    227 //--><!]]></script> 
    228 EOT; 
    229         return $html; 
    230     } 
     208//     static public function getIEWorkaroundJS() { 
     209//         $html = <<<EOT 
     210//         <script type="text/javascript"><!--//--><![CDATA[//><!-- 
     211//  
     212// sfHover = function() { 
     213//  var sfEls = document.getElementById("nav").getElementsByTagName("LI"); 
     214//  for (var i=0; i<sfEls.length; i++) { 
     215//      sfEls[i].onmouseover=function() { 
     216//          this.className+=" sfhover"; 
     217//      } 
     218//      sfEls[i].onmouseout=function() { 
     219//          //alert(this.className); 
     220//          this.className=this.className.replace(new RegExp(" sfhover"), ""); 
     221//          //alert(this.className); 
     222//      } 
     223//  } 
     224// } 
     225// if (window.attachEvent) window.attachEvent("onload", sfHover); 
     226//  
     227// //--><!]]></script> 
     228// EOT; 
     229//         return $html; 
     230//     } 
     231 
    231232    public function getUserUI() 
    232233    { 
  • trunk/wifidog-auth/wifidog/templates/classes/MainUI_Display.tpl

    r1300 r1319  
    5959                <script src="{$base_url_path}js/formutils.js" type="text/javascript"></script> 
    6060                <script src="{$base_url_path}js/addEvent.js"  type="text/javascript"></script> 
     61                <script src="{$base_url_path}js/menu.js"  type="text/javascript"></script> 
    6162    </head> 
    6263    <body id='page' class='{$page_name}'> 
     
    6970                                {$contentDisplayArray.page_header} 
    7071                {/if} 
    71                </div> 
     72            </div> 
    7273        {/if} 
    7374        <div id="page_body"> 
     
    9596                        {if !empty($contentDisplayArray.main_area_top)} 
    9697                        <div id="main_area_top"> 
    97                             {$contentDisplayArray.main_area_top} 
     98                            {$siteMenu} 
     99                        {$contentDisplayArray.main_area_top} 
    98100                        </div> 
    99101                        {/if}