- <?
- /**
- * @package page
- * @filesource
- * @see HTML_PAGE_COMPONENT_PATH.'/Page.php'
- * @copyright (c) http://Finn-Rasmussen.com
- * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
- * @author http://Finn-Rasmussen.com
- * @version 1.9
- * @since 21-oct-2005
- */
-
- /**
- * The required files
- */
- require_once(HTML_PATH.'/Html.php');
- // Page Util
- require_once(HTML_BASE_PAGE_PATH.'/DocType.php');
- require_once(HTML_BASE_PAGE_PATH.'/HeadStart.php');
- require_once(HTML_BASE_PAGE_PATH.'/BodyStart.php');
- require_once(HTML_BASE_PAGE_PATH.'/Title.php');
- require_once(HTML_BASE_PAGE_PATH.'/Meta.php');
- require_once(HTML_BASE_PAGE_PATH.'/CssBase.php');
- require_once(HTML_BASE_PAGE_PATH.'/Javascript.php');
- require_once(HTML_BASE_PAGE_PATH.'/BodyEnd.php');
- require_once(HTML_BASE_PAGE_PATH.'/Noscript.php');
-
- // Base Util
- require_once(HTML_BASE_UTIL_PATH.'/Link.php');
- require_once(HTML_BASE_UTIL_PATH.'/Image.php');
-
- // Page Util
- require_once(HTML_PAGE_UTIL_PATH.'/Comment.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Div.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Document.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Header.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Hr.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Iframe.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Li.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Ol.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Paragraph.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Span.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Tag.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Text.php');
- require_once(HTML_PAGE_UTIL_PATH.'/Ul.php');
-
- // TODO Components
- // banner bannerif company copyright customer footer google iframe
- // metarotator imagerotator locator line
-
- // TODO Links
- // bottommenu topmenu rightmenu menulink leftmenu
-
- // TODO Util + page
- // imagelink Shortcuticon mailto
-
-
-
- /**
- * Generates the html for a Page. This is the taglib
- * <code>
- * Usage:
- * $page = new Page();
- * print $page->getHtml();
- * Or:
- * Page::display();
- * Page::p('Some Paragraph');
- * </code>
- * @package page
- */
-
- class Page extends Html {
-
- /**
- * Constructor
- */
- function Page() {
- $this->Html();
- }
-
- /**
- * Returns the content html for the page
- * @return String the complete html
- */
- function getHtml() {
- $html = '';
- $html .= "<h1>Welcome to the Page() portlet language</h1>";
- return $html;
- }
-
- /**
- * Display all
- * <code>
- * Usage:
- * Page::show();
- * </code>
- * @static
- */
- function show() {
- DocType::display();
- HeadStart::display();
- Title::display('My title');
- Meta::display('My Meta title','my description','myKeyword','keyword1,keyword2');
- //MetaRotator::display();
- Css::display();
- Javascript::display();
- //ShortcutIcon::display();
-
- BodyStart::display(); // </head><body>
- Noscript::display();
- //Line::display();
- //Banner::display();
- //Bannerif::display();
- //TopMenu::display();
- //Locator::display();
-
- //Skeleton::tablestart();
- //Skeleton::rowstart();
- //Skeleton::columnstart();
-
- //MenuLink::display();
- //LeftMenu::display();
-
- //Skeleton::columnend();
- //Skeleton::columnstart();
-
- //ContentArray::display();
- //ContentReferer::display();
- //ContentRotator::display();
- //Contentdate::display();
- //ContentXml::display();
- //Content::display();
-
- //Skeleton::columnstart();
-
- //RightMenu::display();
-
- //Skeleton::columnend();
- //Skeleton::rowend();
- //Skeleton::tableend();
-
- //BottomMenu::display();
- //Footer::display();
- //Customer::display();
- //Company::display();
- //Copyright::display();
- BodyEnd::display();
- }
-
- /**
- * Display html
- * <code>
- * Usage:
- * Page::display();
- * </code>
- * @static
- */
- function display() {
- $html = new Page();
- $html->addHtml();
- }
-
- // ************* HTML tags *************
-
-
-
- /**
- * Display start
- * <code>
- * Usage:
- * Page::start('ul'); // Generates a start <ul>
- * Page::start('p'); // Generates a start <p>
- * </code>
- * @static
- * @param String $element The html element, Valid elements: p,br,h1..h6,li,b,pre
- * @param String $class The css class name
- */
- function start($element,$class='') {
- Text::start($element,$class);
- }
-
- /**
- * Display end
- * <code>
- * Usage:
- * Page::end(); // Generates an end of PAGE
- * Page::end('ul'); // Generates an end </ul>
- * Page::end('p'); // Generates an end </p>
- * </code>
- * @static
- */
- function end($element='') {
- Text::end($element);
- }
-
- /**
- * Display li
- * <code>
- * Usage:
- * Page::li($text,$class);
- * </code>
- * @static
- * @param String $text The text to show with <li>$text</li>
- * @param String $class The css class name
- */
- function li($text,$class='') {
- Text::display($text,'li',$class);
- }
-
- /**
- * Display p
- * <code>
- * Usage:
- * Page::p($text,$class);
- * </code>
- * @static
- * @param String $text The text to show with <p>$text</p>
- * @param String $class The css class name
- */
- function p($text,$class='') {
- Text::display($text,'p',$class);
- }
-
- /**
- * Display h1
- * <code>
- * Usage:
- * Page::h1($text,$class,$name);
- * </code>
- * @static
- * @param String $text The text to show with <h1>$text</h1>
- * @param String $class The css class name
- * @param String $name The name/id attribute for a link identifier
- */
- function h1($text,$class='',$name='') {
- Text::display($text,'h1',$class,$name);
- }
- function h2($text,$class='',$name='') {
- Text::display($text,'h2',$class,$name);
- }
- function h3($text,$class='',$name='') {
- Text::display($text,'h3',$class,$name);
- }
- function h4($text,$class='',$name='') {
- Text::display($text,'h4',$class,$name);
- }
- function h5($text,$class='',$name='') {
- Text::display($text,'h5',$class,$name);
- }
- function h6($text,$class='',$name='') {
- Text::display($text,'h6',$class,$name);
- }
-
- /**
- * Display br
- * <code>
- * Usage:
- * Page::br();
- * </code>
- * @static
- */
- function br() {
- Text::end('br');
- }
-
- /**
- * Display hr
- * <code>
- * Usage:
- * Page::hr($class);
- * </code>
- * @static
- * @param String $class The css class name
- */
- function hr($class='') {
- Text::end('hr',$class);
- }
-
- /**
- * Display comment
- * <code>
- * Usage:
- * Page::comment($text);
- * </code>
- * @static
- * @param String $text The text to add as comment
- */
- function comment($text='') {
- Comment::display($text);
- }
-
- /**
- * Display text
- * <code>
- * Usage:
- * Page::text($text,$element,$class);
- * </code>
- * @static
- * @param String $text The text to show with i.e. <p>$text</p>
- * @param String $element The html element, if any
- * Valid elements: p,br,h1..h6,li,b
- * @param String $class The css class name
- */
- function text($text='',$element='',$class='') {
- Text::display($text,$element,$class);
- }
-
- /**
- * Display link
- * <code>
- * Usage:
- * Page::link($text,$href,$class,$title,$aux);
- * </code>
- * @static
- * @param String $text The text for the link
- * @param String $href The url for the link
- * @param String $class The css class of the link
- * @param String $title The tool tip of the link
- * @param String $aux Add 'br' or 'li' html Pages, if required
- */
- function link($text='',$href='',$class='',$title='',$aux='') {
- Link::display($text,$href,$class,$title,$aux);
- }
-
- /**
- * Display mailto
- * <code>
- * Usage:
- * Page::mailto($text,$href,$class,$title,$aux);
- * </code>
- * @static
- * @param String $text The text for the link
- * @param String $href The url for the link
- * @param String $class The css class of the link
- * @param String $title The tool tip of the link
- * @param String $aux Add 'br' or 'li' html Pages, if required
- */
- function mailto($text='',$href='',$class='',$title='',$aux='') {
- EmailLink::display($text,$href,$class,$title,$aux);
- }
-
- /**
- * Display image
- * <code>
- * Usage:
- * Page::image($src,$width,$height,$alt,$class,$border);
- * will insert an image here
- * </code>
- * @static
- * @param String $srct The source path for the image
- * @param String $width The width
- * @param String $height The height
- * @param String $alt The alt text
- * @param String $class The css class for the image
- * @param String $border The border of an image
- */
- function image($src='',$width='',$height='',$alt='',$class='',$border='') {
- Image::display($src,$width,$height,$alt,$class,$border);
- }
-
- /**
- * Display iframe
- * <code>
- * Usage:
- * Page::iframe($src);
- * will insert an iframe here
- * </code>
- * @static
- * @param String $srct The source path for the html to iframe
- */
- function iframe($src='') {
- Iframe::display($src);
- }
-
- /**
- * Display imagelink
- * <code>
- * Usage:
- * Page::imagelink($image, $link);
- * </code>
- * @static
- * @param String $image The image object to show
- * @param String $link The link object to go to
- */
- function imagelink($image='', $link='') {
- ImageLink::display($image, $link);
- }
-
- // ************* COMPONENTS *************
-
-
-
- /**
- * Display doctype
- * <code>
- * Usage:
- * Page::doctype($doctype);
- * </code>
- * @static
- * @param String $doctype The doctype to use
- */
- function doctype($doctype='') {
- DocType::display($doctype);
- }
-
- /**
- * Display headstart
- * <code>
- * Usage:
- * Page::headstart();
- * </code>
- * @static
- */
- function headstart() {
- HeadStart::display();
- }
-
- /**
- * Display title
- * <code>
- * Usage:
- * Page::title($title);
- * </code>
- * @static
- * @param String $title The title of the page
- */
- function title($title='') {
- Title::display($title);
- }
-
- /**
- * Display meta
- * <code>
- * Usage:
- * Page::meta('the title','the description','the keyword','keyword1,keyword2,...');
- * </code>
- * @static
- * @param String $title The title of the page
- * @param String $description The description of the page
- * @param String $keyword The unique keyword for this page
- * @param String $keywords The keywords for the page
- */
- function meta($title='',$description='',$keyword='',$keywords='') {
- Meta::display($title,$description,$keyword,$keywords);
- }
-
- /**
- * Display metarotator
- * <code>
- * Usage:
- * Page::metarotator($group,$keyword,$file);
- * </code>
- * @static
- * @param String $group The Meta group to use
- * @param String $keyword The Meta keyword to use
- * @param String $file The Meta file to use
- */
- function metarotator($group='',$keyword='',$file='') {
- MetaRotator::display($group,$keyword,$file);
- }
-
- /**
- * Display css
- * <code>
- * Usage:
- * Page::css($href);
- * </code>
- * @static
- * @param String $href The url to the css file (i.e. /css/my.css)
- */
- function css($href='') {
- CssBase::display($href);
- }
-
- /**
- * Display javascript
- * <code>
- * Usage:
- * Page::javascript($href);
- * </code>
- * @static
- * @param String $href The url to the Javascript file (i.e. /include/my.js)
- */
- function javascript($href='') {
- Javascript::display($href);
- }
-
- /**
- * Display shortcuticon
- * <code>
- * Usage:
- * Page::shortcuticon($href);
- * </code>
- * @static
- * @param String $href The url to the Shortcut Icon
- */
- function shortcuticon($href='') {
- ShortcutIcon::display($href);
- }
-
- /**
- * Display bodystart
- * <code>
- * Usage:
- * Page::bodystart();
- * </code>
- * @static
- */
- function bodystart() {
- BodyStart::display();
- }
-
- /**
- * Display noscript
- * <code>
- * Usage:
- * Page::noscript();
- * </code>
- * @static
- */
- function noscript() {
- Noscript::display();
- }
-
- /**
- * Display line
- * <code>
- * Usage:
- * Page::line($width,$height,$class);
- * </code>
- * @static
- * @param String $width The width of the table
- * @param String $height The height of the line
- * @param String $class The css class to use
- * @param String $border The table border
- * @param String $cellPadding
- * @param String $cellSpacing
- */
- function line($width='',$height='',$class='',$border='',$cellPadding='',$cellSpacing='') {
- Line::display($width,$height,$class,$border,$cellPadding,$cellSpacing);
- }
-
- /**
- * Display banner
- * <code>
- * Usage:
- * Page::banner($width,$link,$imagelink);
- * </code>
- * @static
- * @param String $width The width of the table
- * @param String $link_id The link object to use
- * @param String $imagelink_id The imagelink object to use
- */
- function banner($width='',$link='',$imagelink='') {
- Banner::display($width,$link,$imagelink);
- }
-
- /**
- * Display bannerif
- * <code>
- * Usage:
- * Page::bannerif($width);
- * </code>
- * @static
- * @param String $width The width of the table
- */
- function bannerif($width='') {
- Bannerif::display($width);
- }
-
- /**
- * Display locator
- * <code>
- * Usage:
- * Page::locator($width,$class);
- * </code>
- * @static
- * @param String $width The width of the table
- * @param String $class The css class of the table
- */
- function locator($width='',$class='') {
- Locator::display($width,$class);
- }
-
- /**
- * Display googlestart
- * <code>
- * Usage:
- * Page::googlestart();
- * </code>
- * @static
- */
- function googlestart() {
- Google::start();
- }
-
- /**
- * Display google
- * <code>
- * Usage:
- * Page::google($text);
- * </code>
- * @static
- * @param String $tex, The default search pattern
- */
- function google($text='') {
- Google::display($text);
- }
-
- /**
- * Display googleend
- * <code>
- * Usage:
- * Page::googleend();
- * </code>
- * @static
- */
- function googleend() {
- Google::end();
- }
-
- /**
- * Display topmenu
- * <code>
- * Usage:
- * Page::topmenu($links,$text,$width,$class);
- * </code>
- * @static
- * @param String $links An array of links
- * @param String $text, The text above the menu links
- * @param String $width The width of the menu
- * @param String $class The css class for the menu
- */
- function topmenu($links='',$text='',$width='',$class='') {
- TopMenu::display($links,$text,$width,$class);
- }
-
- /**
- * Display menulink
- * <code>
- * Usage:
- * Page::menulink($path);
- * </code>
- * @static
- * @param String $path The directory path to start from
- */
- function menulink($path='') {
- MenuLink::display($path);
- }
-
- /**
- * Display leftmenu
- * <code>
- * Usage:
- * Page::leftmenu($links,$text,$width,$class);
- * </code>
- * @static
- * @param String $links an array of links
- * @param String $text The text above the menu links
- * @param String $width The width of the menu
- * @param String $class The css class for the menu
- */
- function leftmenu($links='',$text='',$width='',$class='') {
- LeftMenu::display($links,$text,$width,$class);
- }
-
- /**
- * Display rightmenu
- * <code>
- * Usage:
- * Page::rightmenu($links,$text,$width,$class);
- * </code>
- * @static
- * @param String $links an array of links
- * @param String $text The text above the menu links
- * @param String $width The width of the menu
- * @param String $class The css class for the menu
- */
- function rightmenu($links='',$text='',$width='',$class='') {
- RightMenu::display($links,$text,$width,$class);
- }
-
- /**
- * Display bottommenu
- * <code>
- * Usage:
- * Page::bottommenu($links,$text,$width,$class);
- * </code>
- * @static
- * @param String $links An array of links
- * @param String $text The text above the menu links
- * @param String $width The width of the menu
- * @param String $class The css class for the menu
- */
- function bottommenu($links='',$text='',$width='',$class='') {
- BottomMenu::display($links,$text,$width,$class);
- }
-
- /**
- * Display copyright
- * <code>
- * Usage:
- * Page::copyright($width);
- * </code>
- * @static
- * @param String $width The width of the table, default 100%
- */
- function copyright($width='') {
- Copyright::display($width);
- }
-
- /**
- * Display customer
- * <code>
- * Usage:
- * Page::customer($text,$width);
- * </code>
- * @static
- * @param String $text The text of the table
- * @param String $width The width of the table, default 100%
- */
- function customer($text='',$width='',$class='',$border='',$cellPadding='',$cellSpacing='') {
- Customer::display($text,$width,$class,$border,$cellPadding,$cellSpacing);
- }
-
- /**
- * Display company
- * <code>
- * Usage:
- * Page::company($text,$width);
- * </code>
- * @static
- * @param String $text The text of the table
- * @param String $width The width of the table, default 100%
- */
- function company($text='',$width='',$class='',$border='',$cellPadding='',$cellSpacing='') {
- Company::display($text,$width,$class,$border,$cellPadding,$cellSpacing);
- }
-
- /**
- * Display imagerotator
- * <code>
- * Usage:
- * Page::imagerotator($path);
- * </code>
- * @static
- * @param String $path The path to the images to rotate
- */
- function imagerotator($path='') {
- Imagerotator::display($path);
- }
-
- /**
- * Display footer
- * <code>
- * Usage:
- * Page::footer($width);
- * </code>
- * @static
- * @param String $width The width of the table, default 100%
- */
- function footer($width='') {
- Footer::display($width);
- }
-
- /**
- * Display bodyend
- * <code>
- * Usage:
- * Page::bodyend();
- * </code>
- * @static
- */
- function bodyend() {
- BodyEnd::display();
- }
- }
- ?>