• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ilObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ilObject的典型用法代码示例。如果您正苦于以下问题:PHP ilObject类的具体用法?PHP ilObject怎么用?PHP ilObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ilObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getInstanceByObject

 /**
  * Get settings handler for repository object
  * 
  * @param ilObject $a_content_obj
  * @return ilECSObjectSettings
  */
 public static function getInstanceByObject(ilObject $a_content_obj)
 {
     switch ($a_content_obj->getType()) {
         case 'crs':
             include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
             return new ilECSCourseSettings($a_content_obj);
         case 'cat':
             include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
             return new ilECSCategorySettings($a_content_obj);
         case 'file':
             include_once 'Modules/File/classes/class.ilECSFileSettings.php';
             return new ilECSFileSettings($a_content_obj);
         case 'glo':
             include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
             return new ilECSGlossarySettings($a_content_obj);
         case 'grp':
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             return new ilECSGroupSettings($a_content_obj);
         case 'lm':
             include_once 'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
             return new ilECSLearningModuleSettings($a_content_obj);
         case 'wiki':
             include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
             return new ilECSWikiSettings($a_content_obj);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilECSObjectSettings.php


示例2: importXmlRepresentation

 /**
  * Import XML
  *
  * @param
  * @return
  */
 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
 {
     include_once './Modules/Category/classes/class.ilObjCategory.php';
     if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
         $refs = ilObject::_getAllReferences($new_id);
         $this->category = ilObjectFactory::getInstanceByRefId(end($refs), false);
     } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', 0)) {
         $this->category = ilObjectFactory::getInstanceByRefId($new_id, false);
     } elseif (!$this->category instanceof ilObjCategory) {
         $this->category = new ilObjCategory();
         $this->category->create(true);
     }
     include_once './Modules/Category/classes/class.ilCategoryXmlParser.php';
     try {
         $parser = new ilCategoryXmlParser($a_xml, 0);
         $parser->setCategory($this->category);
         $parser->setMode(ilCategoryXmlParser::MODE_UPDATE);
         $parser->startParsing();
         $a_mapping->addMapping('Modules/Category', 'cat', $a_id, $this->category->getId());
     } catch (ilSaxParserException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     } catch (Excpetion $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:31,代码来源:class.ilCategoryImporter.php


示例3: __construct

 /**
  * 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();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:32,代码来源:class.ilCopySelfAssQuestionTableGUI.php


示例4: parseObjectIds

 /**
  * Parse object data
  * @return 
  * @param object $a_ids
  */
 public function parseObjectIds($a_ids)
 {
     foreach ($a_ids as $object_id) {
         $row = array();
         $type = ilObject::_lookupType($object_id);
         $row['title'] = ilObject::_lookupTitle($object_id);
         $row['desc'] = ilObject::_lookupDescription($object_id);
         $row['id'] = $object_id;
         switch ($type) {
             case 'crs':
             case 'grp':
                 include_once './Services/Membership/classes/class.ilParticipants.php';
                 if (ilParticipants::hasParticipantListAccess($object_id)) {
                     $row['member'] = count(ilParticipants::getInstanceByObjId($object_id)->getParticipants());
                 } else {
                     $row['member'] = 0;
                 }
                 break;
             case 'role':
                 global $rbacreview;
                 include_once './Services/User/classes/class.ilUserFilter.php';
                 $row['member'] = count(ilUserFilter::getInstance()->filter($rbacreview->assignedUsers($object_id)));
                 break;
         }
         $data[] = $row;
     }
     $this->setData($data ? $data : array());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:33,代码来源:class.ilRepositoryObjectResultTableGUI.php


示例5: putparam

    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();
    }
开发者ID:arlendotcn,项目名称:ilias,代码行数:30,代码来源:class.ilObjHACPTracking.php


示例6: importXmlRepresentation

 /**
  * Import XML
  *
  * @param
  * @return
  */
 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
 {
     include_once './Modules/Group/classes/class.ilObjGroup.php';
     if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
         $refs = ilObject::_getAllReferences($new_id);
         $this->group = ilObjectFactory::getInstanceByRefId(end($refs), false);
         #$this->group = ilObjectFactory::getInstanceByObjId($new_id,false);
     } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', 0)) {
         $this->group = ilObjectFactory::getInstanceByRefId($new_id, false);
     } elseif (!$this->group instanceof ilObjGroup) {
         $this->group = new ilObjGroup();
         $this->group->create(true);
     }
     include_once './Modules/Group/classes/class.ilGroupXMLParser.php';
     #$GLOBALS['ilLog']->write($a_xml);
     try {
         $parser = new ilGroupXMLParser($a_xml, 0);
         $parser->setGroup($this->group);
         $parser->setMode(ilGroupXMLParser::$UPDATE);
         $parser->startParsing();
         $a_mapping->addMapping('Modules/Group', 'grp', $a_id, $this->group->getId());
     } catch (ilSaxParserException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     } catch (ilWebLinkXMLParserException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:33,代码来源:class.ilGroupImporter.php


示例7: importXmlRepresentation

 /**
  * Import XML
  *
  * @param
  * @return
  */
 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
 {
     include_once './Modules/Category/classes/class.ilObjCategory.php';
     if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
         $refs = ilObject::_getAllReferences($new_id);
         $this->category = ilObjectFactory::getInstanceByRefId(end($refs), false);
     } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', 0)) {
         $this->category = ilObjectFactory::getInstanceByRefId($new_id, false);
     } elseif (!$this->category instanceof ilObjCategory) {
         $this->category = new ilObjCategory();
         $this->category->create(true);
     }
     include_once './Modules/Category/classes/class.ilCategoryXmlParser.php';
     try {
         $parser = new ilCategoryXmlParser($a_xml, 0);
         $parser->setCategory($this->category);
         $parser->setMode(ilCategoryXmlParser::MODE_UPDATE);
         $parser->startParsing();
         $a_mapping->addMapping('Modules/Category', 'cat', $a_id, $this->category->getId());
     } catch (ilSaxParserException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     } catch (Excpetion $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     }
     foreach ($a_mapping->getMappingsOfEntity('Services/Container', 'objs') as $old => $new) {
         $type = ilObject::_lookupType($new);
         // see ilGlossaryImporter::importXmlRepresentation()
         // see ilTaxonomyDataSet::importRecord()
         $a_mapping->addMapping("Services/Taxonomy", "tax_item", $type . ":obj:" . $old, $new);
         // this is since 4.3 does not export these ids but 4.4 tax node assignment needs it
         $a_mapping->addMapping("Services/Taxonomy", "tax_item_obj_id", $type . ":obj:" . $old, $new);
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:39,代码来源:class.ilCategoryImporter.php


示例8: fillRow

 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->tpl->setVariable("TXT_DEP_OBJ", $lng->txt("obj_" . ilObject::_lookupType($a_set["dep_obj"])) . ": " . ilObject::_lookupTitle($a_set["dep_obj"]));
     $this->tpl->setVariable("TXT_DEL_OBJ", $lng->txt("obj_" . ilObject::_lookupType($a_set["del_obj"])) . ": " . ilObject::_lookupTitle($a_set["del_obj"]));
     $this->tpl->setVariable("TXT_MESS", $a_set["message"]);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:10,代码来源:class.ilRepDependenciesTableGUI.php


示例9: _getStatusInfo

 function _getStatusInfo($a_obj_id)
 {
     $status_info = array();
     include_once "Services/Object/classes/class.ilObjectLP.php";
     $olp = ilObjectLP::getInstance($a_obj_id);
     $collection = $olp->getCollectionInstance();
     if ($collection) {
         $status_info["items"] = $collection->getItems($a_obj_id);
         foreach ($status_info["items"] as $item_id) {
             $status_info["completed"][$item_id] = array();
         }
         $ref_ids = ilObject::_getAllReferences($a_obj_id);
         $ref_id = end($ref_ids);
         $possible_items = $collection->getPossibleItems($ref_id);
         $chapter_ids = array_intersect(array_keys($possible_items), $status_info["items"]);
         // fix order (adapt from possible items)
         $status_info["items"] = $chapter_ids;
         if ($chapter_ids) {
             $status = self::_getObjectStatus($a_obj_id);
             foreach ($chapter_ids as $item_id) {
                 $status_info["item_titles"][$item_id] = $possible_items[$item_id]["title"];
                 if (isset($status[$item_id])) {
                     foreach ($status[$item_id] as $user_id => $user_status) {
                         if ($user_status) {
                             $status_info["completed"][$item_id][] = $user_id;
                         }
                     }
                 }
             }
         }
     }
     return $status_info;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:33,代码来源:class.ilLPStatusCollectionManual.php


示例10: gatherCourseLPData

 function gatherCourseLPData()
 {
     global $tree, $ilDB;
     // process all courses
     $all_courses = array_keys(ilObject::_getObjectsByType("crs"));
     if ($all_courses) {
         // gather objects in trash
         $trashed_objects = $tree->getSavedNodeObjIds($all_courses);
         include_once 'Services/Tracking/classes/class.ilLPObjSettings.php';
         include_once "Modules/Course/classes/class.ilCourseParticipants.php";
         include_once "Services/Tracking/classes/class.ilLPStatusWrapper.php";
         foreach ($all_courses as $crs_id) {
             // trashed objects will not change
             if (!in_array($crs_id, $trashed_objects)) {
                 // only if LP is active
                 $mode = ilLPObjSettings::_lookupMode($crs_id);
                 if ($mode == LP_MODE_DEACTIVATED || $mode == LP_MODE_UNDEFINED) {
                     continue;
                 }
                 // only save once per day
                 $ilDB->manipulate("DELETE FROM obj_lp_stat WHERE" . " obj_id = " . $ilDB->quote($crs_id, "integer") . " AND fulldate = " . $ilDB->quote(date("Ymd", $this->date), "integer"));
                 $members = new ilCourseParticipants($crs_id);
                 $members = $members->getMembers();
                 $in_progress = count(ilLPStatusWrapper::_lookupInProgressForObject($crs_id, $members));
                 $completed = count(ilLPStatusWrapper::_lookupCompletedForObject($crs_id, $members));
                 $failed = count(ilLPStatusWrapper::_lookupFailedForObject($crs_id, $members));
                 // calculate with other values - there is not direct method
                 $not_attempted = count($members) - $in_progress - $completed - $failed;
                 $set = array("type" => array("text", "crs"), "obj_id" => array("integer", $crs_id), "yyyy" => array("integer", date("Y", $this->date)), "mm" => array("integer", date("m", $this->date)), "dd" => array("integer", date("d", $this->date)), "fulldate" => array("integer", date("Ymd", $this->date)), "mem_cnt" => array("integer", count($members)), "in_progress" => array("integer", $in_progress), "completed" => array("integer", $completed), "failed" => array("integer", $failed), "not_attempted" => array("integer", $not_attempted));
                 $ilDB->insert("obj_lp_stat", $set);
             }
         }
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:34,代码来源:class.ilCronObjectStatisticsCheck.php


示例11: importXmlRepresentation

 /**
  * Import XML
  *
  * @param
  * @return
  */
 function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
 {
     include_once './Modules/Course/classes/class.ilCourseXMLParser.php';
     include_once './Modules/Course/classes/class.ilObjCourse.php';
     if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
         $refs = ilObject::_getAllReferences($new_id);
         $this->course = ilObjectFactory::getInstanceByRefId(end($refs), false);
         #$this->course = ilObjectFactory::getInstanceByObjId($new_id,false);
     } elseif ($new_id = $a_mapping->getMapping('Services/Container', 'refs', 0)) {
         $this->course = ilObjectFactory::getInstanceByRefId($new_id, false);
     } elseif (!$this->course instanceof ilObjCourse) {
         $this->course = new ilObjCourse();
         $this->course->create(true);
     }
     try {
         $parser = new ilCourseXMLParser($this->course);
         $parser->setXMLContent($a_xml);
         $parser->startParsing();
         $a_mapping->addMapping('Modules/Course', 'crs', $a_id, $this->course->getId());
     } catch (ilSaxParserException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     } catch (Exception $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Parsing failed with message, "' . $e->getMessage() . '".');
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:31,代码来源:class.ilCourseImporter.php


示例12: getHTML

 /**
  * 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;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:38,代码来源:class.ilNavigationHistoryGUI.php


示例13: getListByObject

 /**
  * Get list of roles assigned to an object
  * @return 
  * @param object $result
  */
 public static function getListByObject($a_str)
 {
     global $rbacreview, $ilDB;
     include_once './Services/JSON/classes/class.ilJsonUtil.php';
     $result = array();
     if (strpos($a_str, '@') !== 0) {
         return ilJsonUtil::encode($result);
     }
     $a_str = substr($a_str, 1);
     $ilDB->setLimit(100);
     $query = "SELECT ref_id, title FROM object_data ode " . "JOIN object_reference ore ON ode.obj_id = ore.obj_id " . "WHERE " . $ilDB->like('title', 'text', $a_str . '%') . ' ' . 'ORDER BY title';
     $res = $ilDB->query($query);
     $counter = 0;
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         $rolf = $rbacreview->getRoleFolderIdOfObject($row->ref_id);
         if ($rolf) {
             foreach ($rbacreview->getRolesOfRoleFolder($rolf, false) as $rol_id) {
                 $role = ilObject::_lookupTitle($rol_id);
                 $result[$counter] = new stdClass();
                 $result[$counter]->value = $role;
                 $result[$counter]->label = $role . " (" . $row->title . ")";
                 ++$counter;
             }
         }
     }
     return ilJsonUtil::encode($result);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilRoleAutoComplete.php


示例14: fillRow

 /**
  * 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"])));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:10,代码来源:class.ilSysStyleCatAssignmentTableGUI.php


示例15: getXmlExportHeadDependencies

 /**
  * Get head dependencies
  *
  * @param		string		entity
  * @param		string		target release
  * @param		array		ids
  * @return		array		array of array with keys "component", entity", "ids"
  */
 function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
 {
     if ($a_entity == "pg") {
         // get all media objects and files of the page
         include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
         include_once "./Modules/File/classes/class.ilObjFile.php";
         $mob_ids = array();
         $file_ids = array();
         foreach ($a_ids as $pg_id) {
             $pg_id = explode(":", $pg_id);
             // get media objects
             $mids = ilObjMediaObject::_getMobsOfObject($pg_id[0] . ":pg", $pg_id[1]);
             foreach ($mids as $mid) {
                 if (ilObject::_lookupType($mid) == "mob") {
                     $mob_ids[] = $mid;
                 }
             }
             // get files
             $files = ilObjFile::_getFilesOfObject($pg_id[0] . ":pg", $pg_id[1]);
             foreach ($files as $file) {
                 if (ilObject::_lookupType($file) == "file") {
                     $file_ids[] = $file;
                 }
             }
         }
         return array(array("component" => "Services/MediaObjects", "entity" => "mob", "ids" => $mob_ids), array("component" => "Modules/File", "entity" => "file", "ids" => $file_ids));
     }
     return array();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:37,代码来源:class.ilCOPageExporter.php


示例16: getSinglePool

 public function getSinglePool($CourseID, $PoolID)
 {
     global $ilUser, $ilObjDataCache;
     $retval = array();
     $items = ilParticipants::_getMembershipByType($ilUser->getId(), 'crs');
     // $items = ilParticipants::_getMembershipByType(12855, 'crs');
     $itemId = array_search($CourseID, $items);
     if ($itemId !== FALSE && $itemId >= 0) {
         $obj_id = $items[$itemId];
         $item_references = ilObject::_getAllReferences($obj_id);
         reset($item_references);
         if (strcmp($this->iliasVersion, "4.2") === 0) {
             require_once 'Modules/Course/classes/class.ilCourseItems.php';
             foreach ($item_references as $ref_id) {
                 // Antique Ilias
                 $courseItems = new ilCourseItems($ref_id, 0, $ilUser->getId());
                 $courseItemList = $courseItems->getAllItems();
                 $retval = $this->mapItems($courseItemList, $PoolID);
                 $retval = $retval[0];
             }
         } else {
             // Modern Ilias
             $crs = new ilObjCourse($item_references, true);
             $courseItemList = $crs->getSubItems();
             $retval = $this->mapItems($courseItemList["_all"], $PoolID);
             $retval = $retval[0];
         }
     }
     return $retval;
 }
开发者ID:phish108,项目名称:PowerTLA,代码行数:30,代码来源:QTIPoolBroker.class.php


示例17: checkAccess

 /**
  * 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;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:36,代码来源:class.ilLearningProgressAccess.php


示例18: handleEvent

 /**
  * Handle an event in a listener.
  *
  * @param	string	$a_component	component, e.g. "Modules/Forum" or "Services/User"
  * @param	string	$a_event		event e.g. "createUser", "updateUser", "deleteUser", ...
  * @param	array	$a_parameter	parameter array (assoc), array("name" => ..., "phone_office" => ...)
  */
 public static function handleEvent($a_component, $a_event, $a_params)
 {
     $obj_id = $a_params['obj_id'];
     switch ($a_component) {
         case 'Services/Object':
             switch ($a_event) {
                 case 'toTrash':
                     include_once './Services/Object/classes/class.ilObjectLP.php';
                     $olp = ilObjectLP::getInstance($obj_id);
                     $olp->handleToTrash();
                     break;
                 case 'delete':
                     // ilRepUtil will raise "delete" even if only reference was deleted!
                     $all_ref = ilObject::_getAllReferences($obj_id);
                     if (!sizeof($all_ref)) {
                         include_once './Services/Object/classes/class.ilObjectLP.php';
                         $olp = ilObjectLP::getInstance($obj_id);
                         $olp->handleDelete();
                     }
                     break;
             }
             break;
         case 'Services/Tree':
             switch ($a_event) {
                 case 'moveTree':
                     if ($a_params['tree'] == 'tree') {
                         include_once './Services/Object/classes/class.ilObjectLP.php';
                         ilObjectLP::handleMove($a_params['source_id']);
                     }
                     break;
             }
             break;
     }
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:42,代码来源:class.ilTrackingAppEventListener.php


示例19: getItems

 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);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:31,代码来源:class.ilCourseGroupingAssignmentTableGUI.php


示例20: listObjects

 function listObjects()
 {
     global $tpl, $ilToolbar, $lng, $ilCtrl, $objDefinition;
     $objects = ilObject::getAllOwnedRepositoryObjects($this->user_id);
     if (sizeof($objects)) {
         include_once "Services/Form/classes/class.ilSelectInputGUI.php";
         $sel = new ilSelectInputGUI($lng->txt("type"), "type");
         $ilToolbar->addInputItem($sel, true);
         $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "listObjects"));
         $ilToolbar->addFormButton($lng->txt("ok"), "listObjects");
         $options = array();
         foreach (array_keys($objects) as $type) {
             // #11050
             if (!$objDefinition->isPlugin($type)) {
                 $options[$type] = $lng->txt("obj_" . $type);
             } else {
                 include_once "./Services/Component/classes/class.ilPlugin.php";
                 $options[$type] = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type);
             }
         }
         asort($options);
         $sel->setOptions($options);
         $sel_type = (string) $_REQUEST["type"];
         if ($sel_type) {
             $sel->setValue($sel_type);
         } else {
             $sel_type = array_keys($options);
             $sel_type = array_shift($sel_type);
         }
         $ilCtrl->setParameter($this, "type", $sel_type);
     }
     include_once "Services/Object/classes/class.ilObjectOwnershipManagementTableGUI.php";
     $tbl = new ilObjectOwnershipManagementTableGUI($this, "listObjects", $this->user_id, $objects[$sel_type]);
     $tpl->setContent($tbl->getHTML());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:35,代码来源:class.ilObjectOwnershipManagementGUI.php



注:本文中的ilObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ilObjectFactory类代码示例发布时间:2022-05-23
下一篇:
PHP ilObjUser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap