You are here

function fb_instant_articles_help in Facebook Instant Articles 7

Same name and namespace in other branches
  1. 8.2 fb_instant_articles.module \fb_instant_articles_help()
  2. 8 fb_instant_articles.module \fb_instant_articles_help()
  3. 7.2 fb_instant_articles.module \fb_instant_articles_help()
  4. 3.x fb_instant_articles.module \fb_instant_articles_help()

Implements hook_help().

File

./fb_instant_articles.module, line 66
Hook implementations for Facebook Instant Articles Base module.

Code

function fb_instant_articles_help($path, $arg) {
  switch ($path) {
    case 'admin/help#fb_instant_articles':
      $filepath = dirname(__FILE__) . '/README.md';
      if (file_exists($filepath)) {
        $string = file_get_contents($filepath);
        if ($processed = fb_instant_articles_help_markdown($string)) {
          return $processed;
        }
        return '<pre>' . $string . '</pre>';
      }
      break;
    case 'admin/config/services/fb-instant-articles':
    case 'admin/config/services/fb-instant-articles/settings':
      $page_id = variable_get('fb_instant_articles_page_id', '');
      $output = '';
      $output .= '<h2>' . t('Setup') . '</h2>';
      $output .= '<p>' . t('Once you\'ve activated this Drupal module, set up your Instant Articles and submit them to Facebook for a one-time review. The review is required before you can begin publishing. Follow these steps to get started:') . '</p>';
      $output .= '<ol>';
      $output .= '  <li>' . t('<a href="@sign_up_url" target="_blank">Sign up</a> for Instant Articles, if you haven\'t already, and enabled the same Facebook Page you have selected.', array(
        '@sign_up_url' => 'https://www.facebook.com/instant_articles/signup',
      )) . '</li>';
      $output .= '  <li>' . t('Claim the URL you will use to publish articles.</b> Right now, we think the URL for this page is: %url. ', array(
        '%url' => $_SERVER['HTTP_HOST'],
      ));
      if ($page_id != '') {
        $claim_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles#URL';
        $output .= t('<a href="@claim_url" target="_blank">Claim your URL here.</a>', array(
          '@claim_url' => $claim_url,
        ));
      }
      $output .= '</li>';
      $output .= '  <li>' . t('Install the Pages Manager App to preview your articles and styles on <a href="@ios_url" target="_blank">iOS</a> or <a href="@android_url" target="_blank">Android</a>.', array(
        '@ios_url' => 'http://itunes.apple.com/app/facebook-pages-manager/id514643583?ls=1&mt=8&ign-mscache=1',
        '@android_url' => 'https://play.google.com/store/apps/details?id=com.facebook.pages.app',
      )) . '</li>';
      $output .= '  <li>' . t('Create a style template for your articles using the <a href="@style_url" target="_blank">Style Editor</a>. Be sure to provide the name of the template you want to use in the Module Configuration settings below.', array(
        '@style_url' => 'https://developers.facebook.com/docs/instant-articles/guides/design#style',
      )) . '</li>';
      $output .= '  <li>' . t('[Optional] Enable Audience Network, if you choose. Learn more about <a href="@audience_url" target="_blank">Audience Network</a> for Instant Articles and <a href="@sign_up_url" target="_blank">sign up here</a>.', array(
        '@audience_url' => 'https://fbinstantarticles.files.wordpress.com/2016/03/audience-network_wp_instant-articles-2-2-web_self-serve.pdf',
        '@sign_up_url' => '',
      )) . '</li>';
      $output .= '  <li>' . t('[Optional] Set up your ads and analytics, including Audience Network, in the Configuration area, below.') . '</li>';
      if ($page_id != '') {
        $article_review_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles#Setup-Step2';
        $output .= '  <li>' . t('<a href="@article_review_url" target="_blank">Submit your articles</a> for review.', array(
          '@article_review_url' => $article_review_url,
        )) . '</li>';
      }
      else {
        $output .= '  <li>' . t('Submit your articles for review.') . '</li>';
      }
      $output .= '</ol>';
      $output .= '<p>' . t('Other Resources:') . '</p>';
      $output .= '<ol>';
      $output .= '  <li>' . t('Read the <a href="@docs_url" target="_blank">documentation</a> to answer additional questions you might have about Instant Articles.', array(
        '@docs_url' => 'https://developers.facebook.com/docs/instant-articles',
      )) . '</li>';
      $output .= '  <li>' . t('Check out the <a href="@blog_url" target="_blank">Instant Articles blog</a> and sign up to receive notifications of important updates.', array(
        '@blog_url' => 'https://developers.facebook.com/ia/blog/',
      )) . '</li>';
      if ($page_id != '') {
        $tools_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=instant_articles';
        $roles_url = 'https://www.facebook.com/' . $page_id . '/settings/?tab=admin_roles';
        $output .= '  <li>' . t('To give other members of your team access to the <a href="@tools_url" target="_blank">Instant Articles tools</a>, assign them <a href="@roles_url" target="_blank">page roles here</a>.', array(
          '@tools_url' => $tools_url,
          '@roles_url' => $roles_url,
        )) . '</li>';
      }
      else {
        $output .= '  <li>' . t('To give other members of your team access to the Instant Articles tools, assign them page roles.') . '</li>';
      }
      $output .= '</ol>';
      return $output;
      break;
  }
}