type('src') ->data('http://connect.facebook.net/en_US/all.js'); Script::factory() ->type('stdin') ->data(' $(document).ready(function(){ window.fbAsyncInit = function() { // Initialize the Facebook JavaScript SDK FB.init({ appId: '.$this->oo->app_id.', xfbml: false, status: true, cookie: true, }); // Check if the current user is logged in and has authorized the app //FB.getLoginStatus(checkLoginStatus); } $(".btn-facebook").click(function() { FB.login(checkLoginStatus, {scope:"email"}); // We stop the click, but pick up the href in the javascript return false; }); }); '); Script::factory() ->type('file') ->data('media/js/facebook.js'); } } ?>