Go to the documentation of this file.00001 <?php
00019 class ilParagraphPlugin {
00025 var $properties;
00026
00027
00028
00029
00030 var $directory;
00031
00037 var $description;
00038
00042 var $active;
00043
00044
00056 function ilParagraphPlugin ($directory, $title, $filetype, $link, $description = "", $active = FALSE) {
00057 $this->directory = $directory;
00058 $this->properties = array ("filetype" => "", "title" => "", "link" => "");
00059 $this->setTitle($title);
00060 $this->setFileType($filetype);
00061 $this->setLink ($link);
00062 $this->setActive($active);
00063 $this->setDescription($description);
00064 }
00065
00066
00067
00075 function serializeToString (){
00076 return implode("#",$this->properties);
00077 }
00078
00079
00084 function setTitle ($title) {
00085 $title = str_replace (array("|","#"), array ("_","_"),$title);
00086 $this->properties["title"] = $title;
00087 }
00088
00093 function setLink ($link) {
00094 $link = str_replace (array("|","#"), array ("_","_"),$link);
00095 $this->properties["link"] = $this->getPluginURL()."/".$link;
00096 }
00097
00102 function setImage ($image) {
00103 $image = str_replace (array("|","#"), array ("_","_"),$image);
00104 $this->properties["image"] = $this->getTemplateURL()."/".$image;
00105 }
00106
00111 function setFileType ($filetype) {
00112 $filetype = str_replace (array("|","#"), array ("_","_"),$filetype);
00113 $this->properties["filetype"] = $filetype;
00114 }
00115
00120 function getTitle () {
00121 return $this->properties["title"];
00122 }
00123
00127 function getPluginDir () {
00128 return ILIAS_ABSOLUTE_PATH."/content/plugins/".$this->directory;
00129 }
00130
00134 function getTemplateDir () {
00135 return $this->getPluginDir()."/templates";
00136 }
00137
00143 function getTemplateURL () {
00144 return $this->getPluginURL()."/templates";
00145 }
00149 function getClassDir () {
00150 return $this->getPluginDir()."/classes";
00151 }
00152
00157 function getResourceDir () {
00158 return $this->getPluginDir()."/resources";
00159 }
00160
00165 function getResourceURL () {
00166 return $this->getSystemURL()."/content/plugins/".$this->directory."/resources";
00167 }
00168
00172 function getPluginURL () {
00173 return $this->getSystemURL()."/content/plugins/".$this->directory;
00174 }
00175
00180 function getSystemURL () {
00181 return str_replace("/content/plugins","",ILIAS_HTTP_PATH);
00182 }
00183
00187 function isActive() {
00188 return $this->active;
00189 }
00190
00195 function setActive ($bool) {
00196 $this->active = ($bool)?true:false;
00197 }
00198
00204 function setDescription ($description) {
00205 $this->description = $description;
00206 }
00207
00213 function getDescription () {
00214 return $this->description;
00215 }
00216
00222 function getDirectory () {
00223 return $this->directory;
00224 }
00225 }
00226
00227 ?>