You are here

function service_links_displays_sl_servicestable_alter in Service links 7.2

Same name and namespace in other branches
  1. 6.2 plugins/service_links_displays.module \service_links_displays_sl_servicestable_alter()

Implements hook_sl_servicestable_alter().

File

plugins/service_links_displays.module, line 236
Custom Service Links field for Displays.

Code

function service_links_displays_sl_servicestable_alter(&$table, $form) {
  $table['header'][] = t('Displays');
  if (empty($table['rows'])) {
    return;
  }
  $num_row = 0;
  $col_num = count($table['rows'][0]['data']);
  foreach (element_children($form['service_links_displays']) as $service_id) {
    $service = $form['service_links_displays'][$service_id];
    $service['displays'] = array(
      '#type' => 'checkbox',
      '#checked' => $service['#default_value'],
      '#id' => $service['#id'],
      '#name' => $service['#name'],
      '#attributes' => $service['#attributes'],
    );
    $col = drupal_render($service['displays']);
    $table['rows'][$num_row]['data'][$col_num] = $col;
    $num_row++;
  }
}