You are here

function _amp_get_theme_options in Accelerated Mobile Pages (AMP) 7

Helper function to get available theme options.

1 call to _amp_get_theme_options()
amp_admin_form in ./amp.admin.inc
Form constructor for the AMP administration form.

File

./amp.admin.inc, line 197
Administrative page callbacks for the AMP module.

Code

function _amp_get_theme_options() {

  // Get system_sort_theme_by_info_name from system.admin.inc
  module_load_include('inc', 'system', 'system.admin');

  // Get all available themes.
  $themes = system_rebuild_theme_data();
  uasort($themes, 'system_sort_modules_by_info_name');
  $theme_options = array();
  foreach ($themes as &$theme) {

    // Do not show hidden themes.
    if (!empty($theme->info['hidden'])) {
      continue;
    }

    // Do not show disabled themes.
    if (!empty($theme->status)) {
      $theme_options[$theme->name] = $theme->info['name'];
    }
  }
  return $theme_options;
}