views_view.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * @file
  4. * Allow a view context to be displayed as whole.
  5. */
  6. $plugin = array(
  7. 'title' => t('Entire view'),
  8. 'category' => t('View context'),
  9. 'icon' => 'icon_views_page.png',
  10. 'description' => t('Display the entire view.'),
  11. 'required context' => new ctools_context_required(t('View'), 'view'),
  12. );
  13. /**
  14. * Render the views view content type.
  15. */
  16. function views_content_views_view_content_type_render($subtype, $conf, $panel_args, $context) {
  17. if (empty($context) || empty($context->data)) {
  18. return;
  19. }
  20. // Build the content type block.
  21. $block = new stdClass();
  22. $block->module = 'views_view';
  23. $block->delta = $context->argument;
  24. $block->title = '';
  25. $block->content = '';
  26. $output = views_content_context_get_output($context);
  27. $output = $output['view']->preview();
  28. $block->content = $output;
  29. return $block;
  30. }
  31. function views_content_views_view_content_type_edit_form($form, &$form_state) {
  32. // This form does nothing; it exists to let the main form select the view context.
  33. return $form;
  34. }
  35. function views_content_views_view_content_type_edit_form_submit(&$form, &$form_state) {
  36. // Kept so we guarantee we have a submit handler.
  37. }
  38. /**
  39. * Returns the administrative title for a type.
  40. */
  41. function views_content_views_view_content_type_admin_title($subtype, $conf, $context) {
  42. return t('"@context" entire view', array('@context' => $context->identifier));
  43. }