예제 #1
0
 /**
  * Returns the HTML img tags which can be used to display the various icons for a
  * TeamSpeak_Node_Server object.
  *
  * @return string
  */
 protected function getSuffixIconServer()
 {
     $html = "";
     if ($this->currObj["virtualserver_icon_id"]) {
         if (!$this->currObj->iconIsLocal("virtualserver_icon_id") && $this->ftclient) {
             if (!isset($this->cacheIcon[$this->currObj["virtualserver_icon_id"]])) {
                 $download = $this->currObj->transferInitDownload(rand(0x0, 0xffff), 0, $this->currObj->iconGetName("virtualserver_icon_id"));
                 if ($this->ftclient == "data:image") {
                     $download = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"])->download($download["ftkey"], $download["size"]);
                 }
                 $this->cacheIcon[$this->currObj["virtualserver_icon_id"]] = $download;
             } else {
                 $download = $this->cacheIcon[$this->currObj["virtualserver_icon_id"]];
             }
             if ($this->ftclient == "data:image") {
                 $html .= $this->getImage("data:" . TeamSpeak3_Helper_Convert::imageMimeType($download) . ";base64," . base64_encode($download), "Server Icon", null, false);
             } else {
                 $html .= $this->getImage($this->ftclient . "?ftdata=" . base64_encode(serialize($download)), "Server Icon", null, false);
             }
         } elseif (in_array($this->currObj["virtualserver_icon_id"], $this->cachedIcons)) {
             $html .= $this->getImage("group_icon_" . $this->currObj["virtualserver_icon_id"] . ".png", "Server Icon");
         }
     }
     return $html;
 }