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


PHP ilPlugin::lookupTxt方法代码示例

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


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

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

示例2: fillRow

 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $objDefinition;
     $img = ilObject::_getIcon($obj_id, "small", $a_set["type"]);
     if (is_file($img)) {
         $alt = $objDefinition->isPlugin($a_set["type"]) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $a_set["type"], "obj_" . $a_set["type"]) : $lng->txt("icon") . " " . $lng->txt("obj_" . $a_set["type"]);
         $this->tpl->setVariable("IMG_TYPE", ilUtil::img($img, $alt));
     }
     $this->tpl->setVariable("ID", $a_set["ref_id"]);
     $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
     $this->tpl->setVariable("VAL_LAST_CHANGE", $a_set["last_update"]);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:15,代码来源:class.ilTrashTableGUI.php

示例3: showDeleteConfirmation

 /**
  * Show delete confirmation table
  */
 function showDeleteConfirmation($a_ids, $a_supress_message = false)
 {
     global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition;
     if (!is_array($a_ids) || count($a_ids) == 0) {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
         return false;
     }
     // Remove duplicate entries
     $a_ids = array_unique((array) $a_ids);
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     $cgui = new ilConfirmationGUI();
     if (!$a_supress_message) {
         $msg = $lng->txt("info_delete_sure");
         if (!$ilSetting->get('enable_trash')) {
             $msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash");
         }
         $cgui->setHeaderText($msg);
     }
     $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
     $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
     $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
     $form_name = "cgui_" . md5(uniqid());
     $cgui->setFormName($form_name);
     $deps = array();
     foreach ($a_ids as $ref_id) {
         $obj_id = ilObject::_lookupObjId($ref_id);
         $type = ilObject::_lookupType($obj_id);
         $title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id);
         $alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
         $title .= $this->handleMultiReferences($obj_id, $ref_id, $form_name);
         $cgui->addItem("id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
         ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type);
     }
     $deps_html = "";
     if (is_array($deps) && count($deps) > 0) {
         include_once "./Services/Repository/classes/class.ilRepDependenciesTableGUI.php";
         $tab = new ilRepDependenciesTableGUI($deps);
         $deps_html = "<br/><br/>" . $tab->getHTML();
     }
     $tpl->setContent($cgui->getHTML() . $deps_html);
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:45,代码来源:class.ilRepUtilGUI.php

