index.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\" scoped=\"scoped\">$css</style>" : '';
  8. $bullet = api_get_path(WEB_PLUGIN_PATH).'rss/resources/arrow-bullet.png';
  9. if (empty($rss)) {
  10. Display::display_warning_message(get_lang('NoRSSItem'));
  11. return;
  12. }
  13. echo<<<EOT
  14. <div class="well sidebar-nav rss">
  15. $css
  16. <style type="text/css" scoped="scoped">
  17. .gfg-listentry-highlight{
  18. background-image: url('$bullet');
  19. }
  20. </style>
  21. <div class="menusection">
  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. </div>
  46. EOT;