views_feed.inc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * @file
  4. * Allow a view context to display its attachment(s).
  5. */
  6. $plugin = array(
  7. 'title' => t('View feed icon'),
  8. 'category' => t('View context'),
  9. 'icon' => 'icon_views_page.png',
  10. 'description' => t('Display the view feed icon if there are no results.'),
  11. 'required context' => new ctools_context_required(t('View'), 'view'),
  12. );
  13. /**
  14. * Render the views feed content type.
  15. */
  16. function views_content_views_feed_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_feed';
  23. $block->delta = $context->argument;
  24. $block->title = '';
  25. $block->content = '';
  26. $output = views_content_context_get_output($context);
  27. $block->content = $output['feed_icon'];
  28. return $block;
  29. }
  30. function views_content_views_feed_content_type_edit_form($form, &$form_state) {
  31. // This form does nothing; it exists to let the main form select the view context.
  32. return $form;
  33. }
  34. function views_content_views_feed_content_type_edit_form_submit(&$form, &$form_state) {
  35. // Kept so we guarantee we have a submit handler.
  36. }
  37. /**
  38. * Returns the administrative title for a type.
  39. */
  40. function views_content_views_feed_content_type_admin_title($subtype, $conf, $context) {
  41. return t('"@context" feed icon', array('@context' => $context->identifier));
  42. }