ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilADTEnumSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTEnumSearchBridgeSingle:
+ Collaboration diagram for ilADTEnumSearchBridgeSingle:

Public Member Functions

 loadFilter ()
 
 addToForm ()
 
 importFromPost (array $a_post=null)
 
 getSQLCondition ($a_element_id)
 
 isInCondition (ilADT $a_adt)
 
 getSerializedValue ()
 
 setSerializedValue ($a_value)
 
- Public Member Functions inherited from ilADTSearchBridgeSingle
 getADT ()
 Get ADT. More...
 
 isNull ()
 
 isValid ()
 
 validate ()
 
- Public Member Functions inherited from ilADTSearchBridge
 __construct (ilADTDefinition $a_adt_def)
 Constructor. More...
 
 isNull ()
 Is null ? More...
 
 setForm (ilPropertyFormGUI $a_form)
 Set form. More...
 
 getForm ()
 Get form. More...
 
 setElementId ($a_value)
 Set element id (aka form field) More...
 
 getElementId ()
 Get element id. More...
 
 setTitle ($a_value)
 Set title (aka form field caption) More...
 
 getTitle ()
 Get title. More...
 
 setTableGUI (ilTable2GUI $a_table)
 Set table gui (for filter mode) More...
 
 getTableGUI ()
 Get table gui. More...
 
 loadFilter ()
 Load filter value(s) into ADT. More...
 
 addToForm ()
 Add ADT-specific fields to form. More...
 
 importFromPost (array $a_post=null)
 Import values from (search) form request POST data. More...
 
 validate ()
 Validate current data. More...
 
 getSQLCondition ($a_element_id)
 Get SQL condition for current value(s) More...
 
 isInCondition (ilADT $a_adt)
 Compare directly against ADT. More...
 
 getSerializedValue ()
 Get current value(s) in serialized form (for easy persisting) More...
 
 setSerializedValue ($a_value)
 Set current value(s) in serialized form (for easy persisting) More...
 

Protected Member Functions

 isValidADTDefinition (ilADTDefinition $a_adt_def)
 
- Protected Member Functions inherited from ilADTSearchBridgeSingle
 setDefinition (ilADTDefinition $a_adt_def)
 
- Protected Member Functions inherited from ilADTSearchBridge
 isValidADTDefinition (ilADTDefinition $a_adt_def)
 Check if given ADT definition is valid. More...
 
 setDefinition (ilADTDefinition $a_adt_def)
 Set ADT definition. More...
 
 writeFilter ($a_value=null)
 Write value(s) to filter store (in session) More...
 
 readFilter ()
 Load value(s) from filter store (in session) More...
 
 addToParentElement (ilFormPropertyGUI $a_field)
 Add form field to parent element. More...
 
 addToElementId ($a_add)
 Add sub-element. More...
 
 shouldBeImportedFromPost ($a_post)
 Check if incoming values should be imported at all. More...
 
 extractPostValues (array $a_post=null)
 Extract data from (post) values. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilADTSearchBridgeSingle
 $adt
 
- Protected Attributes inherited from ilADTSearchBridge
 $form
 
 $table_gui
 
 $table_filter_fields = []
 
 $id
 
 $title
 
 $info
 

Detailed Description

Definition at line 5 of file class.ilADTEnumSearchBridgeSingle.php.

Member Function Documentation

◆ addToForm()

ilADTEnumSearchBridgeSingle::addToForm ( )

Definition at line 26 of file class.ilADTEnumSearchBridgeSingle.php.

References $def, $DIC, $lng, PHPMailer\PHPMailer\$options, ilADTSearchBridge\addToParentElement(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), and ilADTSearchBridge\getTitle().

27  {
28  global $DIC;
29 
30  $lng = $DIC['lng'];
31 
32  $def = $this->getADT()->getCopyOfDefinition();
33 
34  $options = $def->getOptions();
35  asort($options); // ?
36 
37  $lng->loadLanguageModule("search");
38  $options = array("" => $lng->txt("search_any")) + $options;
39 
40  $select = new ilSelectInputGUI($this->getTitle(), $this->getElementId());
41  $select->setOptions($options);
42 
43  $select->setValue($this->getADT()->getSelection());
44 
45  $this->addToParentElement($select);
46  }
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
$lng
$def
Definition: croninfo.php:21
getElementId()
Get element id.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
+ Here is the call graph for this function:

◆ getSerializedValue()

ilADTEnumSearchBridgeSingle::getSerializedValue ( )

Definition at line 96 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), ilADTSearchBridgeSingle\isNull(), and ilADTSearchBridgeSingle\isValid().

