function services_client_ui::list_build_row in Services Client 7.2
Same name and namespace in other branches
- 7 plugins/export_ui/services_client_ui.class.php \services_client_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/ services_client_ui.class.php, line 122
Class
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']);
// Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
// we can use it safely.
switch ($form_state['values']['order']) {
case 'disabled':
$this->sorts[$name] = empty($item->disabled) . $name;
break;
case 'title':
$this->sorts[$name] = $item->{$this->plugin['export']['title']};
break;
case 'name':
$this->sorts[$name] = $name;
break;
case 'connection':
$this->sorts[$name] = $item->connection;
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',
);
// If we have an admin title, make it the first row.
$connection = services_client_connection_load($item->connection);
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->title),
'class' => array(
'ctools-export-ui-title',
),
);
$this->rows[$name]['data'][] = array(
'data' => check_plain($name),
'class' => array(
'ctools-export-ui-name',
),
);
$this->rows[$name]['data'][] = array(
'data' => l($connection->admin_title, 'admin/structure/services_client/connection/list/' . $item->connection . '/edit', array(
'query' => drupal_get_destination(),
)),
'class' => array(
'ctools-export-ui-connection',
),
);
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->entity_type),
'class' => array(
'ctools-export-ui-entity-type',
),
);
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->event),
'class' => array(
'ctools-export-ui-event',
),
);
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->plugin),
'class' => array(
'ctools-export-ui-handler',
),
);
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->{$schema['export']['export type string']}),
'class' => array(
'ctools-export-ui-storage',
),
);
$ops = theme('links', array(
'links' => $operations,
'attributes' => array(
'class' => array(
'links',
'inline',
),
),
));
$this->rows[$name]['data'][] = array(
'data' => $ops,
'class' => array(
'ctools-export-ui-operations',
),
);
// Add an automatic mouseover of the description if one exists.
if (!empty($this->plugin['export']['admin_description'])) {
$this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
}
}