MySource Matrix Developer

Main Content

Edit Interface Screen XML Structure

Here is a part of the edit interface screen XML file:

<contents>
	<section name="Details" >
		<field attribute="name">
			<text width="35" height="1" />
		</field>
		<field attribute="short_name">
			<text width="25" height="1" />
		</field>
	</section>
	<section name="Asset Selection" >
		<field>
			<function_call>
				<paint_function   name="paintAssetTypes"   />
				<process_function name="processAssetTypes" />
			</function_call>
		</field>
	</section>
..
...

Viewing the screen defined above will display two sections, “Details”, and “Asset Selection”. The Details section will have two text fields and the Asset Selection section will print custom content which is defined in paintAssetTypes() function. Attribute value must be unique for each asset.

Common Matrix Fields:

Here is a list of most used fields in Matrix Screens. You should also look at other assets to find out how to create other type of fields.

Text:

Creates a text field with width 35 and height 1.

<field attribute="name">
	<text width="35" height="1" />
</field>

Int:

Creates a text field with width 5 and removes any non integer values from the field. 

<field attribute="num_per_page">
	<int width="5" />
</field>

Selection:

Style "list" will creates a combo box and style "boxes" will create check box list. 

<field attribute="group_by">
	<selection style="list" />
</field>

Boolean:

Creates a combo box with the options “yes” (value=1) and “no” (value=0).
<field attribute="subs_only">
	<boolean true_text="yes" false_text="no" />
</field>

Function:

This is a special field where the output is provided by a PHP function paintRootNode and the processing is done by the processRootNode function. Both functions are defined in asset_name_edit_fns.inc.

<field>
	<function_call>
              	<paint_function   name="paintRootNode"  />
		<process_function name="processRootNode" />
	</function_call>
</field>

AssetId:

Creates a special text field where users can select an asset from the Asset Map. This field is read only and can only be changed by clicking the “Change” button (or Reset to clear contents of the field) and selecting an asset from the asset map.
<field attribute="active_question">
	<assetid type_codes="test_asset:D" />
</field>
Details Screen Example

Edit Interface Screen XML Conventions

  • Attribute names should be in all lowercase, with underscores separating words.
  • Function names should start with a lowercase and each word should start with an uppercase. Underscores should not be used.
  • All XML tags should be closed