ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTSearchBridge Class Reference

ADT search bridge base class. More...

+ Inheritance diagram for ilADTSearchBridge:
+ Collaboration diagram for ilADTSearchBridge:

Public Member Functions

 __construct (ilADTDefinition $a_adt_def)
 Constructor.
 isNull ()
 Is null ?
 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.
 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.
 validate ()
 Validate current data.
 getSQLCondition ($a_element_id)
 Get SQL condition for current value(s)
 isInCondition (ilADT $a_adt)
 Compare directly against 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)

Protected Member Functions

 isValidADTDefinition (ilADTDefinition $a_adt_def)
 Check if given ADT definition is valid.
 setDefinition (ilADTDefinition $a_adt_def)
 Set ADT definition.
 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

 $form
 $table_gui
 $table_filter_fields
 $id
 $title
 $info

Detailed Description

ADT search bridge base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilADTSearchBridge.php.

Constructor & Destructor Documentation

ilADTSearchBridge::__construct ( ilADTDefinition  $a_adt_def)

Constructor.

Parameters
ilADT$a_adt_def
Returns
self

Definition at line 28 of file class.ilADTSearchBridge.php.

References setDefinition().

{
$this->setDefinition($a_adt_def);
}

+ Here is the call graph for this function:

Member Function Documentation

ilADTSearchBridge::addToElementId (   $a_add)
protected

Add sub-element.

Parameters
string$a_add
Returns
string

Definition at line 224 of file class.ilADTSearchBridge.php.

References getElementId().

Referenced by ilADTLocationSearchBridgeSingle\addToForm(), ilADTDateTimeSearchBridgeSingle\addToForm(), ilADTDateSearchBridgeSingle\addToForm(), ilADTDateSearchBridgeRange\addToForm(), ilADTDateTimeSearchBridgeRange\addToForm(), and ilADTSearchBridgeRange\validate().

