update to D 7.17

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2012-12-08 11:35:42 +01:00
parent 975d758599
commit 5396b3e2b5
284 changed files with 3674 additions and 1854 deletions

View File

@@ -5,8 +5,8 @@ version = VERSION
core = 7.x
hidden = TRUE
; Information added by drupal.org packaging script on 2012-10-17
version = "7.16"
; Information added by drupal.org packaging script on 2012-11-07
version = "7.17"
project = "drupal"
datestamp = "1350508567"
datestamp = "1352325357"

View File

@@ -12,6 +12,8 @@
* check_plain() before use.
*
* @see template_preprocess_user_picture()
*
* @ingroup themeable
*/
?>
<?php if ($user_picture): ?>

View File

@@ -30,6 +30,8 @@
* @see user-profile-item.tpl.php
* Where the html is handled for each item in the group.
* @see template_preprocess_user_profile()
*
* @ingroup themeable
*/
?>
<div class="profile"<?php print $attributes; ?>>

View File

@@ -299,6 +299,14 @@ function hook_user_login(&$edit, $account) {
/**
* The user just logged out.
*
* Note that when this hook is invoked, the changes have not yet been written to
* the database, because a database transaction is still in progress. The
* transaction is not finalized until the save operation is entirely completed
* and user_save() goes out of scope. You should not rely on data in the
* database at this time as it is not updated yet. You should also note that any
* write/update database queries executed from this hook are also not committed
* immediately. Check user_save() and db_transaction() for more info.
*
* @param $account
* The user object on which the operation was just performed.
*/
@@ -317,6 +325,14 @@ function hook_user_logout($account) {
* The module should format its custom additions for display and add them to the
* $account->content array.
*
* Note that when this hook is invoked, the changes have not yet been written to
* the database, because a database transaction is still in progress. The
* transaction is not finalized until the save operation is entirely completed
* and user_save() goes out of scope. You should not rely on data in the
* database at this time as it is not updated yet. You should also note that any
* write/update database queries executed from this hook are also not committed
* immediately. Check user_save() and db_transaction() for more info.
*
* @param $account
* The user object on which the operation is being performed.
* @param $view_mode

View File

@@ -9,8 +9,8 @@ required = TRUE
configure = admin/config/people
stylesheets[all][] = user.css
; Information added by drupal.org packaging script on 2012-10-17
version = "7.16"
; Information added by drupal.org packaging script on 2012-11-07
version = "7.17"
project = "drupal"
datestamp = "1350508567"
datestamp = "1352325357"

View File

@@ -384,7 +384,7 @@ function user_update_dependencies() {
* An array of permissions names.
* @param $module
* The name of the module defining the permissions.
* @ingroup update-api-6.x-to-7.x
* @ingroup update_api
*/
function _update_7000_user_role_grant_permissions($rid, array $permissions, $module) {
// Grant new permissions for the role.

View File

@@ -187,7 +187,7 @@ function user_entity_info() {
}
/**
* Entity uri callback.
* Entity URI callback.
*/
function user_uri($user) {
return array(
@@ -1307,7 +1307,6 @@ function user_login_block($form) {
);
$form['pass'] = array('#type' => 'password',
'#title' => t('Password'),
'#maxlength' => 60,
'#size' => 15,
'#required' => TRUE,
);
@@ -1873,7 +1872,7 @@ function user_menu_link_alter(&$link) {
*/
function user_translated_menu_link_alter(&$link) {
// Hide the "User account" link for anonymous users.
if ($link['link_path'] == 'user' && $link['module'] == 'system' && user_is_anonymous()) {
if ($link['link_path'] == 'user' && $link['module'] == 'system' && !$GLOBALS['user']->uid) {
$link['hidden'] = 1;
}
}
@@ -2574,6 +2573,14 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) {
// Remove previously built content, if exists.
$account->content = array();
// Allow modules to change the view mode.
$context = array(
'entity_type' => 'user',
'entity' => $account,
'langcode' => $langcode,
);
drupal_alter('entity_view_mode', $view_mode, $context);
// Build fields content.
field_attach_prepare_view('user', array($account->uid => $account), $view_mode, $langcode);
entity_prepare_view('user', array($account->uid => $account), $langcode);
@@ -2582,6 +2589,10 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) {
// Populate $account->content with a render() array.
module_invoke_all('user_view', $account, $view_mode, $langcode);
module_invoke_all('entity_view', $account, 'user', $view_mode, $langcode);
// Make sure the current view mode is stored if no module has already
// populated the related key.
$account->content += array('#view_mode' => $view_mode);
}
/**

View File

@@ -1487,7 +1487,7 @@ class UserAutocompleteTestCase extends DrupalWebTestCase {
/**
* Test user-links in secondary menu.
* Tests user links in the secondary menu.
*/
class UserAccountLinksUnitTests extends DrupalWebTestCase {
public static function getInfo() {
@@ -1498,6 +1498,10 @@ class UserAccountLinksUnitTests extends DrupalWebTestCase {
);
}
function setUp() {
parent::setUp('menu');
}
/**
* Tests the secondary menu.
*/
@@ -1533,6 +1537,36 @@ class UserAccountLinksUnitTests extends DrupalWebTestCase {
$element = $this->xpath('//ul[@id=:menu_id]', array(':menu_id' => 'secondary-menu-links'));
$this->assertEqual(count($element), 0, 'No secondary-menu for logged-out users.');
}
/**
* Tests disabling the 'My account' link.
*/
function testDisabledAccountLink() {
// Create an admin user and log in.
$this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer menu')));
// Verify that the 'My account' link is enabled.
$this->drupalGet('admin/structure/menu/manage/user-menu');
$this->assertFieldChecked('edit-mlid2-hidden', "The 'My account' link is enabled by default.");
// Disable the 'My account' link.
$edit = array(
'mlid:2[hidden]' => FALSE,
);
$this->drupalPost('admin/structure/menu/manage/user-menu', $edit, t('Save configuration'));
// Get the homepage.
$this->drupalGet('<front>');
// Verify that the 'My account' link does not appear when disabled.
$link = $this->xpath('//ul[@id=:menu_id]/li/a[contains(@href, :href) and text()=:text]', array(
':menu_id' => 'secondary-menu-links',
':href' => 'user',
':text' => 'My account',
));
$this->assertEqual(count($link), 0, 'My account link is not in the secondary menu.');
}
}
/**