/**
  * @param string       $key
  * @param AbstractNode $node
  * @param bool         $allowDefault
  *
  * @return $this
  *
  * @throws \InvalidArgumentException
  */
 public function add($key, AbstractNode $node, $allowDefault = false)
 {
     if (isset($this->children[$key])) {
         throw new \InvalidArgumentException(sprintf('There is already a node with key %s!', $key));
     }
     $node->setParent($this);
     $this->children[$key] = new NodeChildRelation($node, $allowDefault);
     return $this;
 }
Пример #2
0
 /**
  * Initializes feature.
  *
  * @param   string  $title          feature title
  * @param   string  $description    feature description (3-liner)
  * @param   string  $file           feature filename
  * @param   integer $line           definition line
  */
 public function __construct($title = null, $description = null, $file = null, $line = 0)
 {
     parent::__construct($line);
     $this->title = $title;
     $this->description = $description;
     $this->file = $file;
 }
Пример #3
0
 /**
  * Sets the text for this node.
  *
  * @param string $text
  */
 public function __construct($text)
 {
     // remove double spaces
     $text = mb_ereg_replace('\\s+', ' ', $text);
     $this->text = $text;
     $this->tag = new Tag('text');
     parent::__construct();
 }
Пример #4
0
 /** Creates an element.
  * @param   string                 $name               the HTML tag of this element.
  * @param   array                  $attributes         the attributes of this element.
  * @param   Element|string         $children           child nodes for the element. String values will be added as
  *                                                     {@link TextNode}s. */
 public function __construct($name, $attributes = array(), ...$children)
 {
     // Do not pass children, the parent does not convert them to the correct type if necessary.
     parent::__construct();
     $this->name = $name;
     $this->attributes = $attributes;
     $this->append(...$children);
 }
Пример #5
0
 public function __construct($id = null)
 {
     parent::__construct();
     $this->module = "voicemail";
     if (isset($id)) {
         $this->id($id);
     }
 }
Пример #6
0
 public function __construct($timezone = null)
 {
     parent::__construct();
     $this->module = "temporal_route";
     if (isset($timezone)) {
         $this->data->timezone = $timezone;
     }
 }
Пример #7
0
 public function __construct($id = null)
 {
     parent::__construct();
     $this->module = "conference";
     if ($id) {
         $this->data->id = $id;
     }
 }
Пример #8
0
 /**
  * Construct validation rules for the current scope
  *
  * @return Cake\Validation\Validator
  */
 public function validator()
 {
     $validator = parent::validator();
     $validator->requirePresence('homepage');
     $validator->add('homepage', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]);
     $validator->requirePresence('self');
     $validator->add('self', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]);
     return $validator;
 }
Пример #9
0
 /**
  * Sets the text for this node.
  *
  * @param string $text
  */
 public function __construct($text)
 {
     // remove double spaces
     $text = mb_ereg_replace('\\s+', ' ', $text);
     // restore line breaks
     $text = str_replace('&#10', "\n", $text);
     $this->text = $text;
     $this->tag = new Tag('text');
     parent::__construct();
 }
Пример #10
0
 public function __construct($id = NULL)
 {
     parent::__construct();
     $this->module = "resources";
     if (isset($id)) {
         $this->huntAccountId($id);
     } else {
         $this->useLocalResources(FALSE);
     }
 }
Пример #11
0
 /**
  * {@inheritdoc}
  */
 public function setContent($content)
 {
     parent::setContent($content);
     $content = parent::getContent();
     $parts = explode('=', $content);
     $key = trim($parts[0]);
     list($value, $comment) = $this->processValue(isset($parts[1]) ? $parts[1] : null);
     $this->setKey($key);
     $this->setValue($value);
     $this->setComment($comment);
 }
Пример #12
0
 /**
  * Construct validation rules for the current scope
  *
  * @return Cake\Validation\Validator
  */
 public function validator()
 {
     $validator = parent::validator();
     $validator->requirePresence('name');
     $validator->add('name', ['required' => ['rule' => 'notBlank']]);
     $validator->requirePresence('description');
     $validator->add('description', ['required' => ['rule' => 'notBlank']]);
     $validator->requirePresence('key');
     $validator->add('key', ['required' => ['rule' => 'notBlank']]);
     return $validator;
 }
Пример #13
0
 /**
  * Looks up all matching Translatables and returns them uniquified
  *
  * @return array matching english strings
  */
 private function getAllPossibleTranslatableStrings()
 {
     $matchingTranslations = array();
     // is it a glob?
     if ($this->node->getValue() instanceof \Xiag\Rql\Parser\DataType\Glob) {
         $userValue = $this->node->getValue()->toRegex();
         $useWildcard = true;
     } else {
         $userValue = $this->node->getValue();
         $useWildcard = false;
     }
     $matchingTranslatables = $this->intUtils->findMatchingTranslatables($userValue, $this->getClientSearchLanguage(), $useWildcard);
     foreach ($matchingTranslatables as $translatable) {
         $originalString = $translatable->getOriginal();
         if (!empty($originalString)) {
             $matchingTranslations[] = $originalString;
         }
     }
     return array_unique($matchingTranslations);
 }
Пример #14
0
 public function __construct($id)
 {
     parent::__construct();
     $this->module = "device";
     $this->data->id = $id;
 }
Пример #15
0
 public function __construct()
 {
     parent::__construct();
     $this->module = "call_forward";
 }
Пример #16
0
 public function __construct()
 {
     parent::__construct();
     $this->module = "intercom";
 }
Пример #17
0
 public function __construct($value)
 {
     $this->previousNode = NULL;
     parent::__construct($value);
 }
Пример #18
0
 public function __construct($language)
 {
     parent::__construct();
     $this->module = "language";
     $this->data->language = $language;
 }
