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


PHP ilUtil::formCheckBox方法代码示例

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


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

示例1: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     $i = $a_set["Nr"];
     $this->tpl->setVariable("CHECKBOX", ilUtil::formCheckBox("", "area[]", $i));
     $this->tpl->setVariable("VAR_NAME", "name_" . $i);
     $this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
     $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
     $this->tpl->setVariable("VAL_HIGHL_MODE", ilUtil::formSelect($a_set["HighlightMode"], "hl_mode_" . $i, $this->highl_modes, false, true));
     $this->tpl->setVariable("VAL_HIGHL_CLASS", ilUtil::formSelect($a_set["HighlightClass"], "hl_class_" . $i, $this->highl_classes, false, true));
     $this->tpl->setVariable("VAL_COORDS", implode(explode(",", $a_set["Coords"]), ", "));
     switch ($a_set["Link"]["LinkType"]) {
         case "ExtLink":
             $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
             break;
         case "IntLink":
             $link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"], $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
             $this->tpl->setVariable("VAL_LINK", $link_str);
             break;
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:25,代码来源:class.ilPCImageMapTableGUI.php

示例2: editPricesObject

 public function editPricesObject($a_show_delete = false)
 {
     /** 
      * @var $ilToolbar ilToolbarGUI
      * */
     global $ilToolbar;
     if ($a_show_delete == false) {
         unset($_SESSION['price_ids']);
     }
     $_SESSION['price_ids'] = $_SESSION['price_ids'] ? $_SESSION['price_ids'] : array();
     if (!$_GET['pobject_id']) {
         ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
         $this->objectsObject();
         return true;
     }
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'objects'));
     $ilToolbar->addButton($this->lng->txt('paya_edit_details'), $this->ctrl->getLinkTarget($this, 'editDetails'));
     $ilToolbar->addButton($this->lng->txt('paya_edit_prices'), $this->ctrl->getLinkTarget($this, 'editPrices'));
     $ilToolbar->addButton($this->lng->txt('pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
     $this->__initPaymentObject((int) $_GET['pobject_id']);
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $price_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
     $standard_prices = array();
     $extension_prices = array();
     $standard_prices = $price_obj->getPrices();
     $extension_prices = $price_obj->getExtensionPrices();
     $prices = array_merge($standard_prices, $extension_prices);
     // No prices created
     if (!count($prices)) {
         ilUtil::sendInfo($this->lng->txt('paya_no_price_available'));
         $ilToolbar->addButton($this->lng->txt('paya_add_price'), $this->ctrl->getLinkTarget($this, 'addPrice'));
         return true;
     }
     // Show confirm delete
     if ($a_show_delete) {
         $oConfirmationGUI = new ilConfirmationGUI();
         // set confirm/cancel commands
         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeletePrice"));
         $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_prices"));
         $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "editPrices");
         $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeletePrice");
         foreach ($prices as $price) {
             $delete_row = '';
             $tmp_price = '';
             if (in_array($price['price_id'], $_SESSION['price_ids'])) {
                 switch ($price['price_type']) {
                     case ilPaymentPrices::TYPE_DURATION_DATE:
                         include_once './Services/Calendar/classes/class.ilDatePresentation.php';
                         $tmp_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE));
                         break;
                     case ilPaymentPrices::TYPE_DURATION_MONTH:
                         $tmp_price = $price['duration'] . ' ' . $this->lng->txt('paya_months');
                         break;
                     case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
                         $tmp_price = $this->lng->txt('unlimited_duration');
                         break;
                 }
                 $delete_row .= '' . $tmp_price . '  ->  ' . ilFormat::_getLocalMoneyFormat($price['price']) . ' ' . $this->genSetData->get('currency_unit');
                 $oConfirmationGUI->addItem('', $delete_row, $delete_row);
             }
         }
         $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
         return true;
     }
     // Fill table cells
     /** 
      * @var object $tpl ilTemplate 
      */
     $tpl = new ilTemplate('tpl.table.html', true, true);
     // set table header
     $tpl->setCurrentBlock('tbl_form_header');
     $tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     $counter = 0;
     $data = array();
     foreach ($prices as $price) {
         $data[$counter]['price_id'] = ilUtil::formCheckBox(in_array($price['price_id'], $_SESSION['price_ids']) ? 1 : 0, 'price_ids[]', $price['price_id']);
         switch ($price['price_type']) {
             case ilPaymentPrices::TYPE_DURATION_MONTH:
                 $data[$counter]['duration'] = $price['duration'] . ' ' . $this->lng->txt('paya_months');
                 break;
             case ilPaymentPrices::TYPE_DURATION_DATE:
                 $data[$counter]['duration'] = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE));
                 break;
             case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
                 $data[$counter]['duration'] = $this->lng->txt('unlimited_duration');
                 break;
         }
         $data[$counter]['price'] = ilFormat::_getLocalMoneyFormat($price['price']);
         $data[$counter]['currency_unit'] = $this->genSetData->get('currency_unit');
         $data[$counter]['extension'] = ilUtil::formCheckBox($price['extension'] ? 1 : 0, 'extension_ids[]', (int) $price['price_id'], true);
         $this->ctrl->setParameter($this, "price_id", $price['price_id']);
         $data[$counter]['edit'] = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, "editPrice") . "\">" . $this->lng->txt("edit") . "</a></div>";
         ++$counter;
     }
     $this->__editPricesTable($data);
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:99,代码来源:class.ilObjPaymentSettingsGUI.php

