Esempio n. 1
0
 /**
  * Sets data of the node by a given data array
  *
  * @param array $data
  * @return void
  */
 public function dataFromArray($data)
 {
     parent::dataFromArray($data);
     $this->setType($data['type']);
     $this->setText($data['label'], $data['t3TextSourceField'], $data['prefix'], $data['suffix']);
     $this->setEditableText($data['editableText']);
     $this->setCls($data['cls']);
     $this->setQTip($data['qtip']);
     $this->setExpanded($data['expanded']);
     $this->setExpandable($data['expandable']);
     $this->setDraggable($data['draggable']);
     $this->setIsDropTarget($data['isTarget']);
     $this->setSpriteIconCode($data['spriteIconCode']);
     $this->setInCopyMode($data['t3InCopyMode']);
     $this->setInCutMode($data['t3InCutMode']);
     $this->setContextInfo($data['t3ContextInfo']);
     $this->setLabelIsEditable($data['editable']);
     $this->setAllowChildren($data['allowChildren']);
     // only set the leaf attribute if it's applied
     // otherwise you cannot insert nodes into this one
     if (isset($data['leaf'])) {
         $this->setLeaf(FALSE);
     }
 }
 /**
  * Sets data of the node by a given data array
  *
  * @param array $data
  * @return void
  */
 public function dataFromArray($data)
 {
     parent::dataFromArray($data);
     $this->setLabel($data['label']);
     $this->setType($data['type']);
     $this->setClass($data['class']);
     $this->setIcon($data['icon']);
     $this->setCallbackAction($data['callbackAction']);
 }