<?php
require_once MIVEC_HOME . "action/WebAction.class.php";
require_once "demo/managers/WeblogManager.class.php";
class EditWeblogEntry extends WebAction
{
var $entryID;
var $title;
var $content;
function setEntryID($entryID)
{
$this->entryID = $entryID;
}
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 getEntryID()
{
return $this->entryID;
}
function getTitle()
{
return $this->title;
}
function getContent()
{
return $this->content;
}
function execute()
{
$entry = WeblogManager::getWeblogEntry($this->entryID);
$this->entryID = $entry["entryID"];
$this->title = $entry["title"];
$this->content = $entry["content"];
return INPUT;
}
function update()
{
WeblogManager::updateWeblogEntry($this->entryID, $this->title, $this->content);
return SUCCESS;
}
}
?>