index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. $plugin = RssPlugin::create();
  3. $rss = $plugin->get_rss();
  4. $title = $plugin->get_block_title();
  5. $title = $title ? "<h4>$title</h4>" : '';
  6. $bullet = api_get_asset('plugins/rss/arrow-bullet.png');
  7. $css = api_get_css('plugins/rss/rss.css');
  8. if (empty($rss)) {
  9. echo Display::return_message(get_lang('NoRSSItem'), 'warning');
  10. return;
  11. }
  12. echo<<<EOT
  13. <div class="well sidebar-nav rss">
  14. $css
  15. <style type="text/css" scoped="scoped">
  16. .gfg-listentry-highlight{
  17. background-image: url('$bullet');
  18. }
  19. </style>
  20. <div class="menusection">
  21. <script src="http://www.google.com/jsapi"></script>
  22. <script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js" type="text/javascript"></script>
  23. <script>
  24. google.load('feeds', '1');
  25. function OnLoad() {
  26. var feeds = [
  27. {
  28. url: '$rss'
  29. }
  30. ];
  31. var options = {
  32. stacked : true,
  33. numResults : 5,
  34. horizontal : false,
  35. title : 'Nouvelles!'
  36. };
  37. new GFdynamicFeedControl(feeds, 'news', options);
  38. }
  39. google.setOnLoadCallback(OnLoad);
  40. </script>
  41. $title
  42. <div id="news" class="" style="min-height:300px;"></div>
  43. </div>
  44. </div>
  45. EOT;