• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/COPage/classes/class.ilParagraphPlugin.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2006 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00039  class ilParagraphPlugin {
00045         var $properties;
00046         
00047         /*
00048          * the directory we are plugin resides within the plugins directory
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 ?>

Generated on Fri Dec 13 2013 17:56:56 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1