ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTEnumSearchBridgeSingle Class Reference
+ Inheritance diagram for ilADTEnumSearchBridgeSingle:
+ Collaboration diagram for ilADTEnumSearchBridgeSingle:

Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from ilADTSearchBridgeSingle
 $adt

Detailed Description

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

Member Function Documentation

ilADTEnumSearchBridgeSingle::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTSearchBridge.

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

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

{
global $lng;
$def = $this->getADT()->getCopyOfDefinition();
$options = $def->getOptions();
asort($options); // ?
$lng->loadLanguageModule("search");
$options = array("" => $lng->txt("search_any")) + $options;
$select = new ilSelectInputGUI($this->getTitle(), $this->getElementId());
$select->setOptions($options);
$select->setValue($this->getADT()->getSelection());
$this->addToParentElement($select);
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::getSerializedValue ( )

Get current value(s) in serialized form (for easy persisting)

Returns
string

Reimplemented from ilADTSearchBridge.

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

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

{
if(!$this->isNull() && $this->isValid())
{
return serialize(array($this->getADT()->getSelection()));
}
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::getSQLCondition (   $a_element_id)

Get SQL condition for current value(s)

Parameters
string$a_element_id
Returns
string

Reimplemented from ilADTSearchBridge.

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

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

{
global $ilDB;
if(!$this->isNull() && $this->isValid())
{
$type = ($this->getADT() instanceof ilADTEnumText)
? "text"
: "integer";
return $a_element_id." = ".$ilDB->quote($this->getADT()->getSelection(), $type);
}
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::importFromPost ( array  $a_post = null)

Import values from (search) form request POST data.

Returns
bool

Reimplemented from ilADTSearchBridge.

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

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

{
$post = $this->extractPostValues($a_post);
if($post && $this->shouldBeImportedFromPost($post))
{
if($this->getForm() instanceof ilPropertyFormGUI)
{
$item = $this->getForm()->getItemByPostVar($this->getElementId());
$item->setValue($post);
}
else if(array_key_exists($this->getElementId(), $this->table_filter_fields))
{
$this->table_filter_fields[$this->getElementId()]->setValue($post);
$this->writeFilter($post);
}
$this->getADT()->setSelection($post);
}
else
{
$this->writeFilter();
$this->getADT()->setSelection();
}
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::isInCondition ( ilADTEnum  $a_adt)

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

References ilADTSearchBridgeSingle\getADT().

{
return $this->getADT()->equals($a_adt);
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
protected

Check if given ADT definition is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADTDefinition$a_adt_def

Reimplemented from ilADTSearchBridge.

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

{
return ($a_adt_def instanceof ilADTEnumDefinition);
}
ilADTEnumSearchBridgeSingle::loadFilter ( )

Load filter value(s) into ADT.

Reimplemented from ilADTSearchBridge.

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

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

{
$value = $this->readFilter();
if($value !== null)
{
$this->getADT()->setSelection($value);
}
}

+ Here is the call graph for this function:

ilADTEnumSearchBridgeSingle::setSerializedValue (   $a_value)

Set current value(s) in serialized form (for easy persisting)

Parameters
string

Reimplemented from ilADTSearchBridge.

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

References ilADTSearchBridgeSingle\getADT().

{
$a_value = unserialize($a_value);
if(is_array($a_value))
{
$this->getADT()->setSelection($a_value[0]);
}
}

+ Here is the call graph for this function:


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