Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Tab  /  Index   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 tl.gif Menu tr.gif tl.gif Mvc tr.gif tl.gif Netbank.eksperter.dk tr.gif tls.gif     Tab  trs.gif tl.gif Table tr.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Tilbage

Skjul: Navn

Index.php


Vis: Sample code, tutorial

Index, Sample code, tutorial

Sådan benyttes komponenten Index klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

Index, Sådan vises komponenten

Sådan vises komponenten Index klassen

arrow-headline.gif Index

Vis: PHP source code

Index, PHP source code

Den fulde PHP kildekode for Index klassen

<?php
/**
 * @package tab
 * @see HTML_TAB_PAGE_PATH/Index.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 list of links, like in an Index
 * <code>
 * Usage:
 *   $rows = array( 'b'=>array('tab'=>'b',...),array('tab'=>'b',...));
 *   $header  = ''; // The header meta data
 *   $default = ''; // The default meta data array
 *   $limit   = ''; // The limit to use for the array
 *   $sort    = true;
 *   
 *   $datareader = DatareaderFactory::newDataReader($rows, $header, $default, $limit, $sort);
 *   $menu = new Index($datareader, $text, $width, $class, $border,
 *                     $cellpadding, $cellspacing, $summary, $caption, $layout);
 *   print $menu->getHtml();
 * Or
 *   Index:display($datareader, $text, $width, $class, $border,
 *                 $cellpadding, $cellspacing, $summary, $caption, $layout);
 * </code>
 * @package tab
 */

class Index 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 Class
     * @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_INDEX_TEXT;
        
$theWidth       $width  != '' $width  TAB_INDEX_VIEW_WIDTH;
        
$theClass       $class  != '' $class  TAB_INDEX_VIEW_CLASS;
        
$theBorder      $border != '' $border TAB_INDEX_VIEW_BORDER;
        
$theCellpadding $cellpadding != '' $cellpadding TAB_INDEX_VIEW_CELLPADDING;
        
$theCellspacing $cellspacing != '' $cellspacing TAB_INDEX_VIEW_CELLSPACING;
        
$theLayout      $layout != '' $layout TAB_INDEX_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_TAB_MENU;
    }

    
/**
     * 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_TAB_SHOWTAB_SHOWTAB_SHOW_MENU_INDEX);
    }

    
/**
     * Returns the html for the Index
     * @return String the complete html
     */
    
function getHtml() {
        
$html  $this->html;
        if (
defined('TAB_SHOW') && TAB_SHOW TAB_SHOW_MENU_INDEX) {
            if (
CACHE_TAB && $this->getCacheFileName(CACHE_TAB_PATH) != '' && file_exists($this->getCacheFileName(CACHE_TAB_PATH))) {
                
$html .= $this->content($this->getCacheFileName(CACHE_TAB_PATH));
            } else {
                
$html .= "<!-- Index -->\r\n";;
                
$html .= $this->getColumns();
                if (
CACHE_TAB) {
                    
$this->save($htmlCACHE_TAB_PATH);
                }
            }
        } else {
               
$html .= $this->getMaximize();
        }
        return 
$html;
    }

    
/**
     * Display the html
     * <code>
      * Usage:
     *    Index::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 Class
     * @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 Index($datareader$text$width$class$border$cellpadding$cellspacing$summary$caption$layout);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

Index, HTML source code

Den fulde HTML kildekode for Index klassen

<?
<!-- DEBUGIndex -->
<!-- 
Index -->
<!-- 
DEBUGTableHeader -->

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

 </
tr>

</
table>

<
table id="IndexId" width="200" class="baseBorder" border="0" cellpadding="0" cellspacing="0">
 <
tr>
    <
td class="tabMenu" valign="top"><!-- LINK_LAYOUT_XX=16408 -->
<!-- 
DEBUGUl -->
<
ul class="tabMenu">
<!-- 
DEBUGLink -->
 <
li class="tabMenu"><class="tabMenu" href="?tabShow=4139" title="Klik her for at Minimere ...  Index"><!-- DEBUGImages -->
<
img src="http://finnrasmussen.dk/images/triangle.gif" width="10" height="10" alt="triangle.gif" class="tabMenu" />
</
a></li>



<!-- 
DEBUGLink -->
<!-- 
Forsiden --> <li class="tabMenu"><class="tabMenu" href="/" title="Til forsiden">Forsiden</a></li>



<!-- 
DEBUGLink -->
<!-- 
Kontakt --> <li class="tabMenu"><class="tabMenu" href="http://www.hvepseeksperten.dk/FormMail/" title="Kontakt via email&#013;">Kontakt</a></li>



</
ul>

</
td>
 </
tr>

</
table>

?>

Vis: Class methods

Index, Class methods

Her er 'klasse metoderne' for Index 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

Index, Object vars

Her er 'objekt variable' for Index 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+squeeze3) 1.11
blank.gif