示例3: membersObject

 /**
  * display group members
  */
 public function membersObject()
 {
     global $ilAccess, $ilBench, $lng, $ilToolbar, $ilUser;
     if (!$this->ilias->getSetting('ilinc_active')) {
         $this->ilias->raiseError($lng->txt('ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.icrs_members.html', 'Modules/ILinc');
     $this->__setSubTabs('members');
     $this->lng->loadLanguageModule('ilinc');
     // display member search button
     $is_admin = (bool) $ilAccess->checkAccess('write', '', $this->object->getRefId());
     if ($is_admin) {
         $ilToolbar->addButton($this->lng->txt('ilinc_add_user'), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
     }
     //if current user is admin he is able to add new members to group
     $val_contact = "<img src=\"" . ilUtil::getImagePath("icon_pencil_b.png") . "\" alt=\"" . $this->lng->txt("ilinc_mem_send_mail") . "\" title=\"" . $this->lng->txt("ilinc_mem_send_mail") . "\" border=\"0\" vspace=\"0\"/>";
     $val_change = "<img src=\"" . ilUtil::getImagePath("icon_change_b.png") . "\" alt=\"" . $this->lng->txt("ilinc_mem_change_status") . "\" title=\"" . $this->lng->txt("ilinc_mem_change_status") . "\" border=\"0\" vspace=\"0\"/>";
     $val_leave = "<img src=\"" . ilUtil::getImagePath("icon_group_out_b.png") . "\" alt=\"" . $this->lng->txt("ilinc_mem_leave") . "\" title=\"" . $this->lng->txt("ilinc_mem_leave") . "\" border=\"0\" vspace=\"0\"/>";
     // store access checks to improve performance
     $access_leave = $ilAccess->checkAccess('leave', '', $this->object->getRefId());
     $access_write = $ilAccess->checkAccess('write', '', $this->object->getRefId());
     $member_ids = $this->object->getMemberIds();
     // fetch all user data in one shot to improve performance (from ILIAS db)
     $members = $this->object->getMemberData($member_ids);
     // fetch docent or student assignment form all coursemembers from iLinc server
     $docent_ids = $this->object->getiLincMemberIds(true);
     $student_ids = $this->object->getiLincMemberIds(false);
     $counter = 0;
     $result_set = array();
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     foreach ($members as $mem) {
         $link_contact = ilMailFormCall::getLinkTarget($this, 'members', array(), array('type' => 'new', 'rcp_to' => $mem['login']));
         $link_change = $this->ctrl->getLinkTarget($this, 'changeMember') . '&mem_id=' . $mem['id'];
         if ($mem['id'] == $ilUser->getId() && $access_leave || $access_delete) {
             $link_leave = $this->ctrl->getLinkTarget($this, 'removeMember') . '&mem_id=' . $mem['id'];
         }
         //build functions
         $member_functions = '';
         if ($access_write) {
             $member_functions = "<a href=\"{$link_change}\">{$val_change}</a>";
         }
         if ($mem['id'] == $ilUser->getId() && $access_leave || $access_write) {
             $link_leave = $this->ctrl->getLinkTarget($this, 'removeMember') . '&mem_id=' . $mem['id'];
             $member_functions .= "<a href=\"{$link_leave}\">{$val_leave}</a>";
         }
         // this is twice as fast than the code above
         $str_member_roles = $this->object->getMemberRolesTitle($mem['id']);
         if ($access_write) {
             $result_set[$counter]['checkbox'] = ilUtil::formCheckBox(0, 'user_id[]', $mem['id']);
         }
         $status = $this->object->checkiLincMemberStatus($mem['ilinc_id'], $docent_ids, $student_ids);
         if ($status == ILINC_MEMBER_NOTSET) {
             $status = "<span class='warning'>" . $this->lng->txt($status) . "</span>";
         } else {
             $status = $this->lng->txt($status);
         }
         $result_set[$counter]['login'] = $mem['login'];
         $result_set[$counter]['firstname'] = $mem['firstname'];
         $result_set[$counter]['lastname'] = $mem['lastname'];
         $result_set[$counter]['attending_as'] = $status;
         $result_set[$counter]['role'] = $str_member_roles;
         $result_set[$counter]['options'] = "<a href=\"{$link_contact}\">" . $val_contact . "</a>" . $member_functions;
         ++$counter;
         unset($member_functions);
     }
     include_once 'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
     $oTable = new iliLinkMembersTableGUI($this, $result_set, 'show', 'members', 'members');
     $oTable->setTitle($this->lng->txt('ilinc_involved_users'), 'icon_usr_b.png', $this->lng->txt('ilinc_involved_users'));
     return $this->tpl->setVariable('MEMBER_TABLE', $oTable->getHTML());
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:73,代码来源:class.ilObjiLincCourseGUI.php

示例4: showItems

 public function showItems()
 {
     global $ilObjDataCache, $ilUser, $ilToolbar;
     include_once './Services/Payment/classes/class.ilPaymentPrices.php';
     include_once './Services/Payment/classes/class.ilPaymentCurrency.php';
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.pay_shopping_cart.html', 'Services/Payment');
     //		var_dump($_SESSION['shop_user_id']);
     //		if(isset($_SESSION['shop_user_id']))
     //		{
     //
     //			$this->user_obj->_toggleActiveStatusOfUsers(array($this->user_obj->getId()), 1);
     //		}
     if ($_SESSION['forceShoppingCartRedirect'] == '1') {
         $_SESSION['forceShoppingCartRedirect'] = 0;
         $this->tpl->touchBlock("close_js");
         return true;
     }
     $this->initShoppingCartObject();
     include_once './Services/Payment/classes/class.ilPaymentSettings.php';
     $genSet = ilPaymentSettings::_getInstance();
     $pay_methods = $this->_getPayMethods(true);
     $num_items = 0;
     $desc = array();
     //course_objects
     $is_crs_object = false;
     $crs_obj_ids = array();
     //file_objects,exercise_objects
     $is_file_object = false;
     // learning_modules,
     $is_lm_object = false;
     $lm_obj_ids = array();
     if ($genSet->get('show_sr_shoppingcart') == 1) {
         require_once 'Services/RTE/classes/class.ilRTE.php';
         $regulations = ilRTE::_replaceMediaObjectImageSrc($genSet->get('statutory_regulations'), 1);
         $this->tpl->setVariable('REGULATIONS_TITLE', $this->lng->txt('statutory_regulations'));
         $this->tpl->setVariable('REGULATIONS', $regulations);
     }
     $ilToolbar->addButton($this->lng->txt('payment_back_to_shop'), 'ilias.php?baseClass=ilShopController');
     foreach ($pay_methods as $pay_method) {
         $this->totalVat = 0;
         $tpl = new ilTemplate($this->_getTemplateFilename($pay_method['pm_title']), true, 'Services/Payment');
         $coupon_session_id = $pay_method['pm_title'];
         if (count($items = $this->psc_obj->getEntries($pay_method['pm_id']))) {
             $counter = 0;
             $paypal_counter = 0;
             $total_price = 0;
             foreach ($items as $item) {
                 $tmp_pobject = new ilPaymentObject($this->user_obj, $item['pobject_id']);
                 $obj_id = $ilObjDataCache->lookupObjId($tmp_pobject->getRefId());
                 $obj_type = $ilObjDataCache->lookupType($obj_id);
                 $obj_title = $ilObjDataCache->lookupTitle($obj_id);
                 $desc[] = "[" . $obj_type . "] " . $obj_title;
                 $price_arr = ilPaymentPrices::_getPrice($item['price_id']);
                 # checks object_type: needed for purchasing file or crs objects without login
                 switch ($obj_type) {
                     case 'crs':
                         // if is_crs there an user-account will be autogenerated
                         $is_crs_object = true;
                         $_SESSION['is_crs_object'] = true;
                         $crs_obj_ids[] = $obj_id;
                         $_SESSION['crs_obj_ids'] = $crs_obj_ids;
                         break;
                     case 'lm':
                     case 'sahs':
                     case 'htlm':
                     case 'tst':
                         $is_lm_object = true;
                         $_SESSION['is_lm_object'] = true;
                         $lm_obj_ids[] = $obj_id;
                         $_SESSION['lm_obj_ids'] = $lm_obj_ids;
                         break;
                     case 'exc':
                     case 'file':
                         $is_file_object = true;
                         break;
                     default:
                         break;
                 }
                 $direct_paypal_info_output = true;
                 $assigned_coupons = '';
                 if (!empty($_SESSION['coupons'][$coupon_session_id])) {
                     $price = $price_arr['price'];
                     $item['math_price'] = (double) $price;
                     foreach ($_SESSION['coupons'][$coupon_session_id] as $key => $coupon) {
                         $this->coupon_obj->setId($coupon['pc_pk']);
                         $this->coupon_obj->setCurrentCoupon($coupon);
                         if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId())) {
                             $assigned_coupons .= $this->lng->txt('paya_coupons_coupon') . ': ' . $coupon['pcc_code'];
                             $_SESSION['coupons'][$coupon_session_id][$key]['total_objects_coupon_price'] += (double) $price;
                             $_SESSION['coupons'][$coupon_session_id][$key]['items'][] = $item;
                             $direct_paypal_info_output = false;
                         }
                     }
                 }
                 $f_result[$counter]['item'] = ilUtil::formCheckBox(0, 'item[]', $item['psc_id']);
                 $subtype = '';
                 if ($obj_type == 'exc') {
                     $subtype = ' (' . $this->lng->txt($tmp_pobject->getSubtype()) . ')';
                     $f_result[$counter]['title'] = "<a href=\"goto.php?target=" . $obj_type . "_" . $tmp_pobject->getRefId() . "\">" . $obj_title . "</a>" . $subtype;
                 } else {
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilShopShoppingCartGUI.php

示例5: listDesktopItemsObject

 function listDesktopItemsObject()
 {
     global $rbacsystem, $rbacreview, $tree;
     #if(!$rbacsystem->checkAccess('edit_permission', $this->rolf_ref_id))
     /*
     if(!$this->checkAccess('edit_permission'))
     {
     	ilUtil::sendFailure()
     	$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
     }
     */
     if (!$rbacreview->isAssignable($this->object->getId(), $this->rolf_ref_id) && $this->rolf_ref_id != ROLE_FOLDER_ID) {
         ilUtil::sendInfo($this->lng->txt('role_no_users_no_desk_items'));
         return true;
     }
     include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
     $role_desk_item_obj =& new ilRoleDesktopItem($this->object->getId());
     if ($rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
         $this->__showButton('selectDesktopItem', $this->lng->txt('role_desk_add'));
     }
     if (!count($items = $role_desk_item_obj->getAll())) {
         ilUtil::sendInfo($this->lng->txt('role_desk_none_created'));
         return true;
     }
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.role_desktop_item_list.html", "Services/AccessControl");
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath('icon_role.png'));
     $this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->lng->txt('obj_role'));
     $this->tpl->setVariable("TBL_TITLE", $this->lng->txt('role_assigned_desk_items') . ' (' . $this->object->getTitle() . ')');
     $this->tpl->setVariable("HEADER_DESC", $this->lng->txt('description'));
     $this->tpl->setVariable("BTN_DELETE", $this->lng->txt('delete'));
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.png'));
     $counter = 0;
     foreach ($items as $role_item_id => $item) {
         $tmp_obj = ilObjectFactory::getInstanceByRefId($item['item_id']);
         if (strlen($desc = $tmp_obj->getDescription())) {
             $this->tpl->setCurrentBlock("description");
             $this->tpl->setVariable("DESCRIPTION_DESK", $desc);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("desk_row");
         $this->tpl->setVariable("DESK_TITLE", $tmp_obj->getTitle());
         $this->tpl->setVariable("ROW_CLASS", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow2'));
         $this->tpl->setVariable("CHECK_DESK", ilUtil::formCheckBox(0, 'del_desk_item[]', $role_item_id));
         $this->tpl->setVariable("TXT_PATH", $this->lng->txt('path') . ':');
         $this->tpl->setVariable("PATH", $this->__formatPath($tree->getPathFull($item['item_id'])));
         $this->tpl->parseCurrentBlock();
     }
     return true;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:50,代码来源:class.ilObjRoleGUI.php

示例6: permObject

 /**
  * display permissions
  * 
  * @access	public
  */
 function permObject()
 {
     global $rbacadmin, $rbacreview, $rbacsystem, $objDefinition;
     if (!$rbacsystem->checkAccess('write', $this->rolf_ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"), $this->ilias->error_obj->WARNING);
         exit;
     }
     $to_filter = $objDefinition->getSubobjectsToFilter();
     $tpl_filter = array();
     $internal_tpl = false;
     if ($internal_tpl = $this->object->isInternalTemplate()) {
         $tpl_filter = $this->object->getFilterOfInternalTemplate();
     }
     $operation_info = $rbacreview->getOperationAssignment();
     foreach ($operation_info as $info) {
         if ($objDefinition->getDevMode($info['type'])) {
             continue;
         }
         // FILTER SUBOJECTS OF adm OBJECT
         if (in_array($info['type'], $to_filter)) {
             continue;
         }
         if ($internal_tpl and $tpl_filter and !in_array($info['type'], $tpl_filter)) {
             continue;
         }
         $rbac_objects[$info['typ_id']] = array("obj_id" => $info['typ_id'], "type" => $info['type']);
         $txt = $objDefinition->isPlugin($info['type']) ? ilPlugin::lookupTxt("rep_robj", $info['type'], $info['type'] . "_" . $info['operation']) : $this->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']);
         } elseif (substr($info['operation'], 0, 6) == 'create') {
             $txt = $this->lng->txt('rbac_' . $info['operation']);
         }
         $rbac_operations[$info['typ_id']][$info['ops_id']] = array("ops_id" => $info['ops_id'], "title" => $info['operation'], "name" => $txt);
     }
     foreach ($rbac_objects as $key => $obj_data) {
         if ($objDefinition->isPlugin($obj_data["type"])) {
             $rbac_objects[$key]["name"] = ilPlugin::lookupTxt("rep_robj", $obj_data["type"], "obj_" . $obj_data["type"]);
         } else {
             $rbac_objects[$key]["name"] = $this->lng->txt("obj_" . $obj_data["type"]);
         }
         $rbac_objects[$key]["ops"] = $rbac_operations[$key];
     }
     sort($rbac_objects);
     foreach ($rbac_objects as $key => $obj_data) {
         sort($rbac_objects[$key]["ops"]);
     }
     // sort by (translated) name of object type
     $rbac_objects = ilUtil::sortArray($rbac_objects, "name", "asc");
     // BEGIN CHECK_PERM
     foreach ($rbac_objects as $key => $obj_data) {
         $arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data["type"], $this->rolf_ref_id);
         $arr_checked = array_intersect($arr_selected, array_keys($rbac_operations[$obj_data["obj_id"]]));
         foreach ($rbac_operations[$obj_data["obj_id"]] as $operation) {
             $checked = in_array($operation["ops_id"], $arr_checked);
             $disabled = false;
             // Es wird eine 2-dim Post Variable �bergeben: perm[rol_id][ops_id]
             $box = ilUtil::formCheckBox($checked, "template_perm[" . $obj_data["type"] . "][]", $operation["ops_id"], $disabled);
             $output["perm"][$obj_data["obj_id"]][$operation["ops_id"]] = $box;
         }
     }
     // END CHECK_PERM
     $output["col_anz"] = count($rbac_objects);
     $output["txt_save"] = $this->lng->txt("save");
     $output["check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id, $this->object->getId()), "protected", 1);
     $output["text_protected"] = $this->lng->txt("role_protect_permissions");
     /************************************/
     /*		adopt permissions form		*/
     /************************************/
     $output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
     // send message for system role
     if ($this->object->getId() == SYSTEM_ROLE_ID) {
         $output["adopt"] = array();
         ilUtil::sendFailure($this->lng->txt("msg_sysrole_not_editable"));
     } else {
         // BEGIN ADOPT_PERMISSIONS
         $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id, true);
         // sort output for correct color changing
         ksort($parent_role_ids);
         foreach ($parent_role_ids as $key => $par) {
             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			*/
     /************************************/
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilObjRoleTemplateGUI.php

示例7: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     //var_dump($a_set);
     $i = $a_set["Nr"];
     // command: edit marker position
     if ($a_set["Overlay"] != "") {
         $this->tpl->setCurrentBlock("cmd");
         $this->tpl->setVariable("CMD_ID", "ov_" . $i);
         $this->tpl->setVariable("HREF_CMD", "#");
         $this->tpl->setVariable("CMD_CLASS", "ov_cmd");
         $this->tpl->setVariable("TXT_CMD", $lng->txt("cont_edit_overlay_position"));
         $this->tpl->parseCurrentBlock();
     }
     // command: edit marker position
     if ($a_set["PopupNr"] != "") {
         $this->tpl->setCurrentBlock("cmd");
         $this->tpl->setVariable("CMD_ID", "pop_" . $i);
         $this->tpl->setVariable("HREF_CMD", "#");
         $this->tpl->setVariable("CMD_CLASS", "pop_cmd");
         $this->tpl->setVariable("TXT_CMD", $lng->txt("cont_edit_popup_position"));
         $this->tpl->parseCurrentBlock();
     }
     if ($a_set["Type"] == ilPCInteractiveImage::AREA) {
         $this->tpl->setCurrentBlock("coords");
         $this->tpl->setVariable("VAL_COORDS", implode(explode(",", $this->area[$a_set["Nr"]]["Coords"]), ", "));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setVariable("TYPE", $lng->txt("cont_" . $this->area[$a_set["Nr"]]["Shape"]));
     } else {
         // command: edit marker position
         $this->tpl->setCurrentBlock("cmd");
         $this->tpl->setVariable("CMD_ID", "mark_" . $i);
         $this->tpl->setVariable("HREF_CMD", "#");
         $this->tpl->setVariable("CMD_CLASS", "mark_cmd");
         $this->tpl->setVariable("TXT_CMD", $lng->txt("cont_edit_marker_position"));
         $this->tpl->parseCurrentBlock();
         // marker position
         $this->tpl->setCurrentBlock("marker_pos");
         $this->tpl->setVariable("VAR_MARK_POS", "markpos[" . $i . "]");
         $this->tpl->setVariable("ID_MARK_POS", "markpos_" . $i);
         $this->tpl->setVariable("VAL_MARK_POS", $a_set["MarkerX"] . "," . $a_set["MarkerY"]);
         $this->tpl->setVariable("TXT_MLEFT", $lng->txt("cont_left"));
         $this->tpl->setVariable("TXT_MTOP", $lng->txt("cont_top"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setVariable("TYPE", $lng->txt("cont_marker"));
     }
     $this->tpl->setVariable("CHECKBOX", ilUtil::formCheckBox("", "tr[]", $i));
     $this->tpl->setVariable("VAR_NAME", "title[" . $i . "]");
     $this->tpl->setVariable("VAL_NAME", $a_set["Title"]);
     $this->tpl->setVariable("VAR_POS", "ovpos[" . $i . "]");
     $this->tpl->setVariable("ID_OV_POS", "ovpos_" . $i);
     $this->tpl->setVariable("ID_POP_POS", "poppos_" . $i);
     $this->tpl->setVariable("VAR_POP_POS", "poppos[" . $i . "]");
     $this->tpl->setVariable("VAR_POP_SIZE", "popsize[" . $i . "]");
     $this->tpl->setVariable("VAL_POS", $a_set["OverlayX"] . "," . $a_set["OverlayY"]);
     $this->tpl->setVariable("VAL_POP_POS", $a_set["PopupX"] . "," . $a_set["PopupY"]);
     $this->tpl->setVariable("VAL_POP_SIZE", $a_set["PopupWidth"] . "," . $a_set["PopupHeight"]);
     $this->tpl->setVariable("TXT_IMG", $lng->txt("image"));
     $this->tpl->setVariable("TXT_TITLE", $lng->txt("title"));
     $this->tpl->setVariable("TXT_LEFT", $lng->txt("cont_left"));
     $this->tpl->setVariable("TXT_TOP", $lng->txt("cont_top"));
     $this->tpl->setVariable("TXT_WIDTH", $lng->txt("cont_width"));
     $this->tpl->setVariable("TXT_HEIGHT", $lng->txt("cont_height"));
     $this->tpl->setVariable("OVERLAY_IMAGE", ilUtil::formSelect($a_set["Overlay"], "ov[" . $i . "]", $this->ov_options, false, true));
     $this->tpl->setVariable("CONTENT_POPUP", ilUtil::formSelect($a_set["PopupNr"], "pop[" . $i . "]", $this->pop_options, false, true));
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:70,代码来源:class.ilPCIIMTriggerTableGUI.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: roleassignmentObject

 /**
  * display roleassignment panel
  *
  * @access	public
  */
 function roleassignmentObject()
 {
     global $rbacreview, $rbacsystem, $ilUser, $ilTabs;
     $ilTabs->activateTab("role_assignment");
     if (!$rbacsystem->checkAccess("edit_roleassignment", $this->usrf_ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_assign_role_to_user"), $this->ilias->error_obj->MESSAGE);
     }
     $_SESSION['filtered_roles'] = isset($_POST['filter']) ? $_POST['filter'] : $_SESSION['filtered_roles'];
     if ($_SESSION['filtered_roles'] > 5) {
         $_SESSION['filtered_roles'] = 0;
     }
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.usr_role_assignment.html', 'Services/User');
     if (false) {
         $this->tpl->setCurrentBlock("filter");
         $this->tpl->setVariable("FILTER_TXT_FILTER", $this->lng->txt('filter'));
         $this->tpl->setVariable("SELECT_FILTER", $this->__buildFilterSelect());
         $this->tpl->setVariable("FILTER_ACTION", $this->ctrl->getFormAction($this));
         $this->tpl->setVariable("FILTER_NAME", 'roleassignment');
         $this->tpl->setVariable("FILTER_VALUE", $this->lng->txt('apply_filter'));
         $this->tpl->parseCurrentBlock();
     }
     // init table
     include_once "./Services/User/classes/class.ilRoleAssignmentTableGUI.php";
     $tab = new ilRoleAssignmentTableGUI($this, "roleassignment");
     // now get roles depending on filter settings
     $role_list = $rbacreview->getRolesByFilter($tab->filter["role_filter"], $this->object->getId());
     $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
     $counter = 0;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $records = array();
     foreach ($role_list as $role) {
         // fetch context path of role
         $rolf = $rbacreview->getFoldersAssignedToRole($role["obj_id"], true);
         // only list roles that are not set to status "deleted"
         if ($rbacreview->isDeleted($rolf[0])) {
             continue;
         }
         // build context path
         $path = "";
         if ($this->tree->isInTree($rolf[0])) {
             if ($rolf[0] == ROLE_FOLDER_ID) {
                 $path = $this->lng->txt("global");
             } else {
                 $tmpPath = $this->tree->getPathFull($rolf[0]);
                 // count -1, to exclude the role folder itself
                 /*for ($i = 1; $i < (count($tmpPath)-1); $i++)
                 				    {
                 					    if ($path != "")
                 					    {
                 						    $path .= " > ";
                 					    }
                 
                 					    $path .= $tmpPath[$i]["title"];
                 				    }*/
                 $path = $tmpPath[count($tmpPath) - 1]["title"];
             }
         } else {
             $path = "<b>Rolefolder " . $rolf[0] . " not found in tree! (Role " . $role["obj_id"] . ")</b>";
         }
         $disabled = false;
         // disable checkbox for system role for the system user
         if ($this->object->getId() == SYSTEM_USER_ID and $role["obj_id"] == SYSTEM_ROLE_ID or !in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles($ilUser->getId())) and $role["obj_id"] == SYSTEM_ROLE_ID) {
             $disabled = true;
         }
         // protected admin role
         if ($role['obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
             include_once './Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
             if (ilSecuritySettings::_getInstance()->isAdminRoleProtected()) {
                 $disabled = true;
             }
         }
         if (substr($role["title"], 0, 3) == "il_") {
             if (!$assignable) {
                 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role["obj_id"], true);
                 $rolf2 = $rolf_arr[0];
             } else {
                 $rolf2 = $rolf;
             }
             $parent_node = $this->tree->getNodeData($rolf2);
             $role["description"] = $this->lng->txt("obj_" . $parent_node["type"]) . "&nbsp;(#" . $parent_node["obj_id"] . ")";
         }
         $role_ids[$counter] = $role["obj_id"];
         $result_set[$counter][] = $checkbox = ilUtil::formCheckBox(in_array($role["obj_id"], $assigned_roles), "role_id[]", $role["obj_id"], $disabled) . "<input type=\"hidden\" name=\"role_id_ctrl[]\" value=\"" . $role["obj_id"] . "\"/>";
         $this->ctrl->setParameterByClass("ilobjrolegui", "ref_id", $rolf[0]);
         $this->ctrl->setParameterByClass("ilobjrolegui", "obj_id", $role["obj_id"]);
         $result_set[$counter][] = $link = "<a href=\"" . $this->ctrl->getLinkTargetByClass("ilobjrolegui", "perm") . "\">" . ilObjRole::_getTranslation($role["title"]) . "</a>";
         $title = ilObjRole::_getTranslation($role["title"]);
         $result_set[$counter][] = $role["description"];
         // Add link to objector local Rores
         if ($role["role_type"] == "local") {
             // Get Object to the role
             $obj_id = ilRbacReview::getObjectOfRole($role["rol_id"]);
             $obj_type = ilObject::_lookupType($obj_id);
             $ref_ids = ilObject::_getAllReferences($obj_id);
             foreach ($ref_ids as $ref_id) {
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilObjUserGUI.php

示例10: fillRow

 /**
  * Standard Version of Fill Row. Most likely to
  * be overwritten by derived class.
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl, $ilAccess;
     $area = $a_set["area"];
     $i = $a_set["nr"];
     $this->tpl->setVariable("CHECKBOX", ilUtil::formCheckBox("", "area[]", $i));
     $this->tpl->setVariable("VAR_NAME", "name_" . $i);
     $this->tpl->setVariable("VAL_NAME", $area->getTitle());
     $this->tpl->setVariable("VAL_SHAPE", $area->getShape());
     $this->tpl->setVariable("VAL_HIGHL_MODE", ilUtil::formSelect($area->getHighlightMode(), "hl_mode_" . $i, $this->highl_modes, false, true));
     $this->tpl->setVariable("VAL_HIGHL_CLASS", ilUtil::formSelect($area->getHighlightClass(), "hl_class_" . $i, $this->highl_classes, false, true));
     $this->tpl->setVariable("VAL_COORDS", implode(explode(",", $area->getCoords()), ", "));
     switch ($area->getLinkType()) {
         case "ext":
             $this->tpl->setVariable("VAL_LINK", $area->getHRef());
             break;
         case "int":
             $link_str = $this->parent_obj->getMapAreaLinkString($area->getTarget(), $area->getType(), $area->getTargetFrame());
             $this->tpl->setVariable("VAL_LINK", $link_str);
             break;
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:26,代码来源:class.ilImageMapTableGUI.php


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