+

:4736 Function create_function() is deprecated [8192]

Last commit for projectinfos/main.php: e538d65f710c830cb12383fb162775f5229232eb

Put CSS in separated file

Benjamin Renard [2013-08-21 17:39:18]
Put CSS in separated file
  1. <?php
  2. /**
  3.  * Project infos plugin for ViewGit.
  4.  *
  5.  * This add project infos on summary page.
  6.  *
  7.  * @author Benjamin Renard <brenard@easter-eggs.com>
  8.  */
  9. class ProjectInfosPlugin extends VGPlugin
  10. {
  11. function __construct() {
  12. $this->register_hook('header');
  13. $this->register_hook('summary');
  14. }
  15.  
  16. function hook_summary() {
  17. global $page;
  18. $page['project_infos']=get_project_info($page['project']);
  19. if (isset($page['project_infos']['url']) && !is_array($page['project_infos']['url'])) {
  20. $page['project_infos']['url']=array($page['project_infos']['url']);
  21. }
  22. $this->display_plugin_template('summary', FALSE);
  23. }
  24.  
  25. function hook($type) {
  26. global $conf;
  27. if ($type == 'header') {
  28. echo "\t<link rel='stylesheet' href='plugins/projectinfos/style.css' type='text/css' />\n";
  29. }
  30. elseif ($type == 'summary') {
  31. $this -> hook_summary();
  32. }
  33. }
  34. }