private static function getPluginManager() { global $DEBUGMODEON; if ($DEBUGMODEON) { echo "Retrieving Plugin Manager<br>"; } if (empty(self::$PluginManager)) { self::$PluginManager = new PluginManager(); } return self::$PluginManager; }
/** * Will echo an XML document will all the available plugins * * @param TagontoNET $tnet */ function listPlugins($tnet) { $plugins = $tnet->getPluginList(); //Creating the XML and outputting $doc = new DomDocument('1.0'); $doc->preserveWhiteSpace = false; $doc->formatOutput = true; $root = $doc->createElement('tagonto'); $root->setAttribute('requestSatisfied', 'true'); $root = $doc->appendChild($root); foreach ($plugins as $Risorsa) { //Main Plugin element $risorsa = $doc->createElement('resource'); $risorsa = $root->appendChild($risorsa); //Name $child = $doc->createElement('name'); $child = $risorsa->appendChild($child); $value = $doc->createTextNode($Risorsa->getName()); $value = $child->appendChild($value); //Url $child = $doc->createElement('url'); $child = $risorsa->appendChild($child); $value = $doc->createTextNode($Risorsa->getWebUrl()); $value = $child->appendChild($value); //Logo $child = $doc->createElement('logo'); $child = $risorsa->appendChild($child); $value = $doc->createTextNode($Risorsa->getLogo()); $value = $child->appendChild($value); } //Output xml $xml_string = $doc->saveXML(); echo $xml_string; }
function getResourceResultsByTag($tag) { $TagontoNET = new TagontoNET(); $resources = $TagontoNET->getResourcesForTag($tag); return $resources; }