Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * CategoryPortlet class file
4
 *
5
 * @author Qiang Xue <qiang.xue@gmail.com>
6
 * @link http://www.pradosoft.com/
7
 * @copyright Copyright &copy; 2006 PradoSoft
8
 * @license http://www.pradosoft.com/license/
9
 * @version $Id: CategoryPortlet.php 1398 2006-09-08 19:31:03Z xue $
10
 */
11
 
12
Prado::using('Application.Portlets.Portlet');
13
 
14
/**
15
 * CategoryPortlet class
16
 *
17
 * @author Qiang Xue <qiang.xue@gmail.com>
18
 * @link http://www.pradosoft.com/
19
 * @copyright Copyright &copy; 2006 PradoSoft
20
 * @license http://www.pradosoft.com/license/
21
 */
22
class CategoryPortlet extends Portlet
23
{
24
	public function onLoad($param)
25
	{
26
		parent::onLoad($param);
27
		$cats=$this->Application->getModule('data')->queryCategories();
28
		foreach($cats as $cat)
29
		{
30
			$cat->ID=$this->Service->constructUrl('Posts.ListPost',array('cat'=>$cat->ID));
31
			$cat->Name.=' (' . $cat->PostCount .')';
32
		}
33
		$this->CategoryList->DataSource=$cats;
34
		$this->CategoryList->dataBind();
35
	}
36
}
37
 
38
?>