You are here

function lazy_help in Lazy-load 7

Same name and namespace in other branches
  1. 8.3 lazy.module \lazy_help()
  2. 8 lazy.module \lazy_help()
  3. 8.2 lazy.module \lazy_help()

Implements hook_help().

File

./lazy.module, line 34
Module file for Lazy-load.

Code

function lazy_help($path, $arg) {
  switch ($path) {
    case 'admin/help#lazy':
      $filepath = dirname(__FILE__) . '/README.md';
      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;
  }
}