function comment_skinr_form_index_handler in Skinr 6
Same name and namespace in other branches
- 6.2 modules/comment.skinr.inc \comment_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 'comment_skinr_form_index_handler'
- comment_skinr_data in modules/
comment.skinr.inc - Implementation of hook_skinr_data().
File
- modules/
comment.skinr.inc, line 46 - Provide skinr handling for comment.module
Code
function comment_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']['comment_group'] as $theme_name => $theme_data) {
skinr_set($theme_name, 'comment', $form_state['values']['old_type'], '');
}
}
return $form_state['values']['type'];
}
}