You are here

function theme_matrix_formatter_default in Matrix field 6.2

Same name and namespace in other branches
  1. 6 matrix.module \theme_matrix_formatter_default()

Theme function for 'default' text field formatter.

Parameters

$element The whole $node object, but containing specific information relating to the delta of this element.:

Return value

HTML.

File

./matrix.module, line 893
Defines simple matrix field types.

Code

function theme_matrix_formatter_default($element) {
  if ($element['#weight'] == 'rows_elements') {
    $field_info = $element['#node']->{$element}['#field_name'];
    $prepared = matrix_format_prepare($field_info, NULL, $element['#field_name']);
    if ($prepared) {
      $links = matrix_format_prepare_links($element['#node']->nid, $element['#field_name']);

      //if you want to customize the formatting, manipulate $prepared before passing it to theme('matrix_table'...)
      $output = theme('matrix_table', $prepared);
      $output .= '<div class="matrix-links">' . $links . '</div>';

      //eg export link
      return $output;
    }
  }
}