You are here

protected function FBAutopost::publishParameterPrepare in Facebook Autopost 7

Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.

7 calls to FBAutopost::publishParameterPrepare()
FBAutopost::publishOn in class/FBAutopost.php
Publishes on a single destination.
FBAutopostEntityEvent::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityEvent.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEntityPhoto::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityPhoto.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEntityPost::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityPost.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEvent::publishParameterPrepare in class/FBAutopostEvent.php
Prepares the parameters to publish to Facebook, this means setting any field or destination dependent configuration.

... See full list

6 methods override FBAutopost::publishParameterPrepare()
FBAutopostEntityEvent::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityEvent.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEntityPhoto::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityPhoto.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEntityPost::publishParameterPrepare in fb_autopost_entity/class/FBAutopostEntityPost.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.
FBAutopostEvent::publishParameterPrepare in class/FBAutopostEvent.php
Prepares the parameters to publish to Facebook, this means setting any field or destination dependent configuration.
FBAutopostPhoto::publishParameterPrepare in class/FBAutopostPhoto.php
Prepares the parameters to publish to Facebook, this means settings any field or destination dependent configuration.

... See full list

File

class/FBAutopost.php, line 249

Class

FBAutopost
API class to handle common actions when autoposting This class uses FBAutopostException for error handling. Severity is passed resusing watchdog severity (See: http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/watch...)

Code

protected function publishParameterPrepare(&$publication) {
  $destination = $this
    ->getDestination();
  if ($destination != 'me') {
    $pages = self::getPagesAccessTokens(variable_get('fb_autopost_account_id', 'me'), variable_get('fb_autopost_token', ''));
    $publication['params'] += array(
      'access_token' => $pages[$destination]['access_token'],
    );
  }
  else {

    // Privacy only makes sense when publishing to timeline
    if ($p = $this
      ->getPrivacy()) {
      $publication['params'] += array(
        'privacy' => $p,
      );
    }
  }
}