register block

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy 2013-02-08 16:11:46 +01:00
parent 7bd9dd6d80
commit b8b7044eb3

View File

@ -20,3 +20,52 @@ function materio_user_menu_alter(&$items) {
$items['user/%user']['access callback'] = 'user_access';
$items['user/%user']['access arguments'] = array('view own user profile');
}
/**
* Implements hook_block_info().
*/
function materio_user_block_info() {
$blocks['user_register'] = array(
'info' => t('Register block'),
'cache' => DRUPAL_NO_CACHE
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function materio_user_block_view($delta = '') {
global $user, $language;
$block = array();
switch ($delta) {
case 'user_register':
if(isset($user->roles[1])){
$block['subject'] = t('Your projects will born from here');
$block['content'] = drupal_render(drupal_get_form('user_register_form'));
}
break;
}
return $block;
}
/**
* Implements hook_form_alter().
*/
function materio_user_form_alter(&$form, &$form_state, $form_id) {
// dsm($form_id);
if($form_id == "user_register_form" ){
// dsm($form);
$form['account']['pass']['#type'] = 'password';
$form['account']['pass']['#title'] = t('Password');
$form['actions']['#type'] = "container";
$form['actions']['submit']['#value'] = t('Join');
// $form['submit'] = $form['actions']['submit'];
// unset($form['actions']);
}
}