ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
All Data Structures Namespaces Files Functions Variables Typedefs Modules Pages
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, $lng, $options, ilADTSearchBridge\addToParentElement(), array, ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), and ilADTSearchBridge\getTitle().

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

◆ getSerializedValue()

ilADTEnumSearchBridgeSingle::getSerializedValue ( )

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

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

93  {
94  if (!$this->isNull() && $this->isValid()) {
95  return serialize(array($this->getADT()->getSelection()));
96  }
97  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getSQLCondition()

ilADTEnumSearchBridgeSingle::getSQLCondition (   $a_element_id)

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

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

70  {
71  global $ilDB;
72 
73  if (!$this->isNull() && $this->isValid()) {
74  $type = ($this->getADT() instanceof ilADTEnumText)
75  ? "text"
76  : "integer";
77 
78  return $a_element_id . " = " . $ilDB->quote($this->getADT()->getSelection(), $type);
79  }
80  }
$type
global $ilDB
+ Here is the call graph for this function:

◆ importFromPost()

ilADTEnumSearchBridgeSingle::importFromPost ( array  $a_post = null)

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

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

47  {
48  $post = $this->extractPostValues($a_post);
49 
50  if ($post && $this->shouldBeImportedFromPost($post)) {
51  if ($this->getForm() instanceof ilPropertyFormGUI) {
52  $item = $this->getForm()->getItemByPostVar($this->getElementId());
53  $item->setValue($post);
54  } elseif (array_key_exists($this->getElementId(), $this->table_filter_fields)) {
55  $this->table_filter_fields[$this->getElementId()]->setValue($post);
56  $this->writeFilter($post);
57  }
58 
59  $this->getADT()->setSelection($post);
60  } else {
61  $this->writeFilter();
62  $this->getADT()->setSelection();
63  }
64  }
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 82 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

83  {
84  assert($a_adt instanceof ilADTEnum);
85 
86  return $this->getADT()->equals($a_adt);
87  }
+ 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 99 of file class.ilADTEnumSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

100  {
101  $a_value = unserialize($a_value);
102  if (is_array($a_value)) {
103  $this->getADT()->setSelection($a_value[0]);
104  }
105  }
+ Here is the call graph for this function:

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