PageRenderTime 15ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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)) { ?>
 7window.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
21(function() {
22  var e = document.createElement('script');
23  e.src = document.location.protocol + <?php echo json_encode('//connect.facebook.net/'.$culture.'/all.js') ?>;
24  e.async = true;
25  document.getElementById('fb-root').appendChild(e);
26})();
27<?php } ?>
28</script>