cvs: phd /themes/pear pearchm.php

From: Date: Sat, 24 Jan 2009 21:39:13 +0000
Subject: cvs: phd /themes/pear pearchm.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3074@lists.php.net to get a copy of this message
cweiske Sat Jan 24 21:39:13 2009 UTC Modified files: /phd/themes/pear pearchm.php Log: Apply Richard's ereg_replace->preg_replace patch http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearchm.php?r1=1.6&r2=1.7&diff_format=u Index: phd/themes/pear/pearchm.php diff -u phd/themes/pear/pearchm.php:1.6 phd/themes/pear/pearchm.php:1.7 --- phd/themes/pear/pearchm.php:1.6 Sat Nov 1 09:32:04 2008 +++ phd/themes/pear/pearchm.php Sat Jan 24 21:39:12 2009 @@ -339,18 +339,28 @@ return parent::format_root_chunk($open, $name, $attrs, $props); } - public function header($id) { + /** + * Generate the HTML header. + * Uses parent::header() and adds some additional stylesheets. + * + * @param string $id Page ID + * + * @return string Header HTML + */ + public function header($id) + { $header = parent::header($id); // Add CSS link to <head> - $header = ereg_replace('( *)</head>','\\1 <link media="all" rel="stylesheet" type="text/css" href="reset-fonts.css"/> - <link media="all" rel="stylesheet" type="text/css" href="style.css"/> - <link media="all" rel="stylesheet" href="manual.css"/> -\\1</head>', $header); + $header = preg_replace('#( *)</head>#', + '$1 <link media="all" rel="stylesheet" type="text/css" href="reset-fonts.css"/> +$1 <link media="all" rel="stylesheet" type="text/css" href="style.css"/> +$1 <link media="all" rel="stylesheet" href="manual.css"/> +$1</head>', + $header + ); return $header; } - - private function collectContent($attrs) { if (isset($attrs[PhDReader::XMLNS_XML]["id"])) { $id = $attrs[PhDReader::XMLNS_XML]["id"];

« previous php.doc.cvs (#3074) next »