setSubcategoryId() public method

Set the id of the subcategory the widget belongs to. If a subcategory is specified, the widget will be shown in the Piwik reporting UI. The subcategoryId will be used as a translation key for the submenu item.
public setSubcategoryId ( string $subcategoryId ) : static
$subcategoryId string Usually a translation key, eg 'General_Overview', 'Actions_Pages', ...
return static
Esempio n. 1
0
 public static function configure(WidgetConfig $config)
 {
     $config->setCategoryId('General_Visitors');
     $config->setSubcategoryId('UserCountry_SubmenuLocations');
     $config->setName('UserCountryMap_VisitorMap');
     $config->setAction('visitorMap');
     $config->setOrder(1);
 }
Esempio n. 2
0
 private function addDefaultDashboard(&$widgets)
 {
     $config = new WidgetConfig();
     $config->setIsNotWidgetizable();
     $config->setModule('Dashboard');
     $config->setAction('embeddedIndex');
     $config->setCategoryId('Dashboard_Dashboard');
     $config->setSubcategoryId('1');
     $config->setParameters(array('idDashboard' => 1));
     $widgets[] = $config;
 }
Esempio n. 3
0
 public static function configure(WidgetConfig $config)
 {
     $config->setCategoryId('General_Visitors');
     $config->setSubcategoryId('UserCountryMap_RealTimeMap');
     $config->setName('UserCountryMap_RealTimeMap');
     $config->setModule('UserCountryMap');
     $config->setAction('realtimeMap');
     $config->setOrder(5);
     if (!PluginManager::getInstance()->isPluginActivated('UserCountry')) {
         $config->disable();
     }
 }
Esempio n. 4
0
 public static function configure(WidgetConfig $config)
 {
     $config->setCategoryId('Goals_Ecommerce');
     $config->setSubcategoryId('Goals_EcommerceLog');
     $config->setName('Goals_EcommerceLog');
     $idSite = Common::getRequestVar('idSite', 0, 'int');
     if (empty($idSite)) {
         $config->disable();
         return;
     }
     $site = new Site($idSite);
     $config->setIsEnabled($site->isEcommerceEnabled());
 }
Esempio n. 5
0
 public static function configure(WidgetConfig $config)
 {
     $idSite = Common::getRequestVar('idSite', 0, 'int');
     $config->setCategoryId('Goals_Goals');
     $config->setSubcategoryId('Goals_ManageGoals');
     $config->setIsNotWidgetizable();
     if (empty($idSite)) {
         $config->disable();
         return;
     }
     $goals = API::getInstance()->getGoals($idSite);
     if (Piwik::isUserHasAdminAccess($idSite)) {
         $config->setName('Goals_ManageGoals');
     } else {
         $config->setName('Goals_CreateNewGOal');
     }
     if (count($goals) === 0) {
         $config->disable();
     }
 }