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

AMD field type float (based on integer) More...

+ Inheritance diagram for ilAdvancedMDFieldDefinitionFloat:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionFloat:

Public Member Functions

 getType ()
 Get type.
 setDecimals ($a_value)
 Set decimals.
 getDecimals ()
 Get decimals.
 getFieldDefinitionForTableGUI ()
 Parse properties for table gui.
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, $a_disabled=false)
 Add input elements to definition form.
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form)
 Import custom post values from definition form.
 importXMLProperty ($a_key, $a_value)
 Import property from XML.
- Public Member Functions inherited from ilAdvancedMDFieldDefinitionInteger
 setMin ($a_value)
 Set min.
 getMin ()
 Get min.
 setMax ($a_value)
 Set max.
 getMax ()
 Get max.
 setSuffix ($a_value)
 Set suffix.
 getSuffix ()
 Get suffix.
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export)
 importValueFromXML ($a_cdata)
 Import value from xml.
- Public Member Functions inherited from ilAdvancedMDFieldDefinition
 __construct ($a_field_id=null)
 Constructor.
 getTypeTitle ()
 Get type title (lang id)
 getADTDefinition ()
 Get ADT definition instance.
 getADT ()
 Get ADT instance.
 getFieldId ()
 Get field_id.
 setRecordId ($a_id)
 Set record id.
 getRecordId ()
 Get record id.
 setImportId ($a_id_string)
 Set import id.
 getImportId ()
 Get import id.
 setPosition ($a_pos)
 Set position.
 getPosition ()
 Get position.
 setTitle ($a_title)
 Get title.
 getTitle ()
 Get title.
 setDescription ($a_desc)
 Set description.
 getDescription ()
 Get description.
 setSearchable ($a_status)
 Toggle searchable.
 isSearchable ()
 Is searchable.
 setRequired ($a_status)
 Toggle required.
 isRequired ()
 Is required field.
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Add input elements to definition form.
 importDefinitionFormPostValues (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Import post values from definition form.
 importDefinitionFormPostValuesNeedsConfirmation ()
 prepareCustomDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 prepareDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 save ()
 Create new field entry.
 update ()
 Update field entry.
 delete ()
 Delete field entry.
 toXML (ilXmlWriter $a_writer)
 To Xml.
 importFromECS ($a_ecs_type, $a_value, $a_sub_id)
 Import meta data from ECS.
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 Prepare editor form elements.
 getSearchQueryParserValue (ilADTSearchBridge $a_adt_search)
 Get value for search query parser.
 getSearchValueSerialized (ilADTSearchBridge $a_adt_search)
 Get value for search persistence.
 setSearchValueSerialized (ilADTSearchBridge $a_adt_search, $a_value)
 Set value from search persistence.
 searchSubObjects (ilADTSearchBridge $a_adt_search, $a_obj_id, $sub_obj_type)
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, $a_locate, $a_search_type)
 Search objects.
 getLuceneSearchString ($a_value)
 Get search string in lucene syntax.
 prepareElementForSearch (ilADTSearchBridge $a_bridge)
 Prepare search form elements.

Protected Member Functions

 init ()
 Init properties.
 initADTDefinition ()
 Init adt instance.
 importFieldDefinition (array $a_def)
 Import (type-specific) field definition from DB.
 getFieldDefinition ()
 Get (type-specific) field definition.
 addPropertiesToXML (ilXmlWriter $a_writer)
 Add (type-specific) properties to xml export.

Protected Attributes

 $decimals
- Protected Attributes inherited from ilAdvancedMDFieldDefinitionInteger
 $min
 $max
 $suffix
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
 $field_id
 $record_id
 $import_id
 $position
 $title
 $description
 $searchable
 $required
 $adt_def
 $adt

Additional Inherited Members

- Static Public Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstance ($a_field_id, $a_type=null)
 Get definition instance by type.
static getInstanceByTypeString ($a_type)
 Get instance by type string (used by import)
static getInstancesByRecordId ($a_record_id, $a_only_searchable=false)
 Get definitions by record id.
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
static getInstanceByImportId ($a_import_id)
 Get definition instance by import id.
static getSearchableDefinitionIds ()
 Get searchable definition ids (performance is key)
static getADTGroupForDefinitions (array $a_defs)
 Init ADTGroup for definitions.
static getValidTypes ()
 Get all valid types.
static isValidType ($a_type)
 Is given type valid.
