ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPageComponentPlugin.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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 */
23 
24 include_once("./Services/Component/classes/class.ilPlugin.php");
25 
34 abstract class ilPageComponentPlugin extends ilPlugin
35 {
36  const TXT_CMD_INSERT = "cmd_insert";
37  const CMD_INSERT = "insert";
38  const CMD_EDIT = "edit";
39 
45  final function getComponentType()
46  {
47  return IL_COMP_SERVICE;
48  }
49 
55  final function getComponentName()
56  {
57  return "COPage";
58  }
59 
65  final function getSlot()
66  {
67  return "PageComponent";
68  }
69 
75  final function getSlotId()
76  {
77  return "pgcp";
78  }
79 
83  protected final function slotInit()
84  {
85  // nothing to do here
86  }
87 
96  abstract function isValidParentType($a_type);
97 
106  abstract function getUIText($a_text_id);
107 
113  final function setMode($a_mode)
114  {
115  $this->mode = $a_mode;
116  }
117 
123  final function getMode()
124  {
125  return $this->mode;
126  }
127 
133  final function setProperties($a_properties)
134  {
135  $this->properties = $a_properties;
136  }
137 
143  final function getProperties()
144  {
145  return $this->properties;
146  }
147 
151  final function addSaveCancelButtons($a_form)
152  {
153  global $lng;
154 
156  {
157  $a_form->addCommandButton("create_plug", $lng->txt("save"));
158  $a_form->addCommandButton("cancelCreate", $lng->txt("cancel"));
159  }
160  else
161  {
162  $a_form->addCommandButton("update_plug", $lng->txt("save"));
163  $a_form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
164  }
165  }
166 }
167 ?>