Files
ShrinkVertically/Plugin.php

67 lines
2.0 KiB
PHP
Raw Permalink Normal View History

2026-06-28 16:24:11 -03:00
<?php
2026-06-28 16:36:58 -03:00
namespace Kanboard\Plugin\ShrinkVertically;
2026-06-28 16:24:11 -03:00
use Kanboard\Core\Plugin\Base;
class Plugin extends Base
{
public function initialize()
{
2026-06-28 16:36:58 -03:00
// Inject a small CSS override that reduces the height of vertically
// collapsed board columns so the horizontal scrollbar stays visible.
2026-06-28 16:24:11 -03:00
$this->hook->on('template:layout:css', array(
2026-06-28 16:36:58 -03:00
'template' => 'plugins/ShrinkVertically/Asset/css/shrink-vertically.css',
2026-06-28 16:24:11 -03:00
));
2026-06-28 16:45:55 -03:00
2026-06-28 17:03:17 -03:00
// Inject the configured pixel offset as a CSS variable in the page head.
$this->template->hook->attach('template:layout:head', 'shrinkVertically:layout/variable');
2026-06-28 16:45:55 -03:00
// Append a "+" to the two vertical-collapse menu labels so it is visible
// that the behaviour is modified by this plugin.
$this->hook->on('template:layout:js', array(
'template' => 'plugins/ShrinkVertically/Asset/js/shrink-vertically.js',
));
2026-06-28 17:03:17 -03:00
// Add a "Shrink Vertically" entry to the Settings sidebar.
$this->template->hook->attach('template:config:sidebar', 'shrinkVertically:config/sidebar');
// Optional: a second, mirrored horizontal scrollbar above the board columns.
if ((int) $this->configModel->get('shrink_vertically_top_scrollbar', 1) === 1) {
$this->hook->on('template:layout:js', array(
'template' => 'plugins/ShrinkVertically/Asset/js/top-scrollbar.js',
));
}
2026-06-28 16:24:11 -03:00
}
public function getPluginName()
{
2026-06-28 16:36:58 -03:00
return 'ShrinkVertically';
2026-06-28 16:24:11 -03:00
}
public function getPluginDescription()
{
2026-06-28 16:36:58 -03:00
return t('Shrink vertically-collapsed board columns so the horizontal scrollbar stays visible.');
2026-06-28 16:24:11 -03:00
}
public function getPluginAuthor()
{
return 'Ruben (drbeco)';
}
public function getPluginVersion()
{
2026-07-04 09:50:45 -03:00
return '1.4.1';
2026-06-28 16:24:11 -03:00
}
public function getPluginHomepage()
{
2026-06-28 16:36:58 -03:00
return 'https://code.beco.cc/beco/shrink-vertically';
2026-06-28 16:24:11 -03:00
}
public function getCompatibleVersion()
{
return '>=1.2.0';
}
}