Skip to content
Browse files

* added support for CSS2 media types

* updated inline docs


git-svn-id: http://svn.php.net/repository/pear/packages/HTML_Page/trunk@142442 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent da3217d commit 8c59b79046971a4b16d90f646702271d84c02d80 Klaus Guenther committed
Showing with 11 additions and 4 deletions.
  1. +11 −4 Page.php
View
15 Page.php
@@ -443,8 +443,12 @@ function _generateHead()
}
// 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 @@ function addScriptDeclaration($content, $type = 'text/javascript')
* 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
/**

0 comments on commit 8c59b79

Please sign in to comment.
Something went wrong with that request. Please try again.