svn: /pear2/sandbox/Pyrus_WebFrontend/trunk/ src/pear2/Pyrus/WebFrontend/Controller.php src/pear2/Pyrus/WebFrontend/ListChannels.php
www/templates/WebFrontend/ListChannels.tpl.php
| From: | Brett Bieber | Date: | Tue, 23 Mar 2010 14:25:34 +0000 |
| Subject: | svn: /pear2/sandbox/Pyrus_WebFrontend/trunk/ src/pear2/Pyrus/WebFrontend/Controller.php src/pear2/Pyrus/WebFrontend/ListChannels.php www/templates/WebFrontend/ListChannels.tpl.php |
||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-9322@lists.php.net to get a copy of this message | ||
saltybeagle Tue, 23 Mar 2010 14:25:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=296674
Log:
Add list channels view.
Changed paths:
U pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php
A pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/ListChannels.php
A pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/ListChannels.tpl.php
Modified: pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php
===================================================================
--- pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php 2010-03-23
14:19:10 UTC (rev 296673)
+++ pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/Controller.php 2010-03-23
14:25:34 UTC (rev 296674)
@@ -28,6 +28,7 @@
{
public $view_map = array(
'index' => 'pear2\Pyrus\WebFrontend\Index',
+ 'list_channels' => 'pear2\Pyrus\WebFrontend\ListChannels',
'list_packages' => 'pear2\Pyrus\WebFrontend\ListPackages',
'install' => 'pear2\Pyrus\WebFrontend\InstallPackage'
);
Added: pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/ListChannels.php
===================================================================
--- pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/ListChannels.php
(rev 0)
+++ pear2/sandbox/Pyrus_WebFrontend/trunk/src/pear2/Pyrus/WebFrontend/ListChannels.php 2010-03-23
14:25:34 UTC (rev 296674)
@@ -0,0 +1,15 @@
+<?php
+namespace pear2\Pyrus\WebFrontend;
+class ListChannels extends \ArrayIterator
+{
+ function __construct($options = array())
+ {
+ $channel_registry = Controller::getConfig()->channelregistry;
+ $channels = array();
+ foreach ($channel_registry as $channel) {
+ $channels[$channel->name] = $channel->alias;
+ }
+ ksort($channels);
+ parent::__construct($channels);
+ }
+}
\ No newline at end of file
Added: pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/ListChannels.tpl.php
===================================================================
--- pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/ListChannels.tpl.php
(rev 0)
+++ pear2/sandbox/Pyrus_WebFrontend/trunk/www/templates/WebFrontend/ListChannels.tpl.php 2010-03-23
14:25:34 UTC (rev 296674)
@@ -0,0 +1,8 @@
+<?php $parent->context->page_title = 'Channels'; ?>
+<h2>Channels</h2>
+<ul>
+<?php
+foreach($context as $channel => $alias) {
+ echo '<li>'.$channel . ' (' . $alias . ")</li>\n";
+}?>
+</ul>