/**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $ilSetting;
     if ($this->is_root) {
         return parent::initFilter(true, false);
     }
     // show only if extended data was activated in lp settings
     include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
     $tracking = new ilObjUserTracking();
     $item = $this->addFilterItemByMetaType("user_total", ilTable2GUI::FILTER_NUMBER_RANGE, true, "∑ " . $lng->txt("users"));
     $this->filter["user_total"] = $item->getValue();
     if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
         $item = $this->addFilterItemByMetaType("read_count", ilTable2GUI::FILTER_NUMBER_RANGE, true, "∑ " . $lng->txt("trac_read_count"));
         $this->filter["read_count"] = $item->getValue();
     }
     if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) {
         $item = $this->addFilterItemByMetaType("spent_seconds", ilTable2GUI::FILTER_DURATION_RANGE, true, "Ø " . $lng->txt("trac_spent_seconds") . " / " . $lng->txt("user"));
         $this->filter["spent_seconds"]["from"] = $item->getCombinationItem("from")->getValueInSeconds();
         $this->filter["spent_seconds"]["to"] = $item->getCombinationItem("to")->getValueInSeconds();
     }
     $item = $this->addFilterItemByMetaType("percentage", ilTable2GUI::FILTER_NUMBER_RANGE, true, "Ø " . $lng->txt("trac_percentage") . " / " . $lng->txt("user"));
     $this->filter["percentage"] = $item->getValue();
     // do not show status if learning progress is deactivated
     if ($this->olp->isActive()) {
         include_once "Services/Tracking/classes/class.ilLPStatus.php";
         $item = $this->addFilterItemByMetaType("status", ilTable2GUI::FILTER_SELECT, true);
         $item->setOptions(array("" => $lng->txt("trac_all"), ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM + 1 => $lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED), ilLPStatus::LP_STATUS_IN_PROGRESS_NUM + 1 => $lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS), ilLPStatus::LP_STATUS_COMPLETED_NUM + 1 => $lng->txt(ilLPStatus::LP_STATUS_COMPLETED), ilLPStatus::LP_STATUS_FAILED_NUM + 1 => $lng->txt(ilLPStatus::LP_STATUS_FAILED)));
         $this->filter["status"] = $item->getValue();
         if ($this->filter["status"]) {
             $this->filter["status"]--;
         }
         $item = $this->addFilterItemByMetaType("trac_status_changed", ilTable2GUI::FILTER_DATE_RANGE, true);
         $this->filter["status_changed"] = $item->getDate();
     }
     if (ilObject::_lookupType($this->obj_id) != "lm") {
         $item = $this->addFilterItemByMetaType("mark", ilTable2GUI::FILTER_TEXT, true, $lng->txt("trac_mark"));
         $this->filter["mark"] = $item->getValue();
     }
     if ($ilSetting->get("usr_settings_course_export_gender")) {
         $item = $this->addFilterItemByMetaType("gender", ilTable2GUI::FILTER_SELECT, true);
         $item->setOptions(array("" => $lng->txt("trac_all"), "m" => $lng->txt("gender_m"), "f" => $lng->txt("gender_f")));
         $this->filter["gender"] = $item->getValue();
     }
     if ($ilSetting->get("usr_settings_course_export_city")) {
         $item = $this->addFilterItemByMetaType("city", ilTable2GUI::FILTER_TEXT, true);
         $this->filter["city"] = $item->getValue();
     }
     if ($ilSetting->get("usr_settings_course_export_country")) {
         $item = $this->addFilterItemByMetaType("country", ilTable2GUI::FILTER_TEXT, true);
         $this->filter["country"] = $item->getValue();
     }
     if ($ilSetting->get("usr_settings_course_export_sel_country")) {
         $item = $this->addFilterItemByMetaType("sel_country", ilTable2GUI::FILTER_SELECT, true);
         $item->setOptions(array("" => $lng->txt("trac_all")) + $this->getSelCountryCodes());
         $this->filter["sel_country"] = $item->getValue();
     }
     $item = $this->addFilterItemByMetaType("language", ilTable2GUI::FILTER_LANGUAGE, true);
     $this->filter["language"] = $item->getValue();
     if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
         $item = $this->addFilterItemByMetaType("trac_first_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
         $this->filter["first_access"] = $item->getDate();
         $item = $this->addFilterItemByMetaType("trac_last_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
         $this->filter["last_access"] = $item->getDate();
     }
     $item = $this->addFilterItemByMetaType("registration_filter", ilTable2GUI::FILTER_DATE_RANGE, true);
     $this->filter["registration"] = $item->getDate();
 }