You are here

function facebook_boxes_block_save in Facebook Boxes 7

Implements hook_block_save()

File

./facebook_boxes.module, line 209

Code

function facebook_boxes_block_save($delta = '', $edit = array()) {
  if ($delta == 'fb_like') {
    variable_set('fb_like_url', $edit['fb_url']);
    variable_set('fb_like_width', $edit['fb_width']);
    variable_set('fb_like_height', $edit['fb_height']);
    variable_set('fb_like_colorscheme', $edit['fb_colorscheme']);
    variable_set('fb_like_border', $edit['fb_border']);
    $toggles = array();
    foreach ($edit['fb_toggles'] as $key => $val) {
      if ($val) {
        $toggles[] = $key;
      }
    }
    variable_set('fb_like_toggles', $toggles);
  }
  elseif ($delta == 'fb_rec') {
    variable_set('fb_rec_domain', $edit['fb_domain']);
    variable_set('fb_rec_width', $edit['fb_width']);
    variable_set('fb_rec_height', $edit['fb_height']);
    variable_set('fb_rec_colorscheme', $edit['fb_colorscheme']);
    variable_set('fb_rec_border', $edit['fb_border']);
    $toggles = array();
    foreach ($edit['fb_toggles'] as $key => $val) {
      if ($val) {
        $toggles[] = $key;
      }
    }
    variable_set('fb_rec_toggles', $toggles);
  }
  elseif ($delta == 'fb_follow') {
    variable_set('fb_follow_url', $edit['fb_follow_url']);
    variable_set('fb_follow_layout', $edit['fb_follow_layout']);
    variable_set('fb_follow_showface', $edit['fb_follow_showface']);
    variable_set('fb_follow_colorscheme', $edit['fb_follow_colorscheme']);
    variable_set('fb_follow_font', $edit['fb_follow_font']);
    variable_set('fb_follow_width', $edit['fb_follow_width']);
  }
}