Plugin.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace Kanboard\Plugin\Nebula;
  3. use Kanboard\Core\Plugin\Base;
  4. class Plugin extends Base
  5. {
  6. public function initialize()
  7. {
  8. global $themeNebulaConfig;
  9. if (file_exists(DATA_DIR . '/files/Nebula/config.php'))
  10. {
  11. require_once(DATA_DIR . '/files/Nebula/config.php');
  12. } else {
  13. mkdir(DATA_DIR . '/files/Nebula/Assets/images', 0755, true);
  14. copy('plugins/Nebula/config.php', DATA_DIR . '/files/Nebula/config.php');
  15. copy('plugins/Nebula/Assets/images/brand-logo.png', DATA_DIR . '/files/Nebula/Assets/images/brand-logo.png');
  16. }
  17. if (file_exists('plugins/Customizer'))
  18. {
  19. $this->template->setTemplateOverride('header/title', 'Nebula:layout/header/customizerTitle');
  20. $this->template->setTemplateOverride('layout', 'Nebula:layout');
  21. $this->template->setTemplateOverride('header/creation_dropdown', 'Nebula:layout/header/creation_dropdown');
  22. }
  23. elseif (isset($themeNebulaConfig['logo']))
  24. {
  25. $this->template->setTemplateOverride('header/title', 'Nebula:layout/header/title');
  26. $this->template->setTemplateOverride('layout', 'Nebula:layout');
  27. $this->template->setTemplateOverride('header/creation_dropdown', 'Nebula:layout/header/creation_dropdown');
  28. }
  29. $this->hook->on("template:layout:css", array("template" => "plugins/Nebula/Assets/css/nebula.css"));
  30. $this->hook->on("template:layout:css", array("template" => "plugins/Nebula/Assets/css/prism.css"));
  31. $this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/clipboard.min.js'));
  32. $this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/prism.js'));
  33. $this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/nebula.js'));
  34. }
  35. public function getPluginName()
  36. {
  37. return 'Nebula';
  38. }
  39. public function getPluginDescription()
  40. {
  41. return t('This theme allows you to add special features like replacing the logo and adds syntax highlighting for Markdown code.');
  42. }
  43. public function getPluginAuthor()
  44. {
  45. return 'Valentino Pesce';
  46. }
  47. public function getPluginVersion()
  48. {
  49. return '1.3.6';
  50. }
  51. public function getCompatibleVersion()
  52. {
  53. return '>=1.0.48';
  54. }
  55. public function getPluginHomepage()
  56. {
  57. return 'https://github.com/kenlog/nebula';
  58. }
  59. }