Пример #1
0
 /**
  * Returns a string for the current corpus element which contains the display name
  * for the current TeamSpeak_Node_Abstract object.
  *
  * @return string
  */
 protected function getCorpusName()
 {
     if ($this->currObj instanceof TeamSpeak3_Node_Channel && $this->currObj->isSpacer()) {
         if ($this->currObj->spacerGetType() != TeamSpeak3::SPACER_CUSTOM) {
             return;
         }
         $string = $this->currObj["channel_name"]->section("]", 1, 99);
         if ($this->currObj->spacerGetAlign() == TeamSpeak3::SPACER_ALIGN_REPEAT) {
             $string->resize(30, $string);
         }
         return htmlspecialchars($string);
     }
     if ($this->currObj instanceof TeamSpeak3_Node_Client) {
         $before = array();
         $behind = array();
         foreach ($this->currObj->memberOf() as $group) {
             if ($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEFORE) {
                 $before[] = "[" . htmlspecialchars($group["name"]) . "]";
             } elseif ($group->getProperty("namemode") == TeamSpeak3::GROUP_NAMEMODE_BEHIND) {
                 $behind[] = "[" . htmlspecialchars($group["name"]) . "]";
             }
         }
         return implode("", $before) . " " . htmlspecialchars($this->currObj) . " " . implode("", $behind);
     }
     return htmlspecialchars($this->currObj);
 }