ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAdvancedSearchFilterGUI Class Reference

Class ilAdvancedSearchFilterGUI. More...

+ Inheritance diagram for ilAdvancedSearchFilterGUI:
+ Collaboration diagram for ilAdvancedSearchFilterGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd="")
 
 initFilter ()
 
 setTopicId ($a_topic_id)
 
 getTopicId ()
 
 setString ($a_str)
 
 getString ()
 
 setType ($a_type)
 
 getType ()
 
 setSortDirection ($a_sort_direction)
 
 getSortDirection ()
 
 setSortField ($a_field)
 
 getSortField ()
 
 setSortingTypeTopics ($a_field)
 
 getSortingTypeTopics ()
 
 setSortingDirectionTopics ($a_sort_direction)
 
 getSortingDirectionTopics ()
 
- Public Member Functions inherited from ilFilterGUI
 __construct ($a_parent_obj, $a_parent_cmd="")
 
 getFilterCmd ()
 
 setFilterCmd ($filter_cmd)
 
 getFilterCols ()
 
 setFilterCols ($filter_cols)
 
 getFilters ()
 
 setFilters ($filters)
 
 getOptionalFilters ()
 
 setOptionalFilters ($optional_filters)
 
 getResetCmd ()
 
 setResetCmd ($reset_cmd)
 
 isDisableFilterHiding ()
 
 setDisableFilterHiding ($disable_filter_hiding)
 
 isFiltersDetermined ()
 
 setFiltersDetermined ($filters_determined)
 
 isSelectedFilter ()
 
 setSelectedFilter ($selected_filter)
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 getId ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 loadProperty ($type)
 Load table property. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 initFilter ()
 Init filter. More...
 
 getFilterId ()
 
 setFilterId ($filter_id)
 
 getHtml ()
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 

Additional Inherited Members

- Data Fields inherited from ilFilterGUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
- Protected Attributes inherited from ilFilterGUI
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'setFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $filters_determined = false
 
 $filter_id = ''
 

Detailed Description

Class ilAdvancedSearchFilterGUI.

Author
: Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:

Definition at line 12 of file class.ilAdvancedSearchFilterGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAdvancedSearchFilterGUI::__construct (   $a_parent_obj,
  $a_parent_cmd = "" 
)

Definition at line 14 of file class.ilAdvancedSearchFilterGUI.php.

References ilPaymentSettings\_getInstance(), ilFilterGUI\setFilterCols(), and ilFilterGUI\setFilterId().

15  {
16  $this->settings = ilPaymentSettings::_getInstance();
17  parent::__construct($a_parent_obj, $a_parent_cmd);
18  $this->setFilterId('advanced_filter');
19  $this->setFilterCols(3);
20  }
setFilterId($filter_id)
setFilterCols($filter_cols)
+ Here is the call graph for this function:

Member Function Documentation

◆ getSortDirection()

ilAdvancedSearchFilterGUI::getSortDirection ( )

Definition at line 204 of file class.ilAdvancedSearchFilterGUI.php.

Referenced by initFilter().

205  {
206  return $this->sort_direction;
207  }
+ Here is the caller graph for this function:

◆ getSortField()

ilAdvancedSearchFilterGUI::getSortField ( )

Definition at line 214 of file class.ilAdvancedSearchFilterGUI.php.

Referenced by initFilter().

215  {
216  return $this->sort_field;
217  }
+ Here is the caller graph for this function:

◆ getSortingDirectionTopics()

ilAdvancedSearchFilterGUI::getSortingDirectionTopics ( )

Definition at line 252 of file class.ilAdvancedSearchFilterGUI.php.

Referenced by initFilter().

253  {
254  return $this->sort_direction_topics;
255  }
+ Here is the caller graph for this function:

◆ getSortingTypeTopics()

ilAdvancedSearchFilterGUI::getSortingTypeTopics ( )

Definition at line 233 of file class.ilAdvancedSearchFilterGUI.php.

References $ilUser, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

Referenced by initFilter().

