Location: PHPKode > projects > SnortCenter 2.x > snortcenter-release/layout_class.php
<?php
    /*
    ** SnortCenter Copyright (C) 2001,2002,2003 Stefan Dens
    **
    ** Author: Stefan Dens <hide@address.com>
    **
    ** This program is free software; you can redistribute it and/or modify
    ** it under the terms of the GNU General Public License as published by
    ** the Free Software Foundation; either version 2 of the License, or
    ** (at your option) any later version.
    **
    ** This program is distributed in the hope that it will be useful,
        ** but WITHOUT ANY WARRANTY; without even the implied warranty of
    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ** GNU General Public License for more details.
    **
    ** You should have received a copy of the GNU General Public License
    ** along with this program; if not, write to the Free Software
    ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    */
?>
<?php
    class layout {
        var $menu_items;
        var $banner_name;
         
        function display_top() {
            if (($this->menu_items) OR ($this->banner_name)) {
                //init for banner and menu
                print '<tr><td width="1" bgcolor="#006699" background="./images/leftside.gif">&nbsp;</td><td width="100%">';
                if ($this->menu_items) {
                    print '<DIV>'. $this->top_menu() .'</DIV>';
                }
                if ($this->banner_name) {
                    print $this->banner_name;
                }
                // ending for banner and menu
                print ' </td><td width="1" bgcolor="#CCCCCC" background="./images/rightside.gif">&nbsp;</td></tr>';
            }
        }
         
        function top_menu() {
            include('config.php');
            $topmenu = '<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" bgcolor="#000000">
                <tr><TD><table width="100%" border="0" cellspacing="0" cellpadding="0" bordercolor="#000000">
                <tr bordercolor="#000000">
                <td width="7" height="10" background="./images/t_menubar.gif"><img src="./images/t_menubar.gif" width="8" height="20"></td>
                <td no-wrap valign=top width="100%" background="'.$lang_images_dir.'/background_bar.png">';
             
            $topmenu  .= '<font face="Times, Verdana, Arial, Helvetica, sans-serif" size="1">';
             
            foreach($this->menu_items as $tmp) {
                $topmenu  .= $tmp;
            }
            $topmenu  .= "</font></td>
                <TD align=right valign=top background=\"$lang_images_dir/background_bar.png\">";
            if ($alert_console  != '') {
                 $topmenu  .= "<a href=\"$alert_console\" onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"hideActiveMenus(); MM_displayStatusMsg('Alert Console'); MM_swapImage('alert','','$lang_images_dir/alert_console_y.png',1); return document.MM_returnValue\" ><img name=\"alert\" src=\"$lang_images_dir/alert_console_w.png\" height=\"39\" border=\"0\">";
            }
            if (($User_authentication == 1) || ($User_authentication == 2)) {
                 $topmenu  .= "<a href=\"login.php?phpUserLogin_logout=TRUE\" onMouseOut=\"MM_swapImgRestore(); FW_startTimeout()\" onMouseOver=\"hideActiveMenus(); MM_displayStatusMsg('Logout'); MM_swapImage('logout','','$lang_images_dir/logout_y.png',1); return document.MM_returnValue\" ><img name=\"logout\" src=\"$lang_images_dir/logout_w.png\" height=\"39\" border=\"0\">";
            }
            $topmenu  .= "
                </TD>
                </tr></table>
                <CENTER><img name='load' src='./images/loading.gif'></CENTER>
                </TD></tr></TABLE>";
            $topmenu  .= '';
            return $topmenu;
        }
         
        function menu_item($tag) {
            $this->menu_items[] = $tag;
        }
         
        function banner($tag) {
            $this->banner_name = '<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000">
                <tr bordercolor="#000000">
                <td width="7" height="10" bgcolor="#999999" background="./images/t_midbar.gif">';
            $this->banner_name  .= '<img src="./images/t_menubar.gif" width="9" height="10" ></td>';
            $this->banner_name  .= '<td bgcolor="#CCCCCC" height="50" background="./images/midbar.gif" valign="middle">';
            $this->banner_name  .= $tag;
            $this->banner_name  .= '</td></tr></table>';
        }
         
    }
?>
Return current item: SnortCenter 2.x