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

Public Member Functions

 setTextInputMode ($a_value)
 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 (ilADTDate $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.
 shouldBeImportedFromPost (array $a_post)
- 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.

Protected Attributes

 $text_input
- 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.ilADTDateSearchBridgeSingle.php.

Member Function Documentation

ilADTDateSearchBridgeSingle::addToForm ( )

Add ADT-specific fields to form.

Reimplemented from ilADTSearchBridge.

Definition at line 34 of file class.ilADTDateSearchBridgeSingle.php.

References $lng, ilADTSearchBridge\addToElementId(), ilADTSearchBridge\addToParentElement(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), ilADTSearchBridge\getTitle(), and ilDateTimeInputGUI\MODE_INPUT.

{
global $lng;
$adt_date = $this->getADT()->getDate();
$date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId());
$date->setShowTime(false);
if(!(bool)$this->text_input)
{
$checked = !(!$adt_date || $adt_date->isNull());
$date->enableDateActivation($lng->txt("enabled"), $this->addToElementId("tgl"), $checked);
}
else
{
}
$date->setDate($adt_date);
$this->addToParentElement($date);
}

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::getSerializedValue ( )

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

Returns
string

Reimplemented from ilADTSearchBridge.

Definition at line 132 of file class.ilADTDateSearchBridgeSingle.php.

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

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

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::getSQLCondition (   $a_element_id)

Get SQL condition for current value(s)

Parameters
string$a_element_id
Returns
string

Reimplemented from ilADTSearchBridge.

Definition at line 114 of file class.ilADTDateSearchBridgeSingle.php.

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

{
global $ilDB;
if(!$this->isNull() && $this->isValid())
{
return $a_element_id." = ".$ilDB->quote($this->getADT()->getDate()->get(IL_CAL_DATE), "date");
}
}

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::importFromPost ( array  $a_post = null)

Import values from (search) form request POST data.

Returns
bool

Reimplemented from ilADTSearchBridge.

Definition at line 67 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridge\extractPostValues(), ilADTSearchBridgeSingle\getADT(), ilADTSearchBridge\getElementId(), ilADTSearchBridge\getForm(), ilADTDateSearchUtil\handleSelectInputPost(), ilADTDateSearchUtil\handleTextInputPost(), IL_CAL_DATE, IL_CAL_UNIX, ilADTDateSearchUtil\MODE_DATE, shouldBeImportedFromPost(), and ilADTSearchBridge\writeFilter().

{
$post = $this->extractPostValues($a_post);
if($post && $this->shouldBeImportedFromPost($post))
{
include_once "Services/ADT/classes/class.ilADTDateSearchUtil.php";
if((bool)$this->text_input)
{
}
else
{
}
// :TODO: all dates are imported as valid
if($date)
{
$date = new ilDate($date, IL_CAL_UNIX);
}
if($this->getForm() instanceof ilPropertyFormGUI)
{
$item = $this->getForm()->getItemByPostVar($this->getElementId());
$item->setDate($date);
}
else if(array_key_exists($this->getElementId(), $this->table_filter_fields))
{
$this->table_filter_fields[$this->getElementId()]->setDate($date);
$this->writeFilter($date->get(IL_CAL_DATE));
}
$this->getADT()->setDate($date);
}
else
{
$this->writeFilter();
$this->getADT()->setDate();
}
}

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::isInCondition ( ilADTDate  $a_adt)

Definition at line 124 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT().

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

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::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 9 of file class.ilADTDateSearchBridgeSingle.php.

{
return ($a_adt_def instanceof ilADTDateDefinition);
}
ilADTDateSearchBridgeSingle::loadFilter ( )

Load filter value(s) into ADT.

Reimplemented from ilADTSearchBridge.

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

References ilADTSearchBridge\readFilter().

{
$value = $this->readFilter();
if($value !== null)
{
// $this->getADT()->setDate(new ilDate($value, IL_CAL_DATE));
}
}

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::setSerializedValue (   $a_value)

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

Parameters
string

Reimplemented from ilADTSearchBridge.

Definition at line 140 of file class.ilADTDateSearchBridgeSingle.php.

References ilADTSearchBridgeSingle\getADT(), and IL_CAL_DATE.

{
$a_value = unserialize($a_value);
if(is_array($a_value))
{
$this->getADT()->setDate(new ilDate($a_value[0], IL_CAL_DATE));
}
}

+ Here is the call graph for this function:

ilADTDateSearchBridgeSingle::setTextInputMode (   $a_value)

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

{
$this->text_input = (bool)$a_value;
}
ilADTDateSearchBridgeSingle::shouldBeImportedFromPost ( array  $a_post)
protected

Definition at line 58 of file class.ilADTDateSearchBridgeSingle.php.

Referenced by importFromPost().

{
if(!(bool)$this->text_input)
{
return (bool)$a_post["tgl"];
}
}

+ Here is the caller graph for this function:

Field Documentation

ilADTDateSearchBridgeSingle::$text_input
protected

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


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