PHP 클래스 Piwik\Widget\WidgetConfig

파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$action
$categoryId
$isEnabled
$isWide
$isWidgetizable
$middlewareParameters
$module
$name
$order
$parameters
$subcategoryId

공개 메소드들

메소드 설명
addParameters ( array $parameters ) : static Add new parameters and only overwrite parameters that have the same name. See {@link setParameters()}
checkIsEnabled ( ) This method checks whether the widget is available, see {@link isEnabled()}. If not, it triggers an exception containing a message that will be displayed to the user. You can overwrite this message in case you want to customize the error message. Eg.
disable ( ) Disables the widget. See {@link isEnabled()}
enable ( ) Enables the widget. See {@link isEnabled()}
getAction ( ) : string Get the currently set action.
getCategoryId ( ) : string Get the id of the category the widget belongs to.
getMiddlewareParameters ( ) : array Get defined middleware parameters (if any).
getModule ( )
getName ( ) : string Get the name of the widget.
getOrder ( ) : integer Returns the order of the widget.
getParameters ( ) : array Get all URL parameters needed to render this widget.
getSubcategoryId ( ) : string Get the currently set category ID.
getUniqueId ( ) : string Returns the unique id of an widget based on module, action and the set parameters.
isEnabled ( ) : boolean Defines 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 return true or false. If your report is only available to users having super user access you can do the following: return Piwik::hasUserSuperUserAccess();
isWide ( ) : boolean Detect whether the widget should be shown wide or not.
isWidgetizeable ( ) : boolean Detect whether the widget is widgetizable meaning it won't be able to add it to the dashboard and it won't be possible to export the widget via an iframe if it is not widgetizable. This is usually not needed but useful when you eg want to display a widget within the Piwik UI but not want to have it widgetizable.
setAction ( string $action ) : static Set the action of the widget that shall be used in the URL to render the widget.
setCategoryId ( string $categoryId ) : static Set the id of the category the widget belongs to.
setIsEnabled ( boolean $isEnabled ) : static Enable / disable the widget. See {@link isEnabled()}
setIsNotWidgetizable ( ) : static Sets the widget as not widgetizable {@link isWidgetizeable()}.
setIsWide ( ) Marks this widget as a "wide" widget that requires the full width.
setIsWidgetizable ( ) : static Sets the widget as widgetizable {@link isWidgetizeable()}.
setMiddlewareParameters ( array $parameters ) : static If middleware parameters are specified, the corresponding action will be executed before showing the actual widget in the UI. Only if this action (can be a controller method or API method) returns JSON true the widget will be actually shown. It is similar to isEnabled() but the specified action is performed each time the widget is requested in the UI whereas isEnabled is only checked once on the inital page load when we load the inital list of widgets. So if your widget's visibility depends on archived data (aka idSite/period/date) you should specify middle parameters. This has mainly two reasons:
setModule ( string $module ) : static Set the module (aka plugin name) of the widget. The correct module is usually detected automatically and not needed to be configured manually.
setName ( string $name ) : static Set the name of the widget.
setOrder ( integer $order ) : static Set the order of the widget.
setParameters ( array $parameters ) : static Sets (overwrites) the parameters of the widget. These parameters will be added to the URL when rendering the widget. You can access these parameters via `Piwik\Common::getRequestVar(.
setSubcategoryId ( string $subcategoryId ) : static 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.

메소드 상세

addParameters() 공개 메소드

Add new parameters and only overwrite parameters that have the same name. See {@link setParameters()}
public addParameters ( array $parameters ) : static
$parameters array eg. ('urlparam' => 'urlvalue')
리턴 static

checkIsEnabled() 공개 메소드

if (!$this->isEnabled()) { throw new Exception('Setting XYZ is not enabled or the user has not enough permission'); }
public checkIsEnabled ( )

disable() 공개 메소드

Disables the widget. See {@link isEnabled()}
public disable ( )

enable() 공개 메소드

Enables the widget. See {@link isEnabled()}
public enable ( )

getAction() 공개 메소드

Get the currently set action.
public getAction ( ) : string
리턴 string

getCategoryId() 공개 메소드

Get the id of the category the widget belongs to.
public getCategoryId ( ) : string
리턴 string

getMiddlewareParameters() 공개 메소드

Get defined middleware parameters (if any).
public getMiddlewareParameters ( ) : array
리턴 array

getModule() 공개 메소드

public getModule ( )

getName() 공개 메소드

Get the name of the widget.
public getName ( ) : string
리턴 string

getOrder() 공개 메소드

Returns the order of the widget.
public getOrder ( ) : integer
리턴 integer

getParameters() 공개 메소드

Get all URL parameters needed to render this widget.
public getParameters ( ) : array
리턴 array Eg ('urlparam' => 'urlvalue').

getSubcategoryId() 공개 메소드

Get the currently set category ID.
public getSubcategoryId ( ) : string
리턴 string

getUniqueId() 공개 메소드

Returns the unique id of an widget based on module, action and the set parameters.
public getUniqueId ( ) : string
리턴 string

isEnabled() 공개 메소드

Defines 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 return true or false. If your report is only available to users having super user access you can do the following: return Piwik::hasUserSuperUserAccess();
public isEnabled ( ) : boolean
리턴 boolean

isWide() 공개 메소드

Detect whether the widget should be shown wide or not.
public isWide ( ) : boolean
리턴 boolean

isWidgetizeable() 공개 메소드

Detect whether the widget is widgetizable meaning it won't be able to add it to the dashboard and it won't be possible to export the widget via an iframe if it is not widgetizable. This is usually not needed but useful when you eg want to display a widget within the Piwik UI but not want to have it widgetizable.
public isWidgetizeable ( ) : boolean
리턴 boolean

setAction() 공개 메소드

The correct action is usually detected automatically and not needed to be configured manually.
public setAction ( string $action ) : static
$action string eg 'renderMyWidget'
리턴 static

setCategoryId() 공개 메소드

Set the id of the category the widget belongs to.
public setCategoryId ( string $categoryId ) : static
$categoryId string Usually a translation key, eg 'General_Visits', 'Goals_Goals', ...
리턴 static

setIsEnabled() 공개 메소드

Enable / disable the widget. See {@link isEnabled()}
public setIsEnabled ( boolean $isEnabled ) : static
$isEnabled boolean
리턴 static

setIsNotWidgetizable() 공개 메소드

Sets the widget as not widgetizable {@link isWidgetizeable()}.
public setIsNotWidgetizable ( ) : static
리턴 static

setIsWide() 공개 메소드

Marks this widget as a "wide" widget that requires the full width.
public setIsWide ( )

setIsWidgetizable() 공개 메소드

Sets the widget as widgetizable {@link isWidgetizeable()}.
public setIsWidgetizable ( ) : static
리턴 static

setMiddlewareParameters() 공개 메소드

- This way the inital page load time is faster as we won't have to request archived data on the initial page load for widgets that are potentially never shown. - We execute that action every time before showing it. As the initial list of widgets is loaded on page load it is possible that some archives have no data yet, but at a later time there might be actually archived data. As we never reload the initial list of widgets we would still not show the widget even there we should. Example: On page load there are no conversions, a few minutes later there might be conversions. As the middleware is executed before showing it, we detect correctly that there are now conversions whereas isEnabled is only checked once on the initial Piwik page load.
public setMiddlewareParameters ( array $parameters ) : static
$parameters array URL parameters eg array('module' => 'Goals', 'action' => 'Conversions')
리턴 static

setModule() 공개 메소드

Set the module (aka plugin name) of the widget. The correct module is usually detected automatically and not needed to be configured manually.
public setModule ( string $module ) : static
$module string eg 'CoreHome'
리턴 static

setName() 공개 메소드

Set the name of the widget.
public setName ( string $name ) : static
$name string Usually a translation key, eg 'VisitTime_ByServerTimeWidgetName'
리턴 static

setOrder() 공개 메소드

Set the order of the widget.
public setOrder ( integer $order ) : static
$order integer eg. 5
리턴 static

setParameters() 공개 메소드

..)`.
public setParameters ( array $parameters ) : static
$parameters array eg. ('urlparam' => 'urlvalue')
리턴 static

setSubcategoryId() 공개 메소드

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', ...
리턴 static

프로퍼티 상세

$action 보호되어 있는 프로퍼티

protected $action

$categoryId 보호되어 있는 프로퍼티

protected $categoryId

$isEnabled 보호되어 있는 프로퍼티

protected $isEnabled

$isWide 보호되어 있는 프로퍼티

protected $isWide

$isWidgetizable 보호되어 있는 프로퍼티

protected $isWidgetizable

$middlewareParameters 보호되어 있는 프로퍼티

protected $middlewareParameters

$module 보호되어 있는 프로퍼티

protected $module

$name 보호되어 있는 프로퍼티

protected $name

$order 보호되어 있는 프로퍼티

protected $order

$parameters 보호되어 있는 프로퍼티

protected $parameters

$subcategoryId 보호되어 있는 프로퍼티

protected $subcategoryId