You are here

function theme_sharerich_manage_services in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 plugins/export_ui/sharerich_ctools_export_ui.inc \theme_sharerich_manage_services()
1 theme call to theme_sharerich_manage_services()
sharerich_ctools_export_ui_form in plugins/export_ui/sharerich_ctools_export_ui.inc
Define the preset add/edit form.

File

plugins/export_ui/sharerich_ctools_export_ui.inc, line 186

Code

function theme_sharerich_manage_services($variables) {
  $form = $variables['form'];
  $rows = array();
  foreach (element_children($form) as $service_identifier) {
    $form[$service_identifier]['weight']['#attributes']['class'] = array(
      'services-order-weight',
    );
    $rows[] = array(
      'data' => array(
        array(
          'class' => array(
            'service-cross',
          ),
        ),
        drupal_render($form[$service_identifier]['service']),
        drupal_render($form[$service_identifier]['enabled']),
        drupal_render($form[$service_identifier]['weight']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  $header = array(
    '',
    t('Service'),
    t('Enabled'),
    t('Weight'),
  );
  $output = drupal_render($form['note']);
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'service-order',
    ),
  ));
  $output .= drupal_render_children($form);
  drupal_add_tabledrag('service-order', 'order', 'sibling', 'services-order-weight');
  return $output;
}