Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
class ProjectList extends TPage
4
{
5
	protected function showProjects($sort='', $order='')
6
	{
7
		$dao = $this->Application->Modules['daos']->getDao('ProjectDao');
8
		$this->projectList->DataSource = $dao->getAllProjects($sort, $order);
9
		$this->projectList->dataBind();
10
	}
11
 
12
	protected function getSortOrdering($sort)
13
	{
14
		$ordering = $this->getViewState('SortOrder', array());
15
		$order = isset($ordering[$sort]) ? $ordering[$sort] : 'DESC';
16
		$ordering[$sort] = $order == 'DESC' ? 'ASC' : 'DESC';
17
		$this->setViewState('SortOrder', $ordering);
18
		return $ordering[$sort];
19
	}
20
 
21
	protected function sortProjects($sender, $param)
22
	{
23
		$sort = $param->SortExpression;
24
		$this->showProjects($sort, $this->getSortOrdering($sort));
25
	}
26
 
27
	public function onLoad($param)
28
	{
29
		if(!$this->IsPostBack)
30
			$this->showProjects();
31
	}
32
}
33
 
34
?>