function node_skinr_form_index_handler in Skinr 6.2
Same name and namespace in other branches
- 6 modules/node.skinr.inc \node_skinr_form_index_handler()
Skinr form index handler.
Parameters
$op: What kind of action is being performed. Possible values:
- "form": the form elements for Skinr are being inserted in a form
- "submit": the form has been submitted.
&$form:
- For "form", passes in the $form parameter from hook_form_alter().
- For "submit", passes in the $form parameter from hook_form_submit().
$form_state:
- For "form", passes in the $form_state parameter from hook_form_alter().
- For "submit", passes in the $form_state parameter from hook_form_submit().
Return value
The index where we can find our values in Skinrs data structure.
Related topics
1 string reference to 'node_skinr_form_index_handler'
- node_skinr_config in modules/
node.skinr.inc - Implementation of hook_skinr_config().
File
- modules/
node.skinr.inc, line 51 - Provide skinr handling for node.module
Code
function node_skinr_form_index_handler($op, &$form, $form_state) {
switch ($op) {
case 'form':
return $form['#node_type']->type;
case 'submit':
// Clear old variable before we set a new one if the node type has changed
if ($form_state['values']['old_type'] != $form_state['values']['type']) {
foreach ($form_state['values']['skinr_settings']['node_group'] as $theme_name => $theme_data) {
$skinr = new stdClass();
$skinr->theme = $theme_name;
$skinr->module = 'node';
$skinr->sid = $form_state['values']['old_type'];
$skinr->skins = array();
skinr_set($skinr);
}
}
return $form_state['values']['type'];
}
}