You are here

function feeds_para_mapper_help in Feeds Paragraphs 7

Same name and namespace in other branches
  1. 8 feeds_para_mapper.module \feeds_para_mapper_help()

Implements hook_help().

File

./feeds_para_mapper.module, line 11
Allows feeds to import content to Paragraphs' fields.

Code

function feeds_para_mapper_help($path, $arg) {
  switch ($path) {
    case 'admin/help#feeds_para_mapper':
      $filepath = dirname(__FILE__) . '/README.md';
      if (file_exists($filepath)) {
        $readme = file_get_contents($filepath);
      }
      else {
        $filepath = dirname(__FILE__) . '/README.txt';
        if (file_exists($filepath)) {
          $readme = file_get_contents($filepath);
        }
      }
      if (!isset($readme)) {
        return NULL;
      }
      if (module_exists('markdown')) {
        $filters = module_invoke('markdown', 'filter_info');
        $info = $filters['filter_markdown'];
        if (function_exists($info['process callback'])) {
          $output = $info['process callback']($readme, NULL);
        }
        else {
          $output = '<pre>' . $readme . '</pre>';
        }
      }
      else {
        $output = '<pre>' . $readme . '</pre>';
      }
      return $output;
  }
}