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


PHP ilObjRole::delete方法代码示例

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


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

示例1: restoreObjects

 /**
  * Move objects from trash back to repository
  */
 function restoreObjects($a_cur_ref_id, $a_ref_ids)
 {
     global $rbacsystem, $log, $ilAppEventHandler, $lng, $tree;
     $cur_obj_id = ilObject::_lookupObjId($a_cur_ref_id);
     foreach ($a_ref_ids as $id) {
         $obj_data = ilObjectFactory::getInstanceByRefId($id);
         if (!$rbacsystem->checkAccess('create', $a_cur_ref_id, $obj_data->getType())) {
             $no_create[] = ilObject::_lookupTitle(ilObject::_lookupObjId($id));
         }
     }
     if (count($no_create)) {
         include_once "./Services/Repository/exceptions/class.ilRepositoryException.php";
         throw new ilRepositoryException($lng->txt("msg_no_perm_paste") . " " . implode(',', $no_create));
     }
     $affected_ids = array();
     foreach ($a_ref_ids as $id) {
         $affected_ids[$id] = $id;
         // INSERT AND SET PERMISSIONS
         ilRepUtil::insertSavedNodes($id, $a_cur_ref_id, -(int) $id, $affected_ids);
         // DELETE SAVED TREE
         $saved_tree = new ilTree(-(int) $id);
         $saved_tree->deleteTree($saved_tree->getNodeData($id));
         include_once './Services/Object/classes/class.ilObjectFactory.php';
         $factory = new ilObjectFactory();
         $ref_obj = $factory->getInstanceByRefId($id, FALSE);
         if ($ref_obj instanceof ilObject) {
             $lroles = $GLOBALS['rbacreview']->getRolesOfRoleFolder($id, FALSE);
             foreach ($lroles as $role_id) {
                 include_once './Services/AccessControl/classes/class.ilObjRole.php';
                 $role = new ilObjRole($role_id);
                 $role->setParent($id);
                 $role->delete();
             }
             $parent_ref = $GLOBALS['tree']->getParentId($id);
             if ($parent_ref) {
                 $ref_obj->setPermissions($parent_ref);
             }
         }
         // BEGIN ChangeEvent: Record undelete.
         require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
         global $ilUser;
         ilChangeEvent::_recordWriteEvent(ilObject::_lookupObjId($id), $ilUser->getId(), 'undelete', ilObject::_lookupObjId($tree->getParentId($id)));
         ilChangeEvent::_catchupWriteEvents($cur_obj_id, $ilUser->getId());
         // END PATCH ChangeEvent: Record undelete.
     }
     // send events
     foreach ($affected_ids as $id) {
         // send global event
         $ilAppEventHandler->raise("Services/Object", "undelete", array("obj_id" => ilObject::_lookupObjId($id), "ref_id" => $id));
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:54,代码来源:class.ilRepUtil.php


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