You are here

function _quotes_block_configure_save in Quotes 5

Quotes block configuration save.

1 call to _quotes_block_configure_save()
quotes_block in ./quotes.module
Implementation of hook_block().

File

./quotes.module, line 949

Code

function _quotes_block_configure_save($delta, $edit) {
  $vals = array(
    $edit['name'],
    $edit['block_type'],
    preg_replace('<[,\\s]+>', ',', trim($edit['nid_filter'])),
    implode(',', (array) $edit['aid_filter']),
    implode(',', (array) $edit['rid_filter']),
    implode(',', (array) $edit['uid_filter']),
    implode(',', (array) $edit['tid_filter']),
    $edit['cron_interval'] ? $edit['cron_interval'] : 0,
    $edit['cron_step'],
    // Make sure random and timed blocks have a count of 1.
    $edit['block_type'] == 0 || !empty($edit['cron_interval']) ? 1 : $edit['block_count'],
    $edit['show_titles'],
    $edit['show_citation'],
    // We only save the "more" text for random blocks.
    $edit['block_type'] == 0 ? $edit['block_more'] : NULL,
    $edit['view_text'],
    $edit['view_weight'],
    $edit['max_length'],
    // Frequency is only for random blocks.
    $edit['block_type'] == 0 ? $edit['rand_freq'] : 100,
    $delta,
  );
  db_query("UPDATE {quotes_blocks} SET name = '%s', block_type = %d, nid_filter = '%s', aid_filter = '%s', rid_filter = '%s',\n    uid_filter = '%s', tid_filter = '%s', cron_interval = %d, cron_step = %d,\n    count = %d, show_titles = %d, show_citation = %d, more_text = '%s',\n    view_text = '%s', view_weight = %d, max_length = %d, rand_freq = %d WHERE bid = %d", $vals);
}