Development

Changeset 4862

You must first sign up to be able to contribute.

Changeset 4862

Show
Ignore:
Timestamp:
08/11/07 05:23:04 (1 year ago)
Author:
davedash
Message:

sfFacebookPlatformPlugin: added a fb_form_action function to the FBML helper, using a sfFacebook singleton that proxies the facebook class.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfFacebookPlatformPlugin/lib/helper/FBMLHelper.php

    r4718 r4862  
    44{ 
    55   
     6  $options['href'] = _fb_url($internal_uri); 
     7  return content_tag('fb:action', $text, $options); 
     8} 
     9 
     10function fb_form_tag($action) 
     11{ 
     12  $url = _fb_url($action); 
     13  return form_tag($action); 
     14} 
     15 
     16function _fb_url($internal_uri) 
     17{ 
    618  if (!is_array($internal_uri) && preg_match('#^[a-z]+\://#', $internal_uri)) 
    719  { 
     
    1830    $url = rtrim($host, '/') . $path; 
    1931  } 
    20   $options['href'] = $url; 
    21   return content_tag('fb:action', $text, $options); 
     32  return $url; 
    2233} 
     34 
     35function fb_link_to($text = '', $internal_uri ='', $options = array()) 
     36{ 
     37  $url = _fb_url($internal_uri); 
     38  return link_to($text, $url, $options); 
     39} 
  • plugins/sfFacebookPlatformPlugin/lib/sfFacebookFilter.class.php

    r4718 r4862  
    1616      if ($this->isFirstCall()) 
    1717      { 
     18        $user = $this->getContext()->getUser(); 
    1819       
    19         require_once dirname(__FILE__).'/facebook-platform/client/facebook.php'; 
    20  
    21         $user = $this->getContext()->getUser(); 
    22          
    23         $appapikey      = sfConfig::get('app_facebook_api_key'); 
    24         $appsecret      = sfConfig::get('app_facebook_api_secret'); 
    25  
    26         if (!$appapikey) 
    27         { 
    28           throw new sfException("app_facebook_api_key not defined in app.yml"); 
    29         } 
    30  
    31         if (!$appsecret) 
    32         { 
    33           throw new sfException("app_facebook_api_secret not defined in app.yml"); 
    34         } 
    35  
    36         $this->facebook = new Facebook($appapikey, $appsecret); 
     20        $this->facebook = sfFacebook::getInstance(); 
    3721        // our Facebook ID 
    3822        $this->user     = $this->facebook->require_login();