/** * Implements hook_form_alter */ function mymodule_form_alter(&$form, &$form_state, $form_id) { switch ($form_id) { case 'user_pass': // user pass page $form['name']['#title'] = t('请输入您的注册邮箱:'); $form['name']['#description'] = ''; $form['actions']['submit']['#value'] = t('确认>'); // $form['name']['#attributes'] = array('placeholder' => array(t('Your e-mail'))); break; case 'user_login': // user login page $form['name']['#size'] = 30; $form['pass']['#size'] = 30; $form['actions']['submit']['#value'] = t('确认提交'); $form['#attributes'] = array('class' => array('user-login')); /*$form['name']['#attributes'] = array('placeholder' => array(t('用户名或邮箱地址'))); $form['pass']['#attributes'] = array('placeholder' => array(t('输入您的登录密码')));*/ if (arg(0) && arg(1) && arg(0) == 'user' && arg(1) == 'login') { // drupal_set_title(t('登录')); $form['name']['#title'] = t('用户名或邮箱地址'); $form['pass']['#title'] = t('输入您的登录密码'); unset($form['name']['#description']); unset($form['pass']['#description']); } break; case 'user_register_form': // dpm($form); $form['account']['name']['#access'] = TRUE; $form['account']['name']['#title'] = t('用户名'); unset($form['account']['name']['#description']); $form['account']['mail']['#title'] = t('电子邮箱'); $form['actions']['submit']['#value'] = t('提交>'); unset($form['field_gender']['und']['#options']['_none']); unset($form['account']['mail']['#description']); unset($form['account']['current_pass']['#description']); unset($form['account']['pass']['#description']); $form['name'] = $form['account']['name']; $form['name']['#weight'] = 6; unset($form['account']['name']); if (variable_get('nocurrent_pass_disabled', TRUE)) { // searches the #validate array for the current_pass validation function, and removes it $key = array_search('user_validate_current_pass', $form['#validate']); if ($key !== FALSE) { unset($form['#validate'][$key]); } // hide the current password fields $form['account']['current_pass_required_value']['#access'] = FALSE; $form['account']['current_pass']['#access'] = FALSE; } $form['contract']=array( '#markup' => theme('user_register_contract'), '#weight' => 14 ); $form['argee'] = array( '#type' => 'checkbox', '#title' => t('我同意协议内容'), // '#description' => t('我同意协议内容'), '#required' => TRUE, '#weight' => 15 ); // dpm($form); $form['actions']['#weight'] = 20; $form['actions']['submit']['#states'] = array( // Hide the settings when the cancel notify checkbox is disabled. 'disabled' => array( ':input[name="argee"]' => array('checked' => FALSE), ), ); break; } }
相关推荐
Drupal提前检测用户名是否被注册模块。
包含:Drupal7宝典; Drupal开发指南; Using Drupal(强烈推荐) 值得你下载!
Drupal dataDrupal data
"Enterprise Drupal 8 Development: For Advanced Projects and Large Development Teams" English | ISBN: 1484202546 | 2017 | 309 pages | PDF | 9 MB Successfully architect a Drupal 8 website that scales ...
drupal6的安装,drupal6的安装drupal6的安装drupal6的安装
Drupal 自带有33个模块,基本上涵盖了当前网站所应具有的全部功能:用户管理、博客、论坛、评论、相册以及日志管理的,还有新闻聚合等Web 2.0 特性的功能。这些模块都是Drupal 的下载包中所附带的。有些被开启,有些...
drupal7 vs drupal6 详细的列出了从drupal6升级到drupal7所做的一些改动。 从代码,配置,UI,API等全方面的诠释drupal7与drupal6 的不同之处。
Decoupled Drupal in Practice: Architect and Implement Decoupled Drupal Architectures Across the Stack By 作者: Preston So ISBN-10 书号: 1484240715 ISBN-13 书号: 9781484240717 Edition 版本: 1st ed. ...
零起点学习Drupal教程零起点学习Drupal教程零起点学习Drupal教程
PHP 编程 Drupal Patch
Beginning Drupal 8 teaches you how to build, maintain, and manage Drupal 8-based web sites. The book covers what Drupal is, using Drupal when building a new web site, installing and configuring Drupal...
drupal7图文安装教程
Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册Drupal6开发手册
Drupal专业开发指南,这是drupal5版的。可能现在还有人用。
Drupal 7 高级开发第三版 Drupal7专业开发指南
Write a Drupal 8 module with custom functionality and hook into various extension points Master numerous Drupal 8 sub-systems and APIs Model, store, and manipulate data in various ways and for various...
Drupal宝典 用drupal建站必备
根据显示器的宽度 , 自动按照设定好的权重显示或隐藏一个列
Ideal for experienced Drupal developers, this book takes you through RWD basics and shows you how to build sites based on Aurora, Zen, and Omega—three popular base themes created by Drupal ...