cvs: pear /HTML_Page Page.php

From: Date: Wed, 15 Oct 2003 14:03:17 +0000
Subject: cvs: pear /HTML_Page Page.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13621@lists.php.net to get a copy of this message
thesaur Wed Oct 15 10:03:17 2003 EDT Modified files: /pear/HTML_Page Page.php Log: * added support for CSS2 media types * updated inline docs Index: pear/HTML_Page/Page.php diff -u pear/HTML_Page/Page.php:1.24 pear/HTML_Page/Page.php:1.25 --- pear/HTML_Page/Page.php:1.24 Tue Sep 2 06:01:19 2003 +++ pear/HTML_Page/Page.php Wed Oct 15 10:03:16 2003 @@ -17,7 +17,7 @@ // | Klaus Guenther <klaus@capitalfocus.org> | // +----------------------------------------------------------------------+ // -// $Id: Page.php,v 1.24 2003/09/02 10:01:19 thesaur Exp $ +// $Id: Page.php,v 1.25 2003/10/15 14:03:16 thesaur Exp $ require_once 'PEAR.php'; require_once 'HTML/Common.php'; @@ -443,8 +443,12 @@ } // Generate stylesheet links - foreach ($this->_styleSheets as $strSrc => $strType ) { - $strHtml .= $tab . "<link rel=\"stylesheet\" href=\"$strSrc\" type=\"$strType\"" . $tagEnd . $lnEnd; + foreach ($this->_styleSheets as $strSrc => $strAttr ) { + $strHtml .= $tab . "<link rel=\"stylesheet\" href=\"$strSrc\" type=\"".$strAttr['type'].'"'; + if (!isnull($strType['media'])){ + $strHtml .= ' media="'.$strAttr['media'].'"'; + } + $strHtml .= $tagEnd . $lnEnd; } // Generate stylesheet declarations @@ -726,12 +730,15 @@ * Adds a linked stylesheet to the page * * @param string $url URL to the linked style sheet + * @param string $type Mime encoding type + * @param string $media Media type that this stylesheet applies to * @access public * @return void */ - function addStyleSheet($url, $type = 'text/css') + function addStyleSheet($url, $type = 'text/css', $media = null) { - $this->_styleSheets[$url] = $type; + $this->_styleSheets[$url]['mime'] = $type; + $this->_styleSheets[$url]['media'] = $media; } // end func addStyleSheet /**

« previous php.pear.cvs (#13621) next »