TYPO3 CMS  TYPO3_6-2
ContextMenuAction.php
Go to the documentation of this file.
1 <?php
3 
23 
29  protected $label = '';
30 
36  protected $id = '';
37 
43  protected $icon = '';
44 
50  protected $class = '';
51 
57  protected $callbackAction = '';
58 
64  protected $type = '';
65 
71  protected $childActions = NULL;
72 
78  protected $customAttributes = array();
79 
85  public function getLabel() {
86  return $this->label;
87  }
88 
94  public function setLabel($label) {
95  $this->label = $label;
96  }
97 
103  public function getId() {
104  return $this->id;
105  }
106 
112  public function setId($id) {
113  $this->id = $id;
114  }
115 
121  public function getIcon() {
122  return $this->icon;
123  }
124 
131  public function setIcon($icon) {
132  $this->icon = $icon;
133  }
134 
140  public function getClass() {
141  return $this->class;
142  }
143 
149  public function setClass($class) {
150  $this->class = $class;
151  }
152 
158  public function getCallbackAction() {
159  return $this->callbackAction;
160  }
161 
168  $this->callbackAction = $callbackAction;
169  }
170 
176  public function getType() {
177  return $this->type;
178  }
179 
186  public function setType($type) {
187  $this->type = $type;
188  }
189 
195  public function getChildActions() {
196  return $this->childActions;
197  }
198 
205  public function setChildActions(\TYPO3\CMS\Backend\ContextMenu\ContextMenuActionCollection $actions) {
206  $this->childActions = $actions;
207  }
208 
214  public function hasChildActions() {
215  if ($this->childActions !== NULL) {
216  return TRUE;
217  }
218  return FALSE;
219  }
220 
227  public function setCustomAttributes(array $customAttributes) {
228  $this->customAttributes = $customAttributes;
229  }
230 
236  public function getCustomAttributes() {
238  }
239 
245  public function toArray() {
246  $arrayRepresentation = array(
247  'label' => $this->getLabel(),
248  'id' => $this->getId(),
249  'icon' => $this->getIcon(),
250  'class' => $this->getClass(),
251  'callbackAction' => $this->getCallbackAction(),
252  'type' => $this->getType(),
253  'customAttributes' => $this->getCustomAttributes()
254  );
255  $arrayRepresentation['childActions'] = '';
256  if ($this->hasChildActions()) {
257  $arrayRepresentation['childActions'] = $this->childActions->toArray();
258  }
259  return $arrayRepresentation;
260  }
261 
262 }
setChildActions(\TYPO3\CMS\Backend\ContextMenu\ContextMenuActionCollection $actions)