Skip to content

Commit

Permalink
Refs #4199 minor doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 9, 2013
1 parent e66925e commit 60949f6
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 56 deletions.
6 changes: 2 additions & 4 deletions core/API/Request.php
Expand Up @@ -183,10 +183,8 @@ static public function reloadAuthUsingTokenAuth($request = null)
if ($token_auth) {

/**
* This event will be triggered if the token_auth is found in the $request parameter. In this case the
* current session will be authenticated using this token_auth. It will overwrite the previous `Auth`
* object.
* @matt
* This event is triggered when authenticating the API call, only if the token_auth is found in the request.
* In this case the current session should authenticate using this token_auth.
*/
Piwik_PostEvent('API.Request.authenticate', array($token_auth));
Access::getInstance()->reloadAccess();
Expand Down
24 changes: 8 additions & 16 deletions core/Db/Schema.php
Expand Up @@ -130,23 +130,15 @@ public static function getSchemas($adapterName)
*/
private function loadSchema()
{
$schema = null;
/**
* @matt can be removed?
*/
Piwik_PostEvent('Schema.loadSchema', array(&$schema));
if ($schema === null) {
$config = Config::getInstance();
$dbInfos = $config->database;
if (isset($dbInfos['schema'])) {
$schemaName = $dbInfos['schema'];
} else {
$schemaName = 'Myisam';
}
$className = self::getSchemaClassName($schemaName);
$schema = new $className();
$config = Config::getInstance();
$dbInfos = $config->database;
if (isset($dbInfos['schema'])) {
$schemaName = $dbInfos['schema'];
} else {
$schemaName = 'Myisam';
}
$this->schema = $schema;
$className = self::getSchemaClassName($schemaName);
$this->schema = new $className();
}

/**
Expand Down
11 changes: 4 additions & 7 deletions core/FrontController.php
Expand Up @@ -326,9 +326,8 @@ public function init()
Access::getInstance();

/**
* This event is triggered after the platform is initialized and most plugins are loaded. The user is not
* authenticated at this point though. You can use this event for instance to initialize your own plugin.
* @matt
* This event is the first event triggered just after the platform is initialized and plugins are loaded.
* You can use this event to do early initialization. Note: the user is not authenticated yet.
*/
Piwik_PostEvent('Request.dispatchCoreAndPluginUpdatesScreen');

Expand All @@ -340,10 +339,8 @@ public function init()
}

/**
* This event is triggered shortly before the user is authenticated. Use it to create your own
* authentication object instead of the Piwik authentication. Make sure to implement the `Piwik\Auth`
* interface in case you want to define your own authentication.
* @matt here we have a problem if multiple plugins listen to this event?
* This event is triggered before the user is authenticated. You can use it to create your own
* authentication object which implements the `Piwik\Auth` interface, and override the default authentication logic.
*/
Piwik_PostEvent('Request.initAuthenticationObject');
try {
Expand Down
9 changes: 5 additions & 4 deletions core/SettingsPiwik.php
Expand Up @@ -60,14 +60,15 @@ static public function getKnownSegmentsToArchive()
{
if (self::$cachedKnownSegmentsToArchive === null) {
$segments = Config::getInstance()->Segments;
$cachedResult = isset($segments['Segments']) ? $segments['Segments'] : array();
$segmentsToProcess = isset($segments['Segments']) ? $segments['Segments'] : array();

/**
* @matt
* This event is triggered when the automatic archiving runs.
* You can use it to add segments to the list of segments to pre-process during archiving.
*/
Piwik_PostEvent('Segments.getKnownSegmentsToArchiveAllSites', array(&$cachedResult));
Piwik_PostEvent('Segments.getKnownSegmentsToArchiveAllSites', array(&$segmentsToProcess));

self::$cachedKnownSegmentsToArchive = array_unique($cachedResult);
self::$cachedKnownSegmentsToArchive = array_unique($segmentsToProcess);
}

return self::$cachedKnownSegmentsToArchive;
Expand Down
4 changes: 2 additions & 2 deletions plugins/CoreAdminHome/templates/trackingCodeGenerator.twig
Expand Up @@ -45,7 +45,7 @@
<div class="tracking-option-section">
<input type="checkbox" id="javascript-tracking-all-subdomains"/>
<label for="javascript-tracking-all-subdomains">{{ 'CoreAdminHome_JSTracking_MergeSubdomains'|translate }}
<span class='current-site-name'>{{ defaultReportSiteName }}</span>
<span class='current-site-name'>{{ defaultReportSiteName|raw }}</span>
</label>

<div class="small-form-description">
Expand All @@ -67,7 +67,7 @@
<div class="tracking-option-section">
<input type="checkbox" id="javascript-tracking-all-aliases"/>
<label for="javascript-tracking-all-aliases">{{ 'CoreAdminHome_JSTracking_MergeAliases'|translate }}
<span class='current-site-name'>{{ defaultReportSiteName }}</span>
<span class='current-site-name'>{{ defaultReportSiteName|raw }}</span>
</label>

<div class="small-form-description">
Expand Down
12 changes: 5 additions & 7 deletions plugins/CustomVariables/CustomVariables.php
Expand Up @@ -124,13 +124,11 @@ public function getSegmentsMetadata(&$segments)
*/
public function getReportsWithGoalMetrics(&$dimensions)
{
$dimensions = array_merge($dimensions, array(
array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('CustomVariables_CustomVariables'),
'module' => 'CustomVariables',
'action' => 'getCustomVariables',
),
));
$dimensions[] = array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('CustomVariables_CustomVariables'),
'module' => 'CustomVariables',
'action' => 'getCustomVariables',
);
}

/**
Expand Down
31 changes: 16 additions & 15 deletions plugins/Goals/Goals.php
Expand Up @@ -335,7 +335,7 @@ public function getReportMetadata(&$reports, $info)
unset($goalMetrics['nb_visits_converted']);

$reportsWithGoals = self::getAllReportsWithGoalMetrics();

foreach ($reportsWithGoals as $reportWithGoals) {
// Select this report from the API metadata array
// and add the Goal metrics to it
Expand All @@ -356,8 +356,8 @@ static private function getAllReportsWithGoalMetrics()
$reportsWithGoals = array();

/*
* This event is triggered to define available goal segments.
* @matt
* This event is triggered by the Goals plugin to gather the list of all reports which define Goal metrics (conversions, revenue).
* You can use this event to add your report to the list of reports displayed in the left column of the Goals Overview report.
*/
Piwik_PostEvent('Goals.getReportsWithGoalMetrics', array(&$reportsWithGoals));

Expand All @@ -384,18 +384,19 @@ static public function getProductReportColumns()
*/
public function getActualReportsWithGoalMetrics(&$dimensions)
{
$dimensions = array_merge($dimensions, array(
array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('Goals_VisitsUntilConv'),
'module' => 'Goals',
'action' => 'getVisitsUntilConversion'
),
array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('Goals_DaysToConv'),
'module' => 'Goals',
'action' => 'getDaysToConversion'
)
));
$reportWithGoalMetrics = array(
array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('Goals_VisitsUntilConv'),
'module' => 'Goals',
'action' => 'getVisitsUntilConversion'
),
array('category' => Piwik_Translate('General_Visit'),
'name' => Piwik_Translate('Goals_DaysToConv'),
'module' => 'Goals',
'action' => 'getDaysToConversion'
)
);
$dimensions = array_merge($dimensions, $reportWithGoalMetrics);
}

public function getSegmentsMetadata(&$segments)
Expand Down
2 changes: 1 addition & 1 deletion plugins/UsersManager/templates/userSettings.twig
Expand Up @@ -139,7 +139,7 @@
{% if anonymousSites is not empty %}
<select id="anonymousDefaultReportWebsite">
{% for info in anonymousSites %}
<option value="{{ info.idsite }}" {% if anonymousDefaultReport==info.idsite %} selected="selected"{% endif %}>{{ info.name }}</option>
<option value="{{ info.idsite }}" {% if anonymousDefaultReport==info.idsite %} selected="selected"{% endif %}>{{ info.name|raw }}</option>
{% endfor %}
</select>
{% endif %}
Expand Down

0 comments on commit 60949f6

Please sign in to comment.