You are here

function block_skinr_preprocess_hook_callback in Skinr 6.2

Skinr preprocess_hook_callback.

Parameters

&$form: Passes in the $form parameter from hook_form_alter().

$form_state: Passes in the $form_state parameter from hook_form_alter().

Return value

The preprocess_hook we wish to use.

Related topics

1 string reference to 'block_skinr_preprocess_hook_callback'
block_skinr_config in modules/block.skinr.inc
Implementation of hook_skinr_config().

File

modules/block.skinr.inc, line 86
Provide skinr handling for block.module

Code

function block_skinr_preprocess_hook_callback(&$form, $form_state) {
  $preprocess_hooks = array();
  if (!isset($form['module']['#value']) && isset($form['skinr']['sid']['#value'])) {
    list($module, $delta) = explode('-', $form['skinr']['sid']['#value'], 2);
    $result = db_query_range(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b WHERE b.module = '%s' AND b.delta = '%s'", 'b', 'bid'), $module, $delta, 0, 1);
    while ($block = db_fetch_object($result)) {
      $preprocess_hooks[] = 'block_' . $block->module;
    }
  }
  else {
    $preprocess_hooks[] = 'block_' . $form['module']['#value'];
  }
  $preprocess_hooks[] = 'block';
  return $preprocess_hooks;
}