public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('Installation_SystemCheck'); $config->setOrder(16); $config->setIsEnabled(Piwik::hasUserSuperUserAccess()); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('ProfessionalServices_WidgetProfessionalServicesForPiwik'); $advertising = StaticContainer::get('Piwik\\ProfessionalServices\\Advertising'); $config->setIsEnabled($advertising->areAdsForProfessionalServicesEnabled()); }
public static function configure(WidgetConfig $config) { /** * Set the category the widget belongs to. You can reuse any existing widget category or define * your own category. */ $config->setCategoryId('About Piwik'); /** * Set the subcategory the widget belongs to. If a subcategory is set, the widget will be shown in the UI. */ // $config->setSubcategoryId('General_Overview'); /** * Set the name of the widget belongs to. */ $config->setName('Example Widget Name'); /** * Set the order of the widget. The lower the number, the earlier the widget will be listed within a category. */ $config->setOrder(99); /** * Optionally set URL parameters that will be used when this widget is requested. * $config->setParameters(array('myparam' => 'myvalue')); */ /** * Define whether a widget is enabled or not. For instance some widgets might not be available to every user or * might depend on a setting (such as Ecommerce) of a site. In such a case you can perform any checks and then * set `true` or `false`. If your widget is only available to users having super user access you can do the * following: * * $config->setIsEnabled(\Piwik\Piwik::hasUserSuperUserAccess()); * or * if (!\Piwik\Piwik::hasUserSuperUserAccess()) * $config->disable(); */ }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('CoreHome_SystemSummaryWidget'); $config->setOrder(15); $config->setIsEnabled(Piwik::hasUserSuperUserAccess()); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('General_Visitors'); $config->setName('Live_VisitorProfile'); $config->setOrder(25); if (Piwik::isUserIsAnonymous()) { $config->disable(); } }
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(); } }
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; }
/** * @inheritdoc */ public function getParameters() { $parameters = parent::getParameters(); $defaultParams = array(); if ($this->forceViewDataTable) { $defaultParams['forceView'] = '1'; if ($this->viewDataTable) { // URL param is not needed for default view dataTable $defaultParams['viewDataTable'] = $this->viewDataTable; } } return $defaultParams + $parameters; }
public static function configure(WidgetConfig $config) { $config->setCategoryId('General_Visitors'); $config->setSubcategoryId('UserCountry_SubmenuLocations'); $config->setName('UserCountryMap_VisitorMap'); $config->setAction('visitorMap'); $config->setOrder(1); }
public static function configure(WidgetConfig $config) { $idSite = Common::getRequestVar('idSite', 0, 'int'); $config->setCategoryId('Goals_Goals'); $config->setSubcategoryId('Goals_AddNewGoal'); $config->setParameters(array('idGoal' => '')); $config->setIsNotWidgetizable(); if (empty($idSite)) { $config->disable(); return; } $goals = API::getInstance()->getGoals($idSite); if (Piwik::isUserHasAdminAccess($idSite)) { $config->setName('Goals_AddNewGoal'); } else { $config->setName('Goals_CreateNewGOal'); } if (count($goals) !== 0) { $config->disable(); } }
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()); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('SEO'); $config->setName('Referrers_WidgetTopKeywordsForPages'); $config->setIsEnabled(SettingsPiwik::isSegmentationEnabled()); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('Latest Marketplace Updates'); $config->setOrder(19); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('Piwik.org Blog'); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('SEO'); $config->setName('SEO_SeoRankings'); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('Live!'); $config->setName('Live_VisitorsInRealTime'); $config->setOrder(20); }
private function getWidgetConfigForClassName($widgetClass) { /** @var string|Widget $widgetClass */ $config = new WidgetConfig(); $config->setModule($this->getModuleFromWidgetClassName($widgetClass)); $config->setAction($this->getActionFromWidgetClassName($widgetClass)); $widgetClass::configure($config); return $config; }
public static function configure(WidgetConfig $config) { $config->setCategoryId('Insights_WidgetCategory'); $config->setName('Insights_MoversAndShakersWidgetTitle'); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('Insights_WidgetCategory'); $config->setName('Insights_OverviewWidgetTitle'); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('Installation_Welcome'); $config->setOrder(10); }
private function checkIsValidWidget(WidgetConfig $widget) { if (!$widget->getModule()) { Development::error('No module is defined for added widget having name "' . $widget->getName()); } if (!$widget->getAction()) { Development::error('No action is defined for added widget having name "' . $widget->getName()); } }
/** * @param WidgetConfig $widget * @param CategoryList|null $categoryList If null, no category information will be added to the widgets in first * level (they will be added to nested widgets as potentially needed eg for * widgets in ByDimensionView where they are needed to build the left menu) * @return array */ public function buildWidgetMetadata(WidgetConfig $widget, $categoryList = null) { $item = array('name' => Piwik::translate($widget->getName())); if (isset($categoryList)) { $category = $categoryList->getCategory($widget->getCategoryId()); $subcategory = $category ? $category->getSubcategory($widget->getSubcategoryId()) : null; $item['category'] = $this->buildCategoryMetadata($category); $item['subcategory'] = $this->buildSubcategoryMetadata($subcategory); } $item['module'] = $widget->getModule(); $item['action'] = $widget->getAction(); $item['order'] = $widget->getOrder(); $item['parameters'] = $widget->getParameters(); $item['uniqueId'] = $widget->getUniqueId(); $item['isWide'] = $widget->isWide(); $middleware = $widget->getMiddlewareParameters(); if (!empty($middleware)) { $item['middlewareParameters'] = $middleware; } if ($widget instanceof ReportWidgetConfig) { $item['viewDataTable'] = $widget->getViewDataTable(); $item['isReport'] = true; } if ($widget instanceof WidgetContainerConfig) { $item['layout'] = $widget->getLayout(); $item['isContainer'] = true; // we do not want to create categories to the inital categoryList. Otherwise we'd maybe display more pages // etc. $subCategoryList = new CategoryList(); $this->createMissingCategoriesAndSubcategories($subCategoryList, $widget->getWidgetConfigs()); $children = array(); foreach ($widget->getWidgetConfigs() as $widgetConfig) { $children[] = $this->buildWidgetMetadata($widgetConfig, $subCategoryList); } $item['widgets'] = $children; } return $item; }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setName('CoreHome_SupportPiwik'); $config->setOrder(5); }
public static function configure(WidgetConfig $config) { $config->setCategoryId('About Piwik'); $config->setIsEnabled(false); }