You are here

private function drupalchatSettingsForm::_drupalchat_load_themes in DrupalChat 8

1 call to drupalchatSettingsForm::_drupalchat_load_themes()
drupalchatSettingsForm::buildForm in src/Form/drupalchatSettingsForm.php
Form constructor.

File

src/Form/drupalchatSettingsForm.php, line 349
Contains Drupal\drupalchat\Form\drupalchatSettingsForm

Class

drupalchatSettingsForm
Class drupalchatSettingsForm

Namespace

Drupal\drupalchat\Form

Code

private 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 = drupalchatSettingsForm::_drupalchat_load_themes($outerDir . '/' . $d, $x)) {
        $dir_array[$d] = $innerDir;
      }
    }
    elseif ($x ? preg_match('/' . $x . '$/', $d) : 1) {
      $name = drupalchatSettingsForm::_drupalchat_remove_extension($d);
      $dir_array[$name] = $name;
    }
  }
  return $dir_array;
}