You are here

function blocktheme_format_vars in Block Theme 7

Same name and namespace in other branches
  1. 8 blocktheme.module \blocktheme_format_vars()
  2. 6 blocktheme.module \blocktheme_format_vars()

Formats custom variables as an array to be used in the block template.

2 calls to blocktheme_format_vars()
blocktheme_save in ./blocktheme.module
Save a new block after the block form has been submitted.
blocktheme_update in ./blocktheme.module
Update an existing block after the block form has been submitted.

File

./blocktheme.module, line 265
Provides a configuration option to select custom themes for blocks

Code

function blocktheme_format_vars($block_vars) {
  $formatted_vars = array();
  if ($block_vars) {
    $_sets = explode("\n", $block_vars);
    foreach ($_sets as $key => $value) {
      $set = explode('|', $value);
      $formatted_vars[$set[0]] = $set[1];
    }
  }
  return $formatted_vars;
}