Skip to content
Extraits de code Groupes Projets
Valider ccaf2c6b rédigé par Thomas Steur's avatar Thomas Steur Validation de sgiehl
Parcourir les fichiers

added missing doc

parent b09be690
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -10,7 +10,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
* The class `Piwik\WidgetList` class has been moved to `Piwik\Widget\WidgetsList`.
* The method `Piwik\Plugin\Menu::configureReportingMenu` has been removed. To add something to the reporting menu you need to create widgets
* The method `Report::configureWidget()`, `Report::getWidgetTitle()` and `Report::configureReportingMenu()` have been removed, use the new method `Report::configureWidgets()` instead.
* The method `Report::getCategory()` does no longer return the translated category but the translation key of the category
* The method `Report::getCategory()` has been moved to `Report::getCategoryId()` and does no longer return the translated category but the translation key of the category.
* The property `Report::$category` has been renamed to `Report::$categoryId`
* The methods `Report::factory()`, `Report::getAllReportClasses()`, `Report::getAllReports` have been moved to the `Piwik\Plugin\Reports` class.
* The properties `Report::$widgetTitle`, `Report::$widgetParams` and `Report::$menuTitle` were removed, use the method `Report::configureWidgets()` to create widgets instead
......
......@@ -310,6 +310,25 @@ class Report
return $view->render();
}
/**
* Let's you add any amount of widgets for this report. If a report defines a {@link $categoryId} and a
* {@link $subcategoryId} a widget will be generated automatically.
*
* Example to add a widget manually by overwriting this method in your report:
* $widgetsList->addWidgetConfig($factory->createWidget());
*
* If you want to have the name and the order of the widget differently to the name and order of the report you can
* do the following:
* $widgetsList->addWidgetConfig($factory->createWidget()->setName('Custom')->setOrder(5));
*
* If you want to add a widget to any container defined by your plugin or by another plugin you can do
* this:
* $widgetsList->addToContainerWidget($containerId = 'Products', $factory->createWidget());
*
* @param WidgetsList $widgetsList
* @param ReportWidgetFactory $factory
* @api
*/
public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory)
{
if ($this->categoryId && $this->subcategoryId) {
......
......@@ -6,7 +6,7 @@
*/
/**
* <div piwik-dashboard dashboardId="5" layout="10"></div>
* <div piwik-dashboard dashboard-id="5"></div>
*/
(function () {
angular.module('piwikApp').directive('piwikDashboard', piwikDashboard);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter