Files
bm/public_html/public/cms/modules/ticketpage.class.php
2025-09-24 13:26:28 +02:00

102 lines
2.3 KiB
PHP

<?php
/** Ticket Page
*
* @version 1.9.2
* @date 2007-05-01
* @author martin lenzelbauer
*
* @change 2007-06-15
* fixed PHP4 bug
*
* @change 2007-06-18
* removed canBeDeleted()
*/
class TicketPage extends StdPage{
/** C'tor
*/
//------------------------------------------------
function TicketPage($id, $parent){
//------------------------------------------------
parent::StdPage($id, $parent);
$this->editable = USER_GROUP;
$this->visible = 1;
$this->buttonPreview = false;
$this->buttonPublish = false;
}
/** @see CmsObject::publish()
*/
//---------------------------------------------
function publish(){
//---------------------------------------------
return true;
}
/** @see CmsObjec::canBePublished()
*/
//----------------------------------------------
function canBePublished(){
//----------------------------------------------
return true;
}
/** @see CmsObject::doPublish()
*/
//----------------------------------------------
function doPublish(){
//----------------------------------------------
if(!$this->parentObj){
logError(5, "No parent object given to TicketPage: ".$this->toString(), __FILE__, __LINE__);
defaultErrorPage();
}
$this->parentObj->load();
$menu = $this->parentObj->getMenu();
$this->template = $this->parentObj->getTemplate();
$t = new Template(TEMPLATE_DIR.$this->template);
$content = $this->parentObj->printInfoBox();
foreach($this->buildingBlocks as $i=>$block){
$content .= $this->buildingBlocks[$i]->publish();
}
$t->setVar("CONTENT", $content);
$t = $menu->printMenu($t);
$t->setVar("TITLE", $this->toString());
return $t->toString();
}
/** @see CmsObject::show()
*/
//---------------------------------------------
function show(){
//---------------------------------------------
return $this->doPublish();
}
// === ADDITIONAL METHODS ==================================================== //
/** sets the page title
* @param name page title
*/
//-------------------------------------------
function setName($name){
//-------------------------------------------
$this->name = $name;
$query = sprintf("UPDATE bruckm_index SET name = %s WHERE id = %d",
sqlstring($name),
sqlnum($this->id));
dbQuery($query);
}
};
?>