Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once("./Services/Block/classes/class.ilCustomBlock.php");
00025
00032 class ilHtmlBlock extends ilCustomBlock
00033 {
00034
00035 protected $content;
00036
00042 public function __construct($a_id = 0)
00043 {
00044 if ($a_id > 0)
00045 {
00046 $this->setId($a_id);
00047 $this->read();
00048 }
00049
00050 }
00051
00057 public function setContent($a_content)
00058 {
00059 $this->content = $a_content;
00060 }
00061
00067 public function getContent()
00068 {
00069 return $this->content;
00070 }
00071
00076 public function create()
00077 {
00078 global $ilDB;
00079
00080 parent::create();
00081
00082 $query = "INSERT INTO il_html_block (".
00083 " id".
00084 ", content".
00085 " ) VALUES (".
00086 $ilDB->quote($this->getId())
00087 .",".$ilDB->quote($this->getContent()).")";
00088 $ilDB->query($query);
00089
00090
00091 }
00092
00097 public function read()
00098 {
00099 global $ilDB;
00100
00101 parent::read();
00102
00103 $query = "SELECT * FROM il_html_block WHERE id = ".
00104 $ilDB->quote($this->getId());
00105 $set = $ilDB->query($query);
00106 $rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
00107
00108 $this->setContent($rec["content"]);
00109
00110 }
00111
00116 public function update()
00117 {
00118 global $ilDB;
00119
00120 parent::update();
00121
00122 $query = "UPDATE il_html_block SET ".
00123 " content = ".$ilDB->quote($this->getContent()).
00124 " WHERE id = ".$ilDB->quote($this->getId());
00125
00126 $ilDB->query($query);
00127
00128 }
00129
00134 public function delete()
00135 {
00136 global $ilDB;
00137
00138 parent::delete();
00139
00140 $query = "DELETE FROM il_html_block".
00141 " WHERE id = ".$ilDB->quote($this->getId());
00142
00143 $ilDB->query($query);
00144
00145 }
00146
00147
00148 }
00149 ?>