12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php namespace Kanboard\Plugin\OMITemplateModder;
- use Kanboard\Core\Plugin\Base;
- use Kanboard\Core\Security\Role;
- use Kanboard\Core\Translator;
- // Define a local constant for the plugin root directory.
- define("ETM_PLUGIN_ROOT_DIR", __DIR__);
- // Define a constant for the core Kanboard application directory.
- // This is a robust alternative to KANBOARD_APP_DIR if it's not available.
- define("KB_APP_DIR", dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . "app");
- /**
- * Plugin Initialisation
- *
- * @package Kanboard\Plugin\OMITemplateModder
- * @author Dwayne @ OMI NZ
- */
- class Plugin extends Base {
-
- /**
- * Initialise the plugin
- */
- public function initialize() {
- // Add a new sub-menu item under Application settings
- $this->hook->on('template:config:sidebar', ['template' => 'OMITemplateModder:config/sidebar']);
-
- // Register the new route for the plugin configuration page
- $this->route->addRoute("/settings/template_modder", "TemplateController", "show", "OMITemplateModder");
- $this->route->addRoute("/settings/template_modder/edit/:template_index", "TemplateController", "edit", "OMITemplateModder");
- $this->route->addRoute("/settings/template_modder/save/:template_index", "TemplateController", "save", "OMITemplateModder");
-
- // loop through all notification templates and registers them (that exist in this plugin dir!)
- $templateDir = ETM_PLUGIN_ROOT_DIR . "/Template/notification";
- foreach (glob($templateDir . "/*.php") as $filename) {
- $templateName = basename($filename, ".php");
- $this->template->setTemplateOverride("notification/" . $templateName, "EmailTemplateModder:notification/" . $templateName);
- }
- }
-
- public function getPluginName() {
- return "OMI Notification Template Modder";
- }
-
- public function getPluginDescription() {
- return t("View and modify Kanboard notification templates which include email templates. Built by dwayne Pivac @ OMI Ltd.");
- }
-
- public function getPluginAuthor() {
- return "OMI NZ";
- }
-
- public function getPluginVersion() {
- return "1.0.3";
- }
-
- public function getPluginHomepage() {
- return "https://vcs.nz/ominz/OMITemplateModder";
- }
-
- public function getCompatibleVersion() {
- return ">=1.2";
- }
- }
- #-
- #plugins/OMITemplateModder/Plugin.php
|