public function parse(ilLuceneAdvancedSearchSettings $settings) { foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) { $tmp_arr['id'] = $field; $tmp_arr['active'] = $settings->isActive($field); $tmp_arr['title'] = $translation; $tmp_arr['type'] = substr($field, 0, 3) == 'lom' ? $this->lng->txt('search_lom') : $this->lng->txt('search_adv_md'); $content[] = $tmp_arr; } $this->setData($content ? $content : array()); }
public static function getInstance() { if (isset(self::$instance) and self::$instance != null) { return self::$instance; } return self::$instance = new ilLuceneAdvancedSearchSettings(); }
protected function __construct() { global $lng; $this->settings = ilLuceneAdvancedSearchSettings::getInstance(); $this->lng = $lng; $this->lng->loadLanguageModule('meta'); $this->readFields(); $this->readSections(); }
protected function saveAdvancedLuceneSettingsObject() { include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php'; $settings = ilLuceneAdvancedSearchSettings::getInstance(); foreach (ilLuceneAdvancedSearchFields::getFields() as $field => $translation) { $settings->setActive($field, in_array($field, (array) $_POST['fid']) ? true : false); } $settings->save(); ilUtil::sendInfo($this->lng->txt('settings_saved')); $this->advancedLuceneSettingsObject(); }