Plugin.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace Kanboard\Plugin\UpdateNotifier;
  3. use Kanboard\Plugin\UpdateNotifier\Model\PluginTimestampedModel;
  4. use Kanboard\Core\Plugin\Base;
  5. use Kanboard\Core\Translator;
  6. class Plugin extends Base
  7. {
  8. public function initialize()
  9. {
  10. $this->helper->register('Notifier', 'Kanboard\Plugin\UpdateNotifier\Helper\Notifier');
  11. $this->template->hook->attach('template:layout:top', 'UpdateNotifier:layout/top');
  12. $this->template->setTemplateOverride('plugin/directory', 'UpdateNotifier:plugin/directory');
  13. $this->template->setTemplateOverride('plugin/sidebar', 'UpdateNotifier:plugin/sidebar');
  14. $this->hook->on("template:layout:css", array("template" => "plugins/UpdateNotifier/Assets/css/notifier.css"));
  15. $this->hook->on('template:layout:js', array('template' => 'plugins/UpdateNotifier/Assets/js/notifier.js'));
  16. }
  17. public function onStartup()
  18. {
  19. Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
  20. }
  21. public function getClasses()
  22. {
  23. return [
  24. 'Plugin\UpdateNotifier\Model' => [
  25. 'PluginTimestampedModel',
  26. ],
  27. ];
  28. }
  29. public function getPluginName()
  30. {
  31. return 'UpdateNotifier';
  32. }
  33. public function getPluginDescription()
  34. {
  35. return t('What is Update Notifier? The Update Notifier is a utility that scans installed plugin and displays a list of updates.');
  36. }
  37. public function getPluginAuthor()
  38. {
  39. return 'Valentino Pesce';
  40. }
  41. public function getPluginVersion()
  42. {
  43. return '1.7.0';
  44. }
  45. public function getCompatibleVersion()
  46. {
  47. return '>=1.0.42';
  48. }
  49. public function getPluginHomepage()
  50. {
  51. return 'https://github.com/kenlog/UpdateNotifier';
  52. }
  53. }