public function preload() { global $objDefinition, $tree, $ilObjDataCache, $ilUser, $rbacsystem; if (!$this->obj_ids) { return; } $this->obj_ids = array_unique($this->obj_ids); $this->types = array_unique($this->types); if ($this->ref_ids) { $this->ref_ids = array_unique($this->ref_ids); } // type specific preloads include_once "./Services/AccessControl/classes/class.ilConditionHandler.php"; foreach ($this->types as $type) { $this->obj_ids_by_type[$type] = array_unique($this->obj_ids_by_type[$type]); if (is_array($this->ref_ids_by_type[$type])) { $this->ref_ids_by_type[$type] = array_unique($this->ref_ids_by_type[$type]); } if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY || $this->context == ilObjectListGUI::CONTEXT_PERSONAL_DESKTOP || $this->context == ilObjectListGUI::CONTEXT_SEARCH) { ilConditionHandler::preloadConditionsForTargetRecords($type, $this->obj_ids_by_type[$type]); } $class = $objDefinition->getClassName($type); $location = $objDefinition->getLocation($type); if ($class && $location) { $full_class = "ilObj" . $class . "Access"; include_once $location . "/class." . $full_class . ".php"; if (class_exists($full_class)) { call_user_func(array($full_class, "_preloadData"), $this->obj_ids_by_type[$type], $this->ref_ids_by_type[$type]); } } } if ($this->ref_ids) { $tree->preloadDeleted($this->ref_ids); $tree->preloadDepthParent($this->ref_ids); $ilObjDataCache->preloadReferenceCache($this->ref_ids, false); $rbacsystem->preloadRbacPaCache($this->ref_ids, $ilUser->getId()); if ($ilUser->getId != ANONYMOUS_USER_ID && $this->context != ilObjectListGUI::CONTEXT_PERSONAL_DESKTOP) { ilObjUser::preloadIsDesktopItem($ilUser->getId(), $this->ref_ids); } include_once "./Services/Object/classes/class.ilObjectActivation.php"; ilObjectActivation::preloadData($this->ref_ids); } include_once "./Services/Object/classes/class.ilObjectListGUI.php"; ilObjectListGUI::preloadCommonProperties($this->obj_ids, $this->context); if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY) { include_once "./Services/Rating/classes/class.ilRating.php"; include_once "./Services/Rating/classes/class.ilRatingGUI.php"; ilRating::preloadListGUIData($this->obj_ids); include_once "./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php"; ilAdvancedMDValues::preloadByObjIds($this->obj_ids); } if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY || $this->context == ilObjectListGUI::CONTEXT_PERSONAL_DESKTOP || $this->context == ilObjectListGUI::CONTEXT_SEARCH) { include_once "./Services/Tracking/classes/class.ilLPStatus.php"; ilLPStatus::preloadListGUIData($this->obj_ids); } }
/** * Preload common properties * * @param * @return */ static function preloadCommonProperties($a_obj_ids) { global $lng; $lng->loadLanguageModule("notes"); $lng->loadLanguageModule("tagging"); $lng->loadLanguageModule("rating"); include_once "./Services/Tagging/classes/class.ilTagging.php"; self::$cnt_tags = ilTagging::_countTags($a_obj_ids); include_once "./Services/Notes/classes/class.ilNote.php"; self::$cnt_notes = ilNote::_countNotesAndCommentsMultiple($a_obj_ids, true); self::$comments_activation = ilNote::getRepObjActivation($a_obj_ids); include_once "./Services/Tracking/classes/class.ilLPStatus.php"; ilLPStatus::preloadListGUIData($a_obj_ids); include_once "./Services/Rating/classes/class.ilRating.php"; include_once "./Services/Rating/classes/class.ilRatingGUI.php"; ilRating::preloadListGUIData($a_obj_ids); self::$preload_done = true; }