{
return $this->getElementId()."[".$a_add."]";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTSearchBridge::addToParentElement ( ilFormPropertyGUI  $a_field)
protected

Add form field to parent element.

Parameters
ilFormPropertyGUI$a_field

Definition at line 201 of file class.ilADTSearchBridge.php.

References ilFormPropertyGUI\getFieldId(), getForm(), and getTableGUI().

Referenced by ilADTFloatSearchBridgeSingle\addToForm(), ilADTIntegerSearchBridgeSingle\addToForm(), ilADTEnumSearchBridgeSingle\addToForm(), ilADTLocationSearchBridgeSingle\addToForm(), ilADTTextSearchBridgeSingle\addToForm(), ilADTDateTimeSearchBridgeSingle\addToForm(), ilADTDateSearchBridgeSingle\addToForm(), ilADTDateTimeSearchBridgeRange\addToForm(), ilADTDateSearchBridgeRange\addToForm(), and ilADTEnumSearchBridgeMulti\addToForm().

{
if($this->getForm() instanceof ilPropertyFormGUI)
{
$this->getForm()->addItem($a_field);
}
else if($this->getTableGUI() instanceof ilTable2GUI)
{
$this->table_filter_fields[$a_field->getFieldId()] = $a_field;
$this->getTableGUI()->addFilterItem($a_field);
// :TODO:
// $a_field->readFromSession();
// $this->getTableGUI()->filter[$this->getElementId()] = $a_field->getValue();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTSearchBridge::extractPostValues ( array  $a_post = null)
protected

Extract data from (post) values.

Parameters
array$a_post
Returns
mixed

Definition at line 256 of file class.ilADTSearchBridge.php.

References $_POST, and getElementId().

Referenced by ilADTIntegerSearchBridgeSingle\importFromPost(), ilADTFloatSearchBridgeSingle\importFromPost(), ilADTTextSearchBridgeSingle\importFromPost(), ilADTEnumSearchBridgeSingle\importFromPost(), ilADTEnumSearchBridgeMulti\importFromPost(), ilADTDateSearchBridgeSingle\importFromPost(), ilADTDateTimeSearchBridgeSingle\importFromPost(), ilADTLocationSearchBridgeSingle\importFromPost(), ilADTDateSearchBridgeRange\importFromPost(), and ilADTDateTimeSearchBridgeRange\importFromPost().

{
$element_id = $this->getElementId();
$multi = strpos($this->getElementId(), "[");
if(!$a_post)
{
$a_post = $_POST;
if($multi !== false)
{
$post = $a_post[substr($element_id, 0, $multi)][substr($element_id, $multi+1, -1)];
}
else
{
$post = $a_post[$element_id];
}
}
else
{
if($multi !== false)
{
$post = $a_post[substr($element_id, $multi+1, -1)];
}
else
{
$post = $a_post[$element_id];
}
}
return $post;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTSearchBridge::getSerializedValue ( )
abstract
ilADTSearchBridge::getTableGUI ( )

Get table gui.

Returns
ilTable2GUI

Definition at line 142 of file class.ilADTSearchBridge.php.

References $table_gui.

Referenced by addToParentElement().

{
}

+ Here is the caller graph for this function:

ilADTSearchBridge::isInCondition ( ilADT  $a_adt)

Compare directly against ADT.

Parameters
ilADT$a_adt
Returns
boolean

Definition at line 321 of file class.ilADTSearchBridge.php.

{
return false;
}
ilADTSearchBridge::isNull ( )
abstract

Is null ?

Returns
bool

Reimplemented in ilADTSearchBridgeRange, and ilADTSearchBridgeSingle.

ilADTSearchBridge::isValidADTDefinition ( ilADTDefinition  $a_adt_def)
abstractprotected
ilADTSearchBridge::readFilter ( )
protected

Load value(s) from filter store (in session)

Parameters
string$a_element_id

Definition at line 173 of file class.ilADTSearchBridge.php.

References $_SESSION, and getElementId().

Referenced by ilADTEnumSearchBridgeSingle\loadFilter(), ilADTLocationSearchBridgeSingle\loadFilter(), ilADTTextSearchBridgeSingle\loadFilter(), ilADTDateTimeSearchBridgeRange\loadFilter(), ilADTDateSearchBridgeRange\loadFilter(), ilADTDateSearchBridgeSingle\loadFilter(), ilADTDateTimeSearchBridgeSingle\loadFilter(), and ilADTEnumSearchBridgeMulti\loadFilter().

{
if(!$this->table_gui instanceof ilTable2GUI)
{
return;
}
$value = $_SESSION["form_".$this->table_gui->getId()][$this->getElementId()];
if($value)
{
return unserialize($value);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilADTSearchBridge::setDefinition ( ilADTDefinition  $a_adt_def)
abstractprotected

Set ADT definition.

Parameters
ilADTDefinition$a_adt_def

Reimplemented in ilADTSearchBridgeRange, ilADTSearchBridgeSingle, and ilADTSearchBridgeMulti.

Referenced by __construct().

+ Here is the caller graph for this function:

ilADTSearchBridge::setElementId (   $a_value)

Set element id (aka form field)

Parameters
string$a_value

Definition at line 87 of file class.ilADTSearchBridge.php.

{
$this->id = (string)$a_value;
}
ilADTSearchBridge::setForm ( ilPropertyFormGUI  $a_form)

Set form.

Parameters
ilPropertyFormGUI$a_form

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

{
$this->form = $a_form;
}
ilADTSearchBridge::setSerializedValue (   $a_value)
abstract
ilADTSearchBridge::setTableGUI ( ilTable2GUI  $a_table)

Set table gui (for filter mode)

Parameters
ilTable2GUI$a_table

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

{
$this->table_gui = $a_table;
}
ilADTSearchBridge::setTitle (   $a_value)

Set title (aka form field caption)

Parameters
string$a_value

Definition at line 107 of file class.ilADTSearchBridge.php.

{
$this->title = trim($a_value);
}
ilADTSearchBridge::shouldBeImportedFromPost (   $a_post)
protected

Check if incoming values should be imported at all.

Parameters
mixed$a_post
Returns
bool

Reimplemented in ilADTLocationSearchBridgeSingle.

Definition at line 245 of file class.ilADTSearchBridge.php.

Referenced by ilADTIntegerSearchBridgeSingle\importFromPost(), ilADTFloatSearchBridgeSingle\importFromPost(), ilADTTextSearchBridgeSingle\importFromPost(), ilADTEnumSearchBridgeSingle\importFromPost(), and ilADTEnumSearchBridgeMulti\importFromPost().

{
return true;
}

+ Here is the caller graph for this function:

ilADTSearchBridge::validate ( )
abstract

Validate current data.

Returns
bool

Reimplemented in ilADTSearchBridgeRange, and ilADTSearchBridgeSingle.

ilADTSearchBridge::writeFilter (   $a_value = null)
protected

Write value(s) to filter store (in session)

Parameters
mixed$a_value

Definition at line 152 of file class.ilADTSearchBridge.php.

References $_SESSION, and getElementId().

Referenced by ilADTTextSearchBridgeSingle\importFromPost(), ilADTEnumSearchBridgeSingle\importFromPost(), ilADTEnumSearchBridgeMulti\importFromPost(), ilADTDateTimeSearchBridgeSingle\importFromPost(), ilADTDateSearchBridgeSingle\importFromPost(), ilADTDateSearchBridgeRange\importFromPost(), and ilADTDateTimeSearchBridgeRange\importFromPost().

{
if(!$this->table_gui instanceof ilTable2GUI)
{
return;
}
if($a_value !== null)
{
$_SESSION["form_".$this->table_gui->getId()][$this->getElementId()] = serialize($a_value);
}
else
{
unset($_SESSION["form_".$this->table_gui->getId()][$this->getElementId()]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilADTSearchBridge::$form
protected

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

Referenced by getForm().

ilADTSearchBridge::$id
protected

Definition at line 18 of file class.ilADTSearchBridge.php.

Referenced by getElementId().

ilADTSearchBridge::$info
protected

Definition at line 20 of file class.ilADTSearchBridge.php.

ilADTSearchBridge::$table_filter_fields
protected

Definition at line 17 of file class.ilADTSearchBridge.php.

ilADTSearchBridge::$table_gui
protected

Definition at line 16 of file class.ilADTSearchBridge.php.

Referenced by getTableGUI().

ilADTSearchBridge::$title
protected

Definition at line 19 of file class.ilADTSearchBridge.php.

Referenced by getTitle().


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