コード例 #1
0
 /**
  * Init standard search form.
  */
 public function getSearchAreaForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setOpenTag(false);
     $form->setCloseTag(false);
     // term combination
     $radg = new ilHiddenInputGUI('search_term_combination');
     $radg->setValue(ilSearchSettings::getInstance()->getDefaultOperator());
     $form->addItem($radg);
     // search area
     include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php";
     $ti = new ilRepositorySelectorInputGUI($lng->txt("search_area"), "area");
     $ti->setSelectText($lng->txt("search_select_search_area"));
     $form->addItem($ti);
     $ti->readFromSession();
     // alex, 15.8.2012: Added the following lines to get the value
     // from the main menu top right input search form
     if (isset($_POST["root_id"])) {
         $ti->setValue($_POST["root_id"]);
         $ti->writeToSession();
     }
     $form->setFormAction($ilCtrl->getFormAction($this, 'performSearch'));
     return $form;
 }
コード例 #2
0
 /**
  * Init filter
  *
  * @param bool $a_split_learning_resources
  */
 public function initFilter($a_split_learning_resources = false, $a_include_no_status_filter = true)
 {
     global $lng, $ilObjDataCache;
     $this->setDisableFilterHiding(true);
     // object type selection
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
     $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
     $this->addFilterItem($si);
     $si->readFromSession();
     if (!$si->getValue()) {
         $si->setValue("crs");
     }
     $this->filter["type"] = $si->getValue();
     // hidden items
     include_once "./Services/Form/classes/class.ilMultiSelectInputGUI.php";
     $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
     $this->addFilterItem($msi);
     $msi->readFromSession();
     $this->filter["hide"] = $msi->getValue();
     if ($this->filter["hide"]) {
         // create options from current value
         $types = $this->getCurrentFilter(true);
         $type = $types["type"];
         $options = array();
         if ($type == 'lres') {
             $type = array('lm', 'sahs', 'htlm', 'dbk');
         } else {
             $type = array($type);
         }
         foreach ($this->filter["hide"] as $obj_id) {
             if (in_array($ilObjDataCache->lookupType($obj_id), $type)) {
                 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
             }
         }
         $msi->setOptions($options);
     }
     // title/description
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     // repository area selection
     include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php";
     $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
     $rs->setSelectText($lng->txt("trac_select_area"));
     $this->addFilterItem($rs);
     $rs->readFromSession();
     $this->filter["area"] = $rs->getValue();
     // hide "not started yet"
     if ($a_include_no_status_filter) {
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
         $this->addFilterItem($cb);
         $cb->readFromSession();
         $this->filter["status"] = $cb->getChecked();
     }
 }
コード例 #3
0
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilCtrl;
     // Show context filter
     if ($this->getMode() == self::MODE_LOCAL_USER) {
         include_once './Services/User/classes/class.ilLocalUser.php';
         $parent_ids = ilLocalUser::_getFolderIds();
         if (count($parent_ids) > 1) {
             include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
             $co = new ilSelectInputGUI($lng->txt('context'), 'time_limit_owner');
             $ref_id = $this->getUserFolderId();
             $opt[0] = $this->lng->txt('all_users');
             $opt[$this->getUserFolderId()] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($this->getUserFolderId())) . ')';
             foreach ($parent_ids as $parent_id) {
                 if ($parent_id == $this->getUserFolderId()) {
                     continue;
                 }
                 switch ($parent_id) {
                     case USER_FOLDER_ID:
                         $opt[USER_FOLDER_ID] = $lng->txt('global_user');
                         break;
                     default:
                         $opt[$parent_id] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($parent_id)) . ')';
                         break;
                 }
             }
             $co->setOptions($opt);
             $this->addFilterItem($co);
             $co->readFromSession();
             $this->filter['time_limit_owner'] = $co->getValue();
         }
     }
     // User name, login, email filter
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($lng->txt("login") . "/" . $lng->txt("email") . "/" . $lng->txt("name"), "query");
     $ul->setDataSource($ilCtrl->getLinkTarget($this->getParentObject(), "addUserAutoComplete", "", true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter["query"] = $ul->getValue();
     /*
     include_once("./Services/Form/classes/class.ilTextInputGUI.php");
     $ti = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".$lng->txt("name"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     */
     // activation
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = array("" => $lng->txt("user_all"), "active" => $lng->txt("active"), "inactive" => $lng->txt("inactive"));
     $si = new ilSelectInputGUI($this->lng->txt("user_activation"), "activation");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["activation"] = $si->getValue();
     // limited access
     include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     $cb = new ilCheckboxInputGUI($this->lng->txt("user_limited_access"), "limited_access");
     $this->addFilterItem($cb);
     $cb->readFromSession();
     $this->filter["limited_access"] = $cb->getChecked();
     // last login
     include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
     $di = new ilDateTimeInputGUI($this->lng->txt("user_last_login_before"), "last_login");
     $default_date = new ilDateTime(time(), IL_CAL_UNIX);
     $default_date->increment(IL_CAL_DAY, 1);
     $di->setDate($default_date);
     $this->addFilterItem($di);
     $di->readFromSession();
     $this->filter["last_login"] = $di->getDate();
     if ($this->getMode() == self::MODE_USER_FOLDER) {
         // no assigned courses
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $cb = new ilCheckboxInputGUI($this->lng->txt("user_no_courses"), "no_courses");
         $this->addFilterItem($cb);
         $cb->readFromSession();
         $this->filter["no_courses"] = $cb->getChecked();
         // no assigned groups
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $ng = new ilCheckboxInputGUI($this->lng->txt("user_no_groups"), "no_groups");
         $this->addFilterItem($ng);
         $ng->readFromSession();
         $this->filter['no_groups'] = $ng->getChecked();
         // course/group members
         include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php";
         $rs = new ilRepositorySelectorInputGUI($lng->txt("user_member_of_course_group"), "course_group");
         $rs->setSelectText($lng->txt("user_select_course_group"));
         $rs->setHeaderMessage($lng->txt("user_please_select_course_group"));
         $rs->setClickableTypes(array("crs", "grp"));
         $this->addFilterItem($rs);
         $rs->readFromSession();
         $this->filter["course_group"] = $rs->getValue();
     }
     // global roles
     $options = array("" => $lng->txt("user_any"));
     $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
     foreach ($roles as $role) {
         $options[$role["rol_id"]] = $role["title"];
     }
     $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["global_role"] = $si->getValue();
 }