Commit 09ce9d77 authored by tim.plunkett's avatar tim.plunkett

Issue #1796182 by tim.plunkett: Remove the remaining 'template' code.

parent b4072e39
......@@ -3110,32 +3110,6 @@ function theme_views_ui_style_plugin_table($variables) {
return $output;
}
function views_ui_add_template_page() {
$templates = views_get_all_templates();
if (empty($templates)) {
return t('There are no templates available.');
}
$header = array(
t('Name'),
t('Description'),
t('Operation'),
);
$rows = array();
foreach ($templates as $name => $template) {
$rows[] = array(
array('data' => check_plain($template->getHumanName())),
array('data' => check_plain($template->description)),
array('data' => l('add', 'admin/structure/views/template/' . $template->name . '/add')),
);
}
$output = theme('table', array('header' => $header, 'rows' => $rows));
return $output;
}
/**
* #process callback for a button; determines if a button is the form's triggering element.
*
......
<?php
/**
* @file
* Contains views templates on behalf of the node module.
*/
function node_views_templates() {
// Only the standard install profile has the image field provided so only show it for it.
if (variable_get('install_profile', 'standard') != 'standard') {
return array();
}
$view = new Drupal\views\ViewExecutable(array(), 'view');
$view->name = 'image_gallery';
$view->description = 'Shows all images which was uploaded on the "field_image" field';
$view->tag = '';
$view->base_table = 'node';
$view->human_name = 'Image Gallery';
$view->core = 8;
$view->api_version = '3.0';
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
/* Display: Defaults */
$handler = $view->newDisplay('default', 'Defaults', 'default');
$handler->display['display_options']['title'] = 'Image gallery';
$handler->display['display_options']['access']['type'] = 'perm';
$handler->display['display_options']['cache']['type'] = 'none';
$handler->display['display_options']['query']['type'] = 'views_query';
$handler->display['display_options']['exposed_form']['type'] = 'basic';
$handler->display['display_options']['pager']['type'] = 'full';
$handler->display['display_options']['pager']['options']['items_per_page'] = '24';
$handler->display['display_options']['pager']['options']['offset'] = '0';
$handler->display['display_options']['pager']['options']['id'] = '0';
$handler->display['display_options']['pager']['options']['expose']['items_per_page_options_all'] = 0;
$handler->display['display_options']['style_plugin'] = 'grid';
$handler->display['display_options']['style_options']['fill_single_line'] = 1;
$handler->display['display_options']['row_plugin'] = 'fields';
/* Field: Content: Image */
$handler->display['display_options']['fields']['field_image']['id'] = 'field_image';
$handler->display['display_options']['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display['display_options']['fields']['field_image']['field'] = 'field_image';
$handler->display['display_options']['fields']['field_image']['label'] = '';
$handler->display['display_options']['fields']['field_image']['alter']['alter_text'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['make_link'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['absolute'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['external'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['trim'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['nl2br'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['word_boundary'] = 1;
$handler->display['display_options']['fields']['field_image']['alter']['ellipsis'] = 1;
$handler->display['display_options']['fields']['field_image']['alter']['strip_tags'] = 0;
$handler->display['display_options']['fields']['field_image']['alter']['html'] = 0;
$handler->display['display_options']['fields']['field_image']['element_label_colon'] = 1;
$handler->display['display_options']['fields']['field_image']['element_default_classes'] = 1;
$handler->display['display_options']['fields']['field_image']['hide_empty'] = 0;
$handler->display['display_options']['fields']['field_image']['empty_zero'] = 0;
$handler->display['display_options']['fields']['field_image']['click_sort_column'] = 'fid';
$handler->display['display_options']['fields']['field_image']['settings'] = array(
'image_style' => 'thumbnail',
'image_link' => 'content',
);
$handler->display['display_options']['fields']['field_image']['field_api_classes'] = 0;
/* Field: User: Name */
$handler->display['display_options']['fields']['name']['id'] = 'name';
$handler->display['display_options']['fields']['name']['table'] = 'users';
$handler->display['display_options']['fields']['name']['field'] = 'name';
$handler->display['display_options']['fields']['name']['label'] = 'Author';
$handler->display['display_options']['fields']['name']['alter']['alter_text'] = 0;
$handler->display['display_options']['fields']['name']['alter']['make_link'] = 0;
$handler->display['display_options']['fields']['name']['alter']['absolute'] = 0;
$handler->display['display_options']['fields']['name']['alter']['external'] = 0;
$handler->display['display_options']['fields']['name']['alter']['trim'] = 0;
$handler->display['display_options']['fields']['name']['alter']['nl2br'] = 0;
$handler->display['display_options']['fields']['name']['alter']['word_boundary'] = 1;
$handler->display['display_options']['fields']['name']['alter']['ellipsis'] = 1;
$handler->display['display_options']['fields']['name']['alter']['strip_tags'] = 0;
$handler->display['display_options']['fields']['name']['alter']['html'] = 0;
$handler->display['display_options']['fields']['name']['element_label_colon'] = 1;
$handler->display['display_options']['fields']['name']['element_default_classes'] = 1;
$handler->display['display_options']['fields']['name']['hide_empty'] = 0;
$handler->display['display_options']['fields']['name']['empty_zero'] = 0;
$handler->display['display_options']['fields']['name']['link_to_user'] = 1;
$handler->display['display_options']['fields']['name']['overwrite_anonymous'] = 0;
/* Contextual filter: Content: Has taxonomy term ID */
$handler->display['display_options']['arguments']['tid']['id'] = 'tid';
$handler->display['display_options']['arguments']['tid']['table'] = 'taxonomy_index';
$handler->display['display_options']['arguments']['tid']['field'] = 'tid';
$handler->display['display_options']['arguments']['tid']['default_action'] = 'summary';
$handler->display['display_options']['arguments']['tid']['default_argument_type'] = 'fixed';
$handler->display['display_options']['arguments']['tid']['default_argument_skip_url'] = 0;
$handler->display['display_options']['arguments']['tid']['summary']['number_of_records'] = '1';
$handler->display['display_options']['arguments']['tid']['summary']['format'] = 'unformatted_summary';
$handler->display['display_options']['arguments']['tid']['summary_options']['items_per_page'] = '25';
$handler->display['display_options']['arguments']['tid']['summary_options']['inline'] = 0;
$handler->display['display_options']['arguments']['tid']['break_phrase'] = 0;
$handler->display['display_options']['arguments']['tid']['add_table'] = 0;
$handler->display['display_options']['arguments']['tid']['require_value'] = 0;
$handler->display['display_options']['arguments']['tid']['reduce_duplicates'] = 0;
$handler->display['display_options']['arguments']['tid']['set_breadcrumb'] = 0;
/* Filter criterion: Content: Image (field_image) - fid */
$handler->display['display_options']['filters']['field_image_fid']['id'] = 'field_image_fid';
$handler->display['display_options']['filters']['field_image_fid']['table'] = 'field_data_field_image';
$handler->display['display_options']['filters']['field_image_fid']['field'] = 'field_image_fid';
$handler->display['display_options']['filters']['field_image_fid']['operator'] = 'not empty';
/* Filter criterion: Content: Published */
$handler->display['display_options']['filters']['status']['id'] = 'status';
$handler->display['display_options']['filters']['status']['table'] = 'node';
$handler->display['display_options']['filters']['status']['field'] = 'status';
$handler->display['display_options']['filters']['status']['value'] = '1';
/* Display: Gallery page */
$handler = $view->newDisplay('page', 'Gallery page', 'page_1');
$handler->display['display_options']['path'] = 'gallery';
$translatables['image_gallery'] = array(
t('Defaults'),
t('Image gallery'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('Author'),
t('All'),
t('Gallery page'),
);
$views[$view->name] = $view;
return $views;
}
......@@ -1484,29 +1484,6 @@ function views_get_enabled_display_extenders() {
// -----------------------------------------------------------------------
// Views database functions
/**
* Get all view templates.
*
* Templates are special in-code views that are never active, but exist only
* to be cloned into real views as though they were templates.
*/
function views_get_all_templates() {
$templates = array();
$modules = views_module_include('views_template');
foreach ($modules as $module => $info) {
$function = $module . '_views_templates';
if (function_exists($function)) {
$new = $function();
if ($new && is_array($new)) {
$templates = array_merge($new, $templates);
}
}
}
return $templates;
}
/**
* Create an empty view to work with.
*
......
......@@ -56,16 +56,6 @@ function views_ui_menu() {
'title' => 'Disable a view',
) + $ajax_base;
/*
// Top-level Views module pages (not tied to a particular View).
$items['admin/structure/views/add-template'] = array(
'title' => 'Add view from template',
'page callback' => 'views_ui_add_template_page',
// Don't show a local action link if there aren't any templates.
'type' => views_get_all_templates() ? MENU_LOCAL_ACTION : MENU_VISIBLE_IN_BREADCRUMB,
) + $base;
*/
$items['admin/structure/views/settings'] = array(
'title' => 'Settings',
'page callback' => 'drupal_get_form',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment