You are here

function theme_imageapi_optimize_services_internal_form in Image Optimize (or ImageAPI Optimize) 7

Theme callback for Internal ImageAPI Optimize form.

1 theme call to theme_imageapi_optimize_services_internal_form()
imageapi_optimize_services_internal_form in services/internal.inc
Internal ImageAPI Optimize form callback.

File

services/internal.inc, line 237
Internal ImageAPI Optimize service.

Code

function theme_imageapi_optimize_services_internal_form($variables) {
  $output = '';
  $form = $variables['form'];
  list(, $type) = explode('-', $form['#id']);
  $rows = array();
  foreach (element_children($form) as $name) {
    $row = array();
    $form[$name]['weight']['#attributes']['class'] = array(
      $type . '-binary-weight',
    );
    $row[] = drupal_render($form[$name]['status']);
    $row[] = drupal_render($form[$name]['title']);
    $row[] = drupal_render($form[$name]['path']);
    $row[] = drupal_render($form[$name]['op']);
    $row[] = drupal_render($form[$name]['weight']);
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $header = array(
    '',
    t('Binary'),
    t('Path'),
    '',
    t('Weight'),
  );
  $id = $type . '-binaries-table';
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => $id,
    ),
  ));
  drupal_add_tabledrag($id, 'order', 'subling', $type . '-binary-weight');
  return $output;
}