/Resources/views/initialize.html.php

http://github.com/FriendsOfSymfony/FOSFacebookBundle · PHP · 28 lines · 27 code · 1 blank · 0 comment · 3 complexity · ec28d676d61c9487bcb0fb283973541e MD5 · raw file

  1. <div id="fb-root"></div>
  2. <?php if (empty($async)) { ?>
  3. <script type="text/javascript" src="http://connect.facebook.net/<?php echo $culture ?>/all.js"></script>
  4. <?php } ?>
  5. <script type="text/javascript">
  6. <?php if (!empty($async)) { ?>
  7. window.fbAsyncInit = function() {
  8. <?php }?>
  9. FB.init(<?php echo json_encode(array(
  10. 'appId' => $appId,
  11. 'xfbml' => $xfbml,
  12. 'status' => $status,
  13. 'oauth' => $oauth,
  14. 'cookie' => $cookie,
  15. 'channelUrl' => $channelUrl,
  16. 'logging' => $logging)) ?>);
  17. <?php if (!empty($async)) { ?>
  18. <?php echo $fbAsyncInit ?>
  19. };
  20. (function() {
  21. var e = document.createElement('script');
  22. e.src = document.location.protocol + <?php echo json_encode('//connect.facebook.net/'.$culture.'/all.js') ?>;
  23. e.async = true;
  24. document.getElementById('fb-root').appendChild(e);
  25. })();
  26. <?php } ?>
  27. </script>