function total_control_views_add_display in Total Control Admin Dashboard 6.2
Same name and namespace in other branches
- 7.2 includes/total_control.inc \total_control_views_add_display()
Adds view displays.
Parameters
$machine_type: The machine readable name of the content type
$content_type: The human readable name of the content type
1 call to total_control_views_add_display()
- total_control_add_type_submit in includes/
total_control.inc - Submit function for content type form
File
- includes/
total_control.inc, line 51 - total_control.inc
Code
function total_control_views_add_display($machine_type, $content_type) {
if (!$machine_type) {
drupal_set_message('no content type provided', 'error');
return;
}
$auto_pane_default = variable_get('total_control_auto_panels', array());
$auto_page_default = variable_get('total_control_auto_pages', array());
if (!($auto_page_default['type'] === 0)) {
$view = views_get_view('control_content');
if (!$view->display['page_tc_' . $machine_type]) {
total_control_add_views_page_display($view, $content_type, $machine_type);
$defaults = variable_get('total_control_type_pages', array());
$defaults[$machine_type] = $machine_type;
$defaults = variable_set('total_control_type_pages', $defaults);
}
else {
drupal_set_message(t('Total Control was unable to create your
administrative view because a view already exists with the
name: ' . 'page_tc_' . $machine_type));
}
}
if (!($auto_pane_default['type'] === 0)) {
$paneview = views_get_view('control_content_panes');
$auto_panes = variable_get('total_control_auto_panels', array());
if (!$paneview->display['pane_tc_' . $machine_type]) {
total_control_add_views_pane_display($paneview, $content_type, $machine_type);
$defaults = variable_get('total_control_type_panes', array());
$defaults[$machine_type] = $machine_type;
$defaults = variable_set('total_control_type_panes', $defaults);
}
else {
drupal_set_message(t('Total Control was unable to create your
administrative view because a view already exists with the name: ' . 'pane_tc_' . $machine_type));
}
}
return;
}