123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php namespace Kanboard\Plugin\OMIProjectBranding;
- use Kanboard\Core\Plugin\Base;
- use Kanboard\Core\Translator;
- use Kanboard\Plugin\OMIProjectBranding\Listener\ColorListExtender;
- /**
- * Plugin Initialisation
- *
- * @package Kanboard\Plugin\OMIProjectBranding
- * @author Dwayne @ OMI NZ
- */
- class Plugin extends Base {
- public function initialize() {
- $this->container["helper"]->register("projectBrandingHelper", "\Kanboard\Plugin\OMIProjectBranding\Helper\ProjectBrandingHelper");
- $this->hook->on("template:project:sidebar", ["template" => "OMIProjectBranding:project/sidebar"]);
- $this->route->addRoute("project/:project_id/branding", "ProjectBrandingController", "show", "OMIProjectBranding");
- $this->template->setTemplateOverride("header", "OMIProjectBranding:header");
-
- $this->container['colorModel'] = $this->container->factory(function ($c) {
- return new \Kanboard\Plugin\OMIProjectBranding\Model\CustomColorModel($c);
- });
- }
-
- public function onColorList(Event $event)
- {
- $colors = $event->get('colors');
-
- $colors['brand_color_1'] = [
- 'name' => 'Client Primary',
- 'background' => '#1A2B3C',
- 'border' => '#0F1A2B',
- ];
-
- $colors['brand_color_2'] = [
- 'name' => 'Client Secondary',
- 'background' => '#D9E3F1',
- 'border' => '#C4D1E5',
- ];
-
- $event->set('colors', $colors);
- }
- public function getClasses()
- {
- return [
-
- 'Plugin\OMIProjectBranding\Controller' => [
- 'ProjectBrandingController',
- ],
- 'Plugin\OMIProjectBranding\Model' => [
- 'ProjectBrandingModel',
- 'CustomColorModel',
- ],
- 'Plugin\OMIProjectBranding\Helper' => [
- 'ProjectBrandingHelper',
- ],
- ];
- }
-
- public function getPluginName() {
- return "OMI Project Branding";
- }
-
- public function getPluginDescription() {
- return t("Project Branding plugin for Kanboard, to allow a custom logo and some brand colours per project.");
- }
-
- public function getPluginAuthor() {
- return "OMI NZ";
- }
-
- public function getPluginVersion() {
- return "1.0.3";
- }
-
- public function getPluginHomepage() {
- return "https://vcs.nz/ominz/OMIProjectBranding";
- }
- }
- #-
- #plugins/OMIProjectBranding/Plugin.php
|