ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAdvancedMDFieldDefinitionFloat Class Reference

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

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

Public Member Functions

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

Protected Member Functions

 init ()
 
 initADTDefinition ()
 
 importFieldDefinition (array $a_def)
 
 getFieldDefinition ()
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinitionInteger
 initADTDefinition ()
 
 importFieldDefinition (array $a_def)
 
 getFieldDefinition ()
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 init ()
 Init properties. More...
 
 initADTDefinition ()
 Init adt instance. More...
 
 setADT (ilADT $a_adt)
 Set ADT instance. More...
 
 setFieldId ($a_id)
 Set field_id. More...
 
 importFieldDefinition (array $a_def)
 Import (type-specific) field definition from DB. More...
 
 getFieldDefinition ()
 Get (type-specific) field definition. More...
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, $a_disabled=false)
 Add custom input elements to definition form. More...
 
 getLastPosition ()
 Get last position of record. More...
 
 getDBProperties ()
 Get all definition properties for DB. More...
 
 import (array $a_data)
 Import from DB. More...
 
 read ($a_field_id)
 Read field definition. More...
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 Add (type-specific) properties to xml export. More...
 
 parseSearchObjects (array $a_records, array $a_object_types)
 Add object-data needed for global search to AMD search results. More...
 

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. More...
 
static getInstanceByTypeString ($a_type)
 Get instance by type string (used by import) More...
 
static getInstancesByRecordId ($a_record_id, $a_only_searchable=false)
 Get definitions by record id. More...
 
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
 
static getInstanceByImportId ($a_import_id)
 Get definition instance by import id. More...
 
static getSearchableDefinitionIds ()
 Get searchable definition ids (performance is key) More...
 
static getADTGroupForDefinitions (array $a_defs)
 Init ADTGroup for definitions. More...
 
static getValidTypes ()
 Get all valid types. More...
 
static isValidType ($a_type)
 Is given type valid. More...
 
- 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
 
const TYPE_EXTERNAL_LINK = 9
 
const TYPE_INTERNAL_LINK = 10
 
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getTypeString ($a_type)
 Get type string. More...
 

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

◆ addCustomFieldToDefinitionForm()

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

Add input elements to definition form.

Parameters
ilPropertyFormGUI$a_form
bool$a_disabled

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

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

114  {
115  global $lng;
116 
117  // #32
118  parent::addCustomFieldToDefinitionForm($a_form, $a_disabled);
119 
120  $decimals = new ilNumberInputGUI($lng->txt("md_adv_number_decimals"), "dec");
121  $decimals->setRequired(true);
122  $decimals->setValue($this->getDecimals());
123  $decimals->setSize(5);
124  $a_form->addItem($decimals);
125 
126  if ($a_disabled) {
127  $decimals->setDisabled(true);
128  }
129  }
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a number property in a property form.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ addPropertiesToXML()

ilAdvancedMDFieldDefinitionFloat::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

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

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

149  {
150  parent::addPropertiesToXML($a_writer);
151 
152  $a_writer->xmlElement('FieldValue', array("id"=>"decimals"), $this->getDecimals());
153  }
Create styles array
The data for the language used.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ getDecimals()

ilAdvancedMDFieldDefinitionFloat::getDecimals ( )

Get decimals.

Returns
int

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

References $decimals.

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

+ Here is the caller graph for this function:

◆ getFieldDefinition()

ilAdvancedMDFieldDefinitionFloat::getFieldDefinition ( )
protected

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

References $def, and getDecimals().

92  {
93  $def = parent::getFieldDefinition();
94  $def["decimals"] = $this->getDecimals();
95  return $def;
96  }
$def
Definition: croninfo.php:21
+ Here is the call graph for this function:

◆ getFieldDefinitionForTableGUI()

ilAdvancedMDFieldDefinitionFloat::getFieldDefinitionForTableGUI ( )

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

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

99  {
100  global $lng;
101 
102  $res = parent::getFieldDefinitionForTableGUI();
103  $res[$lng->txt("md_adv_number_decimals")] = $this->getDecimals();
104  return $res;
105  }
foreach($_POST as $key=> $value) $res
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getType()

ilAdvancedMDFieldDefinitionFloat::getType ( )

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

23  {
24  return self::TYPE_FLOAT;
25  }

◆ importCustomDefinitionFormPostValues()

ilAdvancedMDFieldDefinitionFloat::importCustomDefinitionFormPostValues ( ilPropertyFormGUI  $a_form)

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form

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

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

137  {
138  parent::importCustomDefinitionFormPostValues($a_form);
139 
140  $this->setDecimals($a_form->getInput("dec"));
141  }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ importFieldDefinition()

ilAdvancedMDFieldDefinitionFloat::importFieldDefinition ( array  $a_def)
protected

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

References setDecimals().

86  {
87  parent::importFieldDefinition($a_def);
88  $this->setDecimals($a_def["decimals"]);
89  }
+ Here is the call graph for this function:

◆ importXMLProperty()

ilAdvancedMDFieldDefinitionFloat::importXMLProperty (   $a_key,
  $a_value 
)

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

References setDecimals().

156  {
157  if ($a_key == "decimals") {
158  $this->setDecimals($a_value != "" ? $a_value : null);
159  }
160 
161  parent::importXMLProperty($a_key, $a_value);
162  }
+ Here is the call graph for this function:

◆ init()

ilAdvancedMDFieldDefinitionFloat::init ( )
protected

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

References setDecimals().

28  {
29  parent::init();
30  $this->setDecimals(2);
31  }
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionFloat::initADTDefinition ( )
protected

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

References $def, getDecimals(), ilADTFactory\getInstance(), ilAdvancedMDFieldDefinitionInteger\getMax(), ilAdvancedMDFieldDefinitionInteger\getMin(), and ilAdvancedMDFieldDefinitionInteger\getSuffix().

44  {
45  $def = ilADTFactory::getInstance()->getDefinitionInstanceByType("Float");
46 
47  $def->setMin($this->getMin());
48  $def->setMax($this->getMax());
49  $def->setDecimals($this->getDecimals());
50  $def->setSuffix($this->getSuffix());
51 
52  return $def;
53  }
static getInstance()
Get singleton.
$def
Definition: croninfo.php:21
+ Here is the call graph for this function:

◆ isFilterSupported()

ilAdvancedMDFieldDefinitionFloat::isFilterSupported ( )

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

34  {
35  return false;
36  }

◆ setDecimals()

ilAdvancedMDFieldDefinitionFloat::setDecimals (   $a_value)

Set decimals.

Parameters
int$a_value

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

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

66  {
67  $this->decimals = max(1, abs((int) $a_value));
68  }
+ Here is the caller graph for this function:

Field Documentation

◆ $decimals

ilAdvancedMDFieldDefinitionFloat::$decimals
protected

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