The ezmedia datatype (Media)
Class eZMediaType in kernel/classes/datatypes/ezmedia/ezmediatype.php; identifier ezmedia, listed in settings/content.ini [DataTypeSettings] AvailableDataTypes[].
What it stores
The columns of the attribute tables its class reads or writes: data_int1, data_text1 (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.
It is can be filled from an uploaded file.
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/ezmedia.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
if $attribute.content.filename
switch name=mediaType match=$attribute.contentclass_attribute.data_text1
case match=flash
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
if $attribute.content.width|gt( 0 )width="$attribute.content.width|wash"/if
if $attribute.content.height|gt( 0 )height="$attribute.content.height|wash"/if>
<param name="movie" value=concat("content/download/",$attribute.contentobject_id,"/",$attribute.content.contentobject_attribute_id,"/",$attribute.content.original_filename)|ezurl />
<param name="quality" value="$attribute.content.quality|wash" />
<param name="play" value="if $attribute.content.is_autoplaytrue/if" />
<param name="loop" value="if $attribute.content.is_looptrue/if" />
<embed src=concat("content/download/",$attribute.contentobject_id,"/",$attribute.content.contentobject_attribute_id,"/",$attribute.content.original_filename)|ezurl
type="application/x-shockwave-flash"
quality="$attribute.content.quality|wash" pluginspage="$attribute.content.pluginspage|wash"
if $attribute.content.width|gt( 0 )width="$attribute.content.width|wash"/if
if $attribute.content.height|gt( 0 )height="$attribute.content.height|wash"/if
play="if $attribute.content.is_autoplaytrue/if"
loop="if $attribute.content.is_looptrue/if" >
</embed>
</object>
/case
case match=quick_timeThe shipped template that edits it (attribute_edit_gui), design/standard/templates/content/datatype/edit/ezmedia.tpl (first 25 lines):
{* DO NOT EDIT THIS FILE! Use an override template instead. *}
default attribute_base='ContentObjectAttribute'
{* Type. *}
<div class="block">
<label>'Type'|i18n( 'design/standard/content/datatype' ):</label>
<p>
switch name=mediaType match=$attribute.contentclass_attribute.data_text1
case match=flash'Flash'|i18n( 'design/standard/content/datatype' )/case
case match=quick_time'QuickTime'|i18n( 'design/standard/content/datatype' )/case
case match=real_player'RealPlayer'|i18n( 'design/standard/content/datatype' )/case
case match=silverlight'Silverlight'|i18n( 'design/standard/content/datatype' )/case
case match=windows_media_player'Windows Media Player'|i18n( 'design/standard/content/datatype' )/case
case match='html5_video''Html5 Video'|i18n( 'design/standard/content/datatype' )/case
case match='html5_audio''Html5 Audio'|i18n( 'design/standard/content/datatype' )/case
case'Unknown'|i18n( 'design/standard/content/datatype' )/case
/switch
</p>
</div>
{* Current file. *}
<div class="block">
<label>'Current file'|i18n( 'design/standard/content/datatype' ):</label>
if $attribute.content.filename
<table class="list" cellspacing="0">Override them for one class attribute in an override.ini.append.php with Source=content/datatype/view/ezmedia.tpl and a match on attribute_identifier (see A template override).
Related
Generated by ./console exp:help:examples from kernel/classes/datatypes/ezmedia/ezmediatype.php, settings/content.ini, design/standard/templates/content/datatype/view/ezmedia.tpl, design/standard/templates/content/datatype/edit/ezmedia.tpl. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.