ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilParagraphPlugin.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
46 
47  /*
48  * the directory we are plugin resides within the plugins directory
49  */
51 
58 
62  var $active;
63 
64 
76  function ilParagraphPlugin ($directory, $title, $filetype, $link, $description = "", $active = FALSE) {
77  $this->directory = $directory;
78  $this->properties = array ("filetype" => "", "title" => "", "link" => "");
79  $this->setTitle($title);
80  $this->setFileType($filetype);
81  $this->setLink ($link);
82  $this->setActive($active);
84  }
85 
86 
87 
95  function serializeToString (){
96  return implode("#",$this->properties);
97  }
98 
99 
104  function setTitle ($title) {
105  $title = str_replace (array("|","#"), array ("_","_"),$title);
106  $this->properties["title"] = $title;
107  }
108 
113  function setLink ($link) {
114  $link = str_replace (array("|","#"), array ("_","_"),$link);
115  $this->properties["link"] = $this->getPluginURL()."/".$link;
116  }
117 
122  function setImage ($image) {
123  $image = str_replace (array("|","#"), array ("_","_"),$image);
124  $this->properties["image"] = $this->getTemplateURL()."/".$image;
125  }
126 
131  function setFileType ($filetype) {
132  $filetype = str_replace (array("|","#"), array ("_","_"),$filetype);
133  $this->properties["filetype"] = $filetype;
134  }
135 
140  function getTitle () {
141  return $this->properties["title"];
142  }
143 
147  function getPluginDir () {
148  return ILIAS_ABSOLUTE_PATH."/Services/COPage/plugins/".$this->directory;
149  }
150 
154  function getTemplateDir () {
155  return $this->getPluginDir()."/templates";
156  }
157 
163  function getTemplateURL () {
164  return $this->getPluginURL()."/templates";
165  }
169  function getClassDir () {
170  return $this->getPluginDir()."/classes";
171  }
172 
177  function getResourceDir () {
178  return $this->getPluginDir()."/resources";
179  }
180 
185  function getResourceURL () {
186  return $this->getSystemURL()."/Services/COPage/plugins/".$this->directory."/resources";
187  }
188 
192  function getPluginURL () {
193  return $this->getSystemURL()."/Services/COPage/plugins/".$this->directory;
194  }
195 
200  function getSystemURL () {
201  return str_replace("/Services/COPage/plugins","",ILIAS_HTTP_PATH);
202  }
203 
207  function isActive() {
208  return $this->active;
209  }
210 
215  function setActive ($bool) {
216  $this->active = ($bool)?true:false;
217  }
218 
225  $this->description = $description;
226  }
227 
233  function getDescription () {
234  return $this->description;
235  }
236 
242  function getDirectory () {
243  return $this->directory;
244  }
245 }
246 
247 ?>