You are here

function delta_get_theme_settings_templates in Delta 7

Same name and namespace in other branches
  1. 6 delta.module \delta_get_theme_settings_templates()

Pull an object of available templates for the currently selected theme

Parameters

$theme:

2 calls to delta_get_theme_settings_templates()
delta_manage_override_form in ./delta.module
delta_theme_overrides_form in ./delta.module
Generate the override list page.

File

./delta.module, line 467
The Delta Theme API is an advanced manipulation of the Theme Settings API to allow for customization/configuration of theme settings based on node types, context, or groups of paths.

Code

function delta_get_theme_settings_templates($theme = FALSE) {

  // pull select records only from a single theme
  if ($theme) {
    $result = db_query("\n      SELECT \n        tid, name \n      FROM {delta_theme_settings} \n      WHERE theme = '%s'\n      ORDER BY name ASC", $theme);
    while ($delta = db_fetch_object($result)) {
      $data[$delta->tid] = $delta->name;
    }
  }
  else {
    $result = db_query("\n      SELECT \n        tid, name, theme\n      FROM {delta_theme_settings} \n      ORDER BY theme ASC, name ASC");
    while ($delta = db_fetch_object($result)) {
      $data[$delta->theme][$delta->tid] = $delta->name;
    }
  }
  return $data;
}