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

PHP ilObjRole类代码示例

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

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



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

示例1: __construct

 public function __construct($parent_obj, $parent_cmd, $role_id, $template_context = "")
 {
     parent::__construct($parent_obj, $parent_cmd, $template_context);
     global $lng, $ilCtrl, $ilTabs;
     /**
      * @var $ilCtrl ilCtrl
      * @var $ilTabs ilTabsGUI
      */
     $this->ctrl = $ilCtrl;
     $this->tabs = $ilTabs;
     $this->lng = $lng;
     $this->setPrefix("sr_other_role_" . $role_id);
     $this->setFormName('sr_other_role_' . $role_id);
     $this->setId("sr_other_role_" . $role_id);
     $this->setRoleId($role_id);
     $this->setTableHeaders();
     $this->setTopCommands(true);
     $this->setEnableHeader(true);
     $this->setShowRowsSelector(true);
     $this->setShowTemplates(false);
     $this->setEnableHeader(true);
     $this->setDefaultOrderField("role");
     $this->setEnableTitle(true);
     $this->setTitle(ilObjRole::_lookupTitle($role_id));
     $this->setRowTemplate("tpl.staff_row.html", "Modules/OrgUnit");
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilOrgUnitOtherRolesTableGUI.php


示例2: initDefaultRoles

 public function initDefaultRoles()
 {
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $role = ilObjRole::createDefaultRole('il_xvit_admin_' . $this->getRefId(), "Admin of vitero obj_no." . $this->getId(), 'il_xvit_admin', $this->getRefId());
     $role = ilObjRole::createDefaultRole('il_xvit_member_' . $this->getRefId(), "Member of vitero obj_no." . $this->getId(), 'il_xvit_member', $this->getRefId());
     parent::initDefaultRoles();
 }
开发者ID:leifos-gmbh,项目名称:Vitero,代码行数:7,代码来源:class.ilObjVitero.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: 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


示例5: start

 function start()
 {
     global $rbacreview;
     if (!is_array($this->roles)) {
         return false;
     }
     $this->__buildHeader();
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
     foreach ($this->roles as $role) {
         // if role type is not empty and does not match, then continue;
         if (!empty($this->role_type) && strcasecmp($this->role_type, $role["role_type"]) != 0) {
             continue;
         }
         if ($rbacreview->isRoleDeleted($role["obj_id"])) {
             continue;
         }
         $attrs = array('role_type' => ucwords($role["role_type"]), 'id' => "il_" . IL_INST_ID . "_role_" . $role["obj_id"]);
         // open tag
         $this->xmlStartTag("Role", $attrs);
         $this->xmlElement('Title', null, $role["title"]);
         $this->xmlElement('Description', null, $role["description"]);
         $this->xmlElement('Translation', null, ilObjRole::_getTranslation($role["title"]));
         if ($ref_id = ilUtil::__extractRefId($role["title"])) {
             $ownerObj = IlObjectFactory::getInstanceByRefId($ref_id, false);
             if (is_object($ownerObj)) {
                 $attrs = array("obj_id" => "il_" . IL_INST_ID . "_" . $ownerObj->getType() . "_" . $ownerObj->getId(), "ref_id" => $ownerObj->getRefId(), "type" => $ownerObj->getType());
                 $this->xmlStartTag('AssignedObject', $attrs);
                 $this->xmlElement('Title', null, $ownerObj->getTitle());
                 $this->xmlElement('Description', null, $ownerObj->getDescription());
                 ilObjectXMLWriter::appendPathToObject($this, $ref_id);
                 $this->xmlEndTag('AssignedObject', $attrs);
             }
         }
         $this->xmlEndTag("Role");
     }
     $this->__buildFooter();
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:39,代码来源:class.ilSoapRoleObjectXMLWriter.php


示例6: __construct

 /**
  * Constructor
  *
  * @access public
  * @param object parent gui object
  * @return void
  */
 public function __construct($a_parent_obj)
 {
     global $lng, $ilCtrl;
     $this->lng = $lng;
     $this->lng->loadLanguageModule('crs');
     $this->ctrl = $ilCtrl;
     $this->container = $a_parent_obj;
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $this->privacy = ilPrivacySettings::_getInstance();
     $this->participants = ilCourseParticipants::_getInstanceByObjId($a_parent_obj->object->getId());
     parent::__construct($a_parent_obj, 'editMembers');
     $this->setFormName('participants');
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->addColumn($this->lng->txt('lastname'), 'lastname', '20%');
     $this->addColumn($this->lng->txt('login'), 'login', '25%');
     if ($this->privacy->enabledCourseAccessTimes()) {
         $this->addColumn($this->lng->txt('last_access'), 'access_time');
     }
     $this->addColumn($this->lng->txt('crs_passed'), 'passed');
     $this->addColumn($this->lng->txt('crs_blocked'), 'blocked');
     $this->addColumn($this->lng->txt('crs_notification'), 'notification');
     $this->addColumn($this->lng->txt('objs_role'), 'roles');
     $this->addCommandButton('updateMembers', $this->lng->txt('save'));
     $this->addCommandButton('members', $this->lng->txt('cancel'));
     $this->setRowTemplate("tpl.edit_participants_row.html", "Modules/Course");
     $this->disable('sort');
     $this->enable('header');
     $this->enable('numinfo');
     $this->disable('select_all');
     // Performance improvement: We read the local course roles
     // only once, instead of reading them for each row in method fillRow().
     $this->localCourseRoles = array();
     foreach ($this->container->object->getLocalCourseRoles(false) as $title => $role_id) {
         $this->localCourseRoles[ilObjRole::_getTranslation($title)] = array('role_id' => $role_id, 'title' => $title);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:43,代码来源:class.ilCourseEditParticipantsTableGUI.php


示例7: addStandardFieldsToForm


//.........这里部分代码省略.........
                         $ilinc_user = new ilObjiLincUser($a_user);
                         if ($ilinc_user->id) {
                             include_once './Modules/ILinc/classes/class.ilnetucateXMLAPI.php';
                             $ilincAPI = new ilnetucateXMLAPI();
                             $ilincAPI->uploadPicture($ilinc_user);
                             $response = $ilincAPI->sendRequest("uploadPicture");
                             // return URL to user's personal page
                             $url = trim($response->data['url']['cdata']);
                             $desc = $lng->txt("ilinc_upload_pic_text") . " " . '<a href="' . $url . '">' . $lng->txt("ilinc_upload_pic_linktext") . '</a>';
                             $ii->setInfo($desc);
                         }
                     }
                     $a_form->addItem($ii);
                 }
                 break;
             case "roles":
                 if (self::$mode == self::MODE_DESKTOP) {
                     if (ilUserProfile::userSettingVisible("roles")) {
                         $global_roles = $rbacreview->getGlobalRoles();
                         foreach ($global_roles as $role_id) {
                             if (in_array($role_id, $rbacreview->assignedRoles($a_user->getId()))) {
                                 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
                                 $role_names .= $roleObj->getTitle() . ", ";
                                 unset($roleObj);
                             }
                         }
                         $dr = new ilNonEditableValueGUI($lng->txt("default_roles"), "ne_dr");
                         $dr->setValue(substr($role_names, 0, -2));
                         $a_form->addItem($dr);
                     }
                 } else {
                     if (self::$mode == self::MODE_REGISTRATION) {
                         if ($registration_settings->roleSelectionEnabled()) {
                             include_once "./Services/AccessControl/classes/class.ilObjRole.php";
                             $options = array();
                             foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
                                 $options[$role["id"]] = $role["title"];
                             }
                             // registration form validation will take care of missing field / value
                             if ($options) {
                                 if (sizeof($options) > 1) {
                                     $ta = new ilSelectInputGUI($lng->txt('default_role'), "usr_" . $f);
                                     $ta->setOptions($options);
                                     $ta->setRequired($ilSetting->get("require_" . $f));
                                     if (!$ta->getRequired()) {
                                         $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                                     }
                                 } else {
                                     $ta = new ilHiddenInputGUI("usr_" . $f);
                                     $ta->setValue(array_shift(array_keys($options)));
                                 }
                                 $a_form->addItem($ta);
                             }
                         }
                     }
                 }
                 break;
             case "email":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $em = new ilEMailInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $em->setValue($a_user->{$m}());
                     }
                     $em->setRequired($ilSetting->get("require_" . $f));
                     if (!$em->getRequired() || $em->getValue()) {
                         $em->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
开发者ID:bheyser,项目名称:qplskl,代码行数:67,代码来源:class.ilUserProfile.php


示例8: getAvailableRolesTableData

 /**
  * Available Roles Table Data
  * @return array
  */
 function getAvailableRolesTableData()
 {
     global $tree;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $path = array_reverse($tree->getPathId($this->object->getRefId()));
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $counter = 0;
     foreach ($this->valid_roles as $role) {
         $result_set[$counter]["img"] = in_array($role['obj_id'], $this->user_roles) ? self::IMG_OK : self::IMG_NOT_OK;
         $result_set[$counter]["role"] = str_replace(" ", "&nbsp;", ilObjRole::_getTranslation($role["title"]));
         if ($role['role_type'] != "linked") {
             $result_set[$counter]["effective_from"] = "";
         } else {
             $rolfs = $this->rbacreview->getFoldersAssignedToRole($role["obj_id"]);
             // ok, try to match the next rolf in path
             foreach ($path as $node) {
                 if ($node == 1) {
                     break;
                 }
                 if (in_array($node, $rolfs)) {
                     $nodedata = $tree->getNodeData($node);
                     $result_set[$counter]["effective_from"] = $nodedata["title"];
                     $result_set[$counter]["effective_from_ref_id"] = $node;
                     break;
                 }
             }
         }
         if (in_array($role['obj_id'], $this->global_roles)) {
             $result_set[$counter]["original_position"] = $this->lng->txt("global");
             $result_set[$counter]["original_position_ref_id"] = false;
         } else {
             $rolf = $this->rbacreview->getFoldersAssignedToRole($role["obj_id"], true);
             $parent_node = $tree->getNodeData($rolf[0]);
             $result_set[$counter]["original_position"] = $parent_node["title"];
             $result_set[$counter]["original_position_ref_id"] = $parent_node["ref_id"];
         }
         ++$counter;
     }
     return $result_set;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:44,代码来源:class.ilObjectPermissionStatusGUI.php


示例9: getRoleObject

 /**
  * Returns the parent object of the role folder object which contains the specified role.
  */
 function getRoleObject($a_role_id)
 {
     if (array_key_exists($a_role_id, $this->localRoleCache)) {
         return $this->localRoleCache[$a_role_id];
     } else {
         $role_obj = new ilObjRole($a_role_id, false);
         $role_obj->read();
         $this->localRoleCache[$a_role_id] = $role_obj;
         return $role_obj;
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:14,代码来源:class.ilUserImportParser.php


示例10: initDefaultRoles

 public function initDefaultRoles()
 {
     /**
      * @var $rbacadmin  ilRbacAdmin
      * @var $rbacreview ilRbacReview
      */
     global $rbacadmin, $rbacreview;
     include_once 'class.ilObjAdobeConnectAccess.php';
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     ilObjAdobeConnectAccess::getLocalAdminRoleTemplateId();
     ilObjAdobeConnectAccess::getLocalMemberRoleTemplateId();
     $admin_role = ilObjRole::createDefaultRole('il_xavc_admin_' . $this->getRefId(), 'Admin of Adobe Connect object with obj_no.' . $this->getId(), 'il_xavc_admin', $this->getRefId());
     $member_role = ilObjRole::createDefaultRole('il_xavc_member_' . $this->getRefId(), 'Member of Adobe Connect object with obj_no.' . $this->getId(), 'il_xavc_member', $this->getRefId());
     $ops = $rbacreview->getOperationsOfRole($member_role->getId(), 'xavc', $this->getRefId());
     // Set view permission for users
     $rbacadmin->grantPermission(self::RBAC_DEFAULT_ROLE_ID, $ops, $this->getRefId());
     // Set view permission for guests
     $rbacadmin->grantPermission(self::RBAC_GUEST_ROLE_ID, array(2), $this->getRefId());
     $roles = array($admin_role->getId(), $member_role->getId());
     return $roles ? $roles : array();
 }
开发者ID:KamuiXenom,项目名称:ILIAS_AdobeConnectPlugin,代码行数:21,代码来源:class.ilObjAdobeConnect.php


示例11: importUsersObject

 /**
  * import users
  */
 function importUsersObject()
 {
     global $rbacreview, $ilUser;
     // Blind out tabs for local user import
     if ($_GET["baseClass"] == 'ilRepositoryGUI') {
         $this->tabs_gui->clearTargets();
     }
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     include_once './Services/User/classes/class.ilUserImportParser.php';
     global $rbacreview, $rbacsystem, $tree, $lng;
     switch ($_POST["conflict_handling_choice"]) {
         case "update_on_conflict":
             $rule = IL_UPDATE_ON_CONFLICT;
             break;
         case "ignore_on_conflict":
         default:
             $rule = IL_IGNORE_ON_CONFLICT;
             break;
     }
     $importParser = new ilUserImportParser($_POST["xml_file"], IL_USER_IMPORT, $rule);
     $importParser->setFolderId($this->getUserOwnerId());
     $import_dir = $this->getImportDir();
     // Catch hack attempts
     // We check here again, if the role folders are in the tree, and if the
     // user has permission on the roles.
     if ($_POST["role_assign"]) {
         $global_roles = $rbacreview->getGlobalRoles();
         $roles_of_user = $rbacreview->assignedRoles($ilUser->getId());
         foreach ($_POST["role_assign"] as $role_id) {
             if ($role_id != "") {
                 if (in_array($role_id, $global_roles)) {
                     if (!in_array(SYSTEM_ROLE_ID, $roles_of_user)) {
                         if ($role_id == SYSTEM_ROLE_ID && !in_array(SYSTEM_ROLE_ID, $roles_of_user) || $this->object->getRefId() != USER_FOLDER_ID && !ilObjRole::_getAssignUsersStatus($role_id)) {
                             ilUtil::delDir($import_dir);
                             $this->ilias->raiseError($this->lng->txt("usrimport_with_specified_role_not_permitted"), $this->ilias->error_obj->MESSAGE);
                         }
                     }
                 } else {
                     $rolf = $rbacreview->getFoldersAssignedToRole($role_id, true);
                     if ($rbacreview->isDeleted($rolf[0]) || !$rbacsystem->checkAccess('write', $tree->getParentId($rolf[0]))) {
                         ilUtil::delDir($import_dir);
                         $this->ilias->raiseError($this->lng->txt("usrimport_with_specified_role_not_permitted"), $this->ilias->error_obj->MESSAGE);
                         return;
                     }
                 }
             }
         }
     }
     $importParser->setRoleAssignment($_POST["role_assign"]);
     $importParser->startParsing();
     // purge user import directory
     ilUtil::delDir($import_dir);
     switch ($importParser->getErrorLevel()) {
         case IL_IMPORT_SUCCESS:
             ilUtil::sendSuccess($this->lng->txt("user_imported"), true);
             break;
         case IL_IMPORT_WARNING:
             ilUtil::sendInfo($this->lng->txt("user_imported_with_warnings") . $importParser->getProtocolAsHTML($lng->txt("import_warning_log")), true);
             break;
         case IL_IMPORT_FAILURE:
             $this->ilias->raiseError($this->lng->txt("user_import_failed") . $importParser->getProtocolAsHTML($lng->txt("import_failure_log")), $this->ilias->error_obj->MESSAGE);
             break;
     }
     if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
         $this->ctrl->redirect($this, "view");
         //ilUtil::redirect($this->ctrl->getLinkTarget($this));
     } else {
         $this->ctrl->redirectByClass('ilobjcategorygui', 'listUsers');
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:73,代码来源:class.ilObjUserFolderGUI.php


示例12: createRole

 /**
  * creates a local role in current rolefolder (this object)
  * 
  * @access	public
  * @param	string	title
  * @param	string	description
  * @return	object	role object
  */
 function createRole($a_title, $a_desc, $a_import_id = 0)
 {
     global $rbacadmin, $rbacreview;
     include_once "./Services/AccessControl/classes/class.ilObjRole.php";
     $roleObj = new ilObjRole();
     $roleObj->setTitle($a_title);
     $roleObj->setDescription($a_desc);
     //echo "aaa-1-";
     if ($a_import_id != "") {
         //echo "aaa-2-".$a_import_id."-";
         $roleObj->setImportId($a_import_id);
     }
     $roleObj->create();
     // ...and put the role into local role folder...
     $rbacadmin->assignRoleToFolder($roleObj->getId(), $this->getRefId(), "y");
     return $roleObj;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:25,代码来源:class.ilObjRoleFolder.php


示例13: adoptPermObject

 protected function adoptPermObject()
 {
     global $rbacreview;
     $output = array();
     $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id, true);
     $ids = array();
     foreach ($parent_role_ids as $id => $tmp) {
         $ids[] = $id;
     }
     // Sort ids
     $sorted_ids = ilUtil::_sortIds($ids, 'object_data', 'type,title', 'obj_id');
     $key = 0;
     foreach ($sorted_ids as $id) {
         $par = $parent_role_ids[$id];
         if ($par["obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par["obj_id"]) {
             $radio = ilUtil::formRadioButton(0, "adopt", $par["obj_id"]);
             $output["adopt"][$key]["css_row_adopt"] = $key % 2 == 0 ? "tblrow1" : "tblrow2";
             $output["adopt"][$key]["check_adopt"] = $radio;
             $output["adopt"][$key]["role_id"] = $par["obj_id"];
             $output["adopt"][$key]["type"] = $par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt');
             $output["adopt"][$key]["role_name"] = ilObjRole::_getTranslation($par["title"]);
             $output["adopt"][$key]["role_desc"] = $par["desc"];
             $key++;
         }
     }
     $output["formaction_adopt"] = $this->ctrl->getFormAction($this);
     $output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
     $tpl = new ilTemplate("tpl.adm_copy_role.html", true, true, "Services/AccessControl");
     $tpl->setCurrentBlock("ADOPT_PERM_ROW");
     foreach ($output["adopt"] as $key => $value) {
         $tpl->setVariable("CSS_ROW_ADOPT", $value["css_row_adopt"]);
         $tpl->setVariable("CHECK_ADOPT", $value["check_adopt"]);
         $tpl->setVariable("LABEL_ID", $value["role_id"]);
         $tpl->setVariable("TYPE", $value["type"]);
         $tpl->setVariable("ROLE_NAME", $value["role_name"]);
         if (strlen($value['role_desc'])) {
             $tpl->setVariable('ROLE_DESC', $value['role_desc']);
         }
         $tpl->parseCurrentBlock();
     }
     $tpl->setVariable("TPLPATH", $this->tpl->tplPath);
     $tpl->setVariable("MESSAGE_MIDDLE", $output["message_middle"]);
     $tpl->setVariable("FORMACTION_ADOPT", $output["formaction_adopt"]);
     $tpl->setVariable("ADOPT", $this->lng->txt('copy'));
     $tpl->setVariable("CANCEL", $this->lng->txt('cancel'));
     $tpl->setVariable('HEAD_ROLE', $this->lng->txt('title'));
     $tpl->setVariable('HEAD_TYPE', $this->lng->txt('type'));
     $this->tpl->setContent($tpl->get());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:49,代码来源:class.ilObjRoleGUI.php


示例14: createTitle

 /**
  * Create (linked) title
  * @param array $role
  * @return 
  */
 protected function createTitle($role)
 {
     global $ilCtrl;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $role['title'] = ilObjRole::_getTranslation($role['title']);
     // No local policies
     if ($role['parent'] != $this->getRefId()) {
         return $role['title'];
     }
     $ilCtrl->setParameterByClass('ilobjrolegui', 'obj_id', $role['obj_id']);
     return '<a class="tblheader" href="' . $ilCtrl->getLinkTargetByClass('ilobjrolegui', '') . '" >' . $role['title'] . '</a>';
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:17,代码来源:class.ilObjectRolePermissionTableGUI.php


示例15: permObject


//.........这里部分代码省略.........
             if ($par["obj_id"] != SYSTEM_ROLE_ID) {
                 $radio = ilUtil::formRadioButton(0, "adopt", $par["obj_id"]);
                 $output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
                 $output["adopt"][$key]["check_adopt"] = $radio;
                 $output["adopt"][$key]["type"] = $par["type"] == 'role' ? 'Role' : 'Template';
                 $output["adopt"][$key]["role_name"] = $par["title"];
             }
         }
         $output["formaction_adopt"] = $this->ctrl->getFormAction($this);
         // END ADOPT_PERMISSIONS
     }
     $output["formaction"] = $this->ctrl->getFormAction($this);
     $this->data = $output;
     /************************************/
     /*			generate output			*/
     /************************************/
     $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
     $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_perm_role.html", "Services/AccessControl");
     foreach ($rbac_objects as $obj_data) {
         // BEGIN object_operations
         $this->tpl->setCurrentBlock("object_operations");
         foreach ($obj_data["ops"] as $operation) {
             $ops_ids[] = $operation["ops_id"];
             $css_row = ilUtil::switchColor($key, "tblrow1", "tblrow2");
             $this->tpl->setVariable("CSS_ROW", $css_row);
             $this->tpl->setVariable("PERMISSION", $operation["name"]);
             $this->tpl->setVariable("CHECK_PERMISSION", $this->data["perm"][$obj_data["obj_id"]][$operation["ops_id"]]);
             $this->tpl->parseCurrentBlock();
         }
         // END object_operations
         // BEGIN object_type
         $this->tpl->setCurrentBlock("object_type");
         $this->tpl->setVariable("TXT_OBJ_TYPE", $obj_data["name"]);
         // TODO: move this if in a function and query all objects that may be disabled or inactive
         if ($this->objDefinition->getDevMode($obj_data["type"])) {
             $this->tpl->setVariable("TXT_NOT_IMPL", "(" . $this->lng->txt("not_implemented_yet") . ")");
         } else {
             if ($obj_data["type"] == "icrs" and !$this->ilias->getSetting("ilinc_active")) {
                 $this->tpl->setVariable("TXT_NOT_IMPL", "(" . $this->lng->txt("not_enabled_or_configured") . ")");
             }
         }
         // js checkbox toggles
         $this->tpl->setVariable("JS_VARNAME", "template_perm_" . $obj_data["type"]);
         $this->tpl->setVariable("JS_ONCLICK", ilUtil::array_php2js($ops_ids));
         $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
         $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
         $this->tpl->parseCurrentBlock();
         // END object_type
     }
     /* 
     // BEGIN ADOPT PERMISSIONS
     foreach ($this->data["adopt"] as $key => $value)
     {			
     	$this->tpl->setCurrentBlock("ADOPT_PERM_ROW");
     	$this->tpl->setVariable("CSS_ROW_ADOPT",$value["css_row_adopt"]);
     	$this->tpl->setVariable("CHECK_ADOPT",$value["check_adopt"]);
     	$this->tpl->setVariable("TYPE",$value["type"]);
     	$this->tpl->setVariable("ROLE_NAME",$value["role_name"]);
     	$this->tpl->parseCurrentBlock();
     }
     
     $this->tpl->setCurrentBlock("ADOPT_PERM_FORM");
     $this->tpl->setVariable("MESSAGE_MIDDLE",$this->data["message_middle"]);
     $this->tpl->setVariable("FORMACTION_ADOPT",$this->data["formaction_adopt"]);
     $this->tpl->setVariable("ADOPT",$this->lng->txt('copy'));
     $this->tpl->parseCurrentBlock();
     // END ADOPT PERMISSIONS 		
     */
     $this->tpl->setCurrentBlock("tblfooter_protected");
     $this->tpl->setVariable("COL_ANZ", 3);
     $this->tpl->setVariable("CHECK_BOTTOM", $this->data["check_protected"]);
     $this->tpl->setVariable("MESSAGE_TABLE", $this->data["text_protected"]);
     $this->tpl->parseCurrentBlock();
     $this->tpl->setVariable("COL_ANZ_PLUS", 4);
     $this->tpl->setVariable("TXT_SAVE", $this->data["txt_save"]);
     $this->tpl->setCurrentBlock("adm_content");
     $this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath("icon_" . $this->object->getType() . ".png"));
     $this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->lng->txt($this->object->getType()));
     $this->tpl->setVariable("TBL_HELP_IMG", ilUtil::getImagePath("icon_help.png"));
     $this->tpl->setVariable("TBL_HELP_LINK", "tbl_help.php");
     $this->tpl->setVariable("TBL_HELP_IMG_ALT", $this->lng->txt("help"));
     // compute additional information in title
     if (substr($this->object->getTitle(), 0, 3) == "il_") {
         $desc = $this->lng->txt("predefined_template");
         //$this->lng->txt("obj_".$parent_node['type'])." (".$parent_node['obj_id'].") : ".$parent_node['title'];
     }
     $description = "<br/>&nbsp;<span class=\"small\">" . $desc . "</span>";
     // translation for autogenerated roles
     if (substr($this->object->getTitle(), 0, 3) == "il_") {
         include_once './Services/AccessControl/classes/class.ilObjRole.php';
         $title = ilObjRole::_getTranslation($this->object->getTitle()) . " (" . $this->object->getTitle() . ")";
     } else {
         $title = $this->object->getTitle();
     }
     $this->tpl->setVariable("TBL_TITLE", $title . $description);
     $this->tpl->setVariable("TXT_PERMISSION", $this->data["txt_permission"]);
     $this->tpl->setVariable("FORMACTION", $this->data["formaction"]);
     $this->tpl->parseCurrentBlock();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjRoleTemplateGUI.php


示例16: getProfileAsString

 /**
  * Get formatted mail body text of user profile data.
  *
  * @param	object	  Language object (choose user language of recipient) or null to use language of current user
  */
 function getProfileAsString(&$a_language)
 {
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     include_once './Services/Utilities/classes/class.ilFormat.php';
     global $lng, $rbacreview;
     $language =& $a_language;
     $language->loadLanguageModule('registration');
     $language->loadLanguageModule('crs');
     $body = '';
     $body .= $language->txt("login") . ": " . $this->getLogin() . "\n";
     if (strlen($this->getUTitle())) {
         $body .= $language->txt("title") . ": " . $this->getUTitle() . "\n";
     }
     if (strlen($this->getGender())) {
         $gender = $this->getGender() == 'm' ? $language->txt('gender_m') : $language->txt('gender_f');
         $body .= $language->txt("gender") . ": " . $gender . "\n";
     }
     if (strlen($this->getFirstname())) {
         $body .= $language->txt("firstname") . ": " . $this->getFirstname() . "\n";
     }
     if (strlen($this->getLastname())) {
         $body .= $language->txt("lastname") . ": " . $this->getLastname() . "\n";
     }
     if (strlen($this->getInstitution())) {
         $body .= $language->txt("institution") . ": " . $this->getInstitution() . "\n";
     }
     if (strlen($this->getDepartment())) {
         $body .= $language->txt("department") . ": " . $this->getDepartment() . "\n";
     }
     if (strlen($this->getStreet())) {
         $body .= $language->txt("street") . ": " . $this->getStreet() . "\n";
     }
     if (strlen($this->getCity())) {
         $body .= $language->txt("city") . ": " . $this->getCity() . "\n";
     }
     if (strlen($this->getZipcode())) {
         $body .= $language->txt("zipcode") . ": " . $this->getZipcode() . "\n";
     }
     if (strlen($this->getCountry())) {
         $body .= $language->txt("country") . ": " . $this->getCountry() . "\n";
     }
     if (strlen($this->getSelectedCountry())) {
         $body .= $language->txt("sel_country") . ": " . $this->getSelectedCountry() . "\n";
     }
     if (strlen($this->getPhoneOffice())) {
         $body .= $language->txt("phone_office") . ": " . $this->getPhoneOffice() . "\n";
     }
     if (strlen($this->getPhoneHome())) {
         $body .= $language->txt("phone_home") . ": " . $this->getPhoneHome() . "\n";
     }
     if (strlen($this->getPhoneMobile())) {
         $body .= $language->txt("phone_mobile") . ": " . $this->getPhoneMobile() . "\n";
     }
     if (strlen($this->getFax())) {
         $body .= $language->txt("fax") . ": " . $this->getFax() . "\n";
     }
     if (strlen($this->getEmail())) {
         $body .= $language->txt("email") . ": " . $this->getEmail() . "\n";
     }
     if (strlen($this->getHobby())) {
         $body .= $language->txt("hobby") . ": " . $this->getHobby() . "\n";
     }
     if (strlen($this->getComment())) {
         $body .= $language->txt("referral_comment") . ": " . $this->getComment() . "\n";
     }
     if (strlen($this->getMatriculation())) {
         $body .= $language->txt("matriculation") . ": " . $this->getMatriculation() . "\n";
     }
     if (strlen($this->getCreateDate())) {
         ilDatePresentation::setUseRelativeDates(false);
         ilDatePresentation::setLanguage($language);
         $date = ilDatePresentation::formatDate(new ilDateTime($this->getCreateDate(), IL_CAL_DATETIME));
         ilDatePresentation::resetToDefaults();
         $body .= $language->txt("create_date") . ": " . $date . "\n";
     }
     foreach ($rbacreview->getGlobalRoles() as $role) {
         if ($rbacreview->isAssigned($this->getId(), $role)) {
             $gr[] = ilObjRole::_lookupTitle($role);
         }
     }
     if (count($gr)) {
         $body .= $language->txt('reg_role_info') . ': ' . implode(',', $gr) . "\n";
     }
     // Time limit
     if ($this->getTimeLimitUnlimited()) {
         $body .= $language->txt('time_limit') . ": " . $language->txt('crs_unlimited') . "\n";
     } else {
         ilDatePresentation::setUseRelativeDates(false);
         ilDatePresentation::setLanguage($language);
         $period = ilDatePresentation::formatPeriod(new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX), new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX));
         ilDatePresentation::resetToDefaults();
         $start = new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX);
         $end = new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX);
         $body .= $language->txt('time_limit') . ': ' . $start->get(IL_CAL_DATETIME);
         $body .= $language->txt('time_limit') . ': ' . $end->get(IL_CAL_DATETIME);
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilObjUser.php


示例17: getPresentationTitle

 /**
  * return translated title for autogenerated roles
  * @return 
  */
 public function getPresentationTitle()
 {
     return ilObjRole::_getTranslation($this->getTitle());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:8,代码来源:class.ilObjRole.php


示例18: initRoleForm

 /**
  * Shoew add role
  * @global type $rbacreview
  * @global type $objDefinition
  * @return ilPropertyFormGUI 
  */
 protected function initRoleForm()
 {
     global $rbacreview, $objDefinition;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('role_new'));
     $form->addCommandButton('addrole', $this->lng->txt('role_new'));
     $form->addCommandButton('perm', $this->lng->txt('cancel'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setValidationRegexp('/^(?!il_).*$/');
     $title->setValidationFailureMessage($this->lng->txt('msg_role_reserved_prefix'));
     $title->setSize(40);
     $title->setMaxLength(70);
     $title->setRequired(true);
     $form->addItem($title);
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setCols(40);
     $desc->setRows(3);
     $form->addItem($desc);
     $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'pro');
     $pro->setInfo($this->lng->txt('role_protect_permissions_desc'));
     $pro->setValue(1);
     $form->addItem($pro);
     $pd = new ilCheckboxInputGUI($this->lng->txt('rbac_role_add_to_desktop'), 'desktop');
     $pd->setInfo($this->lng->txt('rbac_role_add_to_desktop_info'));
     $pd->setValue(1);
     $form->addItem($pd);
     if ( 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ilObjStyleSheet类代码示例发布时间:2022-05-23
下一篇:
PHP ilObjMediaObject类代码示例发布时间: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