Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * NewCategory 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: NewCategory.php 1398 2006-09-08 19:31:03Z xue $
10
 */
11
 
12
/**
13
 * NewCategory class
14
 *
15
 * @author Qiang Xue <qiang.xue@gmail.com>
16
 * @link http://www.pradosoft.com/
17
 * @copyright Copyright &copy; 2006 PradoSoft
18
 * @license http://www.pradosoft.com/license/
19
 */
20
class NewCategory extends BlogPage
21
{
22
	public function saveButtonClicked($sender,$param)
23
	{
24
		if($this->IsValid)
25
		{
26
			$categoryRecord=new CategoryRecord;
27
			$categoryRecord->Name=$this->CategoryName->Text;
28
			$categoryRecord->Description=$this->CategoryDescription->Text;
29
			$this->DataAccess->insertCategory($categoryRecord);
30
			$this->gotoPage('Posts.ListPost',array('cat'=>$categoryRecord->ID));
31
		}
32
	}
33
 
34
	public function checkCategoryName($sender,$param)
35
	{
36
		$name=$this->CategoryName->Text;
37
		$param->IsValid=$this->DataAccess->queryCategoryByName($name)===null;
38
	}
39
}
40
 
41
?>