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

refs #6045 #6049 the UI should now work even when none of those reporting /...

refs #6045 #6049 the UI should now work even when none of those reporting / tracker plugins is enabled
parent ade4198d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -34,7 +34,7 @@ class GenerateWidget extends GeneratePluginBase ...@@ -34,7 +34,7 @@ class GenerateWidget extends GeneratePluginBase
$category = $this->getCategory($input, $output); $category = $this->getCategory($input, $output);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin'; $exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array('ExampleRssWidget' => $pluginName, $replace = array('ExamplePlugin' => $pluginName,
'Example Category' => $category); 'Example Category' => $category);
$whitelistFiles = array('/Widgets.php'); $whitelistFiles = array('/Widgets.php');
......
...@@ -50,7 +50,7 @@ class DevicesDetection extends \Piwik\Plugin ...@@ -50,7 +50,7 @@ class DevicesDetection extends \Piwik\Plugin
if (!PluginManager::getInstance()->isPluginActivated('UserSettings')) { if (!PluginManager::getInstance()->isPluginActivated('UserSettings')) {
$instance = new UserSettings(); $instance = new UserSettings();
$instance->extendVisitorDetails(&$visitor, $details); $instance->extendVisitorDetails($visitor, $details);
} }
} }
......
{% set allMetadata = reports.getFirstRow.getAllTableMetadata %} {% if reports.getRowsCount %}
{% set consideredGrowth = 'Insights_TitleConsideredInsightsGrowth'|translate(allMetadata.minGrowthPercentPositive, allMetadata.lastDate|prettyDate(allMetadata.period)) %} {% set allMetadata = reports.getFirstRow.getAllTableMetadata %}
{% set consideredGrowth = 'Insights_TitleConsideredInsightsGrowth'|translate(allMetadata.minGrowthPercentPositive, allMetadata.lastDate|prettyDate(allMetadata.period)) %}
{% else %}
{% set allMetadata = {} %}
{% set consideredGrowth = '' %}
{% endif %}
{% set consideredChanges = '' %} {% set consideredChanges = '' %}
{% include "@Insights/overviewWidget.twig" %} {% include "@Insights/overviewWidget.twig" %}
\ No newline at end of file
{% set allMetadata = reports.getFirstRow.getAllTableMetadata %} {% if reports.getRowsCount %}
{% set allMetadata = reports.getFirstRow.getAllTableMetadata %}
{% set consideredGrowth = 'Insights_TitleConsideredMoversAndShakersGrowth'|translate(allMetadata.metricName, allMetadata.lastTotalValue, allMetadata.totalValue, allMetadata.lastDate|prettyDate(allMetadata.period), allMetadata.evolutionTotal) %} {% set consideredGrowth = 'Insights_TitleConsideredMoversAndShakersGrowth'|translate(allMetadata.metricName, allMetadata.lastTotalValue, allMetadata.totalValue, allMetadata.lastDate|prettyDate(allMetadata.period), allMetadata.evolutionTotal) %}
{% set consideredChanges = 'Insights_TitleConsideredMoversAndShakersChanges'|translate(allMetadata.minGrowthPercentPositive, allMetadata.minGrowthPercentNegative, allMetadata.minNewPercent, allMetadata.minIncreaseNew, allMetadata.minDisappearedPercent, allMetadata.minDecreaseDisappeared, allMetadata.totalValue) %} {% set consideredChanges = 'Insights_TitleConsideredMoversAndShakersChanges'|translate(allMetadata.minGrowthPercentPositive, allMetadata.minGrowthPercentNegative, allMetadata.minNewPercent, allMetadata.minIncreaseNew, allMetadata.minDisappearedPercent, allMetadata.minDecreaseDisappeared, allMetadata.totalValue) %}
{% else %}
{% set allMetadata = {} %}
{% set consideredGrowth = '' %}
{% set consideredChanges = '' %}
{% endif %}
{% include "@Insights/overviewWidget.twig" %} {% include "@Insights/overviewWidget.twig" %}
\ No newline at end of file
...@@ -9,12 +9,16 @@ ...@@ -9,12 +9,16 @@
namespace Piwik\Plugins\UserCountryMap; namespace Piwik\Plugins\UserCountryMap;
use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuReporting;
use Piwik\Plugin\Manager as PluginManager;
class Menu extends \Piwik\Plugin\Menu class Menu extends \Piwik\Plugin\Menu
{ {
public function configureReportingMenu(MenuReporting $menu) public function configureReportingMenu(MenuReporting $menu)
{ {
$menu->addVisitorsItem('UserCountryMap_RealTimeMap', if (PluginManager::getInstance()->isPluginActivated('UserCountry')) {
array('module' => 'UserCountryMap', 'action' => 'realtimeWorldMap'), $order = 70); $menu->addVisitorsItem('UserCountryMap_RealTimeMap',
array('module' => 'UserCountryMap', 'action' => 'realtimeWorldMap'),
$order = 70);
}
} }
} }
...@@ -34,9 +34,6 @@ class UserCountryMap extends \Piwik\Plugin ...@@ -34,9 +34,6 @@ class UserCountryMap extends \Piwik\Plugin
public function postLoad() public function postLoad()
{ {
WidgetsList::add('General_Visitors', Piwik::translate('UserCountryMap_VisitorMap'), 'UserCountryMap', 'visitorMap');
WidgetsList::add('Live!', Piwik::translate('UserCountryMap_RealTimeMap'), 'UserCountryMap', 'realtimeMap');
Piwik::addAction('Template.leftColumnUserCountry', array('Piwik\Plugins\UserCountryMap\UserCountryMap', 'insertMapInLocationReport')); Piwik::addAction('Template.leftColumnUserCountry', array('Piwik\Plugins\UserCountryMap\UserCountryMap', 'insertMapInLocationReport'));
} }
......
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\UserCountryMap;
use Piwik\Piwik;
use Piwik\View;
use Piwik\Plugin\Manager as PluginManager;
/**
* This class allows you to add your own widgets to the Piwik platform. In case you want to remove widgets from another
* plugin please have a look at the "configureWidgetsList()" method.
* To configure a widget simply call the corresponding methods as described in the API-Reference:
* http://developer.piwik.org/api-reference/Piwik/Plugin\Widgets
*/
class Widgets extends \Piwik\Plugin\Widgets
{
/**
* Here you can define the category the widget belongs to. You can reuse any existing widget category or define
* your own category.
* @var string
*/
protected $category = 'General_Visitor';
protected function init()
{
if (PluginManager::getInstance()->isPluginActivated('UserCountry')) {
$this->addWidget(Piwik::translate('UserCountryMap_VisitorMap'), 'visitorMap');
$this->addWidgetWithCustomCategory('Live!', Piwik::translate('UserCountryMap_RealTimeMap'), 'realtimeMap');
}
}
}
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