You are here

function themekey_ui_get_path_theme in ThemeKey 6.4

Same name and namespace in other branches
  1. 6 themekey_ui_helper.inc \themekey_ui_get_path_theme()
  2. 6.2 themekey_ui_helper.inc \themekey_ui_get_path_theme()
  3. 6.3 themekey_ui_helper.inc \themekey_ui_get_path_theme()
  4. 7.3 themekey_ui_helper.inc \themekey_ui_get_path_theme()
  5. 7 themekey_ui_helper.inc \themekey_ui_get_path_theme()
  6. 7.2 themekey_ui_helper.inc \themekey_ui_get_path_theme()

Returns a theme assigned to a Drupal path alias using a ThemeKey Theme Switching Rule which is not part of a chain

Parameters

$path: drupal path as string

Return value

array with two elements:

  • id of the database entry in table themekey_properties or '0' if no entry exists
  • the theme
1 call to themekey_ui_get_path_theme()
themekey_ui_pathalias in ./themekey_ui_admin.inc
Adds theme select box to url alias form

File

./themekey_ui_helper.inc, line 33

Code

function themekey_ui_get_path_theme($path) {
  $serialized_empty_array = serialize(array());
  if ($result = db_query("SELECT id, theme FROM {themekey_properties} WHERE property = 'drupal:path' AND operator = '=' AND value = '%s' AND wildcards = '%s' AND parent = 0", $path, $serialized_empty_array)) {
    while ($row = db_fetch_array($result)) {
      if (!db_result(db_query("SELECT COUNT(*) FROM {themekey_properties} WHERE parent = %d", $row['id']))) {
        return array(
          $row['id'],
          $row['theme'],
        );
      }
    }
  }
  return array(
    0,
    'default',
  );
}