Example #1
0
 /**
  * Returns the HTML img tags which can be used to display the various icons for a
  * TeamSpeak_Node_Abstract object.
  *
  * @return string
  */
 protected function getCorpusTitle()
 {
     if ($this->currObj instanceof TeamSpeak3_Node_Server) {
         return "ID: " . $this->currObj->getId() . " | Clients: " . $this->currObj->clientCount() . "/" . $this->currObj["virtualserver_maxclients"] . " | Uptime: " . TeamSpeak3_Helper_Convert::seconds($this->currObj["virtualserver_uptime"]);
     } elseif ($this->currObj instanceof TeamSpeak3_Node_Channel && !$this->currObj->isSpacer()) {
         return "ID: " . $this->currObj->getId() . " | Codec: " . TeamSpeak3_Helper_Convert::codec($this->currObj["channel_codec"]) . " | Quality: " . $this->currObj["channel_codec_quality"];
     } elseif ($this->currObj instanceof TeamSpeak3_Node_Client) {
         return "ID: " . $this->currObj->getId() . " | Version: " . TeamSpeak3_Helper_Convert::versionShort($this->currObj["client_version"]) . " | Platform: " . $this->currObj["client_platform"];
     } elseif ($this->currObj instanceof TeamSpeak3_Node_Servergroup || $this->currObj instanceof TeamSpeak3_Node_Channelgroup) {
         return "ID: " . $this->currObj->getId() . " | Type: " . TeamSpeak3_Helper_Convert::groupType($this->currObj["type"]) . " (" . ($this->currObj["savedb"] ? "Permanent" : "Temporary") . ")";
     }
 }
Example #2
0
 /**
  * Returns the HTML code needed to display this node in a TeamSpeak 3 viewer.
  *
  * @param  TeamSpeak3_Node_Abstract $node
  * @return string
  */
 public function fetchObject(TeamSpeak3_Node_Abstract $node, array $siblings = array())
 {
     $prefix = "";
     $suffix = "";
     $detail = "";
     if (count($siblings)) {
         $last = array_pop($siblings);
         foreach ($siblings as $level) {
             $prefix .= $level ? $this->getImage("16x16_tree_line.gif") : $this->getImage("16x16_tree_blank.png");
         }
         $prefix .= $last ? $this->getImage("16x16_tree_end.gif") : $this->getImage("16x16_tree_mid.gif");
     }
     if ($node instanceof TeamSpeak3_Node_Server) {
         $detail .= "ID: " . $node->getId() . " | Clients: " . $node->clientCount() . "/" . $node["virtualserver_maxclients"] . " | Uptime: " . TeamSpeak3_Helper_Convert::seconds($node["virtualserver_uptime"]);
     } elseif ($node instanceof TeamSpeak3_Node_Channel) {
         $suffix .= $this->fetchSuffixChannel($node);
         $detail .= "ID: " . $node->getId() . " | Codec: " . TeamSpeak3_Helper_Convert::codec($node["channel_codec"]) . " | Quality: " . $node["channel_codec_quality"];
     } elseif ($node instanceof TeamSpeak3_Node_Client) {
         $suffix .= $this->fetchSuffixClient($node);
         $detail .= "ID: " . $node->getId() . " | Version: " . $node["client_version"] . " | Platform: " . $node["client_platform"];
     }
     return "<div id='" . $node->getUniqueId() . "'>" . $prefix . $this->getImage("16x16_" . $node->getIcon() . ".png") . " <span title='" . $detail . "'>" . htmlspecialchars($node) . " " . $suffix . "</span></div>\n";
 }