示例4: fillRow

 public function fillRow($row)
 {
     global $lng, $objDefinition;
     // #11050
     if (!$objDefinition->isPlugin($row["type"])) {
         $txt_type = $lng->txt("obj_" . $row["type"]);
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $txt_type = ilPlugin::lookupTxt("rep_robj", $row["type"], "obj_" . $row["type"]);
     }
     $this->tpl->setVariable("TITLE", $row["title"]);
     $this->tpl->setVariable("ALT_ICON", $txt_type);
     $this->tpl->setVariable("SRC_ICON", ilObject::_getIcon("", "tiny", $row["type"]));
     $this->tpl->setVariable("PATH", $row["path"]);
     if ($row["readable"]) {
         $this->tpl->setCurrentBlock("actions");
         $this->tpl->setVariable("ACTIONS", $this->buildActions($row["ref_id"], $row["type"]));
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:20,代码来源:class.ilObjectOwnershipManagementTableGUI.php

示例5: _prepareCloneSelection

 /**
  * Prepare copy wizard object selection 
  *
  * @access public
  * @static
  *
  * @param array int array of ref ids
  */
 public static function _prepareCloneSelection($a_ref_ids, $new_type, $show_path = true)
 {
     global $ilDB, $lng, $objDefinition;
     $query = "SELECT obj_data.title obj_title,path_data.title path_title,child FROM tree " . "JOIN object_reference obj_ref ON child = obj_ref.ref_id " . "JOIN object_data obj_data ON obj_ref.obj_id = obj_data.obj_id " . "JOIN object_reference path_ref ON parent = path_ref.ref_id " . "JOIN object_data path_data ON path_ref.obj_id = path_data.obj_id " . "WHERE " . $ilDB->in("child", $a_ref_ids, false, "integer") . " " . "ORDER BY obj_data.title ";
     $res = $ilDB->query($query);
     if (!$objDefinition->isPlugin($new_type)) {
         $options[0] = $lng->txt('obj_' . $new_type . '_select');
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $options[0] = ilPlugin::lookupTxt("rep_robj", $new_type, "obj_" . $new_type . "_select");
     }
     while ($row = $ilDB->fetchObject($res)) {
         if (strlen($title = $row->obj_title) > 40) {
             $title = substr($title, 0, 40) . '...';
         }
         if ($show_path) {
             if (strlen($path = $row->path_title) > 40) {
                 $path = substr($path, 0, 40) . '...';
             }
             $title .= ' (' . $lng->txt('path') . ': ' . $path . ')';
         }
         $options[$row->child] = $title;
     }
     return $options ? $options : array();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:33,代码来源:class.ilObject.php

示例6: permObject

 /**
  * Show template permissions
  * @return void
  */
 protected function permObject($a_show_admin_permissions = false)
 {
     global $ilTabs, $ilErr, $ilToolbar, $objDefinition, $rbacreview;
     $ilTabs->setTabActive('default_perm_settings');
     $this->setSubTabs('default_perm_settings');
     if ($a_show_admin_permissions) {
         $ilTabs->setSubTabActive('rbac_admin_permissions');
     } else {
         $ilTabs->setSubTabActive('rbac_repository_permissions');
     }
     if (!$this->checkAccess('write', 'edit_permission')) {
         $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->MESSAGE);
         return true;
     }
     // Show copy role button
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     $ilToolbar->addButton($this->lng->txt("adopt_perm_from_template"), $this->ctrl->getLinkTarget($this, 'adoptPerm'));
     if ($rbacreview->isDeleteable($this->object->getId(), $this->rolf_ref_id)) {
         $ilToolbar->addButton($this->lng->txt('rbac_delete_role'), $this->ctrl->getLinkTarget($this, 'confirmDeleteRole'));
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rbac_template_permissions.html', 'Services/AccessControl');
     $this->tpl->setVariable('PERM_ACTION', $this->ctrl->getFormAction($this));
     include_once './Services/Accordion/classes/class.ilAccordionGUI.php';
     $acc = new ilAccordionGUI();
     $acc->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
     $acc->setId('template_perm_' . $this->getParentRefId());
     if ($this->rolf_ref_id == ROLE_FOLDER_ID) {
         if ($a_show_admin_permissions) {
             $subs = $objDefinition->getSubObjectsRecursively('adm', true, true);
         } else {
             $subs = $objDefinition->getSubObjectsRecursively('root', true, $a_show_admin_permissions);
         }
     } else {
         $subs = $objDefinition->getSubObjectsRecursively($this->getParentType(), true, $a_show_admin_permissions);
     }
     $sorted = array();
     foreach ($subs as $subtype => $def) {
         if ($objDefinition->isPlugin($subtype)) {
             $translation = ilPlugin::lookupTxt("rep_robj", $subtype, "obj_" . $subtype);
         } elseif ($objDefinition->isSystemObject($subtype)) {
             $translation = $this->lng->txt("obj_" . $subtype);
         } else {
             $translation = $this->lng->txt('objs_' . $subtype);
         }
         $sorted[$subtype] = $def;
         $sorted[$subtype]['translation'] = $translation;
     }
     $sorted = ilUtil::sortArray($sorted, 'translation', 'asc', true, true);
     foreach ($sorted as $subtype => $def) {
         if ($objDefinition->isPlugin($subtype)) {
             $translation = ilPlugin::lookupTxt("rep_robj", $subtype, "obj_" . $subtype);
         } elseif ($objDefinition->isSystemObject($subtype)) {
             $translation = $this->lng->txt("obj_" . $subtype);
         } else {
             $translation = $this->lng->txt('objs_' . $subtype);
         }
         include_once 'Services/AccessControl/classes/class.ilObjectRoleTemplatePermissionTableGUI.php';
         $tbl = new ilObjectRoleTemplatePermissionTableGUI($this, 'perm', $this->getParentRefId(), $this->object->getId(), $subtype, $a_show_admin_permissions);
         $tbl->parse();
         $acc->addItem($translation, $tbl->getHTML());
     }
     $this->tpl->setVariable('ACCORDION', $acc->getHTML());
     // Add options table
     include_once './Services/AccessControl/classes/class.ilObjectRoleTemplateOptionsTableGUI.php';
     $options = new ilObjectRoleTemplateOptionsTableGUI($this, 'perm', $this->rolf_ref_id, $this->object->getId(), $a_show_admin_permissions);
     $options->addMultiCommand($a_show_admin_permissions ? 'adminPermSave' : 'permSave', $this->lng->txt('save'));
     $options->parse();
     $this->tpl->setVariable('OPTIONS_TABLE', $options->getHTML());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:73,代码来源:class.ilObjRoleGUI.php

示例7: fillRow

 /**
  * Fill template row
  * @param array $a_set
  */
 protected function fillRow($a_set)
 {
     global $objDefinition;
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setCurrentBlock('item_row');
     $this->tpl->setVariable('ITEM_ID', $a_set['id']);
     $this->tpl->setVariable('COLL_TITLE', $a_set['title']);
     $this->tpl->setVariable('COLL_DESC', $a_set['description']);
     if ($this->getMode() == ilLPObjSettings::LP_MODE_SCORM) {
         $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_sco_s.png'));
         $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_sco'));
     } else {
         if ($objDefinition->isPluginTypeName($a_set["type"])) {
             $alt = ilPlugin::lookupTxt("rep_robj", $a_set['type'], "obj_" . $a_set['type']);
         } else {
             $alt = $this->lng->txt('obj_' . $a_set['type']);
         }
         $this->tpl->setVariable('ALT_IMG', $alt);
         $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon("", "tiny", $a_set['type']));
         if ($this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_MANUAL && $this->getMode() != ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
             $this->tpl->setVariable('COLL_LINK', ilLink::_getLink($a_set['ref_id'], $a_set['type']));
             $this->tpl->setVariable('COLL_FRAME', ilFrameTargetInfo::_getFrame('MainContent', $a_set['type']));
             include_once './Services/Tree/classes/class.ilPathGUI.php';
             $path = new ilPathGUI();
             $this->tpl->setVariable('COLL_PATH', $this->lng->txt('path') . ': ' . $path->getPath($this->getNode(), $a_set['ref_id']));
             $mode = $a_set['mode_id'];
             if ($mode != ilLPObjSettings::LP_MODE_DEACTIVATED && $mode != ilLPObjSettings::LP_MODE_UNDEFINED) {
                 $this->tpl->setVariable("COLL_MODE", $a_set['mode']);
             } else {
                 $this->tpl->setVariable("COLL_MODE", "");
                 $this->tpl->setVariable("COLL_MODE_DEACTIVATED", $a_set['mode']);
             }
             if ($a_set["anonymized"]) {
                 $this->tpl->setVariable("ANONYMIZED", $this->lng->txt('trac_anonymized_info_short'));
             }
         } else {
             if ($this->getMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT) {
                 // handle tlt settings
                 $this->tpl->setCurrentBlock("tlt");
                 $this->tpl->setVariable("TXT_MONTH", $this->lng->txt('md_months'));
                 $this->tpl->setVariable("TXT_DAYS", $this->lng->txt('md_days'));
                 $this->tpl->setVariable("TXT_TIME", $this->lng->txt('md_time'));
                 $this->tpl->setVariable("TLT_HINT", '(hh:mm)');
                 // seconds to units
                 $mon = floor($a_set["tlt"] / (60 * 60 * 24 * 30));
                 $tlt = $a_set["tlt"] % (60 * 60 * 24 * 30);
                 $day = floor($tlt / (60 * 60 * 24));
                 $tlt = $tlt % (60 * 60 * 24);
                 $hr = floor($tlt / (60 * 60));
                 $tlt = $tlt % (60 * 60);
                 $min = floor($tlt / 60);
                 $options = array();
                 for ($i = 0; $i <= 24; $i++) {
                     $options[$i] = sprintf('%02d', $i);
                 }
                 $this->tpl->setVariable("SEL_MONTHS", ilUtil::formSelect($mon, 'tlt[' . $a_set['id'] . '][mo]', $options, false, true));
                 for ($i = 0; $i <= 31; $i++) {
                     $options[$i] = sprintf('%02d', $i);
                 }
                 $this->tpl->setVariable("SEL_DAYS", ilUtil::formSelect($day, 'tlt[' . $a_set['id'] . '][d]', $options, false, true));
                 $this->tpl->setVariable("SEL_TLT", ilUtil::makeTimeSelect('tlt[' . $a_set['id'] . ']', true, $hr, $min, null, false));
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
     // Assigned ?
     $this->tpl->setVariable("ASSIGNED_IMG_OK", $a_set['status'] ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png'));
     $this->tpl->setVariable("ASSIGNED_STATUS", $a_set['status'] ? $this->lng->txt('trac_assigned') : $this->lng->txt('trac_not_assigned'));
     $this->tpl->parseCurrentBlock();
     // Parse grouped items
     foreach ((array) $a_set['grouped'] as $item) {
         $this->fillRow($item);
     }
     // show num obligatory info
     if (count($a_set['grouped'])) {
         $this->tpl->setCurrentBlock('num_passed_items');
         $this->tpl->setVariable('MIN_PASSED_TXT', $this->lng->txt('trac_min_passed'));
         $this->tpl->setVariable('NUM_OBLIGATORY', $a_set['num_obligatory']);
         $this->tpl->setVariable('GRP_ID', $a_set['grouping_id']);
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:86,代码来源:class.ilLPCollectionSettingsTableGUI.php

示例8: __showPermissionsCreateSection

 function __showPermissionsCreateSection()
 {
     global $objDefinition, $ilSetting;
     // no create operation for roles/role templates in local role folders
     // access is controlled by 'administrate' (change permission settings) only
     if ($this->gui_obj->object->getType() == 'rolf' and $this->gui_obj->object->getRefId() != ROLE_FOLDER_ID) {
         return;
     }
     // create pointer to first role (only the permission list is needed)
     reset($this->roles);
     $first_role =& current($this->roles);
     if (count($first_role['permissions']['create'])) {
         $this->tpl->setCurrentBlock("perm_subtitle");
         $this->tpl->setVariable("TXT_PERM_CLASS", $this->lng->txt('perm_class_create'));
         $this->tpl->setVariable("TXT_PERM_CLASS_DESC", $this->lng->txt('perm_class_create_desc'));
         $this->tpl->setVariable("COLSPAN", $this->num_roles);
         $this->tpl->parseCurrentBlock();
         // add a checkbox 'select all' for create permissions of the following object types
         $container_arr = array('cat', 'grp', 'crs', 'fold');
         if (in_array($this->gui_obj->object->getType(), $container_arr)) {
             $chk_toggle_create = true;
         }
         foreach ($this->roles as $role) {
             $ops_ids = array();
             foreach ($role['permissions']['create'] as $perm) {
                 $ops_ids[] = $perm['ops_id'];
             }
             if ($chk_toggle_create) {
                 $this->tpl->setCurrentBlock('chk_toggle_create');
                 $this->tpl->setVariable('PERM_NAME', $this->lng->txt('check_all') . "/" . $this->lng->txt('uncheck_all'));
                 $this->tpl->setVariable('PERM_TOOLTIP', $this->lng->txt('check_all'));
                 $this->tpl->setVariable('ROLE_ID', $role['obj_id']);
                 $this->tpl->setVariable('JS_VARNAME', 'perm_' . $role['obj_id']);
                 $this->tpl->setVariable('JS_ONCLICK', ilUtil::array_php2js($ops_ids));
                 $this->tpl->parseCurrentBlock();
             }
             foreach ($role['permissions']['create'] as $perm) {
                 if ($perm["name"] == "create_icrs" and !$ilSetting->get("ilinc_active")) {
                     continue;
                 }
                 $box = ilUtil::formCheckBox($perm['checked'], "perm[" . $role["obj_id"] . "][]", $perm["ops_id"], $role["protected"]);
                 $this->tpl->setCurrentBlock("perm_item");
                 $this->tpl->setVariable("PERM_CHECKBOX", $box);
                 if ($objDefinition->isPlugin(substr($perm['name'], 7))) {
                     $this->tpl->setVariable("PERM_NAME", ilPlugin::lookupTxt("rep_robj", substr($perm['name'], 7), "obj_" . substr($perm['name'], 7)));
                     $this->tpl->setVariable("PERM_TOOLTIP", ilPlugin::lookupTxt("rep_robj", substr($perm['name'], 7), $this->gui_obj->object->getType() . "_" . $perm['name']));
                 } else {
                     $this->tpl->setVariable("PERM_NAME", $this->lng->txt("obj" . substr($perm['name'], 6)));
                     $this->tpl->setVariable("PERM_TOOLTIP", $this->lng->txt($this->gui_obj->object->getType() . "_" . $perm['name']));
                 }
                 $this->tpl->setVariable("PERM_LABEL", 'perm_' . $role['obj_id'] . '_' . $perm['ops_id']);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock("perm_table");
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("perm_settings");
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:60,代码来源:class.ilPermission2GUI.php

示例9: fillRow

 /**
  * Fill one permission row
  * @param object $row
  * @return 
  */
 public function fillRow($row)
 {
     global $objDefinition;
     // local policy
     if (isset($row['show_local_policy_row'])) {
         foreach ($row['roles'] as $role_id => $role_info) {
             $this->tpl->setCurrentBlock('role_option');
             $this->tpl->setVariable('INHERIT_ROLE_ID', $role_id);
             $this->tpl->setVariable('INHERIT_CHECKED', $role_info['local_policy'] ? 'checked=checked' : '');
             $this->tpl->setVariable('INHERIT_DISABLED', ($role_info['protected'] or $role_info['isLocal']) ? 'disabled="disabled"' : '');
             $this->tpl->setVariable('TXT_INHERIT', $this->lng->txt('rbac_local_policy'));
             $this->tpl->setVariable('INHERIT_LONG', $this->lng->txt('perm_use_local_policy_desc'));
             $this->tpl->parseCurrentBlock();
         }
         return true;
     }
     // protected
     if (isset($row['show_protected_row'])) {
         foreach ($row['roles'] as $role_id => $role_info) {
             $this->tpl->setCurrentBlock('role_protect');
             $this->tpl->setVariable('PROTECT_ROLE_ID', $role_id);
             $this->tpl->setVariable('PROTECT_CHECKED', $role_info['protected_status'] ? 'checked=checked' : '');
             $this->tpl->setVariable('PROTECT_DISABLED', $role_info['protected_allowed'] ? '' : 'disabled="disabled"');
             $this->tpl->setVariable('TXT_PROTECT', $this->lng->txt('role_protect_permissions'));
             $this->tpl->setVariable('PROTECT_LONG', $this->lng->txt('role_protect_permissions_desc'));
             $this->tpl->parseCurrentBlock();
         }
         return true;
     }
     // block role
     if (isset($row['show_block_row'])) {
         foreach ($this->getVisibleRoles() as $counter => $role_info) {
             $this->tpl->setCurrentBlock('role_block');
             $this->tpl->setVariable('BLOCK_ROLE_ID', $role_info['obj_id']);
             $this->tpl->setVariable('TXT_BLOCK', $this->lng->txt('role_block_role'));
             $this->tpl->setVariable('BLOCK_LONG', $this->lng->txt('role_block_role_desc'));
             if ($role_info['protected'] == 'y') {
                 $this->tpl->setVariable('BLOCK_DISABLED', 'disabled="disabled');
             }
             $this->tpl->parseCurrentBlock();
         }
         return true;
     }
     // Select all
     if (isset($row['show_select_all'])) {
         foreach ($this->getVisibleRoles() as $role) {
             $this->tpl->setCurrentBlock('role_select_all');
             $this->tpl->setVariable('JS_ROLE_ID', $role['obj_id']);
             $this->tpl->setVariable('JS_SUBID', $row['subtype']);
             $this->tpl->setVariable('JS_ALL_PERMS', "['" . implode("','", $row['ops']) . "']");
             $this->tpl->setVariable('JS_FORM_NAME', $this->getFormName());
             $this->tpl->setVariable('TXT_SEL_ALL', $this->lng->txt('select_all'));
             $this->tpl->parseCurrentBlock();
         }
         return true;
     }
     // Object permissions
     if (isset($row['show_start_info'])) {
         $this->tpl->setCurrentBlock('section_info');
         $this->tpl->setVariable('SECTION_TITLE', $this->lng->txt('perm_class_object'));
         $this->tpl->setVariable('SECTION_DESC', $this->lng->txt('perm_class_object_desc'));
         $this->tpl->parseCurrentBlock();
         return true;
     }
     if (isset($row['show_create_info'])) {
         $this->tpl->setCurrentBlock('section_info');
         $this->tpl->setVariable('SECTION_TITLE', $this->lng->txt('perm_class_create'));
         $this->tpl->setVariable('SECTION_DESC', $this->lng->txt('perm_class_create_desc'));
         $this->tpl->parseCurrentBlock();
         return true;
     }
     foreach ((array) $row['roles'] as $role_id => $role_info) {
         $this->tpl->setCurrentBlock('role_td');
         $this->tpl->setVariable('PERM_ROLE_ID', $role_id);
         $this->tpl->setVariable('PERM_PERM_ID', $row['perm']['ops_id']);
         if (substr($row['perm']['operation'], 0, 6) == 'create') {
             if ($objDefinition->isPlugin(substr($row['perm']['operation'], 7))) {
                 $perm = ilPlugin::lookupTxt("rep_robj", substr($row['perm']['operation'], 7), "obj_" . substr($row['perm']['operation'], 7));
             } else {
                 $perm = $this->lng->txt('obj_' . substr($row['perm']['operation'], 7));
             }
         } else {
             if ($this->lng->exists($this->getObjType() . '_' . $row['perm']['operation'] . '_short')) {
                 $perm = $this->lng->txt($this->getObjType() . '_' . $row['perm']['operation'] . '_short');
             } else {
                 $perm = $this->lng->txt($row['perm']['operation']);
             }
         }
         $this->tpl->setVariable('TXT_PERM', $perm);
         if ($objDefinition->isPlugin($this->getObjType())) {
             $this->tpl->setVariable('PERM_LONG', ilPlugin::lookupTxt("rep_robj", $this->getObjType(), $this->getObjType() . "_" . $row['perm']['operation']));
         } elseif (substr($row['perm']['operation'], 0, 6) == 'create') {
             $this->tpl->setVariable('PERM_LONG', $this->lng->txt('rbac_' . $row['perm']['operation']));
         } else {
             $this->tpl->setVariable('PERM_LONG', $this->lng->txt($this->getObjType() . '_' . $row['perm']['operation']));
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjectRolePermissionTableGUI.php

示例10: addMessageRow

 /**
  * add message row
  */
 function addMessageRow(&$a_tpl, $a_message, $a_type)
 {
     global $lng, $objDefinition;
     $this->cur_row_type = $this->cur_row_type == "row_type_1" ? "row_type_2" : "row_type_1";
     $a_tpl->touchBlock($this->cur_row_type);
     if (!$objDefinition->isPlugin($type)) {
         $type = $lng->txt("obj_" . $a_type);
     } else {
         include_once "./Services/Component/classes/class.ilPlugin.php";
         $title = ilPlugin::lookupTxt("rep_robj", $a_type, "objs_" . $a_type);
     }
     $a_message = str_replace("[type]", $type, $a_message);
     $a_tpl->setVariable("ROW_NBSP", "&nbsp;");
     $a_tpl->setCurrentBlock("container_standard_row");
     $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_message);
     $a_tpl->parseCurrentBlock();
     $a_tpl->touchBlock("container_row");
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:21,代码来源:class.ilContainerContentGUI.php

示例11: fillRow

 /**
  * Fill template row
  * @param array $a_set
  */
 protected function fillRow($a_set)
 {
     global $objDefinition;
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setCurrentBlock('item_row');
     $this->tpl->setVariable('ITEM_ID', $a_set['id']);
     $this->tpl->setVariable('COLL_TITLE', $a_set['title']);
     $this->tpl->setVariable('COLL_DESC', $a_set['description']);
     if ($this->getMode() == LP_MODE_SCORM) {
         $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_sco_s.png'));
         $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_sco'));
     } else {
         if ($objDefinition->isPluginTypeName($a_set["type"])) {
             $alt = ilPlugin::lookupTxt("rep_robj", $a_set['type'], "obj_" . $a_set['type']);
         } else {
             $alt = $this->lng->txt('obj_' . $a_set['type']);
         }
         $this->tpl->setVariable('ALT_IMG', $alt);
         $this->tpl->setVariable('TYPE_IMG', ilObject::_getIcon("", "tiny", $a_set['type']));
         $this->tpl->setVariable('COLL_LINK', ilLink::_getLink($a_set['ref_id'], $a_set['type']));
         $this->tpl->setVariable('COLL_FRAME', ilFrameTargetInfo::_getFrame('MainContent', $a_set['type']));
         include_once './Services/Tree/classes/class.ilPathGUI.php';
         $path = new ilPathGUI();
         $this->tpl->setVariable('COLL_PATH', $this->lng->txt('path') . ': ' . $path->getPath($this->getNode(), $a_set['ref_id']));
         $mode = $a_set['mode_id'];
         if ($mode != LP_MODE_DEACTIVATED && $mode != LP_MODE_UNDEFINED) {
             $this->tpl->setVariable("COLL_MODE", $a_set['mode']);
         } else {
             $this->tpl->setVariable("COLL_MODE", "");
             $this->tpl->setVariable("COLL_MODE_DEACTIVATED", $a_set['mode']);
         }
         if ($this->isAnonymized($a_set)) {
             $this->tpl->setVariable("ANONYMIZED", $this->lng->txt('trac_anonymized_info_short'));
         }
     }
     // Assigned ?
     $this->tpl->setVariable("ASSIGNED_IMG_OK", $a_set['status'] ? ilUtil::getImagePath('icon_ok.png') : ilUtil::getImagePath('icon_not_ok.png'));
     $this->tpl->setVariable("ASSIGNED_STATUS", $a_set['status'] ? $this->lng->txt('trac_assigned') : $this->lng->txt('trac_not_assigned'));
     $this->tpl->parseCurrentBlock();
     // Parse grouped items
     foreach ((array) $a_set['grouped'] as $item) {
         $this->fillRow($item);
     }
     // show num obligatory info
     if (count($a_set['grouped'])) {
         $this->tpl->setCurrentBlock('num_passed_items');
         $this->tpl->setVariable('MIN_PASSED_TXT', $this->lng->txt('trac_min_passed'));
         $this->tpl->setVariable('NUM_OBLIGATORY', $a_set['num_obligatory']);
         $this->tpl->setVariable('GRP_ID', $a_set['grouping_id']);
         $this->tpl->parseCurrentBlock();
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:56,代码来源:class.ilLPCollectionSettingsTableGUI.php

示例12: __getPermissionDefinitions

 function __getPermissionDefinitions()
 {
     global $ilDB, $lng, $objDefinition, $rbacreview;
     $operation_info = $rbacreview->getOperationAssignment();
     foreach ($operation_info as $info) {
         if ($objDefinition->getDevMode($info['type'])) {
             continue;
         }
         $rbac_objects[$info['typ_id']] = array("obj_id" => $info['typ_id'], "type" => $info['type']);
         // handle plugin permission texts
         $txt = $objDefinition->isPlugin($info['type']) ? ilPlugin::lookupTxt("rep_robj", $info['type'], $info['type'] . "_" . $info['operation']) : $lng->txt($info['type'] . "_" . $info['operation']);
         if (substr($info['operation'], 0, 7) == "create_" && $objDefinition->isPlugin(substr($info['operation'], 7))) {
             $txt = ilPlugin::lookupTxt("rep_robj", substr($info['operation'], 7), $info['type'] . "_" . $info['operation']);
         }
         $rbac_operations[$info['typ_id']][$info['ops_id']] = array("ops_id" => $info['ops_id'], "title" => $info['operation'], "name" => $txt);
     }
     return array($rbac_objects, $rbac_operations);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:18,代码来源:class.ilObjRole.php

示例13: checkObject

 /**
  * displays system check menu
  *
  * @access	public
  */
 function checkObject()
 {
     global $rbacsystem, $ilias, $objDefinition, $ilSetting;
     $this->setSystemCheckSubTabs("system_check_sub");
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     //echo "1";
     if ($_POST['count_limit'] !== null || $_POST['age_limit'] !== null || $_POST['type_limit'] !== null) {
         $ilias->account->writePref('systemcheck_count_limit', is_numeric($_POST['count_limit']) && $_POST['count_limit'] > 0 ? $_POST['count_limit'] : '');
         $ilias->account->writePref('systemcheck_age_limit', is_numeric($_POST['age_limit']) && $_POST['age_limit'] > 0 ? $_POST['age_limit'] : '');
         $ilias->account->writePref('systemcheck_type_limit', trim($_POST['type_limit']));
     }
     if ($_POST["mode"]) {
         //echo "3";
         $this->writeCheckParams();
         $this->startValidator($_POST["mode"], $_POST["log_scan"]);
     } else {
         //echo "4";
         include_once "./Services/Repository/classes/class.ilValidator.php";
         $validator = new ilValidator();
         $hasScanLog = $validator->hasScanLog();
         $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_check.html", "Modules/SystemFolder");
         if ($hasScanLog) {
             $this->tpl->setVariable("TXT_VIEW_LOG", $this->lng->txt("view_last_log"));
         }
         $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
         $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("systemcheck"));
         $this->tpl->setVariable("COLSPAN", 3);
         $this->tpl->setVariable("TXT_ANALYZE_TITLE", $this->lng->txt("analyze_data"));
         $this->tpl->setVariable("TXT_ANALYSIS_OPTIONS", $this->lng->txt("analysis_options"));
         $this->tpl->setVariable("TXT_REPAIR_OPTIONS", $this->lng->txt("repair_options"));
         $this->tpl->setVariable("TXT_OUTPUT_OPTIONS", $this->lng->txt("output_options"));
         $this->tpl->setVariable("TXT_SCAN", $this->lng->txt("scan"));
         $this->tpl->setVariable("TXT_SCAN_DESC", $this->lng->txt("scan_desc"));
         $this->tpl->setVariable("TXT_DUMP_TREE", $this->lng->txt("dump_tree"));
         $this->tpl->setVariable("TXT_DUMP_TREE_DESC", $this->lng->txt("dump_tree_desc"));
         $this->tpl->setVariable("TXT_CLEAN", $this->lng->txt("clean"));
         $this->tpl->setVariable("TXT_CLEAN_DESC", $this->lng->txt("clean_desc"));
         $this->tpl->setVariable("TXT_RESTORE", $this->lng->txt("restore_missing"));
         $this->tpl->setVariable("TXT_RESTORE_DESC", $this->lng->txt("restore_missing_desc"));
         $this->tpl->setVariable("TXT_PURGE", $this->lng->txt("purge_missing"));
         $this->tpl->setVariable("TXT_PURGE_DESC", $this->lng->txt("purge_missing_desc"));
         $this->tpl->setVariable("TXT_RESTORE_TRASH", $this->lng->txt("restore_trash"));
         $this->tpl->setVariable("TXT_RESTORE_TRASH_DESC", $this->lng->txt("restore_trash_desc"));
         $this->tpl->setVariable("TXT_PURGE_TRASH", $this->lng->txt("purge_trash"));
         $this->tpl->setVariable("TXT_PURGE_TRASH_DESC", $this->lng->txt("purge_trash_desc"));
         $this->tpl->setVariable("TXT_COUNT_LIMIT", $this->lng->txt("purge_count_limit"));
         $this->tpl->setVariable("TXT_COUNT_LIMIT_DESC", $this->lng->txt("purge_count_limit_desc"));
         $this->tpl->setVariable("COUNT_LIMIT_VALUE", $ilias->account->getPref("systemcheck_count_limit"));
         $this->tpl->setVariable("TXT_AGE_LIMIT", $this->lng->txt("purge_age_limit"));
         $this->tpl->setVariable("TXT_AGE_LIMIT_DESC", $this->lng->txt("purge_age_limit_desc"));
         $this->tpl->setVariable("AGE_LIMIT_VALUE", $ilias->account->getPref("systemcheck_age_limit"));
         $this->tpl->setVariable("TXT_TYPE_LIMIT", $this->lng->txt("purge_type_limit"));
         $this->tpl->setVariable("TXT_TYPE_LIMIT_DESC", $this->lng->txt("purge_type_limit_desc"));
         if ($ilias->account->getPref('systemcheck_mode_scan')) {
             $this->tpl->touchBlock('mode_scan_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_dump_tree')) {
             $this->tpl->touchBlock('mode_dump_tree_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_clean')) {
             $this->tpl->touchBlock('mode_clean_checked');
         }
         if ($ilias->account->getPref('systemcheck_mode_restore')) {
             $this->tpl->touchBlock('mode_restore_checked');
             $this->tpl->touchBlock('mode_purge_disabled');
         } elseif ($ilias->account->getPref('systemcheck_mode_purge')) {
             $this->tpl->touchBlock('mode_purge_checked');
             $this->tpl->touchBlock('mode_restore_disabled');
         }
         if ($ilias->account->getPref('systemcheck_mode_restore_trash')) {
             $this->tpl->touchBlock('mode_restore_trash_checked');
             $this->tpl->touchBlock('mode_purge_trash_disabled');
         } elseif ($ilias->account->getPref('systemcheck_mode_purge_trash')) {
             $this->tpl->touchBlock('mode_purge_trash_checked');
             $this->tpl->touchBlock('mode_restore_trash_disabled');
         }
         if ($ilias->account->getPref('systemcheck_log_scan')) {
             $this->tpl->touchBlock('log_scan_checked');
         }
         // #9520 - restrict to types which can be found in tree
         $obj_types_in_tree = array();
         global $ilDB;
         $set = $ilDB->query('SELECT type FROM object_data od' . ' JOIN object_reference ref ON (od.obj_id = ref.obj_id)' . ' JOIN tree ON (tree.child = ref.ref_id)' . ' WHERE tree.tree < 1' . ' GROUP BY type');
         while ($row = $ilDB->fetchAssoc($set)) {
             $obj_types_in_tree[] = $row['type'];
         }
         $types = $objDefinition->getAllObjects();
         $ts = array("" => "");
         foreach ($types as $t) {
             if ($t != "" && !$objDefinition->isSystemObject($t) && $t != "root" && in_array($t, $obj_types_in_tree)) {
                 if ($objDefinition->isPlugin($t)) {
                     $ts[$t] = ilPlugin::lookupTxt("rep_robj", $t, "obj_" . $t);
                 } else {
//.........这里部分代码省略.........
开发者ID:bheyser,项目名称:qplskl,代码行数:101,代码来源:class.ilObjSystemFolderGUI.php

示例14: confirmRemoveFromSystemObject

 /**
  * Confirmation for trash
  *
  * @param array $a_ids ref_ids
  */
 public function confirmRemoveFromSystemObject($a_ids)
 {
     global $ilCtrl, $lng, $objDefinition, $tpl;
     include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
     if (!is_array($a_ids)) {
         $a_ids = array($a_ids);
     }
     $cgui = new ilConfirmationGUI();
     $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
     $cgui->setCancel($lng->txt("cancel"), "trash");
     $cgui->setConfirm($lng->txt("confirm"), "removeFromSystem");
     $cgui->setFormName("trash_confirmation");
     $cgui->setHeaderText($lng->txt("info_delete_sure"));
     foreach ($a_ids as $id) {
         $obj_id = ilObject::_lookupObjId($id);
         $type = ilObject::_lookupType($obj_id);
         $title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id);
         $alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
         $cgui->addItem("trash_id[]", $id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
     }
     $tpl->setContent($cgui->getHTML());
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:27,代码来源:class.ilRepUtilGUI.php

示例15: getItems

 function getItems()
 {
     include_once "Services/Tracking/classes/class.ilTrQuery.php";
     $res = ilTrQuery::getObjectTypeStatisticsPerMonth($this->filter["aggregation"], $this->filter["year"]);
     // get plugin titles
     include_once "./Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php";
     $plugins = array();
     $plugins = ilRepositoryObjectPluginSlot::addCreatableSubObjects($plugins);
     $data = array();
     foreach ($res as $type => $months) {
         $data[$type]["type"] = $type;
         // to enable sorting by title
         if (array_key_exists($type, $plugins)) {
             include_once "./Services/Component/classes/class.ilPlugin.php";
             $data[$type]["title"] = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type);
             $data[$type]["icon"] = ilObject::_getIcon("", "tiny", $type);
         } else {
             $data[$type]["title"] = $this->lng->txt("objs_" . $type);
             $data[$type]["icon"] = ilUtil::getTypeIconPath($type, null, "tiny");
         }
         foreach ($months as $month => $row) {
             $value = $row[$this->filter["measure"]];
             $data[$type]["month_" . $month] = $value;
         }
     }
     // add live data
     if ($this->filter["year"] == date("Y")) {
         $live = ilTrQuery::getObjectTypeStatistics();
         foreach ($live as $type => $item) {
             $data[$type]["type"] = $type;
             // to enable sorting by title
             if (array_key_exists($type, $plugins)) {
                 include_once "./Services/Component/classes/class.ilPlugin.php";
                 $data[$type]["title"] = ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type);
                 $data[$type]["icon"] = ilObject::_getIcon("", "tiny", $type);
             } else {
                 $data[$type]["title"] = $this->lng->txt("objs_" . $type);
                 $data[$type]["icon"] = ilUtil::getTypeIconPath($type, null, "tiny");
             }
             $value = $item[$this->filter["measure"]];
             $data[$type]["month_live"] = $value;
         }
     }
     $this->setData($data);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:45,代码来源:class.ilLPObjectStatisticsTypesTableGUI.php


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