31 include_once(
"./classes/class.ilDOMXML.php");
32 include_once(
"./Services/COPage/classes/class.ilParagraphPlugin.php");
56 $this->plugins = array();
58 $this->skipDirectories = array ();
59 $this->skipDirectories [$this->pluginDirectory.
"/classes"] =
"skip";
60 $this->skipDirectories [$this->pluginDirectory.
"/resources"]=
"skip";
61 $this->skipDirectories [$this->pluginDirectory.
"/CVS"]=
"skip";
78 foreach ($this->plugins as $plugin) {
79 if (strcasecmp($pluginDir, $plugin->getDirectory()) == 0)
90 $this->plugins[$plugin->serializeToString()] = $plugin;
95 foreach ($this->plugins as $plugin) {
96 if (strcasecmp(get_class($plugin), $pluginClassname) == 0)
106 return implode (
"|", array_keys($this->plugins));
113 if (file_exists($this->pluginDirectory))
115 $pluginDirs = glob($this->pluginDirectory.
"/*",GLOB_ONLYDIR);
116 if (is_array($pluginDirs))
118 foreach ($pluginDirs as $pluginDir) {
120 if (array_key_exists($pluginDir,$this->skipDirectories) || !file_exists($pluginDir.
"/plugin.xml")) {
127 $pluginDOM->loadDocument(
"plugin.xml", $pluginDir,
false);
128 $pluginNodes = $pluginDOM->getElementsByTagname(
"plugin");
130 if ( count ($pluginNodes)>0 )
133 $pluginNode = $pluginNodes[0];
136 $pluginSubDir = str_replace($this->pluginDirectory.
"/",
"",$pluginDir);
139 $classfile = $pluginNode->get_attribute (
"classfile");
141 $classname = $pluginNode->get_attribute (
"classname");
144 $filetype = $pluginNode->get_attribute (
"filetype");
147 $active = strcasecmp($pluginNode->get_attribute (
"active"),
"true") == 0;
160 $classfile = $pluginDir .
"/classes/".$classfile;
169 if (file_exists($classfile) && $active && !$this->
isRegistered($classname))
171 include_once ($classfile);
172 $plugin =
new $classname($pluginSubDir, $title, $filetype, $link, $description, $active);
176 if (is_a($plugin,
"ilParagraphPlugin") && $plugin->isActive()) {
198 $elems = $a_element -> get_elements_by_tagname ( $nodename );
199 if (count ($elems) > 0)
201 return $elems[0]->get_content();