svn: /pear2/sandbox/SimpleChannelFrontend/trunk/ src/SimpleChannelFrontend/Main.php www/templates/Main.tpl.php www/templates/News.tpl.php
www/templates/Package.tpl.php www/templates/PackageList.tpl.php
| From: | Brett Bieber | Date: | Fri, 30 Oct 2009 16:23:55 +0000 |
| Subject: | svn: /pear2/sandbox/SimpleChannelFrontend/trunk/ src/SimpleChannelFrontend/Main.php www/templates/Main.tpl.php www/templates/News.tpl.php www/templates/Package.tpl.php www/templates/PackageList.tpl.php |
||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9007@lists.php.net to get a copy of this message | ||
saltybeagle Fri, 30 Oct 2009 16:23:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290081
Log:
Get page titles functioning
Changed paths:
U pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php
U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php
U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php
U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php
U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php
Modified: pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php 2009-10-30 15:45:18
UTC (rev 290080)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php 2009-10-30 16:23:55
UTC (rev 290081)
@@ -32,6 +32,8 @@
*/
static public $channel;
+ public $page_title = '{page_title}';
+
public $page_content;
protected $options = array('view' => 'news');
@@ -145,6 +147,9 @@
*/
public function postRender($html)
{
+ $html = str_replace('{page_title}',
+ $this->page_title,
+ $html);
return $html;
}
}
Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php 2009-10-30 15:45:18 UTC
(rev 290080)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php 2009-10-30 16:23:55 UTC
(rev 290081)
@@ -5,7 +5,7 @@
<link rel="search" title="search packages"
type="application/opensearchdescription+xml" href="?view=searchdefinition">
<link rel="alternate" title="My Channel Latest Releases"
type="application/atom+xml" href="?view=latest" />
<link rel="stylesheet" href="css/all.css" />
- <title>page title | <?php echo pear2\SimpleChannelFrontend\Main::$channel->name;
?></title>
+ <title><?php echo $context->page_title; ?></title>
</head>
<body>
<div class="container_12">
Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php 2009-10-30 15:45:18 UTC
(rev 290080)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/News.tpl.php 2009-10-30 16:23:55 UTC
(rev 290081)
@@ -1,3 +1,7 @@
+<?php
+// Set the title for the main template
+$parent->parent->context->page_title = 'News |
'.pear2\SimpleChannelFrontend\Main::$channel->name;
+?>
<div id="news">
<div class="grid_8 left">
<h2>Latest News</h2>
Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php 2009-10-30 15:45:18 UTC
(rev 290080)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Package.tpl.php 2009-10-30 16:23:55 UTC
(rev 290081)
@@ -1,3 +1,7 @@
+<?php
+// Set the title for the main template
+$parent->parent->context->page_title = $context->package->name.' |
'.pear2\SimpleChannelFrontend\Main::$channel->name;
+?>
<div class="package">
<div class="grid_8 left">
<h2>Package :: <?php echo $context->package->name; ?></h2>
Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php
===================================================================
--- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php 2009-10-30 15:45:18
UTC (rev 290080)
+++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/PackageList.tpl.php 2009-10-30 16:23:55
UTC (rev 290081)
@@ -1,3 +1,7 @@
+<?php
+// Set the title for the main template
+$parent->parent->context->page_title = 'Packages |
'.pear2\SimpleChannelFrontend\Main::$channel->name;
+?>
<div class="packagelist grid_8">
<h1>Available Packages</h1>
<ul>