Пример #19
0
 public function __construct()
 {
     parent::__construct();
     $this->module = "pivot";
 }
Пример #20
0
 public function __construct($fileName, array $childNodes = [])
 {
     $this->fileName = $fileName;
     parent::__construct([], $childNodes);
 }
Пример #21
0
 /**
  * Returns the HTML img tags which can be used to display the various icons for a
  * TeamSpeak_Node_Client object.
  *
  * @return string
  */
 protected function getSuffixIconClient()
 {
     $html = "";
     if ($this->currObj["client_is_priority_speaker"]) {
         $html .= $this->getImage("client_priority.png", "Priority Speaker");
     }
     if ($this->currObj["client_is_channel_commander"]) {
         $html .= $this->getImage("client_cc.png", "Channel Commander");
     }
     if ($this->currObj["client_is_talker"]) {
         $html .= $this->getImage("client_talker.png", "Talk Power granted");
     } elseif ($cntp = $this->currObj->getParent()->channelGetById($this->currObj["cid"])->channel_needed_talk_power) {
         if ($cntp > $this->currObj["client_talk_power"]) {
             $html .= $this->getImage("client_mic_muted.png", "Insufficient Talk Power");
         }
     }
     foreach ($this->currObj->memberOf() as $group) {
         if (!$group["iconid"]) {
             continue;
         }
         $type = $group instanceof TeamSpeak3_Node_Servergroup ? "Server Group" : "Channel Group";
         if (!$group->iconIsLocal("iconid") && $this->ftclient) {
             if (!isset($this->cacheIcon[$group["iconid"]])) {
                 $download = $group->getParent()->transferInitDownload(rand(0x0, 0xffff), 0, $group->iconGetName("iconid"));
                 if ($this->ftclient == "data:image") {
                     $download = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"])->download($download["ftkey"], $download["size"]);
                 }
                 $this->cacheIcon[$group["iconid"]] = $download;
             } else {
                 $download = $this->cacheIcon[$group["iconid"]];
             }
             if ($this->ftclient == "data:image") {
                 $html .= $this->getImage("data:" . TeamSpeak3_Helper_Convert::imageMimeType($download) . ";base64," . base64_encode($download), $group . " [" . $type . "]", null, false);
             } else {
                 $html .= $this->getImage($this->ftclient . "?ftdata=" . base64_encode(serialize($download)), $group . " [" . $type . "]", null, false);
             }
         } elseif (in_array($group["iconid"], $this->cachedIcons)) {
             $html .= $this->getImage("group_icon_" . $group["iconid"] . ".png", $group . " [" . $type . "]");
         }
     }
     if ($this->currObj["client_icon_id"]) {
         if (!$this->currObj->iconIsLocal("client_icon_id") && $this->ftclient) {
             if (!isset($this->cacheIcon[$this->currObj["client_icon_id"]])) {
                 $download = $this->currObj->getParent()->transferInitDownload(rand(0x0, 0xffff), 0, $this->currObj->iconGetName("client_icon_id"));
                 if ($this->ftclient == "data:image") {
                     $download = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"])->download($download["ftkey"], $download["size"]);
                 }
                 $this->cacheIcon[$this->currObj["client_icon_id"]] = $download;
             } else {
                 $download = $this->cacheIcon[$this->currObj["client_icon_id"]];
             }
             if ($this->ftclient == "data:image") {
                 $html .= $this->getImage("data:" . TeamSpeak3_Helper_Convert::imageMimeType($download) . ";base64," . base64_encode($download), "Client Icon", null, false);
             } else {
                 $html .= $this->getImage($this->ftclient . "?ftdata=" . base64_encode(serialize($download)), "Client Icon", null, false);
             }
         } elseif (in_array($this->currObj["client_icon_id"], $this->cachedIcons)) {
             $html .= $this->getImage("group_icon_" . $this->currObj["client_icon_id"] . ".png", "Client Icon");
         }
     }
     return $html;
 }
Пример #22
0
 public function __construct()
 {
     parent::__construct();
     $this->module = "privacy";
 }
Пример #23
0
 /** Creates a node.
  * @param   string                 $content            the text value of the node. */
 public function __construct($text)
 {
     parent::__construct();
     $this->text = htmlspecialchars($text, ENT_NOQUOTES);
 }
Пример #24
0
 public function __construct($parent, $joinType)
 {
     $this->joinType = $joinType;
     parent::__construct($parent);
 }
Пример #25
0
 function addChildNode(&$child, $offset = FALSE)
 {
     if ($child->isActive()) {
         $this->setCurrent(FALSE);
         $this->setActive(TRUE);
         $this->setExpanded(TRUE);
         // TODO remove this
     }
     return parent::addChildNode($child, $offset);
 }
Пример #26
0
 public function __construct()
 {
     parent::__construct();
     $this->module = "hotdesk";
 }
Пример #27
0
 /**
  * ArrayNode constructor.
  * @param int|Node $header
  */
 public function __construct($header, $className = null)
 {
     parent::__construct($className);
     $this->header = $header;
 }
Пример #28
0
 /**
  * Initializes scenario.
  *
  * @param string  $title Scenario title
  * @param integer $line  Definition line
  */
 public function __construct($title = null, $line = 0)
 {
     parent::__construct($line);
     $this->title = $title;
 }
Пример #29
0
 public function __construct($id)
 {
     parent::__construct();
     $this->module = "callflow";
     $this->data->id = $id;
 }
Пример #30
0
 /**
  * Initizalizes step.
  *
  * @param string  $type Step type
  * @param string  $text Step text
  * @param integer $line Definition line
  */
 public function __construct($type, $text = null, $line = 0)
 {
     parent::__construct($line);
     $this->type = $type;
     $this->text = $text;
 }