You are here

function _linkit_preprocess_tabledrag_variables in Linkit 7.2

Preprocess tabledrag variables

Parameters

$variables:

$type: "plugin" or "attribute"

1 call to _linkit_preprocess_tabledrag_variables()
template_preprocess_linkit_profiles_export_ui_form in ./linkit.theme.inc
Processes variables

File

./linkit.theme.inc, line 45
Linkit theme functions.

Code

function _linkit_preprocess_tabledrag_variables(&$variables, $type) {

  // Add each attribute in the form to the appropriate place in the attribute listing.
  foreach (element_children($variables['form']['data'][$type . '_fieldset'][$type]) as $i) {
    $element =& $variables['form']['data'][$type . '_fieldset'][$type][$i];

    // Set special classes needed for table drag and drop.
    $element['weight']['#attributes']['class'] = array(
      'weight',
    );
    $variables['linkit_' . $type . '_listing'][$i] = new stdClass();
    $variables['linkit_' . $type . '_listing'][$i]->title = drupal_render($element['name']);
    $variables['linkit_' . $type . '_listing'][$i]->enabled = drupal_render($element['enabled']);
    $variables['linkit_' . $type . '_listing'][$i]->weight_select = drupal_render($element['weight']);
    $variables['linkit_' . $type . '_listing'][$i]->printed = FALSE;

    // Add description if it extists.
    if (isset($element['description'])) {
      $variables['linkit_' . $type . '_listing'][$i]->description = drupal_render($element['description']);
    }
  }
}