Hello,
I'm making a small website using drupal; The front page has block i made in which you click options that affect the visibility of some of the left bar menus;
My idea was to use a simple url variable pass to then update a php global variable; Having this variable set to different value i would specify that block and articles would be visible only when the variable is set a the corresponding value.
Here is the code of the module i made:
//Information about the hook.
function versite_block_info() {
$blocks = array();
$blocks['versite'] = array(
'info' => t('Choix de la version du site')
);
return $blocks;
}
// Block content.
function versite_block_view($delta = ''){
$block = array();
//Declaration of the global variable.
global $item;
//The local variable that will have its values changed according to the options.
$vversite="";
//Affectation of the local variable value to the global variable.
$item=$vversite;
$block['subject'] = "versite";
// The Block content consists in 3 links with variable passed in.
$block['content'] = 'Complete/Ask 76 Rouen/Location';
return $block;