Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
381b7570
Valider
381b7570
rédigé
il y a 7 ans
par
Thomas Steur
Validation de
Matthieu Aubry
il y a 7 ans
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
let plugins decide whether to embed widgetized iframe empty or not (#12292)
parent
a25c43e2
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
CHANGELOG.md
+1
-0
1 ajout, 0 suppression
CHANGELOG.md
plugins/Dashboard/Dashboard.php
+9
-1
9 ajouts, 1 suppression
plugins/Dashboard/Dashboard.php
plugins/Widgetize/Controller.php
+24
-3
24 ajouts, 3 suppressions
plugins/Widgetize/Controller.php
avec
34 ajouts
et
4 suppressions
CHANGELOG.md
+
1
−
0
Voir le fichier @
381b7570
...
...
@@ -8,6 +8,7 @@ The Product Changelog at **[piwik.org/changelog](https://piwik.org/changelog)**
### New APIs
*
Themes can now customize the header text color using
`@theme-color-header-text`
*
New event
`Widgetize.shouldEmbedIframeEmpty`
added so plugins can optionally define the output of the widgetized HTML themselves
## Piwik 3.2.0
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
plugins/Dashboard/Dashboard.php
+
9
−
1
Voir le fichier @
381b7570
...
...
@@ -30,10 +30,18 @@ class Dashboard extends \Piwik\Plugin
'UsersManager.deleteUser'
=>
'deleteDashboardLayout'
,
'Translate.getClientSideTranslationKeys'
=>
'getClientSideTranslationKeys'
,
'Widget.addWidgetConfigs'
=>
'addWidgetConfigs'
,
'Category.addSubcategories'
=>
'addSubcategories'
'Category.addSubcategories'
=>
'addSubcategories'
,
'Widgetize.shouldEmbedIframeEmpty'
=>
'shouldEmbedIframeEmpty'
);
}
public
function
shouldEmbedIframeEmpty
(
&
$shouldEmbedEmpty
,
$controllerName
,
$actionName
)
{
if
(
$controllerName
==
'Dashboard'
&&
$actionName
==
'index'
)
{
$shouldEmbedEmpty
=
true
;
}
}
public
function
addWidgetConfigs
(
&
$widgets
)
{
if
(
Piwik
::
isUserIsAnonymous
())
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
plugins/Widgetize/Controller.php
+
24
−
3
Voir le fichier @
381b7570
...
...
@@ -8,9 +8,9 @@
*/
namespace
Piwik\Plugins\Widgetize
;
use
Piwik\API\Request
;
use
Piwik\Common
;
use
Piwik\FrontController
;
use
Piwik\Piwik
;
use
Piwik\View
;
/**
...
...
@@ -27,7 +27,6 @@ class Controller extends \Piwik\Plugin\Controller
public
function
iframe
()
{
Request
::
reloadAuthUsingTokenAuth
();
$this
->
init
();
$controllerName
=
Common
::
getRequestVar
(
'moduleToWidgetize'
);
...
...
@@ -37,7 +36,29 @@ class Controller extends \Piwik\Plugin\Controller
throw
new
\Exception
(
"Widgetizing API requests is not supported for security reasons. Please change query parameter 'moduleToWidgetize'."
);
}
if
(
$controllerName
==
'Dashboard'
&&
$actionName
==
'index'
)
{
$shouldEmbedEmpty
=
false
;
/**
* Triggered to detect whether a widgetized report should be wrapped in the widgetized HTML or whether only
* the rendered output of the controller/action should be printed. Set `$shouldEmbedEmpty` to `true` if
* your widget renders the full HTML itself.
*
* **Example**
*
* public function embedIframeEmpty(&$shouldEmbedEmpty, $controllerName, $actionName)
* {
* if ($controllerName == 'Dashboard' && $actionName == 'index') {
* $shouldEmbedEmpty = true;
* }
* }
*
* @param string &$shouldEmbedEmpty Defines whether the iframe should be embedded empty or wrapped within the widgetized html.
* @param string $controllerName The name of the controller that will be executed.
* @param string $actionName The name of the action within the controller that will be executed.
*/
Piwik
::
postEvent
(
'Widgetize.shouldEmbedIframeEmpty'
,
array
(
&
$shouldEmbedEmpty
,
$controllerName
,
$actionName
));
if
(
$shouldEmbedEmpty
)
{
$view
=
new
View
(
'@Widgetize/iframe_empty'
);
}
else
{
$view
=
new
View
(
'@Widgetize/iframe'
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter