plugin main php file

This commit is contained in:
2026-07-01 09:50:40 -03:00
parent 2f739c8b75
commit 29ed19b4cb

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace Kanboard\Plugin\Skeleton; namespace Kanboard\Plugin\TweakDrag;
use Kanboard\Core\Plugin\Base; use Kanboard\Core\Plugin\Base;
@@ -8,28 +8,33 @@ class Plugin extends Base
{ {
public function initialize() public function initialize()
{ {
// 1. Render a visible word at the top of every page (the demo output). // Load the plugin stylesheet (drag cursor styling; inert until enabled).
$this->template->hook->attach('template:layout:top', 'skeleton:layout/header');
// 2. Load the plugin stylesheet (currently empty -- proves the CSS hook fires).
$this->hook->on('template:layout:css', array( $this->hook->on('template:layout:css', array(
'template' => 'plugins/Skeleton/Asset/css/skeleton.css', 'template' => 'plugins/TweakDrag/Asset/css/tweak-drag.css',
)); ));
// 3. Load the plugin script (currently empty -- proves the JS hook fires). // Inject the column-gap CSS variable and, when enabled, the gap rule.
$this->hook->on('template:layout:js', array( $this->template->hook->attach('template:layout:head', 'tweakDrag:layout/variable');
'template' => 'plugins/Skeleton/Asset/js/skeleton.js',
)); // Add a "Tweak Drag" entry to the Settings sidebar.
$this->template->hook->attach('template:config:sidebar', 'tweakDrag:config/sidebar');
// Optional: click-and-drag the board background to scroll horizontally.
if ((int) $this->configModel->get('tweakdrag_drag_scroll', 1) === 1) {
$this->hook->on('template:layout:js', array(
'template' => 'plugins/TweakDrag/Asset/js/drag-scroll.js',
));
}
} }
public function getPluginName() public function getPluginName()
{ {
return 'Skeleton'; return 'TweakDrag';
} }
public function getPluginDescription() public function getPluginDescription()
{ {
return t('Reusable skeleton/template for building Kanboard plugins.'); return t('Board drag, touch and column-gap tweaks (drag-to-scroll, wider column gap).');
} }
public function getPluginAuthor() public function getPluginAuthor()
@@ -44,7 +49,7 @@ class Plugin extends Base
public function getPluginHomepage() public function getPluginHomepage()
{ {
return 'https://code.beco.cc/beco/kanboard-plugin-skeleton'; return 'https://code.beco.cc/beco/TweakDrag';
} }
public function getCompatibleVersion() public function getCompatibleVersion()