You are here

function _zenophile_find_sites in Zenophile 6

Same name and namespace in other branches
  1. 6.2 zenophile.module \_zenophile_find_sites()
  2. 7 zenophile.module \_zenophile_find_sites()

List this site's sites as located in the sites directory.

Return value

An array of directories in the sites directory.

1 call to _zenophile_find_sites()
zenophile_create in ./zenophile.module
Form to create the subtheme. drupal_get_form() callback.

File

./zenophile.module, line 231

Code

function _zenophile_find_sites() {
  $sites = array();
  if ($h = opendir('sites')) {
    while (($site = readdir($h)) !== FALSE) {

      // Don't allow dot files or links for security reasons
      if (is_dir('sites/' . $site) && !is_link('sites/' . $site) && $site[0] !== '.' && $site !== 'default') {
        $sites[] = $site;
      }
    }
    return drupal_map_assoc($sites);
  }
  else {
    drupal_set_message(t('The <em>sites</em> directory could not be read.'), 'error');
    return array();
  }
}