You are here

function theme_forena_element_draggable in Forena Reports 7.4

Same name and namespace in other branches
  1. 8 forena.report.inc \theme_forena_element_draggable()
  2. 7.5 forena.report.inc \theme_forena_element_draggable()
5 theme calls to theme_forena_element_draggable()
FrxCrosstab::configForm in renderers/FrxCrosstab.inc
Crosstab configuration form.
FrxFieldTable::configForm in renderers/FrxFieldTable.inc
Template configuration form @parmater $configuration form
FrxSection::configForm in renderers/FrxSection.inc
Generate configuration.
FrxSVGGraph::configForm in renderers/FrxSVGGraph.inc
Returns the section Enter description here ...
FrxTable::configForm in renderers/FrxTable.inc
Returns the section Enter description here ...

File

./forena.report.inc, line 1470

Code

function theme_forena_element_draggable($variables) {
  $output = '';
  $element = $variables['element'];
  $id = $element['#draggable_id'];
  $headers = array();
  $rows = array();
  foreach (element_children($element) as $e_key) {
    $element[$e_key]['weight']['#attributes']['class'] = array(
      $id . '-weight',
    );
    $row = array();
    foreach (element_children($element[$e_key]) as $ctl) {
      if (isset($element[$e_key][$ctl]['#title'])) {
        $headers[$ctl] = $element[$e_key][$ctl]['#title'];
        $element[$e_key][$ctl]['#title_display'] = 'invisible';
        $e = drupal_render($element[$e_key][$ctl]);
        $row[] = $e;
      }
    }
    $rows[] = array(
      'data' => $row,
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = theme('table', array(
    'header' => $headers,
    'rows' => $rows,
    'attributes' => array(
      'id' => $id,
    ),
  ));
  drupal_add_tabledrag($id, 'order', 'group', $id . '-weight');

  //$output .= drupal_render_children($element);
  return $output;
}