You are here

function fb_instant_articles_rss_node_operations in Facebook Instant Articles 7

Same name and namespace in other branches
  1. 7.2 modules/fb_instant_articles_rss/fb_instant_articles_rss.module \fb_instant_articles_rss_node_operations()

Implements hook_node_operations().

File

modules/fb_instant_articles_rss/fb_instant_articles_rss.module, line 46
Facebook Instant Articles RSS module.

Code

function fb_instant_articles_rss_node_operations() {

  // Check for setting "All nodes enabled by default?".
  // Only show additional operations if setting is not set.
  $fia_all_enabled = variable_get('fb_instant_articles_rss_all_enabled_default', TRUE);
  $operations = array();
  if (!$fia_all_enabled) {
    $operations = array(
      'add_fia' => array(
        'label' => t('Publish selected content to Facebook Instant Articles RSS feed'),
        'callback' => 'fb_instant_articles_mass_update',
        'callback arguments' => array(
          'fia_enabled' => 1,
        ),
      ),
      'remove_fia' => array(
        'label' => t('Unpublish selected content from Facebook Instant Articles RSS feed'),
        'callback' => 'fb_instant_articles_rss_mass_update',
        'callback arguments' => array(
          'fia_enabled' => 0,
        ),
      ),
    );
  }
  return $operations;
}