You are here

function delta_get_themes_form_array in Delta 7.2

Same name and namespace in other branches
  1. 6 delta.module \delta_get_themes_form_array()
  2. 7 delta.module \delta_get_themes_form_array()

Pull data from actively selected themes

Return value

a usable array of theme data for use in forms for checkboxes or radio buttons

2 calls to delta_get_themes_form_array()
delta_layout_edit in ./delta_ui.admin.inc
Form callback for creating and editing theme settings templates
delta_theme_settings_config in ./delta_ui.admin.inc
Menu callback; displays the delta listing page.

File

./delta_ui.module, line 127

Code

function delta_get_themes_form_array(&$filter) {
  $system_themes = list_themes();
  $configurable_themes = variable_get('delta_themes', array());
  $themes = array();
  if (is_array($system_themes)) {
    foreach ($system_themes as $name => $theme) {

      // let's gather active themes only
      if (!$filter) {
        if ($theme->status == 1) {
          $themes[$name] = $theme->info['name'];
        }
      }
      else {
        if ($theme->status == 1 && isset($configurable_themes[$theme->name]) && $configurable_themes[$theme->name]) {
          $themes[$name] = $theme->info['name'];
        }
      }
    }
    return $themes;
  }
  return FALSE;
}