index.php 1.4 KB

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