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


PHP ilObject::_getIdsForTitle方法代码示例

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


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

示例1: uninstallCustom

 /**
  * 
  */
 protected function uninstallCustom()
 {
     /**
      * @var $ilDB ilDB
      */
     global $ilDB;
     if ($ilDB->tableExists('rep_robj_xavc_data')) {
         $ilDB->dropTable('rep_robj_xavc_data');
     }
     if ($ilDB->tableExists('rep_robj_xavc_settings')) {
         $ilDB->dropTable('rep_robj_xavc_settings');
     }
     if ($ilDB->tableExists('rep_robj_xavc_users')) {
         $ilDB->dropTable('rep_robj_xavc_users');
     }
     if ($ilDB->tableExists('rep_robj_xavc_members')) {
         $ilDB->dropTable('rep_robj_xavc_members');
     }
     if ($ilDB->tableExists('rep_robj_xavc_gloperm')) {
         $ilDB->dropTable('rep_robj_xavc_gloperm');
     }
     if ($ilDB->sequenceExists('rep_robj_xavc_gloperm')) {
         $ilDB->dropSequence('rep_robj_xavc_gloperm');
     }
     foreach (array('cb_extended', 'cb_simple') as $settings_tpl) {
         $ilDB->manipulateF('DELETE FROM adm_settings_template WHERE type = %s  AND title = %s', array('text', 'text'), array('xavc', $settings_tpl));
     }
     foreach (array('il_xavc_admin', 'il_xavc_member') as $tpl) {
         $obj_ids = ilObject::_getIdsForTitle($tpl, 'rolt');
         foreach ($obj_ids as $obj_id) {
             $obj = ilObjectFactory::getInstanceByObjId($obj_id, false);
             if (!$obj instanceof ilObjRoleTemplate) {
                 continue;
             }
             $obj->delete();
         }
     }
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:41,代码来源:class.ilAdobeConnectPlugin.php

示例2:

 static final function _getIdsForTitle($title, $type = '', $partialmatch = false)
 {
     return parent::_getIdsForTitle($title, $type, $partialmatch);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:4,代码来源:class.ilObject2.php

示例3: mailToRoleObject

 function mailToRoleObject()
 {
     global $rbacreview;
     $obj_ids = ilObject::_getIdsForTitle($this->object->getTitle(), $this->object->getType());
     if (count($obj_ids) > 1) {
         $_SESSION['mail_roles'][] = '#il_role_' . $this->object->getId();
     } else {
         $_SESSION['mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $script = ilMailFormCall::getRedirectTarget($this, 'userassignment', array(), array('type' => 'role'));
     ilUtil::redirect($script);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:13,代码来源:class.ilObjRoleGUI.php

示例4: mailMembersObject

 function mailMembersObject()
 {
     global $rbacreview, $ilErr, $ilAccess, $ilObjDataCache, $ilias;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $this->lng->loadLanguageModule('mail');
     if (!isset($_GET['returned_from_mail'])) {
         ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
     }
     $is_admin = (bool) $ilAccess->checkAccess("write", "", $this->object->getRefId());
     if (!$is_admin && $this->object->getMailToMembersType() != ilCourseConstants::MAIL_ALLOWED_ALL) {
         $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
     }
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     $this->tabs_gui->setSubTabActive('mail_members');
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'membersGallery', array(), array('type' => 'role', 'sig' => $this->createMailSignature())));
     $this->tpl->setVariable("SELECT_ACTION", 'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs=' . $this->object->getId());
     $this->tpl->setVariable("MAIL_SELECTED", $this->lng->txt('send_mail_selected'));
     $this->tpl->setVariable("MAIL_MEMBERS", $this->lng->txt('send_mail_members'));
     $this->tpl->setVariable("MAIL_TUTOR", $this->lng->txt('send_mail_tutors'));
     $this->tpl->setVariable("MAIL_ADMIN", $this->lng->txt('send_mail_admins'));
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.svg'));
     $this->tpl->setVariable("OK", $this->lng->txt('next'));
     // Display roles with user friendly mailbox addresses
     $role_ids = $rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
     // Sort by relevance
     $sorted_role_ids = array();
     $counter = 3;
     foreach ($role_ids as $role_id) {
         switch (substr(ilObject::_lookupTitle($role_id), 0, 8)) {
             case 'il_crs_a':
                 $sorted_role_ids[2] = $role_id;
                 break;
             case 'il_crs_t':
                 $sorted_role_ids[1] = $role_id;
                 break;
             case 'il_crs_m':
                 $sorted_role_ids[0] = $role_id;
                 break;
             default:
                 $sorted_role_ids[$counter++] = $role_id;
                 break;
         }
     }
     ksort($sorted_role_ids, SORT_NUMERIC);
     foreach ((array) $sorted_role_ids as $role_id) {
         $this->tpl->setCurrentBlock("mailbox_row");
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         // check if role title is unique. if not force use pear mail for roles
         $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
         if (count($ids_for_role_title) >= 2) {
             $ilias->setSetting('pear_mail_enable', 1);
         }
         $this->tpl->setVariable("CHECK_MAILBOX", ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail() && substr($role_addr, 0, 4) != '#il_') {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable("MAILBOX", $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable("MAILBOX", ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (" . $role_addr . ")");
         }
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:66,代码来源:class.ilObjCourseGUI.php

示例5: mailMembersObject

 /**
  * Form for mail to group members
  */
 function mailMembersObject()
 {
     global $rbacreview, $ilObjDataCache, $ilias;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $this->lng->loadLanguageModule('mail');
     if (!isset($_GET['returned_from_mail'])) {
         ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'mailMembers', array(), array('type' => 'role', 'sig' => $this->createMailSignature())));
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.png'));
     $this->tpl->setVariable("TXT_MARKED_ENTRIES", $this->lng->txt('marked_entries'));
     $this->tpl->setVariable("OK", $this->lng->txt('next'));
     // Get role mailbox addresses
     $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
     $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
     $role_addrs = array();
     // Sort by relevance
     $sorted_role_ids = array();
     $counter = 2;
     foreach ($role_ids as $role_id) {
         switch (substr(ilObject::_lookupTitle($role_id), 0, 8)) {
             case 'il_grp_a':
                 $sorted_role_ids[1] = $role_id;
                 break;
             case 'il_grp_m':
                 $sorted_role_ids[0] = $role_id;
                 break;
             default:
                 $sorted_role_ids[$counter++] = $role_id;
                 break;
         }
     }
     ksort($sorted_role_ids, SORT_NUMERIC);
     foreach ((array) $sorted_role_ids as $role_id) {
         $this->tpl->setCurrentBlock("mailbox_row");
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         // check if role title is unique. if not force use pear mail for roles
         $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
         if (count($ids_for_role_title) >= 2) {
             $ilias->setSetting('pear_mail_enable', 1);
         }
         $this->tpl->setVariable("CHECK_MAILBOX", ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail()) {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable("MAILBOX", $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable("MAILBOX", ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (" . $role_addr . ")");
         }
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:59,代码来源:class.ilObjGroupGUI.php

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

示例7: getParticipants

 function getParticipants()
 {
     if (count($this->arrFilter)) {
         $filteredParticipants = array();
         $courseids = array();
         $groupids = array();
         global $ilDB;
         if (array_key_exists('group', $this->arrFilter)) {
             $ids = ilObject::_getIdsForTitle($this->arrFilter['group'], 'grp', true);
             $groupids = array_merge($groupids, $ids);
         }
         if (array_key_exists('course', $this->arrFilter)) {
             $ids = ilObject::_getIdsForTitle($this->arrFilter['course'], 'crs', true);
             $courseids = array_merge($courseids, $ids);
         }
         foreach ($this->participants as $active_id => $participant) {
             $remove = FALSE;
             if (array_key_exists('name', $this->arrFilter)) {
                 if (!(strpos(strtolower($participant->getName()), strtolower($this->arrFilter['name'])) !== FALSE)) {
                     $remove = TRUE;
                 }
             }
             if (!$remove) {
                 if (array_key_exists('group', $this->arrFilter)) {
                     include_once "./Services/Membership/classes/class.ilParticipants.php";
                     $groups = ilParticipants::_getMembershipByType($participant->getUserID(), "grp");
                     $foundfilter = FALSE;
                     if (count(array_intersect($groupids, $groups))) {
                         $foundfilter = TRUE;
                     }
                     if (!$foundfilter) {
                         $remove = TRUE;
                     }
                 }
             }
             if (!$remove) {
                 if (array_key_exists('course', $this->arrFilter)) {
                     include_once "./Services/Membership/classes/class.ilParticipants.php";
                     $courses = ilParticipants::_getMembershipByType($participant->getUserID(), "crs");
                     $foundfilter = FALSE;
                     if (count(array_intersect($courseids, $courses))) {
                         $foundfilter = TRUE;
                     }
                     if (!$foundfilter) {
                         $remove = TRUE;
                     }
                 }
             }
             if (!$remove) {
                 if (array_key_exists('active_id', $this->arrFilter)) {
                     if ($active_id != $this->arrFilter['active_id']) {
                         $remove = TRUE;
                     }
                 }
             }
             if (!$remove) {
                 $filteredParticipants[$active_id] = $participant;
             }
         }
         return $filteredParticipants;
     } else {
         return $this->participants;
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:64,代码来源:class.ilTestEvaluationData.php


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