You are here

function _drupalchat_load_themes in DrupalChat 7

Same name and namespace in other branches
  1. 6.2 drupalchat.admin.inc \_drupalchat_load_themes()
  2. 7.2 drupalchat.admin.inc \_drupalchat_load_themes()
1 call to _drupalchat_load_themes()
drupalchat_settings_form in ./drupalchat.admin.inc
Callback for admin/settings/drupalchat.

File

./drupalchat.admin.inc, line 538
Administrative functions to configure DrupalChat.

Code

function _drupalchat_load_themes($outerDir, $x) {
  $dirs = array_diff(scandir($outerDir), array(
    '.',
    '..',
  ));
  $dir_array = array();
  foreach ($dirs as $d) {
    if (is_dir($outerDir . "/" . $d)) {
      if ($innerDir = _drupalchat_load_themes($outerDir . '/' . $d, $x)) {
        $dir_array[$d] = $innerDir;
      }
    }
    elseif ($x ? preg_match('/' . $x . '$/', $d) : 1) {
      $name = _drupalchat_remove_extension($d);
      $dir_array[$name] = $name;
    }
  }
  return $dir_array;
}