104 lines
2.4 KiB
PHP
104 lines
2.4 KiB
PHP
<?php
|
|
|
|
|
|
/** Person Page
|
|
*
|
|
* @version 2.1.0
|
|
* @date 2007-05-01
|
|
* @author martin lenzelbauer
|
|
*
|
|
* @change 2007-06-15
|
|
* fixed PHP4 bug in doPublish()
|
|
*
|
|
* @change 2007-06-18
|
|
* removed canBeDeleted()
|
|
*
|
|
* @change 2008-09-23
|
|
* updated loading & publishing routines to keep memory low in PHP5
|
|
*/
|
|
class PersonPage extends StdPage{
|
|
|
|
|
|
/** C'tor
|
|
*/
|
|
//------------------------------------------------
|
|
function PersonPage($id, $parent){
|
|
//------------------------------------------------
|
|
parent::StdPage($id, $parent);
|
|
$this->editable = USER_GROUP;
|
|
$this->visible = 1;
|
|
}
|
|
|
|
|
|
/** @see CmsObject::publish()
|
|
*/
|
|
//---------------------------------------------
|
|
function publish(){
|
|
//---------------------------------------------
|
|
$out = $this->doPublish();
|
|
$query = sprintf("UPDATE bruckm_index SET cache = %s WHERE id = %d OR id = %d",
|
|
sqlstring($out),
|
|
sqlnum($this->id),
|
|
sqlnum($this->parentId));
|
|
dbQuery($query);
|
|
return true;
|
|
}
|
|
|
|
|
|
/** @see CmsObjec::canBePublished()
|
|
*/
|
|
//----------------------------------------------
|
|
function canBePublished(){
|
|
//----------------------------------------------
|
|
return true;
|
|
}
|
|
|
|
|
|
/** @see CmsObject::doPublish()
|
|
*/
|
|
//----------------------------------------------
|
|
function doPublish(){
|
|
//----------------------------------------------
|
|
if(!$this->parentObj){
|
|
$this->parentObj = FlexiconFactory::instanceById($this->parentId);
|
|
}
|
|
if(!$this->parentObj->isLoaded()){
|
|
$this->parentObj->load();
|
|
}
|
|
$menu = $this->parentObj->getMenu();
|
|
if(empty($this->template)){
|
|
$this->template = $this->parentObj->getTemplate();
|
|
}
|
|
|
|
$t = new Template(TEMPLATE_DIR.$this->template);
|
|
$content = "";
|
|
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();
|
|
}
|
|
|
|
|
|
// === 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);
|
|
}
|
|
|
|
};
|
|
|
|
|
|
?>
|