예제 #1
0
 /**
  * Get information an all plugins and their status.
  */
 function getPluginsInformation()
 {
     global $ilPluginAdmin;
     // read plugins directory
     $pl_dir = $this->getPluginsDirectory();
     if (!@is_dir($pl_dir)) {
         return array();
     }
     $dir = opendir($pl_dir);
     $plugins = array();
     while ($file = readdir($dir)) {
         if ($file != "." and $file != "..") {
             // directories
             if (@is_dir($pl_dir . "/" . $file) && substr($file, 0, 1) != "." && is_file($pl_dir . "/" . $file . "/plugin.php")) {
                 $plugin = array();
                 $plugin = ilPlugin::lookupStoredData($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $file);
                 // create record in il_plugin table (if not existing)
                 ilPlugin::createPluginRecord($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $file);
                 $pdata = $ilPluginAdmin->getAllData($this->getComponentType(), $this->getComponentName(), $this->getSlotId(), $file);
                 $plugin["version"] = $pdata["version"];
                 $plugin["id"] = $pdata["id"];
                 $plugin["is_active"] = $pdata["is_active"];
                 $plugin["inactive_reason"] = $pdata["inactive_reason"];
                 $plugin["needs_update"] = $pdata["needs_update"];
                 $plugin["ilias_min_version"] = $pdata["ilias_min_version"];
                 $plugin["ilias_max_version"] = $pdata["ilias_max_version"];
                 $plugin["activation_possible"] = $pdata["activation_possible"];
                 $plugin["responsible"] = $pdata["responsible"];
                 $plugin["responsible_mail"] = $pdata["responsible_mail"];
                 $plugin["name"] = $file;
                 $plugin["plugin_php_file_status"] = $this->checkPluginPhpFileAvailability($file);
                 $plugin["class_file_status"] = $this->checkClassFileAvailability($file);
                 $plugin["class_file"] = "class.il" . $plugin["name"] . "Plugin.php";
                 $plugins[] = $plugin;
             }
         }
     }
     return $plugins;
 }