97  {
98  if (!$this->isNull() && $this->isValid()) {
99  return serialize(array($this->getADT()->getSelection()));
100  }
101  }
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTEnumSearchBridgeSingle::getSQLCondition (   $a_element_id)

Definition at line 71 of file class.ilADTEnumSearchBridgeSingle.php.

References $DIC, $ilDB, $type, ilADTSearchBridgeSingle\getADT(), ilADTSearchBridgeSingle\isNull(), and ilADTSearchBridgeSingle\isValid().

72  {
73  global $DIC;
74 
75  $ilDB = $DIC['ilDB'];
76 
77  if (!$this->isNull() && $this->isValid()) {
78  $type = ($this->getADT() instanceof ilADTEnumText)
79  ? "text"
80  : "integer";
81 
82  return $a_element_id . " = " . $ilDB->quote($this->getADT()->getSelection(), $type);
83  }
84  }
$type
global $DIC
Definition: saml.php:7
return['Universal Coordinated Time'=> 'UTC', 'Casablanca, Monrovia'=> 'Africa/Casablanca', 'Greenwich Mean Time:Dublin, Edinburgh, Lisbon, London'=> 'Europe/Lisbon', 'Greenwich Mean Time;Dublin, Edinburgh, London'=> 'Europe/London', 'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'=> 'Europe/Berlin', 'Belgrade, Pozsony, Budapest, Ljubljana, Prague'=> 'Europe/Prague', 'Brussels, Copenhagen, Madrid, Paris'=> 'Europe/Paris', 'Paris, Madrid, Brussels, Copenhagen'=> 'Europe/Paris', 'Prague, Central Europe'=> 'Europe/Prague', 'Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb'=> 'Europe/Sarajevo', 'West Central Africa'=> 'Africa/Luanda', 'Athens, Istanbul, Minsk'=> 'Europe/Athens', 'Bucharest'=> 'Europe/Bucharest', 'Cairo'=> 'Africa/Cairo', 'Harare, Pretoria'=> 'Africa/Harare', 'Helsinki, Riga, Tallinn'=> 'Europe/Helsinki', 'Israel, Jerusalem Standard Time'=> 'Asia/Jerusalem', 'Baghdad'=> 'Asia/Baghdad', 'Arab, Kuwait, Riyadh'=> 'Asia/Kuwait', 'Moscow, St. Petersburg, Volgograd'=> 'Europe/Moscow', 'East Africa, Nairobi'=> 'Africa/Nairobi', 'Tehran'=> 'Asia/Tehran', 'Abu Dhabi, Muscat'=> 'Asia/Muscat', 'Baku, Tbilisi, Yerevan'=> 'Asia/Baku', 'Kabul'=> 'Asia/Kabul', 'Ekaterinburg'=> 'Asia/Yekaterinburg', 'Islamabad, Karachi, Tashkent'=> 'Asia/Karachi', 'Kolkata, Chennai, Mumbai, New Delhi, India Standard Time'=> 'Asia/Calcutta', 'Kathmandu, Nepal'=> 'Asia/Kathmandu', 'Almaty, Novosibirsk, North Central Asia'=> 'Asia/Almaty', 'Astana, Dhaka'=> 'Asia/Dhaka', 'Sri Jayawardenepura, Sri Lanka'=> 'Asia/Colombo', 'Rangoon'=> 'Asia/Rangoon', 'Bangkok, Hanoi, Jakarta'=> 'Asia/Bangkok', 'Krasnoyarsk'=> 'Asia/Krasnoyarsk', 'Beijing, Chongqing, Hong Kong SAR, Urumqi'=> 'Asia/Shanghai', 'Irkutsk, Ulaan Bataar'=> 'Asia/Irkutsk', 'Kuala Lumpur, Singapore'=> 'Asia/Singapore', 'Perth, Western Australia'=> 'Australia/Perth', 'Taipei'=> 'Asia/Taipei', 'Osaka, Sapporo, Tokyo'=> 'Asia/Tokyo', 'Seoul, Korea Standard time'=> 'Asia/Seoul', 'Yakutsk'=> 'Asia/Yakutsk', 'Adelaide, Central Australia'=> 'Australia/Adelaide', 'Darwin'=> 'Australia/Darwin', 'Brisbane, East Australia'=> 'Australia/Brisbane', 'Canberra, Melbourne, Sydney, Hobart(year 2000 only)'=> 'Australia/Sydney', 'Guam, Port Moresby'=> 'Pacific/Guam', 'Hobart, Tasmania'=> 'Australia/Hobart', 'Vladivostok'=> 'Asia/Vladivostok', 'Magadan, Solomon Is., New Caledonia'=> 'Asia/Magadan', 'Auckland, Wellington'=> 'Pacific/Auckland', 'Fiji Islands, Kamchatka, Marshall Is.'=> 'Pacific/Fiji', 'Nuku\ 'alofa, Tonga'=> 'Pacific/Tongatapu', 'Azores'=> 'Atlantic/Azores', 'Cape Verde Is.'=> 'Atlantic/Cape_Verde', 'Mid-Atlantic'=> 'America/Noronha', 'Brasilia'=> 'America/Sao_Paulo', 'Buenos Aires'=> 'America/Argentina/Buenos_Aires', 'Greenland'=> 'America/Godthab', 'Newfoundland'=> 'America/St_Johns', 'Atlantic Time(Canada)'=> 'America/Halifax', 'Caracas, La Paz'=> 'America/Caracas', 'Santiago'=> 'America/Santiago', 'Bogota, Lima, Quito'=> 'America/Bogota', 'Eastern Time(US &Canada)'=> 'America/New_York', 'Indiana(East)'=> 'America/Indiana/Indianapolis', 'Central America'=> 'America/Guatemala', 'Central Time(US &Canada)'=> 'America/Chicago', 'Mexico City, Tegucigalpa'=> 'America/Mexico_City', 'Saskatchewan'=> 'America/Edmonton', 'Arizona'=> 'America/Phoenix', 'Mountain Time(US &Canada)'=> 'America/Denver', 'Pacific Time(US &Canada)'=> 'America/Los_Angeles', 'Pacific Time(US &Canada);Tijuana'=> 'America/Los_Angeles', 'Alaska'=> 'America/Anchorage', 'Hawaii'=> 'Pacific/Honolulu', 'Midway Island, Samoa'=> 'Pacific/Midway', 'Eniwetok, Kwajalein, Dateline Time'=> 'Pacific/Kwajalein',]
Microsoft exchange timezones Source: http://msdn.microsoft.com/en-us/library/ms988620%28v=exchg.65%29.aspx.
global $ilDB
+ Here is the call graph for this function:

◆ importFromPost()

ilADTEnumSearchBridgeSingle::importFromPost ( array  $a_post = null)

Definition at line 48 of file class.ilADTEnumSearchBridgeSingle.php.

References $post, ilADTSearchBridge\extractPostValues(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), ilADTSearchBridge\getForm(), ilADTSearchBridge\shouldBeImportedFromPost(), and ilADTSearchBridge\writeFilter().

49  {
50  $post = $this->extractPostValues($a_post);
51 
52  if ($post && $this->shouldBeImportedFromPost($post)) {
53  if ($this->getForm() instanceof ilPropertyFormGUI) {
54  $item = $this->getForm()->getItemByPostVar($this->getElementId());
55  $item->setValue($post);
56  } elseif (array_key_exists($this->getElementId(), $this->table_filter_fields)) {
57  $this->table_filter_fields[$this->getElementId()]->setValue($post);
58  $this->writeFilter($post);
59  }
60 
61  $this->getADT()->setSelection($post);
62  } else {
63  $this->writeFilter();
64  $this->getADT()->setSelection();
65  }
66  }
This class represents a property form user interface.
extractPostValues(array $a_post=null)
Extract data from (post) values.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
$post
Definition: post.php:34
writeFilter($a_value=null)
Write value(s) to filter store (in session)
getElementId()
Get element id.
+ Here is the call graph for this function:

◆ isInCondition()

ilADTEnumSearchBridgeSingle::isInCondition ( ilADT  $a_adt)

Definition at line 86 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

87  {
88  assert($a_adt instanceof ilADTEnum);
89 
90  return $this->getADT()->equals($a_adt);
91  }
+ Here is the call graph for this function:

◆ isValidADTDefinition()

ilADTEnumSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

Definition at line 7 of file class.ilADTEnumSearchBridgeSingle.php.

8  {
9  return ($a_adt_def instanceof ilADTEnumDefinition);
10  }

◆ loadFilter()

ilADTEnumSearchBridgeSingle::loadFilter ( )

Definition at line 15 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), and ilADTSearchBridge\readFilter().

16  {
17  $value = $this->readFilter();
18  if ($value !== null) {
19  $this->getADT()->setSelection($value);
20  }
21  }
readFilter()
Load value(s) from filter store (in session)
+ Here is the call graph for this function:

◆ setSerializedValue()

ilADTEnumSearchBridgeSingle::setSerializedValue (   $a_value)

Definition at line 103 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

104  {
105  $a_value = unserialize($a_value);
106  if (is_array($a_value)) {
107  $this->getADT()->setSelection($a_value[0]);
108  }
109  }
+ Here is the call graph for this function:

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