81,84d80 < $items[] = array('path' => 'admin/block/regions', 'title' => t('regions'), < 'access' => user_access('administer blocks'), < 'callback' => 'block_box_regions', < 'type' => MENU_LOCAL_TASK); 211,212d206 < $block_regions = _block_regionarray(); < 215c209 < $row = array($block['info'], array('data' => form_checkbox(NULL, $block['module'] .']['. $block['delta'] .'][status', 1, $block['status']), 'align' => 'center'), form_weight(NULL, $block['module'] .']['. $block['delta'] .'][weight', $block['weight']), form_select(NULL, $block['module'] .']['. $block['delta'] .'][region', $block['region'], $block_regions)); --- > $row = array($block['info'], array('data' => form_checkbox(NULL, $block['module'] .']['. $block['delta'] .'][status', 1, $block['status']), 'align' => 'center'), form_weight(NULL, $block['module'] .']['. $block['delta'] .'][weight', $block['weight']), form_radios(NULL, $block['module'] .']['. $block['delta'] .'][region', $block['region'], array(t('left'), t('right')))); 344,378d337 < < /** < * Menu callback; handles region setup. < */ < function block_box_regions() { < $edit = $_POST['edit']; < $op = $_POST['op']; < < switch ($op) { < case t('Save regions'): < variable_set('block_regions', $edit['regions']); < drupal_set_message(t('Region settings have been changed.')); < drupal_goto('admin/block/regions'); < < default: < $regions = variable_get('block_regions',''); < $form = form_textarea(t('Regions'), 'regions', $regions, 50, 10, t('List of regions, one per line.')); < $form .= form_submit(t('Save regions')); < $output .= form($form); < } < < print theme('page', $output); < } < < //internal function < function _block_regionarray() { < $regions = array(t('left'), t('right')); < if ($regionsource = explode("\n",trim(variable_get('block_regions','')))) { < foreach($regionsource as $regionlabel) { < array_push($regions, trim($regionlabel)); < } < } < return $regions; < } < 444,454d402 < //calculate regionid < $block_regions = _block_regionarray(); < < if (in_array($region, $block_regions)) { < $regionid = array_search($region, $block_regions); < } < else { < $regionid = '-1'; < } < < 457c405 < $result = db_query('SELECT * FROM {blocks} WHERE status = 1 '. ($region != 'all' ? 'AND region = '.$regionid.' ' : '') .'ORDER BY weight, module'); --- > $result = db_query('SELECT * FROM {blocks} WHERE status = 1 '. ($region != 'all' ? 'AND region = %d ' : '') .'ORDER BY weight, module', $region == 'left' ? 0 : 1);