The ezinisetting datatype (Ini Setting)
Class eZIniSettingType in kernel/classes/datatypes/ezinisetting/ezinisettingtype.php; identifier ezinisetting, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
The columns of the attribute tables its class reads or writes: data_int, data_int1, data_text, data_text1, data_text2, data_text3, data_text4, data_text5 (data_text, data_int, data_float and sort_key_* are the object attribute's; data_text1 ... data_int4 the class attribute's settings). Found by reading the class: a heuristic.
In templates
my_attribute stands for the identifier of an attribute of this type in your class:
def $attribute = $node.data_map.my_attribute
if $attribute.has_content
attribute_view_gui attribute=$attribute
/if
{* the value as the datatype returns it (objectAttributeContent()) *}
$attribute.content|attribute( show, 1 )The shipped template that shows it (attribute_view_gui), design/standard/templates/content/datatype/view/ezinisetting.tpl:
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
switch match=$attribute.contentclass_attribute.data_int1
case in=array( 1, 2, 3, 4, 5 )
$attribute.data_text|wash
/case
case match=6
<textarea class="box" readonly="readonly" cols="97" rows="5">$attribute.data_text|wash</textarea>
/case
/switchThe shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezinisetting.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base=ContentObjectAttribute
section show=count( $attribute.content.modified )
<div class="message-warning">
<p>'Warning: the ini file settings value and object value does not match.'|i18n( 'design/standard/class/datatype' )</p>
<p>'The ini file has probably been modified manually since last time.'|i18n( 'design/standard/class/datatype' )</p>
section var=modified loop=$attribute.content.modified
<ul>
<li>'Ini File: '|i18n( 'design/standard/class/datatype' )$modified.item.file|wash</li>
<li>'Ini Value: '|i18n( 'design/standard/class/datatype' )$modified.item.ini_value|wash</li>
</ul>
/section
</div>
/section
switch match=$attribute.contentclass_attribute.data_int1
{* String. *}
case in=array( 1, 4, 5 )
<input id="ezcoa-if ne( $attribute_base, 'ContentObjectAttribute' )$attribute_base-/if$attribute.contentclassattribute_id_$attribute.contentclass_attribute_identifier" class="box ezcc-$attribute.object.content_class.identifier ezcca-$attribute.object.content_class.identifier_$attribute.contentclass_attribute_identifier" type="text" size="50" name="$attribute_base_ini_setting_$attribute.id" value="$attribute.data_text|wash" />
/case
{* Boolean: enabled/disabled. *}Override them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezinisetting.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezinisetting/ezinisettingtype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezinisetting.tpl, design/standard/templates/content/datatype/edit/ezinisetting.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.