diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 9503320..03a66cf 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -32,6 +32,14 @@ use phpOMS\Model\Message\FormValidation; * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 + * + * @todo Orange-Management/Modules#12 + * Dynamic providing should be handled in the DB + * Providing for the dashboard is dynamic and can be customized by the user himself. + * Hence the loading of the plugins should be handled in the module manager and database. + * Module specific providing could remain the same? Maybe even create a dashboard table just for this like the navigation module. + * This way modules can tell the dashboard that there is a plugin it can use. + * In this table it also should be possible to specify additional information. */ final class ApiController extends Controller { diff --git a/Controller/BackendController.php b/Controller/BackendController.php index ef08f9b..59a25e0 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -15,11 +15,11 @@ declare(strict_types=1); namespace Modules\Dashboard\Controller; use Modules\Dashboard\Models\DashboardBoardMapper; +use Modules\Dashboard\Models\DashboardElementInterface; use Modules\Dashboard\Models\NullDashboardBoard; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; -use phpOMS\Module\NullModule; use phpOMS\Views\View; /** @@ -29,6 +29,10 @@ use phpOMS\Views\View; * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 + * + * @todo Orange-Management/Modules#137 + * Default dashboard styles + * Allow default dashboard templates which users can select */ final class BackendController extends Controller { @@ -41,6 +45,10 @@ final class BackendController extends Controller * * @return RenderableInterface * + * @todo Orange-Management/Modules#57 + * Users should be able to customize their dashboard. + * This includes drag and drop and module selection. + * * @since 1.0.0 * @codeCoverageIgnore */ @@ -62,10 +70,7 @@ final class BackendController extends Controller foreach ($boardComponents as $component) { $module = $this->app->moduleManager->get($component->getModule()); - // todo: check if this should be done with instanceof DashboardView -> instanceof DashboardView - if ($module instanceof NullModule - || !\method_exists($module, 'viewDashboard') - ) { + if (!($module instanceof DashboardElementInterface)) { continue; } diff --git a/Models/DashboardElementInterface.php b/Models/DashboardElementInterface.php new file mode 100644 index 0000000..f24427c --- /dev/null +++ b/Models/DashboardElementInterface.php @@ -0,0 +1,43 @@ +