View source
<?php
class jw_player_ctools_export_ui extends ctools_export_ui {
function list_build_row($item, &$form_state, $operations) {
$name = $item->preset_name;
$description = $item->description;
$preset_settings = jw_player_preset_settings($item->{$this->plugin['export']['key']});
unset($preset_settings['name']);
unset($preset_settings['description']);
$settings = implode('<br />', $preset_settings);
$schema = ctools_export_get_schema($this->plugin['schema']);
switch ($form_state['values']['order']) {
case 'disabled':
$this->sorts[$name] = empty($item->disabled) . $name;
break;
case 'title':
$this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
break;
case 'name':
$this->sorts[$name] = $name;
break;
case 'description':
$this->sorts[$name] = $description;
break;
case 'settings':
$this->sorts[$name] = $settings;
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 (!empty($this->plugin['export']['admin_title'])) {
$this->rows[$name]['data'][] = array(
'data' => check_plain($item->{$this->plugin['export']['admin_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' => check_plain($description),
'class' => array(
'ctools-export-ui-description',
),
);
$this->rows[$name]['data'][] = array(
'data' => $settings,
'class' => array(
'ctools-export-ui-settings',
),
);
$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',
),
);
if (!empty($this->plugin['export']['admin_description'])) {
$this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
}
}
function list_table_header() {
$header = array();
if (!empty($this->plugin['export']['admin_title'])) {
$header[] = array(
'data' => t('Title'),
'class' => array(
'ctools-export-ui-title',
),
);
}
$header[] = array(
'data' => t('Name'),
'class' => array(
'ctools-export-ui-name',
),
);
$header[] = array(
'data' => t('Description'),
'class' => array(
'ctools-export-ui-description',
),
);
$header[] = array(
'data' => t('Settings'),
'class' => array(
'ctools-export-ui-settings',
),
);
$header[] = array(
'data' => t('Storage'),
'class' => array(
'ctools-export-ui-storage',
),
);
$header[] = array(
'data' => t('Operations'),
'class' => array(
'ctools-export-ui-operations',
),
);
return $header;
}
}