Exemple #1
0
 /**
  * Returns the HTML img tags which can be used to display the various icons for a
  * TeamSpeak_Node_Channel object.
  *
  * @return string
  */
 protected function getSuffixIconChannel()
 {
     if ($this->currObj instanceof TeamSpeak3_Node_Channel && $this->currObj->isSpacer()) {
         return;
     }
     $html = "";
     if ($this->currObj["channel_flag_default"]) {
         $html .= $this->getImage("channel_flag_default.png", "Default Channel");
     }
     if ($this->currObj["channel_flag_password"]) {
         $html .= $this->getImage("channel_flag_password.png", "Password-protected");
     }
     if ($this->currObj["channel_codec"] == 3) {
         $html .= $this->getImage("channel_flag_music.png", "Music Codec");
     }
     if ($this->currObj["channel_needed_talk_power"]) {
         $html .= $this->getImage("channel_flag_moderated.png", "Moderated");
     }
     if ($this->currObj["channel_icon_id"]) {
         if (!$this->currObj->iconIsLocal("channel_icon_id") && $this->ftclient) {
             if (!isset($this->cacheIcon[$this->currObj["channel_icon_id"]])) {
                 $download = $this->currObj->getParent()->transferInitDownload(rand(0x0, 0xffff), 0, $this->currObj->iconGetName("channel_icon_id"));
                 $this->cacheIcon[$this->currObj["channel_icon_id"]] = $download;
             } else {
                 $download = $this->cacheIcon[$this->currObj["channel_icon_id"]];
             }
             $html .= $this->getImage($this->ftclient . "?ftdata=" . base64_encode(serialize($download)), "Channel Icon", null, FALSE);
         } elseif (in_array($this->currObj["channel_icon_id"], $this->cachedIcons)) {
             $html .= $this->getImage("group_icon_" . $this->currObj["channel_icon_id"] . ".png", "Channel Icon");
         }
     }
     return $html;
 }
 /**
  * Returns the HTML img tags which can be used to display the various icons for a
  * TeamSpeak_Node_Channel object.
  *
  * @return string
  */
 protected function getSuffixIconChannel()
 {
     if ($this->currObj instanceof TeamSpeak3_Node_Channel && $this->currObj->isSpacer()) {
         return;
     }
     $html = "";
     if ($this->currObj["channel_flag_default"]) {
         $html .= $this->getImage("channel_flag_default.png", "Default Channel");
     }
     if ($this->currObj["channel_flag_password"]) {
         $html .= $this->getImage("channel_flag_password.png", "Password-protected");
     }
     if ($this->currObj["channel_codec"] == TeamSpeak3::CODEC_CELT_MONO || $this->currObj["channel_codec"] == TeamSpeak3::CODEC_OPUS_MUSIC) {
         $html .= $this->getImage("channel_flag_music.png", "Music Codec");
     }
     if ($this->currObj["channel_needed_talk_power"]) {
         $html .= $this->getImage("channel_flag_moderated.png", "Moderated");
     }
     if ($this->currObj["channel_icon_id"]) {
         if (!$this->currObj->iconIsLocal("channel_icon_id") && $this->ftclient) {
             if (!isset($this->cacheIcon[$this->currObj["channel_icon_id"]])) {
                 $download = $this->currObj->getParent()->transferInitDownload(rand(0x0, 0xffff), 0, $this->currObj->iconGetName("channel_icon_id"));
                 if ($this->ftclient == "data:image") {
                     $download = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"])->download($download["ftkey"], $download["size"]);
                 }
                 $this->cacheIcon[$this->currObj["channel_icon_id"]] = $download;
             } else {
                 $download = $this->cacheIcon[$this->currObj["channel_icon_id"]];
             }
             if ($this->ftclient == "data:image") {
                 $html .= $this->getImage("data:" . TeamSpeak3_Helper_Convert::imageMimeType($download) . ";base64," . base64_encode($download), "Channel Icon", null, FALSE);
             } else {
                 $html .= $this->getImage($this->ftclient . "?ftdata=" . base64_encode(serialize($download)), "Channel Icon", null, FALSE);
             }
         } elseif (in_array($this->currObj["channel_icon_id"], $this->cachedIcons)) {
             $html .= $this->getImage("group_icon_" . $this->currObj["channel_icon_id"] . ".png", "Channel Icon");
         }
     }
     return $html;
 }