Files
WorkspaceOrg/Plugin.php
2026-07-13 08:56:00 -03:00

75 lines
2.4 KiB
PHP

<?php
namespace Kanboard\Plugin\WorkspaceOrg;
use Kanboard\Core\Plugin\Base;
/**
* WorkspaceOrg -- group your projects into personal workspaces.
*
* Each user files their own projects into their own named workspaces (a per-user folder). Everything
* is stored in user metadata -- nothing global, no database migration. A "My workspaces" page on the
* dashboard lists projects grouped by workspace and lets you add/rename/remove workspaces and move
* projects between them; a [Workspace] badge appears before the project title on the dashboard and
* the project list.
*/
class Plugin extends Base
{
public function initialize()
{
// "My workspaces" entry in the dashboard sidebar (visible to every logged-in user).
$this->template->hook->attach('template:dashboard:sidebar', 'workspaceOrg:dashboard/sidebar');
// [Workspace] badge before the project title -- this hook fires on the dashboard overview,
// the dashboard "My projects" tab, and the Projects management list (all via project_title).
$this->template->hook->attach('template:dashboard:project:before-title', 'workspaceOrg:project/badge');
$this->hook->on('template:layout:css', array(
'template' => 'plugins/WorkspaceOrg/Asset/css/workspaceorg.css',
));
// Submits the inline "move to workspace" select on change. Must be an external script:
// Kanboard's CSP (default-src 'self') blocks inline onchange handlers.
$this->hook->on('template:layout:js', array(
'template' => 'plugins/WorkspaceOrg/Asset/js/workspaceorg.js',
));
}
public function getHelpers()
{
return array(
'Plugin\WorkspaceOrg\Helper' => array('WorkspaceOrgHelper'),
);
}
public function getPluginName()
{
return 'WorkspaceOrg';
}
public function getPluginDescription()
{
return t('Group your projects into personal per-user workspaces, shown on a "My workspaces" dashboard page with a badge on each project.');
}
public function getPluginAuthor()
{
return 'Ruben (drbeco)';
}
public function getPluginVersion()
{
return '1.0.0';
}
public function getPluginHomepage()
{
return 'https://code.beco.cc/beco/WorkspaceOrg';
}
public function getCompatibleVersion()
{
return '>=1.2.0';
}
}