/**
  * @return bool
  */
 protected function initViteroPlugin()
 {
     /**
      * @var ilPluginAdmin $ilPluginAdmin
      */
     global $ilPluginAdmin;
     if (!$ilPluginAdmin->isActive(self::VIT_CTYPE, self::VIT_CNAME, self::VIT_SLOT_ID, self::VIT_PNAME)) {
         return false;
     }
     include_once './Services/Component/classes/class.ilPluginAdmin.php';
     $vit = ilPluginAdmin::getPluginObject(self::VIT_CTYPE, self::VIT_CNAME, self::VIT_SLOT_ID, self::VIT_PNAME);
     if (ilComponent::isVersionGreaterString(self::VIT_MIN_VERSION, $vit->getVersion())) {
         return false;
     }
     $this->vitero = $vit;
     return true;
 }
コード例 #2
0
 public function initILIAS()
 {
     chdir(substr($_SERVER['SCRIPT_FILENAME'], 0, strpos($_SERVER['SCRIPT_FILENAME'], '/Customizing')));
     require_once 'include/inc.ilias_version.php';
     require_once 'Services/Component/classes/class.ilComponent.php';
     if (ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, '4.2.999')) {
         require_once './Services/Context/classes/class.ilContext.php';
         ilContext::init(ilContext::CONTEXT_WEB);
         require_once './Services/Init/classes/class.ilInitialisation.php';
         ilInitialisation::initILIAS();
     } else {
         $_GET['baseClass'] = 'ilStartUpGUI';
         require_once './include/inc.get_pear.php';
         require_once './include/inc.header.php';
     }
     require_once './Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/Certificate/classes/class.ilCertificatePlugin.php';
     require_once './Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/Certificate/classes/Certificate/class.srCertificate.php';
     require_once "./Services/Tracking/classes/class.ilTrQuery.php";
     require_once "./Services/Tracking/classes/class.ilLPStatusFactory.php";
 }
コード例 #3
0
 /**
  * Get basic data of plugin from plugin.php
  *
  * @param	string	$a_ctype	Component Type
  * @param	string	$a_cname	Component Name
  * @param	string	$a_slot_id	Slot ID
  * @param	string	$a_pname	Plugin Name
  */
 private final function getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname)
 {
     global $ilDB, $lng;
     if (!isset($this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname])) {
         include_once "./Services/Component/classes/class.ilPluginSlot.php";
         $slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
         $plugin_php_file = "./Customizing/global/plugins/" . $a_ctype . "/" . $a_cname . "/" . $slot_name . "/" . $a_pname . "/plugin.php";
         $rec = ilPlugin::getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname);
         if (is_file($plugin_php_file)) {
             include_once $plugin_php_file;
             $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = array("version" => $version, "id" => $id, "ilias_min_version" => $ilias_min_version, "ilias_max_version" => $ilias_max_version, "responsible" => $responsible, "responsible_mail" => $responsible_mail, "learning_progress" => (bool) $learning_progress);
         }
         $active = $rec["active"];
         $needs_update = false;
         $activation_possible = !$active;
         $inactive_reason = "";
         // version checks
         if (ilComponent::isVersionGreaterString($ilias_min_version, ILIAS_VERSION_NUMERIC)) {
             $active = false;
             if (is_object($lng)) {
                 $inactive_reason = $lng->txt("cmps_needs_newer_ilias_version");
             } else {
                 $inactive_reason = "Plugin needs a newer version of ILIAS.";
             }
             $activation_possible = false;
         } else {
             if (ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, $ilias_max_version)) {
                 $active = false;
                 if (is_object($lng)) {
                     $inactive_reason = $lng->txt("cmps_needs_newer_plugin_version");
                 } else {
                     $inactive_reason = "Plugin does not support current version of ILIAS. Newer version of plugin needed.";
                 }
                 $activation_possible = false;
             } else {
                 if ($rec["last_update_version"] == "") {
                     $active = false;
                     if (is_object($lng)) {
                         $inactive_reason = $lng->txt("cmps_needs_update");
                     } else {
                         $inactive_reason = "Update needed.";
                     }
                     $needs_update = true;
                     $activation_possible = false;
                 } else {
                     if (ilComponent::isVersionGreaterString($rec["last_update_version"], $version)) {
                         $active = false;
                         if (is_object($lng)) {
                             $inactive_reason = $lng->txt("cmps_needs_upgrade");
                         } else {
                             $inactive_reason = "Upgrade needed.";
                         }
                         $activation_possible = false;
                     } else {
                         if ($rec["last_update_version"] != $version) {
                             $active = false;
                             if (is_object($lng)) {
                                 $inactive_reason = $lng->txt("cmps_needs_update");
                             } else {
                                 $inactive_reason = "Update needed.";
                             }
                             $needs_update = true;
                             $activation_possible = false;
                         }
                     }
                 }
             }
         }
         $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"] = $active;
         $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["inactive_reason"] = $inactive_reason;
         $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"] = $needs_update;
         $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["activation_possible"] = $activation_possible;
         $this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = true;
     }
 }
 /**
  * @return bool
  */
 public function isAvailable()
 {
     // Only for ILIAS >= 4.4
     return ilComponent::isVersionGreaterString(ILIAS_VERSION_NUMERIC, '4.4.0');
 }