Returns the HTML img tags which can be used to display the various icons for a TeamSpeak_Node_Client object.
529 if($this->currObj[
"client_is_priority_speaker"])
531 $html .= $this->
getImage(
"client_priority.png",
"Priority Speaker");
534 if($this->currObj[
"client_is_channel_commander"])
536 $html .= $this->
getImage(
"client_cc.png",
"Channel Commander");
539 if($this->currObj[
"client_is_talker"])
541 $html .= $this->
getImage(
"client_talker.png",
"Talk Power granted");
543 elseif($cntp = $this->currObj->getParent()->channelGetById($this->currObj[
"cid"])->channel_needed_talk_power)
545 if($cntp > $this->currObj[
"client_talk_power"])
547 $html .= $this->
getImage(
"client_mic_muted.png",
"Insufficient Talk Power");
553 $groups = $this->currObj->memberOf();
554 $clientGroups = [$groups[0]];
559 foreach($groups as $group) {
560 $sgroups[$group[
'sgid']] = $group;
563 uasort($sgroups, array(get_class($this->currObj->getParent()),
"sortGroupList"));
566 $clientGroups = array_merge($clientGroups, array_values($sgroups));
569 foreach($clientGroups as $group)
571 if(!$group[
"iconid"])
continue;
575 if(!$group->iconIsLocal(
"iconid") && $this->ftclient)
577 if(!isset($this->cacheIcon[$group[
"iconid"]]))
579 $download = $group->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $group->iconGetName(
"iconid"));
581 if($this->ftclient ==
"data:image")
583 $download =
TeamSpeak3::factory(
"filetransfer://" . (strstr($download[
"host"],
":") !== FALSE ?
"[" . $download[
"host"] .
"]" : $download[
"host"]) .
":" . $download[
"port"])->download($download[
"ftkey"], $download[
"size"]);
586 $this->cacheIcon[$group[
"iconid"]] = $download;
590 $download = $this->cacheIcon[$group[
"iconid"]];
593 if($this->ftclient ==
"data:image")
599 $html .= $this->
getImage($this->ftclient .
"?ftdata=" . base64_encode(serialize($download)), $group .
" [" . $type .
"]", null, FALSE);
602 elseif(in_array($group[
"iconid"], $this->cachedIcons))
604 $html .= $this->
getImage(
"group_icon_" . $group[
"iconid"] .
".png", $group .
" [" . $type .
"]");
608 if($this->currObj[
"client_icon_id"])
610 if(!$this->currObj->iconIsLocal(
"client_icon_id") && $this->ftclient)
612 if(!isset($this->cacheIcon[$this->currObj[
"client_icon_id"]]))
614 $download = $this->currObj->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->currObj->iconGetName(
"client_icon_id"));
616 if($this->ftclient ==
"data:image")
618 $download =
TeamSpeak3::factory(
"filetransfer://" . (strstr($download[
"host"],
":") !== FALSE ?
"[" . $download[
"host"] .
"]" : $download[
"host"]) .
":" . $download[
"port"])->download($download[
"ftkey"], $download[
"size"]);
621 $this->cacheIcon[$this->currObj[
"client_icon_id"]] = $download;
625 $download = $this->cacheIcon[$this->currObj[
"client_icon_id"]];
628 if($this->ftclient ==
"data:image")
634 $html .= $this->
getImage($this->ftclient .
"?ftdata=" . base64_encode(serialize($download)),
"Client Icon", null, FALSE);
637 elseif(in_array($this->currObj[
"client_icon_id"], $this->cachedIcons))
639 $html .= $this->
getImage(
"group_icon_" . $this->currObj[
"client_icon_id"] .
".png",
"Client Icon");
getImage($name, $text="", $class=null, $iconpath=TRUE, $flagpath=FALSE)
Returns the code to display a custom HTML img tag.
Definition: Html.php:672
static imageMimeType($binary)
Tries to detect the type of an image by a given string and returns it.
Definition: Convert.php:346
Class describing a TeamSpeak 3 server group and all it's parameters.
Definition: Servergroup.php:29
static factory($uri)
Factory for TeamSpeak3_Adapter_Abstract classes.
Definition: TeamSpeak3.php:316