You are here

function tb_megamenu_find_templates in The Better Mega Menu 7

File

./tb_megamenu.functions.inc, line 149

Code

function tb_megamenu_find_templates($path) {
  $templates = array();
  $regex = '/\\.tpl\\.php$/';
  $files = drupal_system_listing($regex, $path, 'name', 0);
  foreach ($files as $template => $file) {
    if (($pos = strpos($template, '.')) !== FALSE) {
      $template = substr($template, 0, $pos);
    }
    $templates[$template] = $template;
  }
  return $templates;
}