You are here

function sharerich_set_ui::list_build_row in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 plugins/export_ui/sharerich_set_ui.class.php \sharerich_set_ui::list_build_row()

Build a row based on the item.

By default all of the rows are placed into a table by the render method, so this is building up a row suitable for theme('table'). This doesn't have to be true if you override both.

Overrides ctools_export_ui::list_build_row

File

plugins/export_ui/sharerich_set_ui.class.php, line 20
A custom Ctools Export UI class for Sharerich Sets.

Class

sharerich_set_ui
Customizations of the Sharerich UI.

Code

function list_build_row($item, &$form_state, $operations) {

  // Set up sorting
  $name = $item->{$this->plugin['export']['key']};
  $schema = ctools_export_get_schema($this->plugin['schema']);
  switch ($form_state['values']['order']) {
    case 'disabled':
      $this->sorts[$name] = empty($item->disabled) . $name;
      break;
    case 'name':
      $this->sorts[$name] = $name;
      break;
    case 'storage':
      $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
      break;
  }
  $this->rows[$name]['data'] = array();
  $this->rows[$name]['class'] = !empty($item->disabled) ? array(
    'ctools-export-ui-disabled',
  ) : array(
    'ctools-export-ui-enabled',
  );
  $this->rows[$name]['data'][] = array(
    'data' => check_plain($item->name),
    'class' => array(
      'ctools-export-ui-name',
    ),
  );
  $this->rows[$name]['data'][] = array(
    'data' => check_plain($item->block) ? t('Yes') : t('No'),
    'class' => array(
      'ctools-export-ui-block',
    ),
  );
  $this->rows[$name]['data'][] = array(
    'data' => check_plain($item->{$schema['export']['export type string']}),
    'class' => array(
      'ctools-export-ui-storage',
    ),
  );
  $ops = theme('links__ctools_dropbutton', array(
    'links' => $operations,
    'attributes' => array(
      'class' => array(
        'links',
        'inline',
      ),
    ),
  ));
  $this->rows[$name]['data'][] = array(
    'data' => $ops,
    'class' => array(
      'ctools-export-ui-operations',
    ),
  );
}