diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index 58cf0ee..eccda17 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -183,7 +183,7 @@ function addCustomMenu() { 'machine_name' => $this->randomName(8), 'region' => 'sidebar_first', ); - $this->drupalPost("admin/structure/block/manage/system_menu_block:$menu_name", $block, t('Save block')); + $this->drupalPost("admin/structure/block/manage/menu_menu_block:$menu_name/$default_theme", $block, t('Save block')); $this->assertResponse(200); return menu_load($menu_name); diff --git a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php index c833b4b..c9ad3d3 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php +++ b/core/modules/user/lib/Drupal/user/Plugin/block/block/UserLoginBlock.php @@ -27,8 +27,36 @@ public function access() { * Implements BlockInterface::build(). */ public function build() { + $form = drupal_get_form('user_login_form'); + unset($form['name']['#attributes']['autofocus']); + unset($form['name']['#description']); + unset($form['pass']['#description']); + $form['name']['#size'] = 15; + $form['pass']['#size'] = 15; + $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE)); + // Build action links. + $items = array(); + if (config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { + $items['create_account'] = l(t('Create new account'), 'user/register', array( + 'attributes' => array( + 'title' => t('Create a new user account.'), + 'class' => array('create-account-link'), + ), + )); + } + $items['request_password'] = l(t('Request new password'), 'user/password', array( + 'attributes' => array( + 'title' => t('Request new password via e-mail.'), + 'class' => array('request-password-link'), + ), + )); return array( - drupal_get_form('user_login_form') + '#title' => t('User login'), + 'user_login_form' => $form, + 'user_links' => array( + '#theme' => 'item_list', + '#items' => $items, + ), ); } }