function _themekey_path_set in ThemeKey 6
Function _themekey_path_set().
3 calls to _themekey_path_set()
- themekey_ui_set_path_theme in ./
themekey_ui_helper.inc - Function themekey_ui_set_path_theme().
- _themekey_paths_submit in ./
themekey_admin.inc - Function _themekey_paths_submit().
- _themekey_rebuild in ./
themekey_build.inc - Function _themekey_rebuild().
File
- ./
themekey_build.inc, line 116
Code
function _themekey_path_set(&$item, $custom = TRUE) {
$item['callbacks'] = isset($item['callbacks']) && !empty($item['callbacks']) ? $item['callbacks'] : array();
$item['conditions'] = isset($item['conditions']) && !empty($item['conditions']) ? $item['conditions'] : array();
if (!is_array($item['conditions'])) {
$item['conditions'] = preg_split('/;[\\s?]/', $item['conditions']);
}
list($item['fit'], $item['weight'], $item['wildcards']) = _themekey_prepare_path($item['path']);
$item['custom'] = $custom;
if (!isset($item['id'])) {
if ($id = db_result(db_query('SELECT id FROM {themekey_paths} WHERE path = \'%s\' AND custom = %d', $item['path'], $item['custom']))) {
$item['id'] = $id;
}
}
drupal_write_record('themekey_paths', $item, isset($item['id']) ? 'id' : array());
}