139 lines
3.0 KiB
PHP
139 lines
3.0 KiB
PHP
<?php
|
|
|
|
|
|
/** Building Block
|
|
*
|
|
* @version 1.0.0
|
|
* @since 2007-05-30
|
|
* @author martin lenzelbauer
|
|
*/
|
|
class BuildingBlock{
|
|
|
|
var $id; //id in the building block's table
|
|
|
|
|
|
/** C'tor
|
|
* @param id id
|
|
*/
|
|
//-------------------------------------------------
|
|
function BuildingBlock($id=0){
|
|
//-------------------------------------------------
|
|
$this->id = $id;
|
|
}
|
|
|
|
|
|
/** loads the building block from the database
|
|
*/
|
|
//-------------------------------------------------
|
|
function load(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** saves the building block to the database
|
|
*/
|
|
//-------------------------------------------------
|
|
function save(){
|
|
//-------------------------------------------------
|
|
if($this->id){
|
|
$this->doSave();
|
|
}
|
|
else{
|
|
$this->id = $this->doCreate();
|
|
}
|
|
}
|
|
|
|
|
|
/** saves an exitsing building block
|
|
*/
|
|
//-------------------------------------------------
|
|
function doSave(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** creates a new entry in the database
|
|
* @return id
|
|
*/
|
|
//-------------------------------------------------
|
|
function doCreate(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** delete the building block from the database
|
|
*/
|
|
//-------------------------------------------------
|
|
function delete(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** updates the building block
|
|
*/
|
|
//-------------------------------------------------
|
|
function update(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** installs the table
|
|
*/
|
|
//-------------------------------------------------
|
|
function install(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** prints the content for editing
|
|
* @param position position
|
|
*/
|
|
//-------------------------------------------------
|
|
function printContent($position){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** publishes the content
|
|
* @return string
|
|
*/
|
|
//-------------------------------------------------
|
|
function publish(){}
|
|
//-------------------------------------------------
|
|
|
|
|
|
/** publishes the content as plain text (if possible)
|
|
* @return string
|
|
*/
|
|
//-------------------------------------------------
|
|
function publishAsPlainText(){
|
|
//-------------------------------------------------
|
|
return "";
|
|
}
|
|
|
|
|
|
/** publishes the content for the newsletter (table layout)
|
|
* @return string
|
|
*/
|
|
//-------------------------------------------------
|
|
function publishForNewsletter(){
|
|
//-------------------------------------------------
|
|
return "";
|
|
}
|
|
|
|
|
|
/** publishes the content for pdf output (using FPDF library)
|
|
*/
|
|
//-------------------------------------------------
|
|
function publishForPdf($pdf) {}
|
|
//-------------------------------------------------
|
|
|
|
/** returns class name and id of the building block
|
|
* @return unique reference
|
|
*/
|
|
//-------------------------------------------------
|
|
function getReference(){
|
|
//-------------------------------------------------
|
|
return strtolower(get_class($this)).",".$this->id;
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
?>
|