Changeset 219 for dev/common

Show
Ignore:
Timestamp:
05/10/07 21:16:43 (15 years ago)
Author:
ralle030583
Message:

- moved the new navigation stuff from page in a new class and prepared for dynamic menuBox :-)

Location:
dev/common/includes
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/class.page.php

    r216 r219  
    11<?php 
     2require_once('common/includes/class.navigation.php'); 
     3 
    24class Page 
    35{ 
     
    7779            } 
    7880            $smarty->assign('banner', $banner); 
    79  
    80             $menu = $this->generateMenu(); 
     81                         
     82            $nav = new Navigation(); 
     83            $nav->setSite($_GET['a']); 
     84            $menu = $nav->generateMenu(); 
    8185            $w = floor(100 / count($menu->get())); 
    8286             
     
    157161    } 
    158162      
    159     function generateMenu(){ 
    160         $menu = new Menu(); 
    161         $contracts = $this->killboard_->hasContracts(); 
    162         $campaigns = $this->killboard_->hasCampaigns(); 
    163         $layout = array(); 
    164         $statlink = ''; 
    165          
    166         $qry = new DBQuery(); 
    167         $query = "SELECT * FROM kb3_navigation WHERE nav_type ='top' ORDER BY posnr"; 
    168         $qry->execute($query); 
    169         while ($row = $qry->getRow()){ 
    170                 $url = $row['url']; 
    171                 // i know thats a bad hack :-) 
    172                 if ($row['target'] == '_blank') 
    173                         $url .= '" target="_blank"'; 
    174                          
    175                 if (!$contracts && ($row['ID']==3)){ 
    176                         continue; 
    177                 }elseif (!$campaigns && ($row['ID']==2)){ 
    178                         continue; 
    179                 }elseif ((((config::get('public_stats')=='replace')||(config::get('public_stats')=='remove')))&& $row['ID']==7) { 
    180                         continue; 
    181                 }elseif (!config::get('show_standings')&& $row['ID']==9){ 
    182                         continue; 
    183                 }elseif ((config::get('public_losses')&& $row['ID']==5)){ 
    184                         continue; 
    185                 }else $menu->add($url , $row['descr']); 
    186         } 
    187         return $menu; 
    188     } 
    189163} 
    190164 
  • dev/common/includes/globals.php

    r215 r219  
    11<?php 
    22// current subversion revision 
    3 preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 215 $', $match); 
     3preg_match('/\$Re'.'vision: (.*?) \$/', '$Revision: 219 $', $match); 
    44define('SVN_REV', $match[1]); 
    55