IV. Element Reference

Element records are the building blocks styles are created with.

1. Element Record Definition

An element record contains information about a style element.

Fields of an element record

id

The id of the element record.

style

Points to the style-id the element belongs to.

name

The name of the style element.

value

The contents of the style element.

sitegroup

Points to the sitegroup-id of the sitegroup the record belongs to.

2. Element Object Definition

Midgard functions like mgd_get_element and mgd_list_elements return objects upon success. This section describes the contents of those objects. Most object parameters map directly to the record fields described above.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Element Object Prototype */

Class element {
 var $N;   # Only in objects returned by mgd_list_element
 var $id;
 var $style;
 var $name;
 var $value;
 var $sitegroup;

 function fetch(); # Only in objects returned by mgd_list_element
 
 function create();
 function update();
 function delete();

 function createattachment();
 function updateattachment();
 function deleteattachment();
 function getattachment();
 function listattahcments();
 function openattachment();
 function serveattachement();

 function listparameters();
 function parameter();
 function searchparameters();

 function getsitegroup();
 function setsitegroup();
}
Table of Contents
mgd_copy_element — Copy a style element
mgd_create_element — Create an element record
mgd_delete_element — Delete an element record
mgd_get_element — Retrieve information about an element
mgd_get_element_by_name — Retrieve information about an element by its name
mgd_list_elements — List elements of a style
mgd_move_element — Move an element
mgd_update_element — Modify an element record