TeamSpeak 3 PHP Framework
1.1.12
|
Renders nodes used in ASCII-based TeamSpeak 3 viewers. More...
Public Member Functions | |
fetchObject (TeamSpeak3_Node_Abstract $node, array $siblings=array()) | |
Returns the code needed to display a node in a TeamSpeak 3 viewer. | |
Protected Member Functions | |
getPrefix () | |
Returns the ASCII string to display the prefix of the current node. | |
getCorpusIcon () | |
Returns an ASCII string which can be used to display the status icon for a TeamSpeak_Node_Abstract object. | |
getCorpusName () | |
Returns a string for the current corpus element which contains the display name for the current TeamSpeak_Node_Abstract object. | |
Protected Attributes | |
$pattern = "%0%1 %2\n" |
TeamSpeak3_Viewer_Text::fetchObject | ( | TeamSpeak3_Node_Abstract $ | node, |
array $ | siblings = array() |
||
) |
Returns the code needed to display a node in a TeamSpeak 3 viewer.
TeamSpeak3_Node_Abstract | $node | |
array | $siblings |
Reimplemented from TeamSpeak3_Viewer_Interface.
Definition at line 48 of file Text.php.
References TeamSpeak3_Helper_String\factory(), getCorpusIcon(), getCorpusName(), and getPrefix().
{ $this->currObj = $node; $this->currSib = $siblings; $args = array( $this->getPrefix(), $this->getCorpusIcon(), $this->getCorpusName(), ); return TeamSpeak3_Helper_String::factory($this->pattern)->arg($args); }
TeamSpeak3_Viewer_Text::getPrefix | ( | ) | [protected] |
Returns the ASCII string to display the prefix of the current node.
Definition at line 67 of file Text.php.
Referenced by fetchObject().
{ $prefix = ""; if(count($this->currSib)) { $last = array_pop($this->currSib); foreach($this->currSib as $sibling) { $prefix .= ($sibling) ? "| " : " "; } $prefix .= ($last) ? "\\-" : "|-"; } return $prefix; }
TeamSpeak3_Viewer_Text::getCorpusIcon | ( | ) | [protected] |
Returns an ASCII string which can be used to display the status icon for a TeamSpeak_Node_Abstract object.
Definition at line 92 of file Text.php.
Referenced by fetchObject().
{
return $this->currObj->getSymbol();
}
TeamSpeak3_Viewer_Text::getCorpusName | ( | ) | [protected] |
Returns a string for the current corpus element which contains the display name for the current TeamSpeak_Node_Abstract object.
Definition at line 103 of file Text.php.
Referenced by fetchObject().
{
return $this->currObj;
}