page_logo.inc 980 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Plugin to handle the 'page_logo' content type which allows the
  5. * logo of the site to be embedded into a panel.
  6. */
  7. /**
  8. * Plugins are described by creating a $plugin array which will be used
  9. * by the system that includes this file.
  10. */
  11. $plugin = array(
  12. 'title' => t('Site logo'),
  13. 'single' => TRUE,
  14. 'icon' => 'icon_page.png',
  15. 'description' => t('Add the logo trail as content.'),
  16. 'category' => t('Page elements'),
  17. 'render last' => TRUE,
  18. );
  19. /**
  20. * Output function for the 'page_logo' content type.
  21. *
  22. * Outputs the logo for the current page.
  23. */
  24. function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) {
  25. $logo = theme_get_setting('logo');
  26. $block = new stdClass();
  27. if (!empty($logo)) {
  28. $image = '<img src="' . $logo . '" alt="' . t('Home') . '" />';
  29. $block->content = l($image, '', array('html' => TRUE, 'attributes' => array('rel' => 'home', 'id' => 'logo', 'title' => t('Home'))));
  30. }
  31. return $block;
  32. }