当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObject::_lookupDescription方法代码示例

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


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

示例1: 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

示例2: 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

示例3: parse

 /**
  * Parse Search entries
  *
  * @access public
  * @param array array of search entries
  * 
  */
 public function parse($entries)
 {
     global $rbacreview;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     foreach ($entries as $entry) {
         $tmp_arr['id'] = $entry['obj_id'];
         $tmp_arr['title'] = ilObjRole::_getTranslation(ilObject::_lookupTitle($entry['obj_id']));
         $tmp_arr['description'] = ilObject::_lookupDescription($entry['obj_id']);
         $tmp_arr['context'] = ilObject::_lookupTitle($rbacreview->getObjectOfRole($entry['obj_id']));
         $records_arr[] = $tmp_arr;
     }
     $this->setData($records_arr ? $records_arr : array());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:20,代码来源:class.ilRoleSelectionTableGUI.php

示例4: il2sop

 function il2sop()
 {
     global $ilUser, $ilias;
     $this->setOfflineMode("il2sop");
     header('Content-Type: text/javascript; charset=UTF-8');
     include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
     $ob = new ilObjSAHSLearningModule($this->id);
     $module_version = $ob->getModuleVersion();
     $sahs_user = $this->il2sopSahsUser();
     $support_mail = "";
     //TODO
     $scorm_version = "1.2";
     if ($this->type == "scorm2004") {
         $scorm_version = "2004";
     }
     $tree = "";
     $learning_progress_enabled = 1;
     include_once './Services/Object/classes/class.ilObjectLP.php';
     $olp = ilObjectLP::getInstance($this->obj_id);
     if ($olp->getCurrentMode() == 0) {
         $learning_progress_enabled = 0;
     }
     $certificate_enabled = 0;
     $adlact_data = null;
     $ilias_version = $ilias->getSetting("ilias_version");
     if ($this->type == 'scorm2004') {
         include_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
         $ob2004 = new ilSCORM13Player();
         $init_data = $ob2004->getConfigForPlayer();
         $resources = json_decode($ob2004->getCPDataInit());
         $cmi = $ob2004->getCMIData($ilUser->getID(), $this->obj_id);
         $max_attempt = $ob2004->get_max_attempts();
         $adlact_data = json_decode($ob2004->getADLActDataInit());
         //$globalobj_data = $ob2004->readGObjectiveInit();
     } else {
         include_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMInitData.php";
         $slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
         $init_data = ilObjSCORMInitData::getIliasScormVars($slm_obj);
         $resources = json_decode(ilObjSCORMInitData::getIliasScormResources($this->obj_id));
         $tree = json_decode(ilObjSCORMInitData::getIliasScormTree($this->obj_id));
         $cmi = json_decode(ilObjSCORMInitData::getIliasScormData($this->obj_id));
         $max_attempt = ilObjSCORMInitData::get_max_attempts($this->obj_id);
     }
     if ($max_attempt == null) {
         $max_attempt = 0;
     }
     $result = array('client_data' => array($support_mail), 'user_data' => $this->il2sopUserData(), 'lm' => array(ilObject::_lookupTitle($this->obj_id), ilObject::_lookupDescription($this->obj_id), $scorm_version, 1, $init_data, $resources, $tree, $module_version, "", $learning_progress_enabled, $certificate_enabled, $max_attempt, $adlact_data, $ilias_version), 'sahs_user' => $sahs_user, 'cmi' => $cmi);
     print json_encode($result);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:49,代码来源:class.ilSCORMOfflineMode.php

示例5: setConditions

 /**
  * Set and parse conditions
  * @param array $a_conditions
  */
 public function setConditions($a_conditions)
 {
     foreach ((array) $a_conditions as $condition) {
         if ($condition['trigger_type'] == 'crsg') {
             continue;
         }
         $row['id'] = $condition['condition_id'];
         $row['ref_id'] = $condition['trigger_ref_id'];
         $row['type'] = $condition['trigger_type'];
         $row['title'] = ilObject::_lookupTitle($condition['trigger_obj_id']);
         $row['description'] = ilObject::_lookupDescription($condition['trigger_obj_id']);
         $row['icon'] = ilObject::_getIcon($condition['trigger_obj_id']);
         $row['icon_alt'] = $this->lng->txt('obj_' . $condition['trigger_type']);
         $row['condition'] = $this->lng->txt('condition_' . $condition['operator']);
         $row['obligatory'] = $condition['obligatory'];
         $rows[] = $row;
     }
     $this->setData($rows);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilConditionHandlerTableGUI.php

示例6: apply

 /**
  * Apply action
  */
 public function apply()
 {
     global $rbacreview, $rbacadmin;
     $source = $this->initSourceObject();
     // Check if role folder already exists
     // Create role
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $role = new ilObjRole();
     $role->setTitle(ilObject::_lookupTitle($this->getRoleTemplateId()));
     $role->setDescription(ilObject::_lookupDescription($this->getRoleTemplateId()));
     $role->create();
     $rbacadmin->assignRoleToFolder($role->getId(), $source->getRefId(), "y");
     $GLOBALS['ilLog']->write(__METHOD__ . ': Using rolt: ' . $this->getRoleTemplateId() . ' with title "' . ilObject::_lookupTitle($this->getRoleTemplateId() . '". '));
     // Copy template permissions
     $rbacadmin->copyRoleTemplatePermissions($this->getRoleTemplateId(), ROLE_FOLDER_ID, $source->getRefId(), $role->getId(), true);
     // Set permissions
     $ops = $rbacreview->getOperationsOfRole($role->getId(), $source->getType(), $source->getRefId());
     $rbacadmin->grantPermission($role->getId(), $ops, $source->getRefId());
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:23,代码来源:class.ilDidacticTemplateLocalRoleAction.php

示例7: apply

 /**
  * Apply action
  */
 public function apply()
 {
     global $rbacreview, $rbacadmin;
     $source = $this->initSourceObject();
     // Check if role folder already exists
     $rolf_id = $rbacreview->getRoleFolderIdOfObject($source->getRefId());
     if (!$rolf_id) {
         $source->createRoleFolder();
     }
     $rolf_id = $rbacreview->getRoleFolderIdOfObject($source->getRefId());
     $GLOBALS['ilLog']->write(__METHOD__ . ': Current role folder id is: ' . $rolf_id);
     // Create role
     $rolf = ilObjectFactory::getInstanceByRefId($rolf_id, false);
     $role = $rolf->createRole(ilObject::_lookupTitle($this->getRoleTemplateId()), ilObject::_lookupDescription($this->getRoleTemplateId()));
     $GLOBALS['ilLog']->write(__METHOD__ . ': Using rolt: ' . $this->getRoleTemplateId() . ' with title "' . ilObject::_lookupTitle($this->getRoleTemplateId() . '". '));
     // Copy template permissions
     $rbacadmin->copyRoleTemplatePermissions($this->getRoleTemplateId(), ROLE_FOLDER_ID, $rolf->getRefId(), $role->getId(), true);
     // Set permissions
     $ops = $rbacreview->getOperationsOfRole($role->getId(), $source->getType(), $rolf->getRefId());
     $rbacadmin->grantPermission($role->getId(), $ops, $source->getRefId());
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:25,代码来源:class.ilDidacticTemplateLocalRoleAction.php

示例8: array

 function &getRoleData($ids)
 {
     if (!is_array($ids) || count($ids) == 0) {
         return array();
     }
     $result = array();
     foreach ($ids as $obj_id) {
         $result[$obj_id] = array("obj_id" => $obj_id, "title" => ilObject::_lookupTitle($obj_id), "description" => ilObject::_lookupDescription($obj_id));
     }
     return $result;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:11,代码来源:class.ilObjTest.php

示例9: _getStatusInfo

 function _getStatusInfo($a_obj_id)
 {
     global $tree;
     include_once './Modules/Session/classes/class.ilEventParticipants.php';
     include_once './Modules/Session/classes/class.ilObjSession.php';
     include_once './Modules/Session/classes/class.ilSessionAppointment.php';
     $references = ilObject::_getAllReferences($a_obj_id);
     $ref_id = end($references);
     $course_ref_id = $tree->checkForParentType($ref_id, 'crs');
     $course_obj_id = ilObject::_lookupObjId($course_ref_id);
     $status_info = array();
     $status_info['crs_id'] = $course_obj_id;
     $status_info['registration'] = ilObjSession::_lookupRegistrationEnabled($a_obj_id);
     $status_info['title'] = ilObject::_lookupTitle($a_obj_id);
     $status_info['description'] = ilObject::_lookupDescription($a_obj_id);
     $time_info = ilSessionAppointment::_lookupAppointment($a_obj_id);
     $status_info['starting_time'] = $time_info['start'];
     $status_info['ending_time'] = $time_info['end'];
     $status_info['fullday'] = $time_info['fullday'];
     $status_info['registered_users'] = ilEventParticipants::_getRegistered($a_obj_id);
     $status_info['participated_users'] = ilEventParticipants::_getParticipated($a_obj_id);
     return $status_info;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:23,代码来源:class.ilLPStatusEvent.php

示例10: parseSearchResults

 /**
  * Parse search results
  * @param ilObject[] $a_res
  * @return array
  */
 private function parseSearchResults($a_res)
 {
     foreach ($a_res as $obj_id => $references) {
         $r['title'] = ilObject::_lookupTitle($obj_id);
         $r['desc'] = ilObject::_lookupDescription($obj_id);
         $r['obj_id'] = $obj_id;
         $r['refs'] = $references;
         $rows[] = $r;
     }
     return $rows ? $rows : array();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:16,代码来源:class.ilDataCollectionRecordEditGUI.php

示例11: testSetGetLookup

 public function testSetGetLookup()
 {
     global $ilUser;
     $obj = new ilObject();
     $obj->setType("");
     // otherwise type check will fail
     $obj->setTitle("TestObject");
     $obj->setDescription("TestDescription");
     $obj->setImportId("imp_44");
     $obj->create();
     $obj->createReference();
     $id = $obj->getId();
     $ref_id = $obj->getRefId();
     $obj = new ilObject($id, false);
     if ($obj->getType() == "") {
         $value .= "sg1-";
     }
     if ($obj->getTitle() == "TestObject") {
         $value .= "sg2-";
     }
     if ($obj->getDescription() == "TestDescription") {
         $value .= "sg3-";
     }
     if ($obj->getImportId() == "imp_44") {
         $value .= "sg4-";
     }
     if ($obj->getOwner() == $ilUser->getId()) {
         $value .= "sg5-";
     }
     $obj = new ilObject($ref_id);
     if ($obj->getTitle() == "TestObject") {
         $value .= "sg6-";
     }
     if ($obj->getCreateDate() == ($lu = $obj->getLastUpdateDate())) {
         $value .= "sg7-";
     }
     $obj->setTitle("TestObject2");
     sleep(2);
     // we want a different date here...
     $obj->update();
     $obj = new ilObject($ref_id);
     if ($lu != ($lu2 = $obj->getLastUpdateDate())) {
         $value .= "up1-";
     }
     if ($obj->getTitle() == "TestObject2") {
         $value .= "up2-";
     }
     if ($id == ilObject::_lookupObjIdByImportId("imp_44")) {
         $value .= "lu1-";
     }
     if ($ilUser->getFullname() == ilObject::_lookupOwnerName(ilObject::_lookupOwner($id))) {
         $value .= "lu2-";
     }
     if (ilObject::_lookupTitle($id) == "TestObject2") {
         $value .= "lu3-";
     }
     if (ilObject::_lookupDescription($id) == "TestDescription") {
         $value .= "lu4-";
     }
     if (ilObject::_lookupLastUpdate($id) == $lu2) {
         $value .= "lu5-";
     }
     if (ilObject::_lookupObjId($ref_id) == $id) {
         $value .= "lu6-";
     }
     if (ilObject::_lookupType($id) == "") {
         $value .= "lu7-";
     }
     if (ilObject::_lookupObjectId($ref_id) == $id) {
         $value .= "lu8-";
     }
     $ar = ilObject::_getAllReferences($id);
     if (is_array($ar) && count($ar) == 1 && $ar[$ref_id] == $ref_id) {
         $value .= "lu9-";
     }
     $ids = ilObject::_getIdsForTitle("TestObject2");
     foreach ($ids as $i) {
         if ($i == $id) {
             $value .= "lu10-";
         }
     }
     $obs = ilObject::_getObjectsByType("usr");
     foreach ($obs as $ob) {
         if ($ob["obj_id"] == $ilUser->getId()) {
             $value .= "lu11-";
         }
     }
     $d1 = ilObject::_lookupDeletedDate($ref_id);
     ilObject::_setDeletedDate($ref_id);
     $d2 = ilObject::_lookupDeletedDate($ref_id);
     ilObject::_resetDeletedDate($ref_id);
     $d3 = ilObject::_lookupDeletedDate($ref_id);
     if ($d1 != $d2 && $d1 == $d3 && $d3 == null) {
         $value .= "dd1-";
     }
     $obj->delete();
     $this->assertEquals("sg1-sg2-sg3-sg4-sg5-sg6-sg7-up1-up2-" . "lu1-lu2-lu3-lu4-lu5-lu6-lu7-lu8-lu9-lu10-lu11-dd1-", $value);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:98,代码来源:ilObjectTest.php

示例12: getResultsForPresentation

 public function getResultsForPresentation()
 {
     global $lng;
     $results = array();
     $offset_counter = 0;
     $counter = 0;
     $objects_with_topics = array();
     $objects_with_no_topcis = array();
     foreach ($this->getResults() as $result) {
         if ($this->getMaxHits() * ($this->getResultPageNumber() - 1) > $offset_counter) {
             ++$offset_counter;
             continue;
         }
         $results[] = $result;
         ++$counter;
         if ($counter >= $this->getMaxHits()) {
             break;
         }
     }
     foreach ($this->getTopics() as $oTopic) {
         foreach ($results as $result) {
             $topic_id = ilPaymentObject::_lookupTopicId($result['ref_id']);
             if (!(int) $topic_id && !array_key_exists($result['ref_id'], $objects_with_no_topcis)) {
                 $objects_with_no_topcis[$result['ref_id']] = $result;
                 continue;
             }
             if ((int) $topic_id != $oTopic->getId()) {
                 continue;
             }
             if (!array_key_exists($result['ref_id'], $objects_with_topics)) {
                 $objects_with_topics[$result['ref_id']] = $result;
             }
             switch ($result['type']) {
                 // learning material
                 case "sahs":
                 case "lm":
                 case "dbk":
                 case "htlm":
                     $type = "lres";
                     break;
                 default:
                     $type = $result['type'];
                     break;
             }
             $title = ilObject::_lookupTitle($result['obj_id']);
             $description = ilObject::_lookupDescription($result['obj_id']);
             $subtype = '';
             if ($result['type'] == 'exc') {
                 $check_sub = ilPaymentObject::_checkExcSubtype($result['ref_id']);
                 $subtype = ' (' . $lng->txt($check_sub[0]) . ')';
             }
             $presentation_results[$oTopic->getId()][$type][] = array('ref_id' => $result['ref_id'], 'title' => $title . ' ' . $subtype, 'description' => $description, 'type' => $result['type'], 'obj_id' => $result['obj_id'], 'topic_id' => $topic_id, 'child' => $result['child']);
             $this->addPresentationResult($presentation_results[$oTopic->getId()][$type][count($presentation_results[$oTopic->getId()][$type]) - 1]);
         }
     }
     foreach ($results as $result) {
         if (!array_key_exists($result['ref_id'], $objects_with_topics) && !array_key_exists($result['ref_id'], $objects_with_no_topcis)) {
             $objects_with_no_topcis[$result['ref_id']] = $result;
         }
     }
     foreach ($objects_with_no_topcis as $result) {
         switch ($result['type']) {
             // learning material
             case "sahs":
             case "lm":
             case "dbk":
             case "htlm":
                 $type = "lres";
                 break;
             default:
                 $type = $result['type'];
                 break;
         }
         $title = ilObject::_lookupTitle($result['obj_id']);
         $description = ilObject::_lookupDescription($result['obj_id']);
         $presentation_results[0][$type][] = array('ref_id' => $result['ref_id'], 'title' => $title, 'description' => $description, 'type' => $result['type'], 'obj_id' => $result['obj_id'], 'child' => $result['child']);
         $this->addPresentationResult($presentation_results[0][$type][count($presentation_results[0][$type]) - 1]);
     }
     return $presentation_results ? $presentation_results : array();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:80,代码来源:class.ilShopSearchResult.php

示例13: writeRole

 /**
  * Write xml presentation of one role
  * @param int $a_role_id
  * @param int $a_rolf 
  */
 private function writeRole($a_role_id, $a_rolf)
 {
     global $rbacreview;
     $attributes = array('type' => ilObject::_lookupType($a_role_id), 'id' => 'il_' . IL_INST_ID . '_' . ilObject::_lookupType($a_role_id) . '_' . $a_role_id);
     $this->xmlStartTag('role', $attributes);
     $this->xmlElement('title', array(), ilObject::_lookupTitle($a_role_id));
     $this->xmlElement('description', array(), ilObject::_lookupDescription($a_role_id));
     $this->xmlStartTag('operations');
     foreach ($rbacreview->getAllOperationsOfRole($a_role_id, $a_rolf) as $obj_group => $operations) {
         foreach ($operations as $ops_id) {
             $this->xmlElement('operation', array('group' => $obj_group), trim($this->operations[$ops_id]));
         }
     }
     $this->xmlEndTag('operations');
     $this->xmlEndTag('role');
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:22,代码来源:class.ilRoleXmlExport.php

示例14: initTestForm

 /**
  * Show test config form
  * @return \ilPropertyFormGUI
  */
 protected function initTestForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton('saveTest', $this->lng->txt('save'));
     switch ($this->getTestType()) {
         case self::TEST_TYPE_IT:
             $form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
             break;
         case self::TEST_TYPE_QT:
             $form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
             break;
     }
     $assignable = $this->getAssignableTests();
     $cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'), 'mode');
     $cr_mode->setRequired(true);
     $cr_mode->setValue(self::TEST_NEW);
     $new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'), self::TEST_NEW);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
             break;
     }
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setValue(ilObject::_lookupTitle(ilObject::_lookupObjId($this->getSettings()->getTestByType($this->getTestType()))));
     $ti->setMaxLength(128);
     $ti->setSize(40);
     $ti->setRequired(true);
     $new->addSubItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setValue(ilObject::_lookupDescription(ilObject::_lookupObjId($this->getSettings()->getTestByType($this->getTestType()))));
     $ta->setCols(40);
     $ta->setRows(2);
     $new->addSubItem($ta);
     // Question assignment type
     include_once './Modules/Test/classes/class.ilObjTest.php';
     $this->lng->loadLanguageModule('assessment');
     $qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'), 'qtype');
     $qst->setRequired(true);
     $qst->setValue($this->getSettings()->isRandomTestType($this->getTestType()) ? ilObjTest::QUESTION_SET_TYPE_RANDOM : ilObjTest::QUESTION_SET_TYPE_FIXED);
     $random = new ilRadioOption($this->lng->txt('tst_question_set_type_random'), ilObjTest::QUESTION_SET_TYPE_RANDOM);
     $qst->addOption($random);
     $fixed = new ilRadioOption($this->lng->txt('tst_question_set_type_fixed'), ilObjTest::QUESTION_SET_TYPE_FIXED);
     $qst->addOption($fixed);
     $new->addSubItem($qst);
     $cr_mode->addOption($new);
     // assign existing
     $existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'), self::TEST_ASSIGN);
     switch ($this->getTestType()) {
         case ilLOSettings::TYPE_TEST_INITIAL:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
             break;
         case ilLOSettings::TYPE_TEST_QUALIFIED:
             $existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
             break;
     }
     if (!$assignable) {
         $existing->setDisabled(true);
     }
     $cr_mode->addOption($existing);
     $options = array();
     $options[0] = $this->lng->txt('select_one');
     foreach ((array) $assignable as $tst_ref_id) {
         $tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
         $options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
     }
     $selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'), 'tst');
     $selectable->setRequired(true);
     $selectable->setOptions($options);
     $existing->addSubItem($selectable);
     $form->addItem($cr_mode);
     return $form;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:83,代码来源:class.ilLOEditorGUI.php

示例15: _lookupDesktopItems

 /**
  * get all desktop items of user and specified type
  *
  * note: the implementation of this method is not good style (directly
  * reading tables object_data and object_reference), must be revised someday...
  */
 static function _lookupDesktopItems($user_id, $a_types = "")
 {
     global $ilUser, $rbacsystem, $tree, $ilDB;
     if ($a_types == "") {
         $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type " . " FROM desktop_item it, object_reference oref " . ", object_data obj" . " WHERE " . "it.item_id = oref.ref_id AND " . "oref.obj_id = obj.obj_id AND " . "it.user_id = %s", array("integer"), array($user_id));
         $items = array();
         while ($item_rec = $ilDB->fetchAssoc($item_set)) {
             if ($tree->isInTree($item_rec["ref_id"]) && $item_rec["type"] != "rolf" && $item_rec["type"] != "itgr") {
                 $parent_ref = $tree->getParentId($item_rec["ref_id"]);
                 $par_left = $tree->getLeftValue($parent_ref);
                 $par_left = sprintf("%010d", $par_left);
                 $title = ilObject::_lookupTitle($item_rec["obj_id"]);
                 $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
                 $items[$par_left . $title . $item_rec["ref_id"]] = array("ref_id" => $item_rec["ref_id"], "obj_id" => $item_rec["obj_id"], "type" => $item_rec["type"], "title" => $title, "description" => $desc, "parent_ref" => $parent_ref);
             }
         }
         ksort($items);
     } else {
         // due to bug 11508
         if (!is_array($a_types)) {
             $a_types = array($a_types);
         }
         $items = array();
         $foundsurveys = array();
         foreach ($a_types as $a_type) {
             if ($a_type == "itgr") {
                 continue;
             }
             $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item it, object_reference oref " . ", object_data obj WHERE " . "it.item_id = oref.ref_id AND " . "oref.obj_id = obj.obj_id AND " . "it.type = %s AND " . "it.user_id = %s " . "ORDER BY title", array("text", "integer"), array($a_type, $user_id));
             while ($item_rec = $ilDB->fetchAssoc($item_set)) {
                 $title = ilObject::_lookupTitle($item_rec["obj_id"]);
                 $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
                 $items[$title . $a_type . $item_rec["ref_id"]] = array("ref_id" => $item_rec["ref_id"], "obj_id" => $item_rec["obj_id"], "type" => $a_type, "title" => $title, "description" => $desc);
             }
         }
         ksort($items);
     }
     return $items;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:45,代码来源:class.ilObjUser.php


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