234  {
235  global $ilUser;
236 
237  if(ANONYMOUS_USER_ID == $ilUser->getId() &&
238  $this->sort_type_topics == ilShopTopics::TOPICS_SORT_MANUALLY
239  )
240  {
241  $this->sort_type_topics = ilShopTopics::TOPICS_SORT_BY_TITLE;
242  }
243 
244  return $this->sort_type_topics;
245  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ getString()

ilAdvancedSearchFilterGUI::getString ( )

Definition at line 184 of file class.ilAdvancedSearchFilterGUI.php.

185  {
186  return $this->string;
187  }

◆ getTopicId()

ilAdvancedSearchFilterGUI::getTopicId ( )

Definition at line 174 of file class.ilAdvancedSearchFilterGUI.php.

175  {
176  return $this->topic_id;
177  }

◆ getType()

ilAdvancedSearchFilterGUI::getType ( )

Definition at line 194 of file class.ilAdvancedSearchFilterGUI.php.

195  {
196  return $this->type;
197  }

◆ initFilter()

ilAdvancedSearchFilterGUI::initFilter ( )

Definition at line 22 of file class.ilAdvancedSearchFilterGUI.php.

References $_POST, $_SESSION, $ilUser, $lng, ilShopTopics\_getInstance(), ilFilterGUI\addFilterItem(), getSortDirection(), getSortField(), getSortingDirectionTopics(), getSortingTypeTopics(), ilTextInputGUI\setValue(), ilCheckboxInputGUI\setValue(), ilRadioOption\setValue(), ilCheckboxGroupInputGUI\setValue(), ilShopTopics\TOPICS_SORT_BY_CREATEDATE, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

23  {
24  global $lng, $ilUser;
25 
26  // search term
27  $search_term = new ilTextInputGUI($lng->txt('search_search_term'), 'search_string');
28  $search_term->setValue($_SESSION['shop_advanced_search']['string']);
29  $search_term->setPostVar('search_string');
30  $this->addFilterItem($search_term);
31  $search_term->readFromSession();
32  $this->filter["search_string"] = $search_term->getValue();
33 
34 
35  // search combination
36  $radio_grp = new ilRadioGroupInputGUI('','search_combination');
37 
38  $radio_or = new ilRadioOption($lng->txt('search_any_word'), 'or');
39  $radio_and = new ilRadioOption($lng->txt('search_all_words'), 'and');
40 
41  $radio_grp->addOption($radio_or);
42  $radio_grp->addOption($radio_and);
43  $radio_grp->setValue($_POST['search_combination']);
44  $this->addFilterItem($radio_grp);
45  $radio_grp->readFromSession();
46  $this->filter['search_combination'] = $radio_grp->getValue();
47 
48  // search objects
49  $object_types = new ilCheckboxGroupInputGUI($lng->txt('obj_type'), 'search_details');
50 
51  $cb_crs = new ilCheckboxInputGUI($lng->txt('courses'), 'search_details["crs"]');
52  $cb_crs->setValue('crs');
53 
54  $cb_lms = new ilCheckboxInputGUI($lng->txt('learning_resources'), 'search_details["lms"]');
55  $cb_lms->setValue('lms');
56 
57  $cb_tst = new ilCheckboxInputGUI($lng->txt('tests'), 'search_details["tst"]');
58  $cb_tst->setValue('tst');
59 
60  $cb_fil = new ilCheckboxInputGUI($lng->txt('objs_file'), 'search_details["fil"]');
61  $cb_fil->setValue('fil');
62 
63  $object_types->addOption($cb_crs);
64  $object_types->addOption($cb_lms);
65  $object_types->addOption($cb_tst);
66  $object_types->addOption($cb_fil);
67 
68  $object_types->setValue($_SESSION['shop_advanced_search']['details']);
69 
70  $this->addFilterItem($object_types);
71  $object_types->readFromSession();
72  $this->filter['search_details'] = $object_types->getValue();
73 
74  // search topics
75  ilShopTopics::_getInstance()->setIdFilter(false);
77  $topic_option = array();
78  if(count(ilShopTopics::_getInstance()->getTopics()))
79  {
80  $topic_option[''] = $lng->txt('please_select');
81  foreach(ilShopTopics::_getInstance()->getTopics() as $oTopic)
82  {
83  $topic_option[(string)$oTopic->getId()] = $oTopic->getTitle();
84  }
85  }
86  else
87  {
88  $topic_option[''] = $lng->txt('no_topics_yet');
89  }
90  $o_topic = new ilSelectInputGUI();
91  $o_topic->setTitle($lng->txt('topic'));
92  $o_topic->setOptions($topic_option);
93  $o_topic->setValue($_SESSION['shop_advanced_search']['topic']);
94  $o_topic->setPostVar('search_topic');
95  $this->addFilterItem($o_topic);
96  $o_topic->readFromSession();
97  $this->filter["search_topic"] = $o_topic->getValue();
98 
99  if((bool)$this->settings->get('objects_allow_custom_sorting'))
100  {
101  // sorting form
102  $allow_objects_option = array(
103  'title' => $lng->txt('title'),
104  'author' => $lng->txt('author'),
105  'price' => $lng->txt('price_a')
106  );
107  $o_allow_objects = new ilSelectInputGUI();
108  $o_allow_objects->setTitle($lng->txt('sort_by'));
109  $o_allow_objects->setOptions($allow_objects_option);
110  $o_allow_objects->setValue($this->getSortField());
111  $o_allow_objects->setPostVar('order_field'); //objects_sorting_type
112  $this->addFilterItem($o_allow_objects);
113  $o_allow_objects->readFromSession();
114  $this->filter["order_field"] = $o_allow_objects->getValue();
115 
116  $direction_option = array(
117  'asc' => $lng->txt('sort_asc'),
118  'desc' => $lng->txt('sort_desc')
119  );
120 
121  $o_object_direction = new ilSelectInputGUI();
122 
123  $o_object_direction->setOptions($direction_option);
124  $o_object_direction->setValue($this->getSortDirection());
125  $o_object_direction->setPostVar('order_direction'); //objects_sorting_direction
126 
127  $this->addFilterItem($o_object_direction);
128  $o_object_direction->readFromSession();
129  $this->filter["order_direction"] = $o_object_direction->getValue();
130  }
131 
132  if((bool)$this->settings->get('topics_allow_custom_sorting'))
133  {
134  // sorting form
135  $allow_topics_option = array(
136  ilShopTopics::TOPICS_SORT_BY_TITLE => $lng->txt('sort_topics_by_title'),
137  ilShopTopics::TOPICS_SORT_BY_CREATEDATE => $lng->txt('sort_topics_by_date')
138  );
139  if(ANONYMOUS_USER_ID != $ilUser->getId())
140  {
141  $allow_topics_option[ilShopTopics::TOPICS_SORT_MANUALLY] = $lng->txt('sort_topics_manually');
142  }
143 
144  $o_allow_topics = new ilSelectInputGUI();
145  $o_allow_topics->setTitle($lng->txt('sort_topics_by'));
146  $o_allow_topics->setOptions($allow_topics_option);
147 
148  $o_allow_topics->setValue($this->getSortingTypeTopics());
149  $o_allow_topics->setPostVar('topics_sorting_type');
150  $this->addFilterItem($o_allow_topics);
151  $o_allow_topics->readFromSession();
152  $this->filter["topics_sorting_type"] = $o_allow_topics->getValue();
153 
154  $direction_option = array(
155  'asc' => $lng->txt('sort_asc'),
156  'desc' => $lng->txt('sort_desc')
157  );
158 
159  $o_topics_direction = new ilSelectInputGUI();
160  $o_topics_direction->setOptions($direction_option);
161  $o_topics_direction->setValue($this->getSortingDirectionTopics());
162  $o_topics_direction->setPostVar('topics_sorting_direction'); //objects_sorting_type
163 
164  $this->addFilterItem($o_topics_direction);
165  $o_topics_direction->readFromSession();
166  $this->filter["topics_sorting_direction"] = $o_topics_direction->getValue();
167  }
168  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
This class represents an option in a radio group.
const TOPICS_SORT_BY_CREATEDATE
$_POST['username']
Definition: cron.php:12
This class represents a selection list property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
This class represents a checkbox property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
This class represents a property in a property form.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ setSortDirection()

ilAdvancedSearchFilterGUI::setSortDirection (   $a_sort_direction)

Definition at line 199 of file class.ilAdvancedSearchFilterGUI.php.

200  {
201  $this->sort_direction = $a_sort_direction;
202  }

◆ setSortField()

ilAdvancedSearchFilterGUI::setSortField (   $a_field)

Definition at line 209 of file class.ilAdvancedSearchFilterGUI.php.

210  {
211  $this->sort_field = $a_field;
212  }

◆ setSortingDirectionTopics()

ilAdvancedSearchFilterGUI::setSortingDirectionTopics (   $a_sort_direction)

Definition at line 247 of file class.ilAdvancedSearchFilterGUI.php.

References $_SESSION.

248  {
249  $_SESSION['shop_content']['shop_topics_sorting_direction'] = $this->sort_direction_topics = $a_sort_direction;
250  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ setSortingTypeTopics()

ilAdvancedSearchFilterGUI::setSortingTypeTopics (   $a_field)

Definition at line 219 of file class.ilAdvancedSearchFilterGUI.php.

References $ilUser, ilShopTopics\TOPICS_SORT_BY_TITLE, and ilShopTopics\TOPICS_SORT_MANUALLY.

220  {
221  global $ilUser;
222 
223  if(ANONYMOUS_USER_ID == $ilUser->getId() &&
225  )
226  {
228  }
229 
230  $this->sort_type_topics = $a_field;
231  }
global $ilUser
Definition: imgupload.php:15

◆ setString()

ilAdvancedSearchFilterGUI::setString (   $a_str)

Definition at line 179 of file class.ilAdvancedSearchFilterGUI.php.

180  {
181  $this->string = $a_str;
182  }

◆ setTopicId()

ilAdvancedSearchFilterGUI::setTopicId (   $a_topic_id)

Definition at line 169 of file class.ilAdvancedSearchFilterGUI.php.

170  {
171  $this->topic_id = $a_topic_id;
172  }

◆ setType()

ilAdvancedSearchFilterGUI::setType (   $a_type)

Definition at line 189 of file class.ilAdvancedSearchFilterGUI.php.

190  {
191  $this->type = $a_type;
192  }

The documentation for this class was generated from the following file: