function views_content_context_view_settings_form in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 views_content/plugins/contexts/view.inc \views_content_context_view_settings_form()
1 string reference to 'views_content_context_view_settings_form'
File
- views_content/
plugins/ contexts/ view.inc, line 79 - Plugin to provide a node context. A node context is a node wrapped in a context object that can be utilized by anything that accepts contexts.
Code
function views_content_context_view_settings_form($conf) {
$views = views_get_applicable_views('returns context');
foreach ($views as $data) {
list($view, $id) = $data;
$title = $view->display_handler
->get_option('admin_title');
if (!$title) {
$title = $view->name;
}
$options[$view->name . ':' . $id] = $title;
}
if (!empty($options)) {
natcasesort($options);
$form['view'] = array(
'#type' => 'select',
'#options' => $options,
'#title' => t('View'),
);
}
else {
$form['view'] = array(
'#value' => '<p>' . t('There are currently no views with Context displays enabled. You should go to the view administration and add a Context display to use a view as a context.') . '</p>',
);
}
return $form;
}