Projet

Général

Profil

Paste
Télécharger (1,39 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / views_content / plugins / content_types / views_header.inc @ c304a780

1
<?php
2

    
3
/**
4
 * @file
5
 * Allow a view context to display its attachment(s).
6
 */
7

    
8
$plugin = array(
9
  'title' => t('View header'),
10
  'category' => t('View context'),
11
  'icon' => 'icon_views_page.png',
12
  'description' => t('Display the view header if there are no results.'),
13
  'required context' => new ctools_context_required(t('View'), 'view'),
14
);
15

    
16
/**
17
 * Render the node_terms content type.
18
 */
19
function views_content_views_header_content_type_render($subtype, $conf, $panel_args, $context) {
20
  if (empty($context) || empty($context->data)) {
21
    return;
22
  }
23

    
24
  // Build the content type block.
25
  $block          = new stdClass();
26
  $block->module  = 'views_header';
27
  $block->delta   = $context->argument;
28
  $block->title   = '';
29
  $block->content = '';
30

    
31
  $output = views_content_context_get_output($context);
32
  $block->content = $output['header'];
33

    
34
  return $block;
35
}
36

    
37
function views_content_views_header_content_type_edit_form($form, &$form_state) {
38
  // This form does nothing; it exists to let the main form select the view context.
39
  return $form;
40
}
41

    
42
function views_content_views_header_content_type_edit_form_submit(&$form, &$form_state) {
43
  // Kept so we guarantee we have a submit handler.
44
}
45

    
46
/**
47
 * Returns the administrative title for a type.
48
 */
49
function views_content_views_header_content_type_admin_title($subtype, $conf, $context) {
50
  return t('"@context" header', array('@context' => $context->identifier));
51
}