Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Menu  /  Menuleft   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tl.gif Base tr.gif tl.gif Basic tr.gif tl.gif Dto tr.gif tl.gif Form tr.gif tl.gif Language tr.gif tl.gif Layout tr.gif tls.gif     Menu  trs.gif tl.gif Mvc tr.gif tl.gif Netbank.eksperter.dk tr.gif tl.gif Tab tr.gif tl.gif Table tr.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink 
arrow-headline.gif Artikler
 
Tilbage

Skjul: Navn

MenuLeft.php


Vis: Sample code, tutorial

MenuLeft, Sample code, tutorial

Sådan benyttes komponenten MenuLeft klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

  • <?
    require_once(HTML_PACKAGE_PATH.'/MenuLeft.php');
    ?>

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

  • <?
    MenuLeft
    ::display($param1$param2$param3, ...);
    ?>

eller du kan lave en instance af komponenten og benytte metoderne direkte:

  • <?
    $object 
    = new MenuLeft($param1$param2$param3, ...);
    print 
    $object->getHtml();
    ?>

Skjul: Sådan vises komponenten

MenuLeft, Sådan vises komponenten

Sådan vises komponenten MenuLeft klassen

arrow-headline.gif Artikler

Vis: PHP source code

MenuLeft, PHP source code

Den fulde PHP kildekode for MenuLeft klassen

<?php
/**
 * @package menu
 * @see HTML_MENU_PAGE_PATH.'/MenuLeft.php'
 * @copyright (c) http://Finn-Rasmussen.com
 * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
 * @author http://Finn-Rasmussen.com
 * @version 1.11
 * @since 27-nov-2009
 */

/**
 * The required files
 */
require_once(HTML_MENU_PAGE_PATH.'/MenuVertical.php');

/**
 * Generates a Menu Left element
 * <code>
 * +---------+----------------------------+
 * |  menu1  |
 * |  menu2  |
 * |    :    |
 * +---------+----------------------------+
 * Usage:
 *   $menu = new MenuLeft($datareader, $text, $width, $class, $border,
 *                        $cellpadding, $cellspacing, $summary, $caption, $layout);
 *   print $menu->getHtml();
 * Or
 *   MenuLeft:display($datareader, $text, $width, $class, $border,
 *                    $cellpadding, $cellspacing, $summary, $caption, $layout);
 * </code>
 * @package menu
 */

class MenuLeft extends MenuVertical {
    
/**
     * Constructor
     * @param DataReader / array $datareader The Data Reader object OR an array
     * @param String $text    The text header for the table
     * @param String $width   The Width for the table
     * @param String $class   The CSS Class name to use
     * @param String $border  The Border
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption 
     * @param String $layout  The layout to use 
     */
    
function __construct($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$layout='') {
        
$theText        $text   != '' $text   MENU_LEFT_TEXT;
        
$theWidth       $width  != '' $width  MENU_LEFT_VIEW_WIDTH;
        
$theClass       $class  != '' $class  MENU_LEFT_VIEW_CLASS;
        
$theBorder      $border != '' $border MENU_LEFT_VIEW_BORDER;
        
$theCellpadding $cellpadding != '' $cellpadding MENU_LEFT_VIEW_CELLPADDING;
        
$theCellspacing $cellspacing != '' $cellspacing MENU_LEFT_VIEW_CELLSPACING;
        
$theLayout      $layout != '' $layout MENU_LEFT_VIEW_LAYOUT;
        
parent::__construct($datareader$theText$theWidth$theClass$theBorder$theCellpadding$theCellspacing$summary$caption$theLayout);
    }

    
/**
     * Get the CSS class Name for this component
     * @return String The CSS class name
     */
    
function getCssClass() {
        return 
CSS_MENU_LEFT;
    }

    
/**
     * Toogle the request parameters which will minimize or maximize this component
     * @return array The array of key=>value pair
     */
    
function getMinimize() {
        return 
$this->getToogle(REQUEST_LINK_SHOWLINK_SHOWLINK_SHOW_MENU_LEFT);
    }

    
/**
    * Get the html for the left menu links
    * @return String The html
    */
    
function getHtml() {
        
$html  $this->html;
        if (
LINK_SHOW LINK_SHOW_MENU_LEFT && HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
            if (
CACHE_MENU && $this->getCacheFileName(CACHE_MENU_PATH) != '' && file_exists($this->getCacheFileName(CACHE_MENU_PATH))) {
                
$html .= $this->content($this->getCacheFileName(CACHE_MENU_PATH));
            } else {
                
$html .= "<!-- MenuLeft -->\r\n";;
                
$html .= $this->getColumns();
                if (
CACHE_MENU) {
                    
$this->save($htmlCACHE_MENU_PATH);
                }
            }
        } else {
               
$html .= $this->getMaximize();
        }
        return 
$html;
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    MenuLeft::display($datareader, $text, $width, $class, $border,
     *                      $cellpadding, $cellspacing, $summary, $caption, $layout);
     * </code>
     * @static
     * @param DataReader / array $datareader The Data Reader object OR an array
     * @param String $text    The text header for the table
     * @param String $width   The Width for the table
     * @param String $class   The CSS Class name to use
     * @param String $border  The Border
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption 
     * @param String $layout  The layout to use 
     */
    
public static function display($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$layout='') {
        
$html = new MenuLeft($datareader$text$width$class$border$cellpadding$cellspacing$summary$caption$layout);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

MenuLeft, HTML source code

Den fulde HTML kildekode for MenuLeft klassen

<?
<!-- DEBUGMenuLeft -->
<!-- 
MenuLeft -->
<!-- 
DEBUGTableHeader -->

<
table width="200" class="baseBorder" border="0" cellpadding="2" cellspacing="0">
 <
tr>
    <
td class="baseArrowHeader" valign="middle"><!-- DEBUGLink -->
<
class="baseLinkColor" href="/source-code/menu/MenuLeft/index.php" title="Klik her for at Minimere ...  TableHeader"><!-- DEBUGImages -->
<
img src="http://myrer.info/images/arrow-headline.gif" width="4" height="7" alt="arrow-headline.gif" />
</
a>
</
td>
  <
th class="baseColorHeader" valign="top" align="left">Artikler
</th>

 </
tr>

</
table>

<
table id="MenuLeftId" width="200" class="baseBorder" border="0" cellpadding="0" cellspacing="0">
 <
tr>
    <
td class="menuLeft" valign="top">Der er ikke fundet noget
</td>

 </
tr>

</
table>

?>

Vis: Class methods

MenuLeft, Class methods

Her er 'klasse metoderne' for MenuLeft klassen:

  • __construct
  • getCssClass
  • getMinimize
  • getHtml
  • display
  • newData
  • newColumn
  • isActive
  • isActiveTab
  • isActiveIndex
  • newColumns
  • adjustColumns
  • newCorner
  • getColumns
  • newTextRow
  • getTableHeader
  • getStart
  • getEnd
  • start
  • end
  • setObject
  • set
  • get
  • getAttribute
  • getTag
  • add
  • getSizeof
  • getElement
  • getElements
  • getToogle
  • getMaximize
  • newTriangle
  • getStartHtml
  • getEndHtml
  • showsource
  • getClassName
  • getMsg
  • addHtml
  • __toString
  • getCacheFileName
  • save
  • content

Vis: Object vars

MenuLeft, Object vars

Her er 'objekt variable' for MenuLeft klassen:

  • html =>
  • sql =>

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 www.Finn-Rasmussen.com Powered by myPHP Version (5.3.3-7+squeeze9) 1.11
blank.gif