- Data Fields inherited from ilAdvancedMDFieldDefinition
const TYPE_SELECT = 1
const TYPE_TEXT = 2
const TYPE_DATE = 3
const TYPE_DATETIME = 4
const TYPE_INTEGER = 5
const TYPE_FLOAT = 6
const TYPE_LOCATION = 7
const TYPE_SELECT_MULTI = 8
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getTypeString ($a_type)
 Get type string.

Detailed Description

AMD field type float (based on integer)

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 14 of file class.ilAdvancedMDFieldDefinitionFloat.php.

Member Function Documentation

ilAdvancedMDFieldDefinitionFloat::addCustomFieldToDefinitionForm ( ilPropertyFormGUI  $a_form,
  $a_disabled = false 
)

Add input elements to definition form.

Parameters
ilPropertyFormGUI$a_form
bool$a_disabled

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 108 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References $decimals, $lng, ilPropertyFormGUI\addItem(), and getDecimals().

{
global $lng;
// #32
$decimals = new ilNumberInputGUI($lng->txt("md_adv_number_decimals"), "dec");
$decimals->setRequired(true);
$decimals->setValue($this->getDecimals());
$decimals->setSize(5);
$a_form->addItem($decimals);
if($a_disabled)
{
$decimals->setDisabled(true);
}
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

Add (type-specific) properties to xml export.

Parameters
ilXmlWriter$a_writer

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 144 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References getDecimals(), and ilXmlWriter\xmlElement().

{
$a_writer->xmlElement('FieldValue',array("id"=>"decimals"),$this->getDecimals());
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::getDecimals ( )

Get decimals.

Returns
int

Definition at line 70 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References $decimals.

Referenced by addCustomFieldToDefinitionForm(), addPropertiesToXML(), getFieldDefinition(), getFieldDefinitionForTableGUI(), and initADTDefinition().

{
}

+ Here is the caller graph for this function:

ilAdvancedMDFieldDefinitionFloat::getFieldDefinition ( )
protected

Get (type-specific) field definition.

Returns
array

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

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

References getDecimals().

{
$def["decimals"] = $this->getDecimals();
return $def;
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::getFieldDefinitionForTableGUI ( )

Parse properties for table gui.

Returns
array

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 93 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References $lng, $res, and getDecimals().

{
global $lng;
$res[$lng->txt("md_adv_number_decimals")] = $this->getDecimals();
return $res;
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::getType ( )

Get type.

Returns
int

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

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

References ilAdvancedMDFieldDefinition\TYPE_FLOAT.

{
}
ilAdvancedMDFieldDefinitionFloat::importCustomDefinitionFormPostValues ( ilPropertyFormGUI  $a_form)

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

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

References ilPropertyFormGUI\getInput(), and setDecimals().

{
$this->setDecimals($a_form->getInput("dec"));
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::importFieldDefinition ( array  $a_def)
protected

Import (type-specific) field definition from DB.

Parameters
array$a_def

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 80 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References setDecimals().

{
$this->setDecimals($a_def["decimals"]);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::importXMLProperty (   $a_key,
  $a_value 
)

Import property from XML.

Parameters
string$a_key
string$a_value

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 151 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References setDecimals().

{
if($a_key == "decimals")
{
$this->setDecimals($a_value != "" ? $a_value : null);
}
parent::importXMLProperty($a_key, $a_value);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::init ( )
protected

Init properties.

Reimplemented from ilAdvancedMDFieldDefinition.

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

References setDecimals().

{
$this->setDecimals(2);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::initADTDefinition ( )
protected

Init adt instance.

Returns
ilADTDefinition

Reimplemented from ilAdvancedMDFieldDefinitionInteger.

Definition at line 38 of file class.ilAdvancedMDFieldDefinitionFloat.php.

References getDecimals(), ilAdvancedMDFieldDefinition\getInstance(), ilAdvancedMDFieldDefinitionInteger\getMax(), ilAdvancedMDFieldDefinitionInteger\getMin(), and ilAdvancedMDFieldDefinitionInteger\getSuffix().

{
$def = ilADTFactory::getInstance()->getDefinitionInstanceByType("Float");
$def->setMin($this->getMin());
$def->setMax($this->getMax());
$def->setDecimals($this->getDecimals());
$def->setSuffix($this->getSuffix());
return $def;
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionFloat::setDecimals (   $a_value)

Set decimals.

Parameters
int$a_value

Definition at line 60 of file class.ilAdvancedMDFieldDefinitionFloat.php.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), importXMLProperty(), and init().

{
$this->decimals = max(1, abs((int)$a_value));
}

+ Here is the caller graph for this function:

Field Documentation

ilAdvancedMDFieldDefinitionFloat::$decimals
protected

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