You are here

public function linkit_profiles_ui::list_build_row in Linkit 7.2

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/linkit_profiles_ui.class.php, line 23
Class that extends the regular ctools export ui.

Class

linkit_profiles_ui
Base class for export UI.

Code

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

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