diff --git a/sites/all/modules/unl/unl_site_creation.php b/sites/all/modules/unl/unl_site_creation.php index 214d84843b98823e1c477cca7de28e1a80aa02de..28a089bed771e88108e06b978454661e2cfa692b 100644 --- a/sites/all/modules/unl/unl_site_creation.php +++ b/sites/all/modules/unl/unl_site_creation.php @@ -88,10 +88,6 @@ function unl_site_create_submit($form, &$form_state) { function unl_site_list($form, &$form_state) { - $form['root'] = array( - '#type' => 'fieldset', - '#title' => 'Existing Sites', - ); $headers = array( 'site_path' => array( @@ -112,12 +108,7 @@ function unl_site_list($form, &$form_state) { ), 'remove' => 'Remove (can not undo!)' ); - - $form['root']['site_list'] = array( - '#theme' => 'unl_table', - '#header' => $headers, - ); - + $sites = db_select('unl_sites', 's') ->fields('s', array('site_id', 'db_prefix', 'installed', 'site_path', 'uri')) ->extend('TableSort') @@ -125,6 +116,19 @@ function unl_site_list($form, &$form_state) { ->execute() ->fetchAll(); + $total_no_of_sites = count($sites); + + $form['root'] = array( + '#type' => 'fieldset', + '#title' => 'Existing Sites ' . '(total: ' . $total_no_of_sites . ')', + ); + + $form['root']['site_list'] = array( + '#theme' => 'unl_table', + '#header' => $headers, + ); + + foreach ($sites as $site) { unset($checkbox); $form['root']['site_list']['rows'][$site->site_id] = array(