function views_skinr_data_handler in Skinr 6.2
Same name and namespace in other branches
- 6 modules/views.skinr.inc \views_skinr_data_handler()
Skinr data handler. This is the data that populates the skinr form.
Parameters
&$form: Passes in the $form parameter from hook_form_submit().
$form_state: Passes in the $form_state parameter from hook_form_submit().
$module: The module that is currently being processed.
$form_settings: The settings from hook_skinr_config() for the form that's currently being processed.
Return value
A skinr object.
Related topics
1 string reference to 'views_skinr_data_handler'
- views_skinr_config in modules/
views.skinr.inc - Implementation of hook_skinr_config().
File
- modules/
views.skinr.inc, line 153 - Provide skinr handling for node.module
Code
function views_skinr_data_handler(&$form, $form_state, $theme, $module, $form_settings) {
// Ensure we have the required index_handler
if (empty($form_settings['index_handler'])) {
trigger_error(sprintf("No index_handler was found for form_id '%s' in module '%s'.", $form_id, $module), E_USER_ERROR);
}
$index = skinr_handler('form_index_handler', 'form', $form_settings['index_handler'], $form, $form_state);
// Fetch skinr data for this view from cache
views_include('cache');
if ($skinrs = views_object_cache_get('skinr', $form_state['view']->name)) {
if (isset($skinrs[$theme][$index])) {
$skinr = new stdClass();
$skinr->theme = $theme;
$skinr->module = $module;
$skinr->sid = $index;
$skinr->skins = $skinrs[$theme][$index];
return $skinr;
}
else {
return array();
}
}
// No data exists in cache, so let's grab it from the regular source
return skinr_get($theme, $module, $index);
}