Creating Blocks using Dynamic (Coding) way:
global $base_path;
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Block name 1');
$blocks[1]['info'] = t('Block name 2');
return $blocks;
break;
case 'view':
switch ($delta) {
case 0:
$blocks['subject'] = t('');
$blocks['content'] = drupal_get_form('reset_form');
break;
case 1:
$blocks['subject'] = t('');
$blocks['content'] = drupal_get_form('login_form');
break;
}
return $blocks;
break;
}
}
function reset_form(){
$form['pass'] = array(
'#type' => 'textfield',
'#title' => t('Password'),
'#maxlength' => 15,
);
$form['conform_pass'] = array(
'#type' => 'password',
'#title' => t('ConformPassword'),
'#maxlength' => 15,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
function login_form(){
$form['mailid'] = array(
'#type' => 'textfield',
'#title' => t('Mail Id'),
'#maxlength' => 15,
);
$form['password'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#maxlength' => 15,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
After creating the block,assign it to the proper region.
No comments:
Post a Comment