You are here

function theme_tmgmt_local_translation_form_element in Translation Management Tool 7

Renders a table for one data item.

1 theme call to theme_tmgmt_local_translation_form_element()
tmgmt_local_translation_form_element in translators/tmgmt_local/includes/tmgmt_local.pages.inc
Builds a translation form element.

File

translators/tmgmt_local/includes/tmgmt_local.theme.inc, line 28

Code

function theme_tmgmt_local_translation_form_element($variables) {

  // Theme table which contains source, translation and action state button.
  $element = $variables['element'];
  $parts = explode('|', $element['#parents'][0]);
  $header_title = ucfirst(str_replace('_', ' ', $parts[0]));

  // Container for ajax messages.
  $result = '<div id="tmgmt-status-messages-' . strtolower($element['#parent_label'][0]) . '"></div>';
  $result .= theme('table', array(
    'attributes' => array(
      'id' => $element['#ajaxid'],
      'class' => array(
        $element['#zebra'],
      ),
    ),
    'header' => array(
      array(
        'data' => $header_title,
        'colspan' => 3,
      ),
    ),
    'rows' => array(
      array(
        'data' => array(
          drupal_render($element['source']),
          drupal_render($element['translation']),
          drupal_render($element['actions']),
        ),
      ),
    ),
  ));
  return $result;
}