You are here

function theme_fe_paths_config_table in File Entity Paths 7.2

Theme function to build table from list of File Entity Paths config.

Parameters

$variables:

Return value

string

1 theme call to theme_fe_paths_config_table()
fe_paths_config_table_form in ./fe_paths.admin.inc
Form builder for File Entity Paths configuration list table.

File

./fe_paths.admin.inc, line 454
Admin ui for the File Entity Paths module.

Code

function theme_fe_paths_config_table($variables) {
  $element = $variables['element'];
  drupal_add_tabledrag('form_id', 'order', 'sibling', 'order-weight');
  $header = array(
    'label' => t('Label'),
    'weight' => t('Weight'),
    'machine_name' => t('Machine name'),
    'status' => t('Status'),
    'path' => t('Path'),
    'filename' => t('Filename'),
    'data' => t('Settings'),
    'link' => t('Edit'),
  );
  $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',
      );

      // needed for table dragging
    }
    $rows[] = $row;
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'form_id',
    ),
  ));
}