function parseTemplate($file) {
    $data = array();

    // Captures a template name and body from a template file.
    $pattern = '#== START (.*?) ==(.*?)== END ==#ms';
     preg_match_all($pattern, $file, $matches);
    $count = count($matches[0]);
    for ($i = 0; $i < $count; $i++) {
      $data[$matches[1][$i]] = array(
        #'title' => $matches[1][$i],
        'template' => $matches[2][$i]
      );
      /*
      $hook_custom_declarations[] = array(
        'title' => $matches[1][$i],
        'data' => $matches[2][$i]
      );
      */
    }
    return $data;
  }