/** * check access to learning progress * * @param int $a_ref_id reference ifd of object * @param bool $a_allow_only_read read access is sufficient (see courses/groups) * @return * @static */ public static function checkAccess($a_ref_id, $a_allow_only_read = true) { global $ilUser, $ilAccess; if ($ilUser->getId() == ANONYMOUS_USER_ID) { return false; } include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (!ilObjUserTracking::_enabledLearningProgress()) { return false; } if ($ilAccess->checkAccess('edit_learning_progress', '', $a_ref_id)) { return true; } if (!ilObjUserTracking::_hasLearningProgressLearner()) { return false; } include_once './Services/Tracking/classes/class.ilLPObjSettings.php'; if (ilLPObjSettings::_lookupMode(ilObject::_lookupObjId($a_ref_id)) == LP_MODE_DEACTIVATED) { return false; } if (!$ilAccess->checkAccess('read', '', $a_ref_id)) { return false; } if ($a_allow_only_read) { return true; } return false; }
/** * Fill table row */ protected function fillRow($a_set) { global $lng; $this->tpl->setVariable("REF_ID", $a_set["ref_id"]); $this->tpl->setVariable("SUBSTYLE", $a_set["substyle"]); $this->tpl->setVariable("CATEGORY", ilObject::_lookupTitle(ilObject::_lookupObjId($a_set["ref_id"]))); }
/** * check access to learning progress * * @param int $a_ref_id reference ifd of object * @param bool $a_allow_only_read read access is sufficient (see courses/groups) * @return * @static */ public static function checkAccess($a_ref_id, $a_allow_only_read = true) { global $ilUser, $ilAccess; if ($ilUser->getId() == ANONYMOUS_USER_ID) { return false; } include_once "Services/Tracking/classes/class.ilObjUserTracking.php"; if (!ilObjUserTracking::_enabledLearningProgress()) { return false; } if ($ilAccess->checkAccess('edit_learning_progress', '', $a_ref_id)) { return true; } if (!ilObjUserTracking::_hasLearningProgressLearner()) { return false; } include_once './Services/Object/classes/class.ilObjectLP.php'; $olp = ilObjectLP::getInstance(ilObject::_lookupObjId($a_ref_id)); if (!$olp->isActive()) { return false; } if (!$ilAccess->checkAccess('read', '', $a_ref_id)) { return false; } if ($a_allow_only_read) { return true; } return false; }
/** * Get HTML for navigation history */ function getHTML() { global $ilNavigationHistory, $lng; include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php"; $selection = new ilAdvancedSelectionListGUI(); $selection->setFormSelectMode("url_ref_id", "ilNavHistorySelect", true, "goto.php?target=navi_request", "ilNavHistory", "ilNavHistoryForm", "_top", $lng->txt("go"), "ilNavHistorySubmit"); $selection->setListTitle($lng->txt("last_visited")); $selection->setId("lastvisited"); $selection->setSelectionHeaderClass("MMInactive"); $selection->setHeaderIcon(ilAdvancedSelectionListGUI::NO_ICON); $selection->setItemLinkClass("small"); $selection->setUseImages(true); include_once "./Services/Accessibility/classes/class.ilAccessKey.php"; $selection->setAccessKey(ilAccessKey::LAST_VISITED); $items = $ilNavigationHistory->getItems(); //$sel_arr = array(0 => "-- ".$lng->txt("last_visited")." --"); reset($items); $cnt = 0; foreach ($items as $k => $item) { if ($cnt++ > 20) { break; } if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) || $item["ref_id"] != $_GET["ref_id"] || $k > 0) { $obj_id = ilObject::_lookupObjId($item["ref_id"]); $selection->addItem($item["title"], $item["ref_id"], $item["link"], ilObject::_getIcon($obj_id, "tiny", $item["type"]), $lng->txt("obj_" . $item["type"]), "_top"); } } $html = $selection->getHTML(); if ($html == "") { $selection->addItem($lng->txt("no_items"), "", "#", "", "", "_top"); $selection->setUseImages(false); $html = $selection->getHTML(); } return $html; }
/** * Show member view switch * @return * @param int $a_ref_id */ public static function showMemberViewSwitch($a_ref_id) { global $ilAccess, $ilCtrl; $settings = ilMemberViewSettings::getInstance(); if (!$settings->isEnabled()) { return false; } global $tpl, $tree, $lng, $ilTabs; // No course or group in path => aborting if (!$tree->checkForParentType($a_ref_id, 'crs') and !$tree->checkForParentType($a_ref_id, 'grp')) { return false; } // TODO: check edit_permission $active = $settings->isActive(); $type = ilObject::_lookupType(ilObject::_lookupObjId($a_ref_id)); if (($type == 'crs' or $type == 'grp') and $ilAccess->checkAccess('write', '', $a_ref_id)) { $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_ref_id); $ilCtrl->setParameterByClass("ilrepositorygui", "mv", "1"); $ilCtrl->setParameterByClass("ilrepositorygui", "set_mode", "flat"); $ilTabs->addNonTabbedLink("members_view", $lng->txt('mem_view_activate'), $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset")); $ilCtrl->clearParametersByClass("ilrepositorygui"); return true; } return true; }
/** * Constructor * * @access public * @param * @return */ public function __construct($a_parent_obj, $a_parent_cmd, $a_pool_ref_id) { global $lng, $ilCtrl; $this->setId("cont_qpl"); $this->pool_ref_id = $a_pool_ref_id; $this->pool_obj_id = ilObject::_lookupObjId($a_pool_ref_id); parent::__construct($a_parent_obj, $a_parent_cmd); $this->setTitle(ilObject::_lookupTitle($this->pool_obj_id)); // $qplSetting = new ilSetting("qpl"); $this->setFormName('sa_quest_browser'); // $this->addColumn('','f','1%'); $this->addColumn($this->lng->txt("title"), 'title', ''); $this->addColumn($this->lng->txt("cont_question_type"), 'ttype', ''); $this->addColumn($this->lng->txt("actions"), '', ''); // $this->setPrefix('q_id'); // $this->setSelectAllCheckbox('q_id'); $this->setRowTemplate("tpl.copy_sa_quest_row.html", "Services/COPage"); $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd)); $this->setDefaultOrderField("title"); $this->setDefaultOrderDirection("asc"); // $this->setFilterCommand('filterQuestionBrowser'); // $this->setResetCommand('resetQuestionBrowser'); $this->initFilter(); $this->getQuestions(); }
function putparam($ref_id, $obj_id, $version, $aicc_data) { //aiccdata is a non standard ini format //$data=parse_ini_file($tmpFilename, TRUE); $data = $this->parseAICCData($aicc_data); $hacp_id = ilObject::_lookupObjId($ref_id); //choose either insert or update to be able to inherit superclass global $ilDB, $ilUser, $ilLog; $this->update = array(); $this->insert = array(); if (is_object($ilUser)) { $user_id = $ilUser->getId(); foreach ($data as $key => $value) { $set = $ilDB->queryF(' SELECT * FROM scorm_tracking WHERE user_id = %s AND sco_id = %s AND lvalue = %s AND obj_id = %s', array('integer', 'integer', 'text', 'integer'), array($user_id, $obj_id, $key, $hacp_id)); if ($rec = $ilDB->fetchAssoc($set)) { $this->update[] = array("left" => $key, "right" => $value); } else { $this->insert[] = array("left" => $key, "right" => $value); } } } //store $this->store($hacp_id, $obj_id, 0); $response = new ilHACPResponse($ref_id, $obj_id); $response->sendOk(); }
protected function getItems($a_content_obj, $a_group_obj) { global $ilUser, $tree; $counter = 0; $items = ilUtil::_getObjectsByOperations($this->type, 'write', $ilUser->getId(), -1); $items_obj_id = array(); $items_ids = array(); foreach ($items as $ref_id) { $obj_id = ilObject::_lookupObjId($ref_id); $items_ids[$obj_id] = $ref_id; $items_obj_id[] = $obj_id; } $items_obj_id = ilUtil::_sortIds($items_obj_id, 'object_data', 'title', 'obj_id'); $assigned_ids = array(); $assigned = $a_group_obj->getAssignedItems(); if ($assigned) { foreach ($assigned as $item) { $assigned_ids[] = $item['target_ref_id']; } } $data = array(); foreach ($items_obj_id as $obj_id) { $item_id = $items_ids[$obj_id]; if ($tree->checkForParentType($item_id, 'adm')) { continue; } $obj_id = ilObject::_lookupObjId($item_id); $data[] = array('id' => $item_id, 'title' => ilObject::_lookupTitle($obj_id), 'description' => ilObject::_lookupDescription($obj_id), 'path' => $this->__formatPath($tree->getPathFull($item_id)), 'assigned' => in_array($item_id, $assigned_ids)); } $this->setData($data); }
/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_print_mode = false) { global $ilCtrl, $lng, $ilAccess, $lng; $this->setId("trsmy"); $this->ref_id = $a_ref_id; $this->obj_id = ilObject::_lookupObjId($a_ref_id); parent::__construct($a_parent_obj, $a_parent_cmd); if ($a_print_mode) { $this->setPrintMode(true); } $this->parseTitle($this->obj_id, "trac_summary"); $this->setLimit(9999); $this->setShowTemplates(true); $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL)); $this->addColumn($this->lng->txt("title"), "title"); $this->setDefaultOrderField("title"); $labels = $this->getSelectableColumns(); foreach ($this->getSelectedColumns() as $c) { $this->addColumn($labels[$c]["txt"], $c); } if ($this->ref_id == ROOT_FOLDER_ID) { $this->addColumn($this->lng->txt("path")); $this->addColumn($this->lng->txt("action")); } $this->initFilter(); // $this->setExternalSorting(true); $this->setEnableHeader(true); $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this))); $this->setRowTemplate("tpl.trac_summary_row.html", "Services/Tracking"); $this->getItems($a_parent_obj->getObjId(), $a_ref_id); $this->anonymized = (bool) (!ilObjUserTracking::_enabledUserRelatedData()); }
public function __construct($a_parent_obj, $a_parent_cmd, array &$a_data, $a_view, $a_by_location = false) { global $ilCtrl, $tree, $ilUser; $this->setId("pdmng"); parent::__construct($a_parent_obj, $a_parent_cmd); $this->addColumn('', '', '5%'); $this->addColumn($this->lng->txt("type"), 'type_caption', '1%'); $this->addColumn($this->lng->txt("title"), 'title', '44%'); $this->addColumn($this->lng->txt("container"), 'container', '50%'); $this->setDefaultOrderField("title"); $this->setRowTemplate("tpl.pd_manage_row.html", "Services/PersonalDesktop"); $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd)); if ($a_view == ilPDSelectedItemsBlockGUI::VIEW_MY_OFFERS) { $this->setTitle($this->lng->txt("pd_my_offers")); $this->addMultiCommand('confirmRemove', $this->lng->txt('unsubscribe')); } else { $this->setTitle($this->lng->txt("pd_my_memberships")); $this->addMultiCommand('confirmRemove', $this->lng->txt('crs_unsubscribe')); } $this->addCommandButton("getHTML", $this->lng->txt("cancel")); // root node caption $root = $tree->getNodeData(ROOT_FOLDER_ID); $root = $root["title"]; if ($root == "ILIAS") { $root = $this->lng->txt("repository"); } foreach ($a_data as $idx => $item) { if (!$item["parent_ref"]) { unset($a_data[$idx]); continue; } if ($a_view == ilPDSelectedItemsBlockGUI::VIEW_MY_MEMBERSHIPS) { $a_data[$idx]["last_admin"] = false; switch ($item["type"]) { case "crs": // see ilObjCourseGUI:performUnsubscribeObject() include_once "Modules/Course/classes/class.ilCourseParticipants.php"; $members = new ilCourseParticipants($item["obj_id"]); break; case "grp": include_once "Modules/Group/classes/class.ilGroupParticipants.php"; $members = new ilGroupParticipants($item["obj_id"]); break; default: // do nothing? continue; } $a_data[$idx]["last_admin"] = $members->isLastAdmin($ilUser->getId()); } $a_data[$idx]["type_caption"] = $this->lng->txt("obj_" . $item["type"]); // parent if ($tree->getRootId() != $item["parent_ref"]) { $a_data[$idx]["container"] = ilObject::_lookupTitle(ilObject::_lookupObjId($item["parent_ref"])); } else { $a_data[$idx]["container"] = $root; } } $this->setData($a_data); }
/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $ref_id) { global $ilCtrl, $lng, $tree; $this->setId("trsmtx_" . $ref_id); $this->ref_id = $ref_id; $this->obj_id = ilObject::_lookupObjId($ref_id); $this->in_group = $tree->checkForParentType($this->ref_id, "grp"); if ($this->in_group) { $this->in_group = ilObject::_lookupObjId($this->in_group); } else { $this->in_course = $tree->checkForParentType($this->ref_id, "crs"); if ($this->in_course) { $this->in_course = ilObject::_lookupObjId($this->in_course); } } // has to be before constructor to work $this->initFilter(); parent::__construct($a_parent_obj, $a_parent_cmd); $this->setLimit(9999); $this->parseTitle($this->obj_id, "trac_matrix"); $this->setEnableHeader(true); $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this))); $this->setRowTemplate("tpl.user_object_matrix_row.html", "Services/Tracking"); $this->setDefaultOrderField("login"); $this->setDefaultOrderDirection("asc"); $this->setShowTemplates(true); $this->addColumn($this->lng->txt("login"), "login"); $labels = $this->getSelectableColumns(); $selected = $this->getSelectedColumns(); foreach ($selected as $c) { $title = $labels[$c]["txt"]; if (isset($labels[$c]["no_permission"]) && (bool) $labels[$c]["no_permission"]) { $title .= " (" . $lng->txt("status_no_permission") . ")"; } $tooltip = ""; if (isset($labels[$c]["icon"])) { $alt = $lng->txt($labels[$c]["type"]); $icon = '<img src="' . $labels[$c]["icon"] . '" alt="' . $alt . '" />'; if (sizeof($selected) > 5) { $tooltip = $title; $title = $icon; } else { $title = $icon . ' ' . $title; } } if (isset($labels[$c]["id"])) { $sort_id = $labels[$c]["id"]; } else { // list cannot be sorted by udf fields (separate query) $sort_id = substr($c, 0, 4) == "udf_" ? "" : $c; } $this->addColumn($title, $sort_id, "", false, "", $tooltip); } $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL)); }
public function __construct() { global $lng; parent::__construct(); $this->parent_ref_id = (int) $_GET["ref_id"]; $this->parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id); $this->parent_obj_type = ilObject::_lookupType($this->parent_obj_id); $lng->loadLanguageModule("classification"); $this->setTitle($lng->txt("clsfct_block_title")); $this->setFooterInfo($lng->txt("clsfct_block_info")); }
protected function verifyObject($a_ref_id) { global $ilAccess; $this->ref_id = $a_ref_id; $this->obj_id = ilObject::_lookupObjId($this->ref_id); if (ilObject::_lookupType($this->obj_id) != "xxco") { $this->sendError("Wrong object given!"); } if (!$ilAccess->checkAccessOfUser($this->user_id, 'read', '', $this->ref_id)) { $this->sendError("No access!"); } }
/** * * @param * @return */ public function __construct($a_auth_ref_id) { global $lng, $ilCtrl, $tpl, $ilTabs, $ilias; $this->ctrl = $ilCtrl; $this->tabs_gui = $ilTabs; $this->lng = $lng; $this->lng->loadLanguageModule('shib'); $this->ilias = $ilias; $this->tpl = $tpl; $this->ref_id = $a_auth_ref_id; $this->obj_id = ilObject::_lookupObjId($this->ref_id); }
public function getLinkHTML($link_name = NULL) { $value = $this->getValue(); $link = ilLink::_getStaticLink($value); $id = ilObject::_lookupObjId($value); if ($link_name) { $html = "<a href='" . $link . "'>" . $link_name . "</a>"; } else { $html = "<a href='" . $link . "'>" . ilObject::_lookupTitle($id) . "</a>"; } return $html; }
/** * Use a registration code and assign the logged in user * to the (parent) course/group that offer the code. * * @todo: throw an error if registration fails (max members, availibility...) * * @param string $a_code * @param int $a_endnode Reference id of node in tree * @return */ protected static function useCode($a_code, $a_endnode) { global $tree, $ilUser; $obj_ids = self::lookupObjectsByCode($a_code); foreach ($tree->getPathId($a_endnode) as $ref_id) { if (in_array(ilObject::_lookupObjId($ref_id), $obj_ids)) { if ($obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) { $obj->register($ilUser->getId()); } } } }
/** * Get node icon * Return custom icon of OrgUnit type if existing * * @param array $a_node * * @return string */ public function getNodeIcon($a_node) { global $ilias; if ($ilias->getSetting('custom_icons')) { $icons_cache = ilObjOrgUnit::getIconsCache(); $obj_id = ilObject::_lookupObjId($a_node["child"]); if (isset($icons_cache[$obj_id])) { return $icons_cache[$obj_id]; } } return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]); }
/** * constructor * * @access public * @param * @return */ public function __construct($a_crs_ref_id, ilParticipants $a_members) { global $tpl, $ilCtrl, $lng; $this->ctrl = $ilCtrl; $this->tpl = $tpl; $this->lng = $lng; $this->lng->loadLanguageModule('event'); $this->lng->loadLanguageModule('crs'); $this->course_ref_id = $a_crs_ref_id; $this->course_id = ilObject::_lookupObjId($this->course_ref_id); $this->members_obj = $a_members; }
public function setValueByArray($value) { parent::setValueByArray($value); include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $reference = $value[$this->getPostVar()]; if ($reference) { $pathString = $path->getPath(ROOT_FOLDER_ID, $reference); $id = ilObject::_lookupObjId($reference); $this->title_input->setValue($pathString . " > " . ilObject::_lookupTitle($id)); $this->hidden_input->setValue($reference); } }
public function getSingleHTML(array $options = array()) { $value = $this->getValue(); if (!$value) { return ''; } $id = ilObject::_lookupObjId($value); $title = ilObject::_lookupTitle($id); if ($this->properties[ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK]) { return $this->getLinkHTML($title); } return $title; }
/** * Constructor * * @param ilObjLearningModule $a_lm learning module */ private function __construct($a_id, $a_by_obj_id = false, $a_user_id) { $this->user_id = $a_user_id; if ($a_by_obj_id) { $this->lm_ref_id = 0; $this->lm_obj_id = $a_id; } else { $this->lm_ref_id = $a_id; $this->lm_obj_id = ilObject::_lookupObjId($a_id); } include_once "./Modules/LearningModule/classes/class.ilLMTree.php"; $this->lm_tree = ilLMTree::getInstance($this->lm_obj_id); }
/** * Check if target is accessible and not deleted * @param int $a_ref_id ref_id * @return bool * @static */ public static function _isAccessible($a_ref_id) { global $ilDB, $tree; $obj_id = ilObject::_lookupObjId($a_ref_id); $query = "SELECT target_obj_id FROM container_reference " . "WHERE obj_id = " . $ilDB->quote($obj_id, 'integer') . " "; $res = $ilDB->query($query); while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $target_id = $row->target_obj_id; } $target_ref_ids = ilObject::_getAllReferences($target_id); $target_ref_id = current($target_ref_ids); return !$tree->isDeleted($target_ref_id); }
/** * check whether goto script will succeed */ public function _checkGoto($a_target) { global $ilAccess, $lng; $t_arr = explode("_", $a_target); if ($t_arr[0] != "bibl" || (int) $t_arr[1] <= 0) { return false; } if ($ilAccess->checkAccess("visible", "", $t_arr[1])) { return true; } $object_title = ilObject::_lookupTitle(ilObject::_lookupObjId($t_arr[1])); ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"), $object_title), true); return false; }
/** * Constructor */ function __construct($a_parent_obj, $a_parent_cmd, $a_obj_id, $a_ref_id, $a_print_view = false) { global $ilCtrl, $lng, $tree, $rbacsystem; $this->setId("troup"); $this->obj_id = $a_obj_id; $this->ref_id = $a_ref_id; $this->type = ilObject::_lookupType($a_obj_id); $this->in_group = $tree->checkForParentType($this->ref_id, "grp"); if ($this->in_group) { $this->in_group = ilObject::_lookupObjId($this->in_group); } else { $this->in_course = $tree->checkForParentType($this->ref_id, "crs"); if ($this->in_course) { $this->in_course = ilObject::_lookupObjId($this->in_course); } } parent::__construct($a_parent_obj, $a_parent_cmd); $this->parseTitle($a_obj_id, "trac_participants"); if ($a_print_view) { $this->setPrintMode(true); } $labels = $this->getSelectableColumns(); foreach ($this->getSelectedColumns() as $c) { $first = $c; // list cannot be sorted by udf fields (separate query) // because of pagination only core fields can be sorted $sort_id = substr($c, 0, 4) == "udf_" ? "" : $c; $this->addColumn($labels[$c]["txt"], $sort_id); } if (!$this->getPrintMode()) { $this->addColumn($this->lng->txt("actions"), ""); } $this->setExternalSorting(true); $this->setExternalSegmentation(true); $this->setEnableHeader(true); $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this))); $this->setRowTemplate("tpl.object_users_props_row.html", "Services/Tracking"); $this->setEnableTitle(true); $this->setShowTemplates(true); $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL)); if ($first) { $this->setDefaultOrderField($first); $this->setDefaultOrderDirection("asc"); } $this->initFilter(); $this->getItems(); // #13807 $this->has_edit = $rbacsystem->checkAccess('edit_learning_progress', $this->ref_id); }
/** * Constructor * * @param int $a_item_group_ref_id ref id of item group */ function ilItemGroupItems($a_item_group_ref_id = 0) { global $ilDB, $lng, $tree, $objDefinition; $this->db = $ilDB; $this->lng = $lng; $this->tree = $tree; $this->obj_def = $objDefinition; $this->setItemGroupRefId((int) $a_item_group_ref_id); if ($this->getItemGroupRefId() > 0) { $this->setItemGroupId((int) ilObject::_lookupObjId($a_item_group_ref_id)); } if ($this->getItemGroupId() > 0) { $this->read(); } }
/** * Read and parse items */ public function parse(ilLPCollection $a_collection) { $this->setData($a_collection->getTableGUIData($this->getNode())); $this->initTable(); // grouping actions if ($this->getMode() == ilLPObjSettings::LP_MODE_COLLECTION && ilLPCollectionOfRepositoryObjects::hasGroupedItems(ilObject::_lookupObjId($this->getNode()))) { $this->addMultiCommand('releaseMaterials', $this->lng->txt('trac_release_materials')); foreach ($this->row_data as $item) { if ($item["grouped"]) { $this->addCommandButton('saveObligatoryMaterials', $this->lng->txt('trac_group_materials_save')); break; } } } }
protected function validateEntry($a_item_ref_id, $a_item_type = null) { if (!$a_item_type) { $a_item_type = ilObject::_lookupType($a_item_ref_id, true); } // this is hardcoded so we do not need to call all ObjectLP types if ($a_item_type == 'tst') { // Check anonymized $item_obj_id = ilObject::_lookupObjId($a_item_ref_id); $olp = ilObjectLP::getInstance($item_obj_id); if ($olp->isAnonymized()) { return false; } } return true; }
/** * Write tree childs * Recursive method * @param object $a_ref_id * @return */ protected function writeSubitems($a_ref_id) { global $tree; $mode = $this->exp_options->getOptionByRefId($a_ref_id, ilExportOptions::KEY_ITEM_MODE); if ($mode == NULL or $mode == ilExportOptions::EXPORT_OMIT) { return false; } $obj_id = ilObject::_lookupObjId($a_ref_id); $this->xmlStartTag('Item', array('RefId' => $a_ref_id, 'Id' => $obj_id, 'Title' => ilObject::_lookupTitle($obj_id), 'Type' => ilObject::_lookupType($obj_id))); $this->writeCourseItemInformation($a_ref_id); foreach ($tree->getChilds($a_ref_id) as $node) { $this->writeSubitems($node['child']); } $this->xmlEndTag('Item'); return true; }
public function cloneCollection($a_target_id, $a_copy_id) { global $ilLog; $target_obj_id = ilObject::_lookupObjId($a_target_id); include_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php'; $cwo = ilCopyWizardOptions::_getInstance($a_copy_id); $mappings = $cwo->getMappings(); // #12067 $new_collection = new static($target_obj_id, $this->mode); foreach ($this->items as $item) { if (!isset($mappings[$item]) or !$mappings[$item]) { continue; } $new_collection->addEntry($mappings[$item]); } $ilLog->write(__METHOD__ . ': cloned learning progress collection.'); }
/** * Parse objects */ public function parse() { $counter = 0; $set = array(); foreach ($this->getObjects() as $ref_id) { $type = ilObject::_lookupType(ilObject::_lookupObjId($ref_id)); if ($type == 'rolf') { continue; } $set[$counter]['ref_id'] = $ref_id; $set[$counter]['obj_id'] = ilObject::_lookupObjId($ref_id); $set[$counter]['type'] = ilObject::_lookupType(ilObject::_lookupObjId($ref_id)); $set[$counter]['title'] = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id)); $counter++; } $this->setData($set); }