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


PHP ilTable2GUI::setFormName方法代码示例

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


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

示例1: showResults

 public function showResults()
 {
     global $lng, $ilUser, $rbacreview, $ilObjDataCache;
     $form = $this->initSearchForm();
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_search.html", "Services/Contact");
     $this->tpl->setVariable("ACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setTitle($this->lng->txt("mail"));
     $this->tpl->setVariable('SEARCHFORM', $form->getHtml());
     // #14109
     if (strlen($_SESSION['mail_search_search']) < 3) {
         if ($_GET["ref"] != "wsp") {
             $this->tpl->show();
         }
         return;
     }
     $abook = new ilAddressbook($ilUser->getId());
     $entries = $abook->searchUsers(addslashes(urldecode($_SESSION['mail_search_search'])));
     // remove all contacts who are not registered users for personal workspace
     if ($_GET["ref"] == "wsp") {
         foreach ($entries as $idx => $entry) {
             if (!$entry["login"]) {
                 unset($entries[$idx]);
             }
         }
     }
     if (count($entries)) {
         $tbl_addr = new ilTable2GUI($this);
         $tbl_addr->setTitle($lng->txt('mail_addressbook'));
         $tbl_addr->setRowTemplate('tpl.mail_search_addr_row.html', 'Services/Contact');
         $result = array();
         $counter = 0;
         foreach ($entries as $entry) {
             if ($_GET["ref"] != "wsp") {
                 $result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_addr[]', $entry['login'] ? $entry['login'] : $entry['email']) . ilUtil::formCheckbox(0, 'search_name_cc[]', $entry['login'] ? $entry['login'] : $entry['email']) . ilUtil::formCheckbox(0, 'search_name_bcc[]', $entry['login'] ? $entry['login'] : $entry['email']);
             } else {
                 $user_id = ilObjUser::_loginExists($entry["login"]);
                 $result[$counter]['check'] = ilUtil::formCheckbox(0, 'search_name_to_addr[]', $user_id);
             }
             $result[$counter]['login'] = $entry['login'];
             $result[$counter]['firstname'] = $entry['firstname'];
             $result[$counter]['lastname'] = $entry['lastname'];
             $id = ilObjUser::_lookupId($entry['login']);
             if (ilObjUser::_lookupPref($id, 'public_email') == 'y' || !$entry['login']) {
                 $has_mail_addr = true;
                 $result[$counter]['email'] = $entry['email'];
             }
             ++$counter;
         }
         if ($_GET["ref"] != "wsp") {
             $tbl_addr->addColumn($this->lng->txt('mail_to') . '/' . $this->lng->txt('cc') . '/' . $this->lng->txt('bc'), 'check', '10%');
         } else {
             $tbl_addr->addColumn("", "", "1%");
         }
         $tbl_addr->addColumn($this->lng->txt('login'), 'login', "15%");
         $tbl_addr->addColumn($this->lng->txt('firstname'), 'firstname', "15%");
         $tbl_addr->addColumn($this->lng->txt('lastname'), 'lastname', "15%");
         if ($has_mail_addr) {
             foreach ($result as $key => $val) {
                 if ($val['email'] == '') {
                     $result[$key]['email'] = '&nbsp;';
                 }
             }
             $tbl_addr->addColumn($this->lng->txt('email'), 'email', "15%");
         }
         $tbl_addr->setData($result);
         $tbl_addr->setDefaultOrderField('login');
         $tbl_addr->setPrefix('addr_');
         $tbl_addr->enable('select_all');
         $tbl_addr->setSelectAllCheckbox('search_name_to_addr');
         $tbl_addr->setFormName('recipients');
         $this->tpl->setVariable('TABLE_ADDR', $tbl_addr->getHTML());
     }
     include_once 'Services/Search/classes/class.ilQueryParser.php';
     include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
     include_once 'Services/Search/classes/class.ilSearchResult.php';
     $all_results = new ilSearchResult();
     $query_parser = new ilQueryParser(addcslashes($_SESSION['mail_search_search'], '%_'));
     $query_parser->setCombination(QP_COMBINATION_AND);
     $query_parser->setMinWordLength(3);
     $query_parser->parse();
     $user_search =& ilObjectSearchFactory::_getUserSearchInstance($query_parser);
     $user_search->enableActiveCheck(true);
     $user_search->setFields(array('login'));
     $result_obj = $user_search->performSearch();
     $all_results->mergeEntries($result_obj);
     $user_search->setFields(array('firstname'));
     $result_obj = $user_search->performSearch();
     $all_results->mergeEntries($result_obj);
     $user_search->setFields(array('lastname'));
     $result_obj = $user_search->performSearch();
     $all_results->mergeEntries($result_obj);
     $all_results->setMaxHits(100000);
     $all_results->preventOverwritingMaxhits(true);
     $all_results->filter(ROOT_FOLDER_ID, true);
     // Filter users (depends on setting in user accounts)
     include_once 'Services/User/classes/class.ilUserFilter.php';
     $users = ilUserFilter::getInstance()->filter($all_results->getResultIds());
     if (count($users)) {
         $tbl_users = new ilTable2GUI($this);
         $tbl_users->setTitle($lng->txt('system') . ': ' . $lng->txt('persons'));
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilMailSearchGUI.php

示例2: editSocialBookmarksObject

 /**
  * Configure social bookmark settings
  * 
  * @access	public
  */
 function editSocialBookmarksObject()
 {
     global $ilAccess, $rbacreview, $lng, $ilCtrl;
     if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $this->__initSubTabs("editSocialBookmarks");
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
     $rset = ilSocialBookmarks::_getEntry();
     $counter = 0;
     foreach ($rset as $row) {
         $current_selection_list = new ilAdvancedSelectionListGUI();
         $current_selection_list->setListTitle($lng->txt("actions"));
         $current_selection_list->setId("act_" . $counter++);
         $ilCtrl->setParameter($this, 'sbm_id', $row->sbm_id);
         $current_selection_list->addItem($lng->txt("edit"), '', $ilCtrl->getLinkTarget($this, "editSocialBookmark"));
         $current_selection_list->addItem($lng->txt("delete"), '', $ilCtrl->getLinkTarget($this, "deleteSocialBookmarks"));
         $toggle_action = '';
         if ($row->sbm_active) {
             $current_selection_list->addItem($lng->txt("socialbm_disable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "disableSocialBookmarks"));
         } else {
             $current_selection_list->addItem($lng->txt("socialbm_enable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "enableSocialBookmarks"));
         }
         $dset[] = array('CHECK' => ilUtil::formCheckbox(0, 'sbm_id[]', $row->sbm_id), 'ID' => $row->sbm_id, 'TITLE' => $row->sbm_title, 'LINK' => str_replace('{', '&#123;', $row->sbm_link), 'ICON' => $row->sbm_icon, 'ACTIVE' => $row->sbm_active ? $lng->txt('enabled') : $lng->txt('disabled'), 'ACTIONS' => $current_selection_list->getHTML(), 'TOGGLE_LINK' => $toggle_action);
         $ilCtrl->clearParameters($this);
     }
     require_once 'Services/Table/classes/class.ilTable2GUI.php';
     $table = new ilTable2GUI($this, 'editSocialBookmarks');
     $table->setFormName('smtable');
     $table->setId('smtable');
     $table->setPrefix('sm');
     $table->setFormAction($ilCtrl->getFormAction($this, 'saveSocialBookmarks'));
     $table->addColumn('', 'check', '', true);
     $table->addColumn($lng->txt('icon'), '');
     $table->addColumn($lng->txt('title'), 'TITLE');
     $table->addColumn($lng->txt('link'), 'LINK');
     $table->addColumn($lng->txt('active'), 'ACTIVE');
     $table->addColumn($lng->txt('actions'), '');
     $table->setTitle($lng->txt('bm_manage_social_bm'));
     $table->setData($dset);
     $table->setRowTemplate('tpl.social_bookmarking_row.html', 'Services/Administration');
     $table->setSelectAllCheckbox('sbm_id');
     $table->setDefaultOrderField("title");
     $table->setDefaultOrderDirection("asc");
     $table->addMultiCommand('enableSocialBookmarks', $lng->txt('socialbm_enable'));
     $table->addMultiCommand('disableSocialBookmarks', $lng->txt('socialbm_disable'));
     $table->addMultiCommand('deleteSocialBookmarks', $lng->txt('delete'));
     $table->addCommandButton('addSocialBookmark', $lng->txt('create'));
     $this->tpl->setVariable('ADM_CONTENT', $table->getHTML());
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:56,代码来源:class.ilObjExternalToolsSettingsGUI.php


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