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
00039 class ilParagraphPlugin {
00045 var $properties;
00046
00047
00048
00049
00050 var $directory;
00051
00057 var $description;
00058
00062 var $active;
00063
00064
00076 function ilParagraphPlugin ($directory, $title, $filetype, $link, $description = "", $active = FALSE) {
00077 $this->directory = $directory;
00078 $this->properties = array ("filetype" => "", "title" => "", "link" => "");
00079 $this->setTitle($title);
00080 $this->setFileType($filetype);
00081 $this->setLink ($link);
00082 $this->setActive($active);
00083 $this->setDescription($description);
00084 }
00085
00086
00087
00095 function serializeToString (){
00096 return implode("#",$this->properties);
00097 }
00098
00099
00104 function setTitle ($title) {
00105 $title = str_replace (array("|","#"), array ("_","_"),$title);
00106 $this->properties["title"] = $title;
00107 }
00108
00113 function setLink ($link) {
00114 $link = str_replace (array("|","#"), array ("_","_"),$link);
00115 $this->properties["link"] = $this->getPluginURL()."/".$link;
00116 }
00117
00122 function setImage ($image) {
00123 $image = str_replace (array("|","#"), array ("_","_"),$image);
00124 $this->properties["image"] = $this->getTemplateURL()."/".$image;
00125 }
00126
00131 function setFileType ($filetype) {
00132 $filetype = str_replace (array("|","#"), array ("_","_"),$filetype);
00133 $this->properties["filetype"] = $filetype;
00134 }
00135
00140 function getTitle () {
00141 return $this->properties["title"];
00142 }
00143
00147 function getPluginDir () {
00148 return ILIAS_ABSOLUTE_PATH."/Services/COPage/plugins/".$this->directory;
00149 }
00150
00154 function getTemplateDir () {
00155 return $this->getPluginDir()."/templates";
00156 }
00157
00163 function getTemplateURL () {
00164 return $this->getPluginURL()."/templates";
00165 }
00169 function getClassDir () {
00170 return $this->getPluginDir()."/classes";
00171 }
00172
00177 function getResourceDir () {
00178 return $this->getPluginDir()."/resources";
00179 }
00180
00185 function getResourceURL () {
00186 return $this->getSystemURL()."/Services/COPage/plugins/".$this->directory."/resources";
00187 }
00188
00192 function getPluginURL () {
00193 return $this->getSystemURL()."/Services/COPage/plugins/".$this->directory;
00194 }
00195
00200 function getSystemURL () {
00201 return str_replace("/Services/COPage/plugins","",ILIAS_HTTP_PATH);
00202 }
00203
00207 function isActive() {
00208 return $this->active;
00209 }
00210
00215 function setActive ($bool) {
00216 $this->active = ($bool)?true:false;
00217 }
00218
00224 function setDescription ($description) {
00225 $this->description = $description;
00226 }
00227
00233 function getDescription () {
00234 return $this->description;
00235 }
00236
00242 function getDirectory () {
00243 return $this->directory;
00244 }
00245 }
00246
00247 ?>