Tilbage Navn : CssLayout.php
Sample code, tutorial
Sådan benyttes komponenten CssLayout klassen
Først skal du inkludere den fil der beskriver komponenten, som en klasse fil
<?
require_once( HTML_PACKAGE_PATH . '/CssLayout.php' );
?>
Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):
<?
CssLayout :: display ( $param1 , $param2 , $param3 , ...);
?>
eller du kan lave en instance af komponenten og benytte metoderne direkte:
<?
$object = new CssLayout ( $param1 , $param2 , $param3 , ...);
print $object -> getHtml ();
?>
Parent html
Sådan vises komponenten CssLayout klassen
PHP source code
Den fulde PHP kildekode for CssLayout klassen
<?
/**
* @package layout
* @see HTML_LAYOUT_PAGE_PATH.'/CssLayout.php'
* @copyright (c) http://Finn-Rasmussen.com
* @license http://Finn-Rasmussen.com/license/ myPHP License conditions
* @author http://Finn-Rasmussen.com
* @version 1.10
* @since 22-feb-2007
*/
/**
* The required files
*/
require_once( HTML_BASE_PAGE_PATH . '/Css.php' );
/**
* Generates the Layout CSS
* <code>
* Usage:
* $css = new CssLayout($href);
* print $css->getHtml();
* Or:
* CssLayout::display($href);
* </code>
* @package layout
*/
class CssLayout extends Css {
/**
* Constructor
* @param String $href The url to the css filename (i.e. /css/my.css)
*/
function CssLayout ( $href = '' ) {
$this -> Css ( $href != '' ? $href : CSS_FILE_NAME_LAYOUT );
}
/**
* Returns the css Table components
* @return String the complete css
*/
function getCustom () {
$html = '' ;
$html .= $this -> getHeader ( $this -> getClassName ());
$html .= $this -> getComponent ( '.' . CSS_BANNER , CSS_BANNER_COLOR , CSS_BANNER_BACKGROUND , '' , '' , CSS_TEXT_DECORATION_NONE ); // CSS_FONTSIZE_SIZE_MEDIUM
$bar0 = new Images ( IMAGE_BAR0 );
$bar1 = new Images ( IMAGE_BAR1 );
$bar2 = new Images ( IMAGE_BAR2 );
$bar3 = new Images ( IMAGE_BAR3 );
$logo = new Images ( IMAGE_LOGO );
$html .= $this -> getClass ( '.' . CSS_LINE , CSS_LINE_COLOR , CSS_LINE_BACKGROUND );
$html .= $this -> getClass ( '.' . CSS_LINE_BANNER , CSS_LINE_BANNER_COLOR , CSS_LINE_BANNER_BACKGROUND , '' , '' , $bar0 -> get ( 'src' ) , CSS_BACKGROUND_REPEAT_X );
$html .= $this -> getClass ( '.' . CSS_LINE_LOCATOR , CSS_LINE_LOCATOR_COLOR , CSS_LINE_LOCATOR_BACKGROUND , '' , '' , $bar2 -> get ( 'src' ), CSS_BACKGROUND_REPEAT_X );
$html .= $this -> getTag ( '.' . CSS_VOWELS , CSS_VOWELS_COLOR , CSS_VOWELS_BACKGROUND , '' , '32px' );
$html .= $this -> getTag ( '.' . CSS_NON_VOWELS , CSS_NON_VOWELS_COLOR , CSS_NON_VOWELS_BACKGROUND , '' , '32px' );
//
//$html .= $this->getComponent('.'.CSS_BANNERIF ,CSS_BANNERIF_COLOR ,CSS_BANNERIF_BACKGROUND,CSS_FONTSIZE_SIZE_MEDIUM);
$html .= $this -> getComponent ( '.' . CSS_BRANDING , CSS_BRANDING_COLOR , CSS_BRANDING_BACKGROUND );
$html .= $this -> getComponent ( '.' . CSS_CANVAS , CSS_CANVAS_COLOR , CSS_CANVAS_BACKGROUND );
$html .= $this -> getComponent ( '.' . CSS_COPYRIGHT , CSS_COPYRIGHT_COLOR , CSS_COPYRIGHT_BACKGROUND , CSS_FONTSIZE_SIZE_XXSMALL , '' , CSS_TEXT_DECORATION_NONE );
$html .= $this -> getComponent ( '.' . CSS_COMPANY , CSS_COMPANY_COLOR , CSS_COMPANY_BACKGROUND );
//$html .= $this->getComponent('.'.CSS_CUSTOMER ,CSS_CUSTOMER_COLOR ,CSS_CUSTOMER_BACKGROUND);
//$html .= $this->getComponent('.'.CSS_FIRMA ,CSS_FIRMA_COLOR ,CSS_FIRMA_BACKGROUND);
$html .= $this -> getComponent ( '.' . CSS_LOCATOR , CSS_LOCATOR_COLOR , CSS_LOCATOR_BACKGROUND , '' , '' , CSS_TEXT_DECORATION_NONE );
//$html .= $this->getComponent('.'.CSS_FOOTER ,CSS_FOOTER_COLOR ,CSS_FOOTER_BACKGROUND);
$html .= $this -> getComponent ( '.' . CSS_TOP , CSS_TOP_COLOR , CSS_TOP_BACKGROUND , '' , '' , CSS_TEXT_DECORATION_NONE );
//$html .= $this->getComponent('.'.CSS_ENIRO_BANNER ,CSS_ENIRO_BANNER_COLOR ,CSS_ENIRO_BANNER_BACKGROUND,'','',CSS_TEXT_DECORATION_NONE);
//
$html .= $this -> getImage ( '.' . CSS_BANNERIF , $logo -> get ( 'src' ), CSS_NO_REPEAT );
// Bugfix for Firefox
$html .= $this -> getSingle ( '.' . CSS_BANNER , 'white-space' , 'nowrap' );
$html .= $this -> getSingle ( '.' . CSS_BRANDING , 'white-space' , 'nowrap' );
$html .= $this -> getSingle ( '.' . CSS_COMPANY , 'white-space' , 'nowrap' );
$html .= $this -> getSingle ( '.' . CSS_LOCATOR , 'white-space' , 'nowrap' );
$html .= $this -> getSingle ( '.' . CSS_TOP , 'white-space' , 'nowrap' );
return $html ;
}
/**
* Display html
* <code>
* Usage:
* CssLayout::display($href);
* </code>
* @static
* @param String $href, The url to the css file (i.e. /css/my.css)
*/
function display ( $href = '' ) {
$html = new CssLayout ( $href );
$html -> addHtml ();
}
}
?>
HTML source code
Den fulde HTML kildekode for CssLayout klassen
<?
<!-- DEBUG , Using CSS Cache file : / cache / css / finnrasmussen . dk - layout . css -->
< link rel = "STYLESHEET" type = "text/css" href = "/cache/css/finnrasmussen.dk-layout.css" title = "Cache and Copyright by http://hvepseeksperten.dk/copyright/" />
?>
Class methods
Her er 'klasse metoderne' for CssLayout klassen:
object
getclassname
getmsg
addhtml
gethtml
tostring
getcachefilename
save
content
stop
html
setobject
set
get
getattribute
gettag
add
getsizeof
getelement
getelements
gettoogle
getmaximize
getminimize
newtriangle
display
showsource
css
getlink
getlinknormal
getlinkhover
getlinkimage
getimage
getcomponent
getborderline
getbordersingle
getborder
getbutton
getclass
getli
getsingle
getcssarray
gethidden
gethr
getwidth
getstart
getcss
getfieldset
getlegend
getselect
getend
getheader
getinline
getcustom
csslayout
Object vars
Her er 'objekt variable' for CssLayout klassen:
html =>
sql =>
elements => Array
sizeof => 0
href => layout.css
Desværre har du ikke slået javascript til i din browser, så dele af hjemmesiden vil ikke fungere