svn: /pear2/sandbox/SimpleChannelFrontend/trunk/ src/SimpleChannelFrontend/Categories.php src/SimpleChannelFrontend/Main.php
www/templates/Categories.tpl.php www/templates/Main.tpl.php

From: Date: Fri, 13 Nov 2009 22:09:36 +0000
Subject: svn: /pear2/sandbox/SimpleChannelFrontend/trunk/ src/SimpleChannelFrontend/Categories.php src/SimpleChannelFrontend/Main.php
www/templates/Categories.tpl.php www/templates/Main.tpl.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-9026@lists.php.net to get a copy of this message
saltybeagle Fri, 13 Nov 2009 22:09:36 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290711 Log: Get basic categories page working. Changed paths: A pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Categories.php U pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php A pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Categories.tpl.php U pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php Added: pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Categories.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Categories.php (rev 0) +++ pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Categories.php 2009-11-13 22:09:36 UTC (rev 290711) @@ -0,0 +1,11 @@ +<?php +namespace pear2\SimpleChannelFrontend; +class Categories +{ + public $categories; + + function __construct($options = array()) + { + $this->categories = $options['frontend']::$channel->remotecategories; + } +} \ No newline at end of file Modified: pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php 2009-11-13 22:08:41 UTC (rev 290710) +++ pear2/sandbox/SimpleChannelFrontend/trunk/src/SimpleChannelFrontend/Main.php 2009-11-13 22:09:36 UTC (rev 290711) @@ -38,9 +38,10 @@ protected $options = array('view' => 'news'); - protected static $view_map = array('news' => 'pear2\SimpleChannelFrontend\News', - 'packages' => 'pear2\SimpleChannelFrontend\PackageList', - 'package' => 'pear2\SimpleChannelFrontend\Package'); + protected static $view_map = array('news' => 'pear2\SimpleChannelFrontend\News', + 'packages' => 'pear2\SimpleChannelFrontend\PackageList', + 'package' => 'pear2\SimpleChannelFrontend\Package', + 'categories' => 'pear2\SimpleChannelFrontend\Categories'); /** * Constructor Added: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Categories.tpl.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Categories.tpl.php (rev 0) +++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Categories.tpl.php 2009-11-13 22:09:36 UTC (rev 290711) @@ -0,0 +1,23 @@ +<?php +$parent->parent->context->page_title = 'Categories | '.pear2\SimpleChannelFrontend\Main::$channel->name; ?> + +<div class="grid_8 left"> +<div class="packages-header"> + <h2 class="category-title">Categories</h2> +</div> +<?php +if (count($context->categories)) : ?> +<ul class="categories"> +<?php + foreach ($context->categories as $category) : ?> + <li id="category-1" class="category category-clear"> + <h3><a href=""><span class="category-title"><?php echo $category->name; ?></span> <span class="category-count"><?php echo count($category);?></span></a></h3> + <div><?php foreach ($category as $package) echo '<a href="./?view=package&amp;package='.$package->name.'">'.$package->name.'</a>'; ?></div> + </li> + <?php + endforeach; ?> +</ul> +<?php +endif; +?> +</div> Modified: pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php =================================================================== --- pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php 2009-11-13 22:08:41 UTC (rev 290710) +++ pear2/sandbox/SimpleChannelFrontend/trunk/www/templates/Main.tpl.php 2009-11-13 22:09:36 UTC (rev 290711) @@ -14,6 +14,7 @@ <ul class="navigation"> <li><a href="<?php echo pear2\SimpleChannelFrontend\Main::getURL('pear2\SimpleChannelFrontend\News'); ?>">Home</a></li> <li><a href="<?php echo pear2\SimpleChannelFrontend\Main::getURL('pear2\SimpleChannelFrontend\PackageList'); ?>">Packages</a></li> + <li><a href="<?php echo pear2\SimpleChannelFrontend\Main::getURL('pear2\SimpleChannelFrontend\Categories'); ?>">Categories</a></li> </ul> </div> <div class="content">

« previous php.pear.core (#9026) next »