Plugin.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php namespace Kanboard\Plugin\OMIProjectBranding;
  2. use Kanboard\Core\Plugin\Base;
  3. use Kanboard\Core\Translator;
  4. use Kanboard\Plugin\OMIProjectBranding\Listener\ColorListExtender;
  5. /**
  6. * Plugin Initialisation
  7. *
  8. * @package Kanboard\Plugin\OMIProjectBranding
  9. * @author Dwayne @ OMI NZ
  10. */
  11. class Plugin extends Base {
  12. public function initialize() {
  13. $this->container["helper"]->register("projectBrandingHelper", "\Kanboard\Plugin\OMIProjectBranding\Helper\ProjectBrandingHelper");
  14. $this->hook->on("template:project:sidebar", ["template" => "OMIProjectBranding:project/sidebar"]);
  15. $this->route->addRoute("project/:project_id/branding", "ProjectBrandingController", "show", "OMIProjectBranding");
  16. $this->template->setTemplateOverride("header", "OMIProjectBranding:header");
  17. $this->container["colorModel"] = $this->container->factory(function ($c) {
  18. return new \Kanboard\Plugin\OMIProjectBranding\Model\CustomColorModel($c);
  19. });
  20. }
  21. public function getClasses() {
  22. return [
  23. "Plugin\OMIProjectBranding\Controller" => [
  24. "ProjectBrandingController",
  25. ],
  26. "Plugin\OMIProjectBranding\Model" => [
  27. "ProjectBrandingModel",
  28. "CustomColorModel",
  29. ],
  30. "Plugin\OMIProjectBranding\Helper" => [
  31. "ProjectBrandingHelper",
  32. ],
  33. ];
  34. }
  35. public function getPluginName() {
  36. return "OMI Project Branding";
  37. }
  38. public function getPluginDescription() {
  39. return t("Project Branding plugin for Kanboard, to allow a custom logo and some brand colours per project.");
  40. }
  41. public function getPluginAuthor() {
  42. return "OMI NZ";
  43. }
  44. public function getPluginVersion() {
  45. return "1.0.4";
  46. }
  47. public function getPluginHomepage() {
  48. return "https://vcs.nz/ominz/OMIProjectBranding";
  49. }
  50. }
  51. #-
  52. #plugins/OMIProjectBranding/Plugin.php