Example #1
0
 /**
  * Get image path
  */
 public static final function _getImagePath($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img)
 {
     $d2 = ilComponent::lookupId($a_ctype, $a_cname) . "_" . $a_slot_id . "_" . ilPlugin::lookupIdForName($a_ctype, $a_cname, $a_slot_id, $a_pname);
     $img = ilUtil::getImagePath($d2 . "/" . $a_img);
     if (is_int(strpos($img, "Customizing"))) {
         return $img;
     }
     $d = ilPlugin::_getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname);
     return $d . "/templates/images/" . $a_img;
 }
 /**
  * Read object definition data
  */
 function readDefinitionData()
 {
     global $ilDB, $ilPluginAdmin;
     $this->obj_data = array();
     // Select all object_definitions and collect the definition id's in
     // this array.
     $defIds = array();
     $set = $ilDB->query("SELECT * FROM il_object_def");
     while ($rec = $ilDB->fetchAssoc($set)) {
         $this->obj_data[$rec["id"]] = array("name" => $rec["id"], "class_name" => $rec["class_name"], "location" => $rec["location"], "checkbox" => $rec["checkbox"], "inherit" => $rec["inherit"], "component" => $rec["component"], "translate" => $rec["translate"], "devmode" => $rec["devmode"], "allow_link" => $rec["allow_link"], "allow_copy" => $rec["allow_copy"], "rbac" => $rec["rbac"], "group" => $rec["grp"], "system" => $rec["system"], "default_pos" => "9999" . str_pad($rec["default_pos"], 4, "0", STR_PAD_LEFT), "sideblock" => $rec["sideblock"], 'export' => $rec['export'], 'repository' => $rec['repository'], 'workspace' => $rec['workspace'], 'administration' => $rec['administration'], 'amet' => $rec['amet']);
         $this->obj_data[$rec["id"]]["subobjects"] = array();
         $defIds[] = $rec["id"];
     }
     // get all subobject definitions in a single query
     $set2 = $ilDB->query("SELECT * FROM il_object_subobj WHERE " . $ilDB->in('parent', $defIds, false, 'text'));
     while ($rec2 = $ilDB->fetchAssoc($set2)) {
         $max = $rec2["mmax"];
         if ($max <= 0) {
             $max = "";
         }
         $this->obj_data[$rec2["parent"]]["subobjects"][$rec2["subobj"]] = array("name" => $rec2["subobj"], "max" => $max, "lng" => $rec2["subobj"]);
     }
     $set = $ilDB->query("SELECT * FROM il_object_group");
     $this->obj_group = array();
     while ($rec = $ilDB->fetchAssoc($set)) {
         $this->obj_group[$rec["id"]] = $rec;
     }
     // now get objects from repository plugin
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
     foreach ($pl_names as $pl_name) {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $pl_id = ilPlugin::lookupIdForName(IL_COMP_SERVICE, "Repository", "robj", $pl_name);
         if ($pl_id != "" && !isset($this->obj_data[$pl_id])) {
             include_once "./Services/Repository/classes/class.ilRepositoryObjectPlugin.php";
             $loc = ilPlugin::_getDirectory(IL_COMP_SERVICE, "Repository", "robj", $pl_name) . "/classes";
             $this->obj_data[$pl_id] = array("name" => $pl_id, "class_name" => $pl_name, "plugin" => "1", "location" => $loc, "checkbox" => "1", "inherit" => "0", "component" => "", "translate" => "0", "devmode" => "0", "allow_link" => "1", "allow_copy" => "0", "rbac" => "1", "group" => null, "system" => "0", "default_pos" => "99992000", 'repository' => '1', 'workspace' => '0', 'administration' => '0', "sideblock" => "0");
             $this->obj_data[$rec["id"]]["subobjects"] = array();
             // plugins have to be marked as such - see ilContainerGUI::showPossibleSubObjects()
             $this->obj_data["crs"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
             $this->obj_data["fold"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
             $this->obj_data["grp"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
             $this->obj_data["cat"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
             $this->obj_data["root"]["subobjects"][$pl_id] = array("name" => $pl_id, "max" => "", "lng" => $pl_id, "plugin" => true);
         }
     }
     //var_dump($this->obj_data["root"]["subobjects"]);
     //var_dump($this->obj_data2["root"]);
     $set = $ilDB->query("SELECT * FROM il_object_sub_type ");
     $this->sub_types = array();
     while ($rec = $ilDB->fetchAssoc($set)) {
         $this->sub_types[$rec["obj_type"]][] = $rec;
     }
 }
Example #3
0
 /**
  * Get image path
  */
 public static final function _getImagePath($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img)
 {
     $d = ilPlugin::_getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname);
     return $d . "/templates/images/" . $a_img;
 }