Location: PHPKode > projects > Mivec Framework > mivec/demo/actions/NewWeblogEntry.action.class.php
<?php

require_once MIVEC_HOME . "action/WebAction.class.php";
require_once "demo/managers/WeblogManager.class.php";

class NewWeblogEntry extends WebAction
{
	var $title;
	var $content;
	var $categories;
	var $availableCategories;
	
	function NewWeblogEntry()
	{
		$this->availableCategories = WeblogManager::getavailableCategories();
	}
	
	function setTitle($title)
	{
		if(($title == null) || ($title == ""))
			$this->addError("title", $this->getMessage("Please enter the entry's title."));
		$this->title = $title;
	}
	
	function setContent($content)
	{
		$this->content = $content;
	}
	
	function setCategories($categories)
	{
		$this->categories = $categories;
	}
	
	function getTitle()
	{
		return $this->title;
	}
	
	function getContent()
	{
		return $this->content;
	}
	
	function getCategories()
	{
		return $this->categories;
	}
	
	function getAvailableCategories()
	{
		return $this->availableCategories;
	}
	
	function execute()
	{
		return INPUT;
	}
	
	function create()
	{
		WeblogManager::addWeblogEntry($this->title, $this->content, $this->categories);
		return SUCCESS;
	}
}

?>
Return current item: Mivec Framework