array(
'render element' => 'elements',
'arguments' => array('elements'=>array())
),
);
}
/**
* accordion_blocks theme
*/
function theme_accordion_blocks($variables) {
$output = '
';
foreach($variables['elements'] as $key => $value) {
if (is_array($value) && array_key_exists('#children', $value)) {
$output .= $value['#children'];
}
}
$output .= '
';
return $output;
}
/**
* Implementation of hook_menu()
*/
function accordion_blocks_menu() {
//settings page
$items['admin/settings/accordion_blocks'] = array(
"title" => t("Accordion Blocks"),
"description" => t("Configure the Regions to apply Accordion effect."),
"page callback" => "drupal_get_form",
"page arguments" => array('accordion_blocks_settings_form'),
"access arguments" => array('administer site configuration'),
);
return $items;
}
/**
* callback for the url admin/settings/accordion_blocks
*/
function accordion_blocks_settings_form() {
$form = array();
global $user;
$themes = list_themes();
$theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');
$regions_list = system_region_list($theme);
$form['accordion_regions'] = array(
'#type' => 'checkboxes',
'#title' => t('Select Regions to apply Accordion effect'),
'#options' => $regions_list,
'#default_value' => variable_get('accordion_regions',array('sidebar_first', 'sidebar_second')),
);
return system_settings_form($form);
}