Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Base  /  Noscript   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tls.gif     Base  trs.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 tl.gif Table tr.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Tilbage

Skjul: Navn

Noscript.php


Vis: Sample code, tutorial

Noscript, Sample code, tutorial

Sådan benyttes komponenten Noscript klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

Noscript, Sådan vises komponenten

Sådan vises komponenten Noscript klassen


Vis: PHP source code

Noscript, PHP source code

Den fulde PHP kildekode for Noscript klassen

<?php
/**
 * @package base
 * @see HTML_BASE_PAGE_PATH.'/Noscript.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_COMMON_PATH.'/Html.php');

/**
 * Generates the html for the noscript tag
 * <code>
 * Usage:
 *   $noscript = new Noscript();
 *   print $noscript->getHtml();
 * Or
 *   Noscript::display();
 * </code>
 * @package base
 */

class Noscript extends Html {
    
/**
     * @var String $text The text to show for the noscript tag
     */
    
protected $text '';

    
/**
     * Constructor
     * @param String $text The text for the noscript tag
     */
    
function __construct($text='') {
        
parent::__construct();
        
$this->text $text != ''?$text:@NO_SCRIPT_TEXT;
    }

    
/**
     * Returns the html for the css file
     * @return String the complete html
     */
    
function getHtml() {
        
$html  '';
        switch (
HTTP_USER_AGENT) {
            case 
HTTP_USER_AGENT_P900:
                
// Ignore SonyEricssonP900
                
break;
            default:
                
$html .= '<noscript><h1>'.$this->text.'</h1></noscript>'."\r\n";
                break;
        }
        return 
$html;
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    Noscript::display($text);
     * </code> 
     * @static
     * @param String $text The text for the no script tag
     */
    
public static function display($text='') {
        
$html = new Noscript($text);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

Noscript, HTML source code

Den fulde HTML kildekode for Noscript klassen

<?
<noscript><h1>Desværre har du ikke slået javascript til i din browser,<br />så dele af hjemmesiden vil ikke fungere</h1></noscript>

?>

Vis: Class methods

Noscript, Class methods

Her er 'klasse metoderne' for Noscript klassen:

  • __construct
  • getHtml
  • display
  • setObject
  • set
  • get
  • getAttribute
  • getTag
  • add
  • getSizeof
  • getElement
  • getElements
  • getToogle
  • getMaximize
  • getMinimize
  • newTriangle
  • getStartHtml
  • getEndHtml
  • showsource
  • getClassName
  • getMsg
  • addHtml
  • __toString
  • getCacheFileName
  • save
  • content

Vis: Object vars

Noscript, Object vars

Her er 'objekt variable' for Noscript 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.2.6-1+lenny8) 1.11
blank.gif