| 27 |
drupal_add_js($module_path . '/blockbar.js'); |
drupal_add_js($module_path . '/blockbar.js'); |
| 28 |
$sent[drupal_get_path('module','blockbar') . '/blockbar.js'] = TRUE; |
$sent[drupal_get_path('module','blockbar') . '/blockbar.js'] = TRUE; |
| 29 |
} |
} |
| 30 |
|
|
| 31 |
|
static $block_bars = array(); |
| 32 |
|
if (isset($block_bars[$block_num])) { |
| 33 |
|
drupal_set_message('Block Bar is missconfigured! Make sure you didn\t assign a Block Bar to the same region that was specified as the "Source Region" in the Block Bar configuration page.'); |
| 34 |
|
return; |
| 35 |
|
} |
| 36 |
|
$block_bars[$block_num] = TRUE; |
| 37 |
|
|
| 38 |
// get all blocks assigned to the region thats assigned to this blockbar |
// get all blocks assigned to the region thats assigned to this blockbar |
| 39 |
$blocks = blockbar_block_list(variable_get('blockbar_region' . $block_num, NULL)); |
$blocks = blockbar_block_list(variable_get('blockbar_region' . $block_num, NULL)); |
| 100 |
); |
); |
| 101 |
$form['blockbar_region' . $block_num] = array( |
$form['blockbar_region' . $block_num] = array( |
| 102 |
'#type' => 'select', |
'#type' => 'select', |
| 103 |
'#title' => t('Region'), |
'#title' => t('Source Region'), |
| 104 |
'#default_value' => variable_get('blockbar_region' . $block_num, NULL), '#options' => _blockbar_region_list(), |
'#default_value' => variable_get('blockbar_region' . $block_num, NULL), '#options' => _blockbar_region_list(), |
| 105 |
'#description' => t('Select the source region.') |
'#description' => t('Select the source region. This is the region that the Block Bar will look to for it\'s contents. It is NOT the region where the Block Bar itself will be placed. This MUST be a custom region. If you have not defined any new custom regions there will be nothing here to select. Please see the Drupal handbook on how to create custom regions. Also, DO NOT place this Block Bar block within the same source region you have selected here or you will get a Block Bar configuration error. Please see the Block Bar readme for more detailed configuration information.') |
| 106 |
); |
); |
| 107 |
$form['blockbar_save_state' . $block_num] = array( |
$form['blockbar_save_state' . $block_num] = array( |
| 108 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
| 161 |
'footer'); |
'footer'); |
| 162 |
|
|
| 163 |
$block_regions = system_region_list($theme_key); |
$block_regions = system_region_list($theme_key); |
| 164 |
|
$return = array(); |
| 165 |
foreach ($block_regions as $region) { |
foreach ($block_regions as $key => $region) { |
| 166 |
if (!in_array($region, $default_regions)) { |
if (!in_array($region, $default_regions)) { |
| 167 |
$return[] = $region; |
$return = array_merge($return,array($key => $region)); |
| 168 |
} |
} |
| 169 |
} |
} |
| 170 |
//return $return; |
//return system_region_list($theme_key); |
| 171 |
// !!!!!! Need to fix this function !!!!!!!!!!!!!! |
return $return; |
|
return system_region_list($theme_key); |
|
|
|
|
| 172 |
} |
} |
| 173 |
|
|
| 174 |
function blockbar_block_list($region){ |
function blockbar_block_list($region){ |