ReportCard.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <f:comment><!-- Displays a matomo widget --></f:comment>
  2. <f:comment>
  3. <!--
  4. The following arguments are expected here:
  5. * {title} (string) The widget title
  6. * {id} (string) an html id
  7. * {matomoSiteId} (int) the matomo site's id
  8. * {matomoToken} (string) the matomo's user token
  9. * {module} (string) the matomo 'moduleToWidgetize' parameter
  10. * {action} (string) the matomo 'actionToWidgetize' parameter
  11. * {period} (string) The analysis period ('day', 'month' or 'year')
  12. * {additionalUrl} (string) [Optional] This string will be added at the end of the iframe's url without any formatting
  13. * {width} (int) [Optional] Override the default card width
  14. * {height} (int) [Optional] Override the default card height, and disable auto-resizing
  15. -->
  16. </f:comment>
  17. <div class="reportCard">
  18. <h4>{title}</h4>
  19. <div class="widgetIframe">
  20. <iframe width="{f:if(condition: '{width} > 0', then: width, else: '500')}"
  21. height="{f:if(condition: '{height} > 0', then: height, else: '300')}"
  22. id="{id}"
  23. src="https://stats.2iopenservice.com/index.php?module=Widgetize
  24. &action=iframe
  25. &disableLink=1
  26. &widget=1
  27. &moduleToWidgetize={module}
  28. &actionToWidgetize={action}
  29. &idSite={matomoSiteId}
  30. &period={period}
  31. &date=today
  32. &token_auth={matomoToken}
  33. {additionalUrl}"
  34. scrolling="yes"
  35. frameborder="0"
  36. marginheight="0"
  37. marginwidth="0"></iframe>
  38. <f:if condition="{height}>0"><f:then>
  39. <f:comment><!-- no resizing --></f:comment>
  40. </f:then><f:else>
  41. <script defer>iFrameResize(<f:format.raw value="{"/>heightCalculationMethod:'grow'<f:format.raw value="}"/>, '#{id}')</script>
  42. </f:else></f:if>
  43. </div>
  44. </div>