function views_plugin_display::options_form
Provide the default form for setting options.
Overrides views_plugin::options_form
3 calls to views_plugin_display::options_form()
- views_plugin_display_attachment::options_form in plugins/
views_plugin_display_attachment.inc - Provide the default form for setting options.
- views_plugin_display_block::options_form in plugins/
views_plugin_display_block.inc - Provide the default form for setting options.
- views_plugin_display_page::options_form in plugins/
views_plugin_display_page.inc - Provide the default form for setting options.
3 methods override views_plugin_display::options_form()
- views_plugin_display_attachment::options_form in plugins/
views_plugin_display_attachment.inc - Provide the default form for setting options.
- views_plugin_display_block::options_form in plugins/
views_plugin_display_block.inc - Provide the default form for setting options.
- views_plugin_display_page::options_form in plugins/
views_plugin_display_page.inc - Provide the default form for setting options.
File
-
plugins/
views_plugin_display.inc, line 1523
Class
- views_plugin_display
- The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.
Code
public function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
if ($this->defaultable_sections($form_state['section'])) {
views_ui_standard_display_dropdown($form, $form_state, $form_state['section']);
}
$form['#title'] = check_plain($this->display->display_title) . ': ';
// Set the 'section' to highlight on the form. If it's the item we're
// looking at is pulling from the default display, reflect that. Don't use
// is_defaulted since we want it to show up even on the default display.
if (!empty($this->options['defaults'][$form_state['section']])) {
$form['#section'] = 'default-' . $form_state['section'];
}
else {
$form['#section'] = $this->display->id . '-' . $form_state['section'];
}
switch ($form_state['section']) {
case 'display_id':
$form['#title'] .= t('The machine name of this display');
$form['display_id'] = array(
'#type' => 'textfield',
'#description' => t('This is machine name of the display.'),
'#default_value' => !empty($this->display->new_id) ? $this->display->new_id : $this->display->id,
'#required' => TRUE,
'#size' => 64,
);
break;
case 'display_title':
$form['#title'] .= t('The name and the description of this display');
$form['display_title'] = array(
'#title' => t('Name'),
'#type' => 'textfield',
'#description' => t('This name will appear only in the administrative interface for the View.'),
'#default_value' => $this->display->display_title,
'#maxlength' => 64,
);
$form['display_description'] = array(
'#title' => t('Description'),
'#type' => 'textfield',
'#description' => t('This description will appear only in the administrative interface for the View.'),
'#default_value' => $this->get_option('display_description'),
);
break;
case 'display_comment':
$form['#title'] .= t("This display's comments");
$form['display_comment'] = array(
'#type' => 'textarea',
'#description' => t('This value will be seen and used only within the Views UI and can be used to document this display. You can use this to provide notes for other or future maintainers of your site about how or why this display is configured.'),
'#default_value' => $this->get_option('display_comment'),
);
break;
case 'title':
$form['#title'] .= t('The title of this view');
$form['title'] = array(
'#type' => 'textfield',
'#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc. Use <none> to not assign a title; this can allow other modules to control the page title.'),
'#default_value' => $this->get_option('title'),
);
break;
case 'css_class':
$form['#title'] .= t('CSS class');
$form['css_class'] = array(
'#type' => 'textfield',
'#description' => t('The CSS class names will be added to the view. This enables you to use specific CSS code for each view. You may define multiples classes separated by spaces.'),
'#default_value' => $this->get_option('css_class'),
);
break;
case 'use_ajax':
$form['#title'] .= t('Use AJAX when available to load this view');
$form['description'] = array(
'#markup' => '<div class="description form-item">' . t('If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages, but it is very useful for side content.') . '</div>',
);
$form['use_ajax'] = array(
'#type' => 'radios',
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => $this->get_option('use_ajax') ? 1 : 0,
);
break;
case 'hide_attachment_summary':
$form['#title'] .= t('Hide attachments when displaying a contextual filter summary');
$form['hide_attachment_summary'] = array(
'#type' => 'radios',
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => $this->get_option('hide_attachment_summary') ? 1 : 0,
);
break;
case 'hide_admin_links':
$form['#title'] .= t('Hide contextual links on this view.');
$form['hide_admin_links'] = array(
'#type' => 'radios',
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => $this->get_option('hide_admin_links') ? 1 : 0,
);
break;
case 'use_more':
$form['#title'] .= t('Add a more link to the bottom of the display.');
$form['use_more'] = array(
'#type' => 'checkbox',
'#title' => t('Create more link'),
'#description' => t("This will add a more link to the bottom of this view, which will link to the page view. If you have more than one page view, the link will point to the display specified in 'Link display' section under advanced. You can override the url at the link display setting."),
'#default_value' => $this->get_option('use_more'),
);
$form['use_more_always'] = array(
'#type' => 'checkbox',
'#title' => t("Display 'more' link only if there is more content"),
'#description' => t("Leave this unchecked to display the 'more' link even if there are no more items to display."),
'#default_value' => !$this->get_option('use_more_always'),
'#dependency' => array(
'edit-use-more' => array(
TRUE,
),
),
);
$form['open_new_window'] = array(
'#type' => 'checkbox',
'#title' => t("Open 'more' link in new window (target='blank')"),
'#description' => t("Leave this unchecked to open the more link in the same window."),
'#default_value' => $this->get_option('open_new_window'),
'#dependency' => array(
'edit-use-more' => array(
TRUE,
),
),
);
$form['use_more_text'] = array(
'#type' => 'textfield',
'#title' => t('More link text'),
'#description' => t("The text to display for the more link."),
'#default_value' => $this->get_option('use_more_text'),
'#dependency' => array(
'edit-use-more' => array(
TRUE,
),
),
);
break;
case 'group_by':
$form['#title'] .= t('Allow grouping and aggregation (calculation) of fields.');
$form['group_by'] = array(
'#type' => 'checkbox',
'#title' => t('Aggregate'),
'#description' => t('If enabled, some fields may become unavailable. All fields that are selected for grouping will be collapsed to one record per distinct value. Other fields which are selected for aggregation will have the function run on them. For example, you can group nodes on title and count the number of nids in order to get a list of duplicate titles.'),
'#default_value' => $this->get_option('group_by'),
);
break;
case 'access':
$form['#title'] .= t('Access restrictions');
$form['access'] = array(
'#prefix' => '<div class="clearfix">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$access = $this->get_option('access');
$form['access']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('access', NULL, array(
$this->view->base_table,
)),
'#default_value' => $access['type'],
);
$access_plugin = views_fetch_plugin_data('access', $access['type']);
if (!empty($access_plugin['uses options'])) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',
'#markup' => t('You may also adjust the !settings for the currently selected access restriction.', array(
'!settings' => $this->option_link(t('settings'), 'access_options'),
)),
'#suffix' => '</div>',
);
}
break;
case 'access_options':
$access = $this->get_option('access');
$plugin = $this->get_plugin('access');
$form['#title'] .= t('Access options');
if ($plugin) {
if (!empty($plugin->definition['help topic'])) {
$form['#help_topic'] = $plugin->definition['help topic'];
}
if (!empty($plugin->definition['module'])) {
$form['#help_module'] = $plugin->definition['module'];
}
$form['access_options'] = array(
'#tree' => TRUE,
);
$form['access_options']['type'] = array(
'#type' => 'value',
'#value' => $access['type'],
);
$plugin->options_form($form['access_options'], $form_state);
}
break;
case 'cache':
$form['#title'] .= t('Caching');
$form['cache'] = array(
'#prefix' => '<div class="clearfix">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$cache = $this->get_option('cache');
$form['cache']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('cache', NULL, array(
$this->view->base_table,
)),
'#default_value' => $cache['type'],
);
$cache_plugin = views_fetch_plugin_data('cache', $cache['type']);
if (!empty($cache_plugin['uses options'])) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',
'#suffix' => '</div>',
'#markup' => t('You may also adjust the !settings for the currently selected cache mechanism.', array(
'!settings' => $this->option_link(t('settings'), 'cache_options'),
)),
);
}
break;
case 'cache_options':
$cache = $this->get_option('cache');
$plugin = $this->get_plugin('cache');
$form['#title'] .= t('Caching options');
if ($plugin) {
if (!empty($plugin->definition['help topic'])) {
$form['#help_topic'] = $plugin->definition['help topic'];
}
if (!empty($plugin->definition['module'])) {
$form['#help_module'] = $plugin->definition['module'];
}
$form['cache_options'] = array(
'#tree' => TRUE,
);
$form['cache_options']['type'] = array(
'#type' => 'value',
'#value' => $cache['type'],
);
$plugin->options_form($form['cache_options'], $form_state);
}
break;
case 'query':
$query_options = $this->get_option('query');
$plugin_name = $query_options['type'];
$form['#title'] .= t('Query options');
$this->view
->init_query();
if ($this->view->query) {
if (!empty($this->view->query->definition['help topic'])) {
$form['#help_topic'] = $this->view->query->definition['help topic'];
}
if (!empty($this->view->query->definition['module'])) {
$form['#help_module'] = $this->view->query->definition['module'];
}
$form['query'] = array(
'#tree' => TRUE,
'type' => array(
'#type' => 'value',
'#value' => $plugin_name,
),
'options' => array(
'#tree' => TRUE,
),
);
$this->view->query
->options_form($form['query']['options'], $form_state);
}
break;
case 'field_language':
$form['#title'] .= t('Field Language');
$entities = entity_get_info();
$entity_tables = array();
$has_translation_handlers = FALSE;
foreach ($entities as $entity_info) {
$entity_tables[] = $entity_info['base table'];
if (!empty($entity_info['translation'])) {
$has_translation_handlers = TRUE;
}
}
// Doesn't make sense to show a field setting here if we aren't querying
// an entity base table. Also, we make sure that there's at least one
// entity type with a translation handler attached.
if (in_array($this->view->base_table, $entity_tables) && $has_translation_handlers) {
$languages = array(
'***CURRENT_LANGUAGE***' => t("Current user's language"),
'***DEFAULT_LANGUAGE***' => t("Default site language"),
LANGUAGE_NONE => t('Language neutral'),
);
$languages = array_merge($languages, views_language_list());
$form['field_language'] = array(
'#type' => 'select',
'#title' => t('Field Language'),
'#description' => t('All fields which support translations will be displayed in the selected language.'),
'#options' => $languages,
'#default_value' => $this->get_option('field_language'),
);
$form['field_language_add_to_query'] = array(
'#type' => 'checkbox',
'#title' => t('When needed, add the field language condition to the query'),
'#default_value' => $this->get_option('field_language_add_to_query'),
);
}
else {
$form['field_language']['#markup'] = t("You don't have translatable entity types.");
}
break;
case 'style_plugin':
$form['#title'] .= t('How should this view be styled');
$form['#help_topic'] = 'style';
$form['style_plugin'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('style', $this->get_style_type(), array(
$this->view->base_table,
)),
'#default_value' => $this->get_option('style_plugin'),
'#description' => t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'),
);
$style_plugin = views_fetch_plugin_data('style', $this->get_option('style_plugin'));
if (!empty($style_plugin['uses options'])) {
$form['markup'] = array(
'#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected style.', array(
'!settings' => $this->option_link(t('settings'), 'style_options'),
)) . '</div>',
);
}
break;
case 'style_options':
$form['#title'] .= t('Style options');
$style = TRUE;
$type = 'style_plugin';
$name = $this->get_option('style_plugin');
case 'row_options':
if (!isset($name)) {
$name = $this->get_option('row_plugin');
}
// If row, $style will be empty.
if (empty($style)) {
$form['#title'] .= t('Row style options');
$type = 'row_plugin';
}
$plugin = $this->get_plugin(empty($style) ? 'row' : 'style');
if ($plugin) {
if (!empty($plugin->definition['help topic'])) {
$form['#help_topic'] = $plugin->definition['help topic'];
}
if (!empty($plugin->definition['module'])) {
$form['#help_module'] = $plugin->definition['module'];
}
$form[$form_state['section']] = array(
'#tree' => TRUE,
);
$plugin->options_form($form[$form_state['section']], $form_state);
}
break;
case 'row_plugin':
$form['#title'] .= t('How should each row in this view be styled');
$form['#help_topic'] = 'style-row';
$form['row_plugin'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('row', $this->get_style_type(), array(
$this->view->base_table,
)),
'#default_value' => $this->get_option('row_plugin'),
);
$row_plugin = views_fetch_plugin_data('row', $this->get_option('row_plugin'));
if (!empty($row_plugin['uses options'])) {
$form['markup'] = array(
'#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected row style.', array(
'!settings' => $this->option_link(t('settings'), 'row_options'),
)) . '</div>',
);
}
break;
case 'link_display':
$form['#title'] .= t('Which display to use for path');
foreach ($this->view->display as $display_id => $display) {
if ($display->handler
->has_path()) {
$options[$display_id] = $display->display_title;
}
}
$options['custom_url'] = t('Custom URL');
if (count($options)) {
$form['link_display'] = array(
'#type' => 'radios',
'#options' => $options,
'#description' => t("Which display to use to get this display's path for things like summary links, rss feed links, more links, etc."),
'#default_value' => $this->get_option('link_display'),
);
}
$options = array();
// This lets us prepare the key as we want it printed.
$count = 0;
foreach ($this->view->display_handler
->get_handlers('argument') as $handler) {
$options[t('Arguments')]['%' . ++$count] = t('@argument title', array(
'@argument' => $handler->ui_name(),
));
$options[t('Arguments')]['!' . $count] = t('@argument input', array(
'@argument' => $handler->ui_name(),
));
}
// Default text. We have some options, so make a list.
$output = '';
if (!empty($options)) {
$output = t('<p>The following tokens are available for this link.</p>');
foreach (array_keys($options) as $type) {
if (!empty($options[$type])) {
$items = array();
foreach ($options[$type] as $key => $value) {
$items[] = $key . ' == ' . $value;
}
$output .= theme('item_list', array(
'items' => $items,
'type' => $type,
));
}
}
}
$form['link_url'] = array(
'#type' => 'textfield',
'#title' => t('Custom URL'),
'#default_value' => $this->get_option('link_url'),
'#description' => t('A Drupal path or external URL the more link will point to. Note that this will override the link display setting above.') . $output,
'#dependency' => array(
'radio:link_display' => array(
'custom_url',
),
),
);
break;
case 'analyze-theme':
$form['#title'] .= t('Theming information');
$form['#help_topic'] = 'analyze-theme';
if (isset($_POST['theme'])) {
$this->theme = $_POST['theme'];
}
elseif (empty($this->theme)) {
$this->theme = variable_get('theme_default', 'bartik');
}
if (isset($GLOBALS['theme']) && $GLOBALS['theme'] == $this->theme) {
$this->theme_registry = theme_get_registry();
$theme_engine = $GLOBALS['theme_engine'];
}
else {
$themes = list_themes();
$theme = $themes[$this->theme];
// Find all our ancestor themes and put them in an array.
$base_theme = array();
$ancestor = $this->theme;
while ($ancestor && isset($themes[$ancestor]->base_theme)) {
$ancestor = $themes[$ancestor]->base_theme;
$base_theme[] = $themes[$ancestor];
}
// The base themes should be initialized in the right order.
$base_theme = array_reverse($base_theme);
// This code is copied directly from _drupal_theme_initialize().
$theme_engine = NULL;
// Initialize the theme.
if (isset($theme->engine)) {
// Include the engine.
include_once DRUPAL_ROOT . '/' . $theme->owner;
$theme_engine = $theme->engine;
if (function_exists($theme_engine . '_init')) {
foreach ($base_theme as $base) {
call_user_func($theme_engine . '_init', $base);
}
call_user_func($theme_engine . '_init', $theme);
}
}
else {
// Include non-engine theme files.
foreach ($base_theme as $base) {
// Include the theme file or the engine.
if (!empty($base->owner)) {
include_once DRUPAL_ROOT . '/' . $base->owner;
}
}
// And our theme gets one too.
if (!empty($theme->owner)) {
include_once DRUPAL_ROOT . '/' . $theme->owner;
}
}
$this->theme_registry = _theme_load_registry($theme, $base_theme, $theme_engine);
}
// If there's a theme engine involved, we also need to know its
// extension so we can give the proper filename.
$this->theme_extension = '.tpl.php';
if (isset($theme_engine)) {
$extension_function = $theme_engine . '_extension';
if (function_exists($extension_function)) {
$this->theme_extension = $extension_function();
}
}
$funcs = array();
// Get theme functions for the display. Note that some displays may not
// have themes. The 'feed' display, for example, completely delegates to
// the style.
if (!empty($this->definition['theme'])) {
$funcs[] = $this->option_link(t('Display output'), 'analyze-theme-display') . ': ' . $this->format_themes($this->theme_functions());
$themes = $this->additional_theme_functions();
if ($themes) {
foreach ($themes as $theme) {
$funcs[] = $this->option_link(t('Alternative display output'), 'analyze-theme-display') . ': ' . $this->format_themes($theme);
}
}
}
$plugin = $this->get_plugin();
if ($plugin) {
$funcs[] = $this->option_link(t('Style output'), 'analyze-theme-style') . ': ' . $this->format_themes($plugin->theme_functions(), $plugin->additional_theme_functions());
$themes = $plugin->additional_theme_functions();
if ($themes) {
foreach ($themes as $theme) {
$funcs[] = $this->option_link(t('Alternative style'), 'analyze-theme-style') . ': ' . $this->format_themes($theme);
}
}
if ($plugin->uses_row_plugin()) {
$row_plugin = $this->get_plugin('row');
if ($row_plugin) {
$funcs[] = $this->option_link(t('Row style output'), 'analyze-theme-row') . ': ' . $this->format_themes($row_plugin->theme_functions());
$themes = $row_plugin->additional_theme_functions();
if ($themes) {
foreach ($themes as $theme) {
$funcs[] = $this->option_link(t('Alternative row style'), 'analyze-theme-row') . ': ' . $this->format_themes($theme);
}
}
}
}
if ($plugin->uses_fields()) {
foreach ($this->get_handlers('field') as $id => $handler) {
$funcs[] = $this->option_link(t('Field @field (ID: @id)', array(
'@field' => $handler->ui_name(),
'@id' => $id,
)), 'analyze-theme-field') . ': ' . $this->format_themes($handler->theme_functions());
}
}
}
$form['important'] = array(
'#markup' => '<div class="form-item description"><p>' . t('This section lists all possible templates for the display plugin and for the style plugins, ordered roughly from the least specific to the most specific. The active template for each plugin -- which is the most specific template found on the system -- is highlighted in bold.') . '</p></div>',
);
if (isset($this->view->display[$this->view->current_display]->new_id)) {
$form['important']['new_id'] = array(
'#prefix' => '<div class="description">',
'#suffix' => '</div>',
'#value' => t("<strong>Important!</strong> You have changed the display's machine name. Anything that attached to this display specifically, such as theming, may stop working until it is updated. To see theme suggestions for it, you need to save the view."),
);
}
foreach (list_themes() as $key => $theme) {
if (!empty($theme->info['hidden'])) {
continue;
}
$options[$key] = $theme->info['name'];
}
$form['box'] = array(
'#prefix' => '<div class="container-inline">',
'#suffix' => '</div>',
);
$form['box']['theme'] = array(
'#type' => 'select',
'#options' => $options,
'#default_value' => $this->theme,
);
$form['box']['change'] = array(
'#type' => 'submit',
'#value' => t('Change theme'),
'#submit' => array(
'views_ui_edit_display_form_change_theme',
),
);
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . theme('item_list', array(
'items' => $funcs,
)) . '</div>',
);
$form['rescan_button'] = array(
'#prefix' => '<div class="form-item">',
'#suffix' => '</div>',
);
$form['rescan_button']['button'] = array(
'#type' => 'submit',
'#value' => t('Rescan template files'),
'#submit' => array(
'views_ui_config_item_form_rescan',
),
);
$form['rescan_button']['markup'] = array(
'#markup' => '<div class="description">' . t("<strong>Important!</strong> When adding, removing, or renaming template files, it is necessary to make Drupal aware of the changes by making it rescan the files on your system. By clicking this button you clear Drupal's theme registry and thereby trigger this rescanning process. The highlighted templates above will then reflect the new state of your system.") . '</div>',
);
$form_state['ok_button'] = TRUE;
break;
case 'analyze-theme-display':
$form['#title'] .= t('Theming information (display)');
$output = '<p>' . t('Back to !info.', array(
'!info' => $this->option_link(t('theming information'), 'analyze-theme'),
)) . '</p>';
if (empty($this->definition['theme'])) {
$output .= t('This display has no theming information');
}
else {
$output .= '<p>' . t('This is the default theme template used for this display.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $this->definition['theme path'] . '/' . strtr($this->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
if (!empty($this->definition['additional themes'])) {
foreach ($this->definition['additional themes'] as $theme => $type) {
$output .= '<p>' . t('This is an alternative template for this display.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $this->definition['theme path'] . '/' . strtr($theme, '_', '-') . '.tpl.php')) . '</pre>';
}
}
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . $output . '</div>',
);
$form_state['ok_button'] = TRUE;
break;
case 'analyze-theme-style':
$form['#title'] .= t('Theming information (style)');
$output = '<p>' . t('Back to !info.', array(
'!info' => $this->option_link(t('theming information'), 'analyze-theme'),
)) . '</p>';
$plugin = $this->get_plugin();
if (empty($plugin->definition['theme'])) {
$output .= t('This display has no style theming information');
}
else {
$output .= '<p>' . t('This is the default theme template used for this style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
if (!empty($plugin->definition['additional themes'])) {
foreach ($plugin->definition['additional themes'] as $theme => $type) {
$output .= '<p>' . t('This is an alternative template for this style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme path'] . '/' . strtr($theme, '_', '-') . '.tpl.php')) . '</pre>';
}
}
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . $output . '</div>',
);
$form_state['ok_button'] = TRUE;
break;
case 'analyze-theme-row':
$form['#title'] .= t('Theming information (row style)');
$output = '<p>' . t('Back to !info.', array(
'!info' => $this->option_link(t('theming information'), 'analyze-theme'),
)) . '</p>';
$plugin = $this->get_plugin('row');
if (empty($plugin->definition['theme'])) {
$output .= t('This display has no row style theming information');
}
else {
$output .= '<p>' . t('This is the default theme template used for this row style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme path'] . '/' . strtr($plugin->definition['theme'], '_', '-') . '.tpl.php')) . '</pre>';
}
if (!empty($plugin->definition['additional themes'])) {
foreach ($plugin->definition['additional themes'] as $theme => $type) {
$output .= '<p>' . t('This is an alternative template for this row style.') . '</p>';
$output .= '<pre>' . check_plain(file_get_contents('./' . $plugin->definition['theme path'] . '/' . strtr($theme, '_', '-') . '.tpl.php')) . '</pre>';
}
}
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . $output . '</div>',
);
$form_state['ok_button'] = TRUE;
break;
case 'analyze-theme-field':
$form['#title'] .= t('Theming information (row style)');
$output = '<p>' . t('Back to !info.', array(
'!info' => $this->option_link(t('theming information'), 'analyze-theme'),
)) . '</p>';
$output .= '<p>' . t('This is the default theme template used for this row style.') . '</p>';
// Field templates aren't registered the normal way... and they're
// always this one, anyhow.
$output .= '<pre>' . check_plain(file_get_contents(drupal_get_path('module', 'views') . '/theme/views-view-field.tpl.php')) . '</pre>';
$form['analysis'] = array(
'#markup' => '<div class="form-item">' . $output . '</div>',
);
$form_state['ok_button'] = TRUE;
break;
case 'exposed_block':
$form['#title'] .= t('Put the exposed form in a block');
$form['description'] = array(
'#markup' => '<div class="description form-item">' . t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '</div>',
);
$form['exposed_block'] = array(
'#type' => 'radios',
'#options' => array(
1 => t('Yes'),
0 => t('No'),
),
'#default_value' => $this->get_option('exposed_block') ? 1 : 0,
);
break;
case 'exposed_form':
$form['#title'] .= t('Exposed Form');
$form['exposed_form'] = array(
'#prefix' => '<div class="clearfix">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$exposed_form = $this->get_option('exposed_form');
$form['exposed_form']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('exposed_form', NULL, array(
$this->view->base_table,
)),
'#default_value' => $exposed_form['type'],
);
$exposed_form_plugin = views_fetch_plugin_data('exposed_form', $exposed_form['type']);
if (!empty($exposed_form_plugin['uses options'])) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',
'#suffix' => '</div>',
'#markup' => t('You may also adjust the !settings for the currently selected style.', array(
'!settings' => $this->option_link(t('settings'), 'exposed_form_options'),
)),
);
}
break;
case 'exposed_form_options':
$plugin = $this->get_plugin('exposed_form');
$form['#title'] .= t('Exposed form options');
if ($plugin) {
if (!empty($plugin->definition['help topic'])) {
$form['#help_topic'] = $plugin->definition['help topic'];
}
if (!empty($plugin->definition['module'])) {
$form['#help_module'] = $plugin->definition['module'];
}
$form['exposed_form_options'] = array(
'#tree' => TRUE,
);
$plugin->options_form($form['exposed_form_options'], $form_state);
}
break;
case 'pager':
$form['#title'] .= t('Select which pager, if any, to use for this view');
$form['pager'] = array(
'#prefix' => '<div class="clearfix">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$pager = $this->get_option('pager');
$form['pager']['type'] = array(
'#type' => 'radios',
'#options' => views_fetch_plugin_names('pager', empty($this->definition['use pager']) ? 'basic' : NULL, array(
$this->view->base_table,
)),
'#default_value' => $pager['type'],
);
$pager_plugin = views_fetch_plugin_data('pager', $pager['type']);
if (!empty($pager_plugin['uses options'])) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',
'#suffix' => '</div>',
'#markup' => t('You may also adjust the !settings for the currently selected pager.', array(
'!settings' => $this->option_link(t('settings'), 'pager_options'),
)),
);
}
break;
case 'pager_options':
$plugin = $this->get_plugin('pager');
$form['#title'] .= t('Pager options');
if ($plugin) {
if (!empty($plugin->definition['help topic'])) {
$form['#help_topic'] = $plugin->definition['help topic'];
}
if (!empty($plugin->definition['module'])) {
$form['#help_module'] = $plugin->definition['module'];
}
$form['pager_options'] = array(
'#tree' => TRUE,
);
$plugin->options_form($form['pager_options'], $form_state);
}
break;
}
foreach ($this->extender as $extender) {
$extender->options_form($form, $form_state);
}
}