You are here

function theme_csm_components in Custom Submit Messages 7

1 theme call to theme_csm_components()
csm_form in ./csm.module
Page callback: CSM settings

File

./csm.module, line 394
The main module file for Custom Submit Messages.

Code

function theme_csm_components($vars) {
  $element = $vars['element'];
  drupal_add_tabledrag('sample_table', 'order', 'sibling', 'item-row-weight');
  $header = array(
    'label' => t('User role'),
    'checkbox' => t('Enable role-specific messages'),
    'weight' => t('Weight'),
  );
  $rows = array();
  foreach (element_children($element) as $key) {
    $row = array();
    $row['data'] = array();
    foreach ($header as $fieldname => $title) {
      $row['data'][] = drupal_render($element[$key][$fieldname]);
      $row['class'] = array(
        'draggable',
      );
    }
    $rows[] = $row;
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'sample_table',
    ),
  ));
}