/**
  * Get pages for list.
  */
 function getComponents()
 {
     $plugins = array();
     include_once "./Services/Component/classes/class.ilModule.php";
     $modules = ilModule::getAvailableCoreModules();
     foreach ($modules as $m) {
         $plugin_slots = ilComponent::lookupPluginSlots(IL_COMP_MODULE, $m["subdir"]);
         foreach ($plugin_slots as $ps) {
             include_once "./Services/Component/classes/class.ilPluginSlot.php";
             $slot = new ilPluginSlot(IL_COMP_MODULE, $m["subdir"], $ps["id"]);
             foreach ($slot->getPluginsInformation() as $p) {
                 $plugins[] = $this->gatherPluginData(IL_COMP_MODULE, $slot, $m["subdir"], $p);
             }
         }
     }
     include_once "./Services/Component/classes/class.ilService.php";
     $services = ilService::getAvailableCoreServices();
     foreach ($services as $s) {
         $plugin_slots = ilComponent::lookupPluginSlots(IL_COMP_SERVICE, $s["subdir"]);
         foreach ($plugin_slots as $ps) {
             $slot = new ilPluginSlot(IL_COMP_SERVICE, $s["subdir"], $ps["id"]);
             foreach ($slot->getPluginsInformation() as $p) {
                 $plugins[] = $this->gatherPluginData(IL_COMP_SERVICE, $slot, $s["subdir"], $p);
             }
         }
     }
     $this->setData($plugins);
 }
 function __construct()
 {
     global $ilDB;
     $set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s " . " AND name = %s", array("text", "text"), array($this->getComponentType(), $this->getName()));
     $rec = $ilDB->fetchAssoc($set);
     $this->setId($rec["id"]);
     $this->setPluginSlots(ilComponent::lookupPluginSlots($this->getComponentType(), $this->getName()));
 }
 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilSetting, $objDefinition;
     // plugin slots
     $plugin_slots = ilComponent::lookupPluginSlots($this->mode, $a_set["subdir"]);
     foreach ($plugin_slots as $slot) {
         $this->tpl->setCurrentBlock("slot");
         $this->tpl->setVariable("SLOT_NAME", $slot["name"]);
         $this->tpl->setVariable("SLOT_ID", $slot["id"]);
         $this->tpl->setVariable("TXT_DIR", $lng->txt("cmps_dir"));
         $this->tpl->setVariable("SLOT_DIR", $slot["dir_pres"]);
         $this->tpl->setVariable("TXT_LANG_PREFIX", $lng->txt("cmps_lang_prefix"));
         $this->tpl->setVariable("LANG_PREFIX", $slot["lang_prefix"]);
         $ilCtrl->setParameter($this->parent_obj, "ctype", $this->mode);
         $ilCtrl->setParameter($this->parent_obj, "cname", $a_set["subdir"]);
         $ilCtrl->setParameter($this->parent_obj, "slot_id", $slot["id"]);
         $this->tpl->setVariable("HREF_SHOW_SLOT", $ilCtrl->getLinkTarget($this->parent_obj, "showPluginSlot"));
         $this->tpl->setVariable("TXT_SHOW_SLOT", $lng->txt("cmps_show_details"));
         $this->tpl->parseCurrentBlock();
     }
     // repository object types
     if ($this->mode == IL_COMP_MODULE) {
         $rep_types = $objDefinition->getRepositoryObjectTypesForComponent(IL_COMP_MODULE, $a_set["subdir"]);
         foreach ($rep_types as $rt) {
             // group
             if ($rt["grp"] != "") {
                 $this->tpl->setCurrentBlock("group");
                 $this->tpl->setVariable("TXT_GROUP", $lng->txt("cmps_group"));
                 $gi = $objDefinition->getGroup($rt["grp"]);
                 $this->tpl->setVariable("VAL_GROUP", $gi["name"]);
                 $this->tpl->setVariable("VAL_GROUP_ID", $rt["grp"]);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("rep_object");
             $this->tpl->setVariable("TXT_REP_OBJECT", $rt["class_name"]);
             $this->tpl->setVariable("TXT_REP_OBJECT_ID", $rt["id"]);
             $this->tpl->setVariable("IMG_REP_OBJECT", ilUtil::getImagePath("icon_" . $rt["id"] . ".png"));
             // add new position
             $this->tpl->setVariable("TXT_ADD_NEW_POS", $lng->txt("cmps_add_new_rank"));
             $this->tpl->setVariable("VAR_POS", "obj_pos[" . $rt["id"] . "]");
             $pos = $ilSetting->get("obj_add_new_pos_" . $rt["id"]) > 0 ? $ilSetting->get("obj_add_new_pos_" . $rt["id"]) : $rt["default_pos"];
             $this->tpl->setVariable("VAL_POS", ilUtil::prepareFormOutput($pos));
             // disable creation
             $this->tpl->setVariable("TXT_DISABLE_CREATION", $lng->txt("cmps_disable_creation"));
             $this->tpl->setVariable("VAR_DISABLE_CREATION", "obj_dis_creation[" . $rt["id"] . "]");
             if ($ilSetting->get("obj_dis_creation_" . $rt["id"])) {
                 $this->tpl->setVariable("CHECKED_DISABLE_CREATION", ' checked="checked" ');
             }
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("rep_object_td");
         if (count($rep_types) == 0) {
             $this->tpl->setVariable("DUMMY", " ");
         }
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("TXT_MODULE_NAME", $a_set["subdir"]);
 }
 /**
  * Get pages for list.
  */
 function getComponents()
 {
     $data = array();
     include_once "./Services/Component/classes/class.ilService.php";
     foreach (ilService::getAvailableCoreServices() as $obj) {
         foreach (ilComponent::lookupPluginSlots(IL_COMP_SERVICE, $obj["subdir"]) as $slot) {
             $data[] = array("subdir" => $obj["subdir"], "id" => $slot["id"], "name" => $slot["name"], "dir" => $slot["dir_pres"], "lang" => $slot["lang_prefix"], "ctype" => IL_COMP_SERVICE);
         }
     }
     include_once "./Services/Component/classes/class.ilModule.php";
     foreach (ilModule::getAvailableCoreModules() as $obj) {
         foreach (ilComponent::lookupPluginSlots(IL_COMP_MODULE, $obj["subdir"]) as $slot) {
             $data[] = array("subdir" => $obj["subdir"], "id" => $slot["id"], "name" => $slot["name"], "dir" => $slot["dir_pres"], "lang" => $slot["lang_prefix"], "ctype" => IL_COMP_MODULE);
         }
     }
     $this->setData($data);
 }
 function __construct()
 {
     //		global $ilDB;
     $this->global_cache = ilCachedComponentData::getInstance();
     $rec = $this->global_cache->lookCompId($this->getName(), $this->getComponentType());
     $this->setId($rec["id"]);
     $this->setPluginSlots(ilComponent::lookupPluginSlots($this->getComponentType(), $this->getName()));
     //
     //		echo '<pre>' . print_r($data, 1) . '</pre>';
     //
     //
     //		$set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s ".
     //			" AND name = %s", array("text", "text"),
     //			array($this->getComponentType(), $this->getName()));
     //		$rec = $ilDB->fetchAssoc($set);
     //
     //		$this->setId($rec["id"]);
     //		$this->setPluginSlots(ilComponent::lookupPluginSlots(
     //			$this->getComponentType(), $this->getName()));
 }
 /**
  * Get pages for list.
  */
 function getComponents()
 {
     include_once "./Services/Component/classes/class.ilModule.php";
     $modules = ilModule::getAvailableCoreModules();
     $slots = array();
     foreach ($modules as $m) {
         $plugin_slots = ilComponent::lookupPluginSlots(IL_COMP_MODULE, $m["subdir"]);
         foreach ($plugin_slots as $ps) {
             $plugins = array();
             include_once "./Services/Component/classes/class.ilPluginSlot.php";
             $slot = new ilPluginSlot(IL_COMP_MODULE, $m["subdir"], $ps["id"]);
             foreach ($slot->getPluginsInformation() as $p) {
                 $plugins[] = $p;
             }
             if (count($plugins) > 0) {
                 $slots[] = array("slot_name" => $slot->getSlotName(), "component_type" => IL_COMP_MODULE, "component_name" => $m["subdir"], "slot_id" => $ps["id"], "plugins" => $plugins);
             }
         }
     }
     include_once "./Services/Component/classes/class.ilService.php";
     $services = ilService::getAvailableCoreServices();
     foreach ($services as $s) {
         $plugin_slots = ilComponent::lookupPluginSlots(IL_COMP_SERVICE, $s["subdir"]);
         foreach ($plugin_slots as $ps) {
             $plugins = array();
             $slot = new ilPluginSlot(IL_COMP_SERVICE, $s["subdir"], $ps["id"]);
             foreach ($slot->getPluginsInformation() as $p) {
                 $plugins[] = $p;
             }
             if (count($plugins) > 0) {
                 $slots[] = array("slot_name" => $slot->getSlotName(), "component_type" => IL_COMP_SERVICE, "component_name" => $s["subdir"], "slot_id" => $ps["id"], "plugins" => $plugins);
             }
         }
     }
     $this->setData($slots);
     //include_once("./Services/Component/classes/class.ilService.php");
     //$services = ilService::getAvailableCoreServices();
 }