You are here

function stylizer_ui::list_build_row in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 stylizer/plugins/export_ui/stylizer_ui.class.php \stylizer_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

stylizer/plugins/export_ui/stylizer_ui.class.php, line 111

Class

stylizer_ui
UI class for Stylizer.

Code

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

  // Set up sorting
  switch ($form_state['values']['order']) {
    case 'disabled':
      $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title;
      break;
    case 'title':
      $this->sorts[$item->name] = $item->admin_title;
      break;
    case 'name':
      $this->sorts[$item->name] = $item->name;
      break;
    case 'type':
      $this->sorts[$item->name] = $this->style_plugin['type'] . $item->admin_title;
      break;
    case 'base':
      $this->sorts[$item->name] = $this->style_plugin['title'] . $item->admin_title;
      break;
    case 'storage':
      $this->sorts[$item->name] = $item->type . $item->admin_title;
      break;
  }
  if (!empty($this->base_types[$this->style_plugin['module']][$this->style_plugin['type']])) {
    $type = $this->base_types[$this->style_plugin['module']][$this->style_plugin['type']]['title'];
  }
  else {
    $type = t('Unknown');
  }
  $this->rows[$item->name] = array(
    'data' => array(
      array(
        'data' => $type,
        'class' => 'ctools-export-ui-type',
      ),
      array(
        'data' => check_plain($item->name),
        'class' => 'ctools-export-ui-name',
      ),
      array(
        'data' => check_plain($item->admin_title),
        'class' => 'ctools-export-ui-title',
      ),
      array(
        'data' => check_plain($this->style_plugin['title']),
        'class' => 'ctools-export-ui-base',
      ),
      array(
        'data' => check_plain($item->type),
        'class' => 'ctools-export-ui-storage',
      ),
      array(
        'data' => theme('links', $operations),
        'class' => 'ctools-export-ui-operations',
      ),
    ),
    'title' => check_plain($item->admin_description),
    'class' => !empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled',
  );
}