ReportCard.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * {date_start} (Datetime) The perdiod starting date
  12. * {date_end} (Datetime) The perdiod ending date
  13. * {additionalUrl} (string) [Optional] This string will be added at the end of the iframe's url without any formatting
  14. * {width} (int) [Optional] Override the default card width
  15. * {height} (int) [Optional] Override the default card height, and disable auto-resizing
  16. -->
  17. </f:comment>
  18. <div class="reportCard">
  19. <h4>{title}</h4>
  20. <div class="widgetIframe">
  21. <iframe width="{f:if(condition: '{width} > 0', then: width, else: '500')}"
  22. height="{f:if(condition: '{height} > 0', then: height, else: '350')}"
  23. id="{id}"
  24. src="https://stats.2iopenservice.com/index.php?module=Widgetize
  25. &action=iframe
  26. &disableLink=1
  27. &widget=1
  28. &moduleToWidgetize={module}
  29. &actionToWidgetize={action}
  30. &idSite={matomoSiteId}
  31. &period=month
  32. &date=today
  33. &token_auth={matomoToken}
  34. {additionalUrl}"
  35. scrolling="yes"
  36. frameborder="0"
  37. marginheight="0"
  38. marginwidth="0"></iframe>
  39. <f:if condition="{height}>0"><f:then>
  40. <f:comment><!-- no resizing --></f:comment>
  41. </f:then><f:else>
  42. <script defer>iFrameResize(<f:format.raw value="{"/><f:format.raw value="}"/>, '#{id}')</script>
  43. </f:else></f:if>
  44. </div>
  45. </div>