Projet

Général

Profil

Paste
Télécharger (985 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / plugins / content_types / page / page_logo.inc @ 7e72b748

1
<?php
2

    
3
/**
4
 * @file
5
 * Plugin to handle the 'page_logo' content type which allows the
6
 * logo of the site to be embedded into a panel.
7
 */
8

    
9
/**
10
 * Plugins are described by creating a $plugin array which will be used
11
 * by the system that includes this file.
12
 */
13
$plugin = array(
14
  'title' => t('Site logo'),
15
  'single' => TRUE,
16
  'icon' => 'icon_page.png',
17
  'description' => t('Add the logo trail as content.'),
18
  'category' => t('Page elements'),
19
  'render last' => TRUE,
20
);
21

    
22
/**
23
 * Output function for the 'page_logo' content type.
24
 *
25
 * Outputs the logo for the current page.
26
 */
27
function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) {
28
  $logo = theme_get_setting('logo');
29
  $block = new stdClass();
30

    
31
  if (!empty($logo)) {
32
    $image = theme('image', array('path' => $logo, 'alt' => t('Home')));
33
    $block->content = l($image, '', array('html' => TRUE, 'attributes' => array('rel' => 'home', 'id' => 'logo', 'title' => t('Home'))));
34
  }
35

    
36
  return $block;
37
}