Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(developer): Remove docs for deprecated and removed event #11515

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Deprecated events
Removed events
^^^^^^^^^^^^^^

* tbd
* ``OCP\Dashboard\RegisterWidgetEvent`` was deprecated in Nextcloud 20 and is now removed. Use ``OCP\AppFramework\Bootstrap\IRegistrationContext::registerDashboardWidget`` from within your app bootstrap.

Changed behavior
^^^^^^^^^^^^^^^^
Expand Down
26 changes: 0 additions & 26 deletions developer_manual/digging_deeper/dashboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,32 +121,6 @@ The `MyAppWidget` class needs to be registered during the :ref:`app bootstrap<Bo
}
}

For compatibility reasons the widget registration can also be performed by
listening to the `OCP\\Dashboard\\RegisterWidgetEvent` for apps that still
need to support older versions where the new app boostrap flow is not available,
however this method is deprecated and will be removed once Nextcloud 19 is EOL.

.. code-block:: php

<?php

use OCP\Dashboard\RegisterWidgetEvent;
use OCP\EventDispatcher\IEventDispatcher;

class Application extends App {
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
$container = $this->getContainer();

/** @var IEventDispatcher $dispatcher */
$dispatcher = $container->getServer()->get(IEventDispatcher::class);
$dispatcher->addListener(RegisterWidgetEvent::class, function (RegisterWidgetEvent $event) use ($container): void {
\OCP\Util::addScript('myapp', 'dashboard');
$event->registerWidget(MyAppWidget::class);
});
}
}

The IConditionalWidget interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
Loading