Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Sie sind hier: /  Top page  /  Anzeige der quellcode  /  Table  /  Tableheader   Logon jetzt   Logon
blank.gif
««« Anzeige der Quellcode
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 tl.gif Tab tr.gif tls.gif     Table  trs.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Zurück

Minimieren: Name

TableHeader.php


Anzeigen: Sample code, tutorial

TableHeader, Sample code, tutorial

Wie nutzen Sie das TableHeader Klasse

Erstens sind die Komponente-Datei

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

Verwenden Sie die Komponente als taglib:

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

Oder nutzen Sie die Komponente als Objekt:

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

Minimieren: Ein Beispiel für die Nutzung der

TableHeader, Ein Beispiel für die Nutzung der

Ein Beispiel für die Nutzung der TableHeader Klasse


Anzeigen: PHP source code

TableHeader, PHP source code

Der vollständige PHP-Source-Code für die TableHeader Klasse

<?php
/**
 * @package table
 * @filesource
 * @see HTMP_TABLE_COMPONENT_PATH.'/TableHeader.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_BASE_UTIL_PATH.'/Htmlspecialchars.php');
require_once(
HTML_TABLE_COMPONENT_PATH.'/Table.php');
require_once(
HTML_BASE_UTIL_PATH.'/Images.php');
if (
defined('HTML_LOG_UTIL_PATH')) {
    require_once(
HTML_LOG_UTIL_PATH.'/Log.php');
}

/**
 * Generates a table header
 * <code> 
 * +------------------------- 
 * | > | Text header        |
 * +-------------------------
 * |   :
 * Usage:
 *   $datareader  = null;
 *   $text        = "Text header";
 *   $width       = "100%";
 *   $class       = "theTable";
 *   $border      = "1";
 *   $cellpadding = "5"
 *   $cellspacing = "0";
 *   $summary     = "";
 *   $caption     = "";
 *   $id          = "";
 *   
 *   $header = new TableHeader($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $id);
 *   print $header->getHtml();
 * Or
 *   TableHeader::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $id);
 * </code>
 * @package table
 */

class TableHeader extends Table {
    
/**
     * @var String $text The text heading
     */
    
protected $text  '';

    
/**
     * @var Image $text  The Image object
     */
    
protected $image NULL;

    
/**
     * Constructor
     * @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 $id          The element ID
     */
    
function __construct($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$id='') {
        
parent::__construct($datareader$text$width$class$border$cellpadding$cellspacing$summary$caption$id);
        if (
defined('DEBUG_LEVEL_SHOW_INFO') && DEBUG_LEVEL DEBUG_LEVEL_SHOW_INFO) {
            
//$this->text = $text != '' ? $text : $this->getClassName().'(), you forgot to add text';
        
} else {
            
$this->text trim($text != '' $text '');
        }
        
$this->image NULL;
    }

    
/**
     * Return a new content object for table header 
     * @return Object The table header as html
     */
    
function newContent() {
        
$tr = new Tr();
        
$image $this->newTriangle(IMAGE_ARROW_HEADLINE"");
        if (
$this->image != NULL && is_object($this->image)) {
            
$image $this->image;
        }
        
$td = new Td(CSS_ARROW_HEADLINE,'middle',''$image);
        
$tr->add($td);
        
$rawvalue ucfirst(str_replace('_',' '$this->text));
        
$text Htmlspecialchars::encode($rawvalue);
        
$th = new Th(CSS_COLOR_HEADER,'','left'$text);
        
$tr->add($th);
        return 
$tr;
    }
    
    
/**
     * Toogle the request parameters which will minimize or maximize this component
     * You may override this function in order to create the minimize functionality
     * @abstract
     * @return array The array of key=>value pair
     */
    
function getMinimize() {
        return array(); 
// Dymmy stub
    
}

    
/**
     * Builds the html for a table header, and return it 
     * @return String The table header as html
     */
    
function getHtml() {
        
$html  $this->html;
        if (
HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
            if (
$this->text != '') {
                
$this->add($this->newContent());
                
// Render it
                
$html .= $this->getStart();
                
$html .= $this->getEnd();
            } else {
                
$html .= '<!-- No text in TableHeader -->'."\r\n";
            }
        }
        return 
$html;
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    TableHeader::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $id); 
     * </code> 
     * @static
     * @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 $id          The element ID
     */
    
public static function display($datareader=null$text=''$width=''$class=''$border=''$cellpadding=''$cellspacing=''$summary=''$caption=''$id='') {
        
$html = new TableHeader($datareader$text$width$class$border$cellpadding$cellspacing$summary$caption$id);
        
$html->addHtml();
    }
}
?>

Anzeigen: HTML source code

TableHeader, HTML source code

Der HTML-Quellcode für das TableHeader Klasse

<?
<!-- DEBUGTableHeader -->
<!-- 
No text in TableHeader -->

?>

Anzeigen: Class methods

TableHeader, Class methods

Die 'Methoden der Klasse' für die TableHeader Klasse sind:

  • __construct
  • newContent
  • getMinimize
  • getHtml
  • display
  • 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

Anzeigen: Object vars

TableHeader, Object vars

Das 'Objekt vars' für die TableHeader Klasse sind:

  • html =>
  • sql =>

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 Web Expert www.Finn-Rasmussen.com Powered by myPHP Version (5.2.6-1+lenny9) 1.11
blank.gif