updated core and some modules
This commit is contained in:
@@ -5,9 +5,9 @@ core = 7.x
|
||||
files[] = token_test.module
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-02-28
|
||||
version = "7.x-1.6"
|
||||
; Information added by Drupal.org packaging script on 2017-01-25
|
||||
version = "7.x-1.7"
|
||||
core = "7.x"
|
||||
project = "token"
|
||||
datestamp = "1425149060"
|
||||
datestamp = "1485316088"
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ description = Provides a user interface for the Token API and some missing core
|
||||
core = 7.x
|
||||
files[] = token.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-02-28
|
||||
version = "7.x-1.6"
|
||||
; Information added by Drupal.org packaging script on 2017-01-25
|
||||
version = "7.x-1.7"
|
||||
core = "7.x"
|
||||
project = "token"
|
||||
datestamp = "1425149060"
|
||||
datestamp = "1485316088"
|
||||
|
||||
|
||||
@@ -21,18 +21,12 @@ function token_requirements($phase = 'runtime') {
|
||||
$problems = array_unique($problem['problems']);
|
||||
$problems = array_map('check_plain', $problems);
|
||||
$token_problems[$problem_key] = $problem['label'] . theme('item_list', array('items' => $problems));
|
||||
$requirements['token-' . $problem_key] = array(
|
||||
'title' => $problem['label'],
|
||||
'value' => theme('item_list', array('items' => $problems)),
|
||||
'severity' => $problem['severity'],
|
||||
);
|
||||
}
|
||||
else {
|
||||
unset($token_problems[$problem_key]);
|
||||
}
|
||||
}
|
||||
if (!empty($token_problems)) {
|
||||
$requirements['token_problems'] = array(
|
||||
'title' => $t('Tokens'),
|
||||
'value' => $t('Problems detected'),
|
||||
'severity' => REQUIREMENT_WARNING,
|
||||
'description' => '<p>' . implode('</p><p>', $token_problems) . '</p>', //theme('item_list', array('items' => $token_problems)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,19 +266,24 @@ function token_get_token_problems() {
|
||||
$token_info = token_info();
|
||||
$token_problems = array(
|
||||
'not-array' => array(
|
||||
'label' => t('The following tokens or token types are not defined as arrays:'),
|
||||
'label' => t('Tokens or token types not defined as arrays'),
|
||||
'severity' => REQUIREMENT_ERROR,
|
||||
),
|
||||
'missing-info' => array(
|
||||
'label' => t('The following tokens or token types are missing required name and/or description information:'),
|
||||
'label' => t('Tokens or token types missing name property'),
|
||||
'severity' => REQUIREMENT_WARNING,
|
||||
),
|
||||
'type-no-tokens' => array(
|
||||
'label' => t('The following token types do not have any tokens defined:'),
|
||||
'label' => t('Token types do not have any tokens defined'),
|
||||
'severity' => REQUIREMENT_INFO,
|
||||
),
|
||||
'tokens-no-type' => array(
|
||||
'label' => t('The following token types are not defined but have tokens:'),
|
||||
'label' => t('Token types are not defined but have tokens'),
|
||||
'severity' => REQUIREMENT_INFO,
|
||||
),
|
||||
'duplicate' => array(
|
||||
'label' => t('The following token or token types are defined by multiple modules:')
|
||||
'label' => t('Token or token types are defined by multiple modules'),
|
||||
'severity' => REQUIREMENT_ERROR,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -295,9 +294,12 @@ function token_get_token_problems() {
|
||||
$token_problems['not-array']['problems'][] = "\$info['types']['$type']";
|
||||
continue;
|
||||
}
|
||||
elseif (!isset($type_info['name']) || !isset($type_info['description'])) {
|
||||
elseif (!isset($type_info['name'])) {
|
||||
$token_problems['missing-info']['problems'][] = "\$info['types']['$type']";
|
||||
}
|
||||
elseif (is_array($type_info['name'])) {
|
||||
$token_problems['duplicate']['problems'][] = "\$info['types']['$type']";
|
||||
}
|
||||
elseif (empty($token_info['tokens'][$real_type])) {
|
||||
$token_problems['type-no-tokens']['problems'][] = "\$info['tokens']['$real_type']";
|
||||
}
|
||||
@@ -315,10 +317,10 @@ function token_get_token_problems() {
|
||||
$token_problems['not-array']['problems'][] = "\$info['tokens']['$type']['$token']";
|
||||
continue;
|
||||
}
|
||||
elseif (!isset($tokens[$token]['name']) || !isset($tokens[$token]['description'])) {
|
||||
elseif (!isset($tokens[$token]['name'])) {
|
||||
$token_problems['missing-info']['problems'][] = "\$info['tokens']['$type']['$token']";
|
||||
}
|
||||
elseif (is_array($tokens[$token]['name']) || is_array($tokens[$token]['description'])) {
|
||||
elseif (is_array($tokens[$token]['name'])) {
|
||||
$token_problems['duplicate']['problems'][] = "\$info['tokens']['$type']['$token']";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,11 @@ function token_form_block_admin_configure_alter(&$form, $form_state) {
|
||||
*/
|
||||
function token_field_widget_form_alter(&$element, &$form_state, $context) {
|
||||
if (!empty($element['#description']) && !empty($context['instance']['description'])) {
|
||||
$element['#description'] = filter_xss_admin(token_replace($context['instance']['description']));
|
||||
$instance = $context['instance'];
|
||||
if (module_exists('i18n_field')) {
|
||||
$instance = i18n_string_object_translate('field_instance', $instance);
|
||||
}
|
||||
$element['#description'] = field_filter_xss(token_replace($instance['description']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,15 +723,13 @@ function token_element_validate(&$element, &$form_state) {
|
||||
|
||||
// Validate if an element must have a minimum number of tokens.
|
||||
if (isset($element['#min_tokens']) && count($tokens) < $element['#min_tokens']) {
|
||||
// @todo Change this error message to include the minimum number.
|
||||
$error = format_plural($element['#min_tokens'], 'The %element-title cannot contain fewer than one token.', 'The %element-title must contain at least @count tokens.', array('%element-title' => $title));
|
||||
$error = format_plural($element['#min_tokens'], '%name must contain at least one token.', '%name must contain at least @count tokens.', array('%name' => $title));
|
||||
form_error($element, $error);
|
||||
}
|
||||
|
||||
// Validate if an element must have a maximum number of tokens.
|
||||
if (isset($element['#max_tokens']) && count($tokens) > $element['#max_tokens']) {
|
||||
// @todo Change this error message to include the maximum number.
|
||||
$error = format_plural($element['#max_tokens'], 'The %element-title must contain as most one token.', 'The %element-title must contain at most @count tokens.', array('%element-title' => $title));
|
||||
$error = format_plural($element['#max_tokens'], '%name must contain at most one token.', '%name must contain at most @count tokens.', array('%name' => $title));
|
||||
form_error($element, $error);
|
||||
}
|
||||
|
||||
@@ -735,7 +737,7 @@ function token_element_validate(&$element, &$form_state) {
|
||||
if (isset($element['#token_types'])) {
|
||||
$invalid_tokens = token_get_invalid_tokens_by_context($tokens, $element['#token_types']);
|
||||
if ($invalid_tokens) {
|
||||
form_error($element, t('The %element-title is using the following invalid tokens: @invalid-tokens.', array('%element-title' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens))));
|
||||
form_error($element, t('%name is using the following invalid tokens: @invalid-tokens.', array('%name' => $title, '@invalid-tokens' => implode(', ', $invalid_tokens))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -983,7 +985,7 @@ function _token_build_tree($token_type, array $options) {
|
||||
// parent.
|
||||
$token_parents[] = $token_type;
|
||||
}
|
||||
elseif (in_array($token, array_slice($token_parents, 1))) {
|
||||
elseif (in_array($token, array_slice($token_parents, 1), TRUE)) {
|
||||
// Prevent duplicate recursive tokens. For example, this will prevent
|
||||
// the tree from generating the following tokens or deeper:
|
||||
// [comment:parent:parent]
|
||||
|
||||
@@ -199,7 +199,7 @@ function _token_token_tree_format_row($token, array $token_info, $is_group = FAL
|
||||
$row = $defaults;
|
||||
$row['id'] = _token_clean_css_identifier($token);
|
||||
$row['data']['name'] = $token_info['name'];
|
||||
$row['data']['description'] = $token_info['description'];
|
||||
$row['data']['description'] = isset($token_info['description']) ? $token_info['description'] : '';
|
||||
|
||||
if ($is_group) {
|
||||
// This is a token type/group.
|
||||
@@ -207,6 +207,7 @@ function _token_token_tree_format_row($token, array $token_info, $is_group = FAL
|
||||
}
|
||||
else {
|
||||
// This is a token.
|
||||
$row['data']['token'] = array();
|
||||
$row['data']['token']['data'] = $token;
|
||||
$row['data']['token']['class'][] = 'token-key';
|
||||
if (isset($token_info['value'])) {
|
||||
|
||||
@@ -1392,7 +1392,6 @@ function field_token_info_alter(&$info) {
|
||||
*/
|
||||
function field_tokens($type, $tokens, array $data = array(), array $options = array()) {
|
||||
$replacements = array();
|
||||
$sanitize = !empty($options['sanitize']);
|
||||
$langcode = isset($options['language']) ? $options['language']->language : NULL;
|
||||
|
||||
// Entity tokens.
|
||||
@@ -1437,7 +1436,7 @@ function field_tokens($type, $tokens, array $data = array(), array $options = ar
|
||||
/**
|
||||
* Pre-render callback for field output used with tokens.
|
||||
*/
|
||||
function token_pre_render_field_token(&$elements) {
|
||||
function token_pre_render_field_token($elements) {
|
||||
// Remove the field theme hook, attachments, and JavaScript states.
|
||||
unset($elements['#theme']);
|
||||
unset($elements['#states']);
|
||||
|
||||
@@ -8,9 +8,9 @@ files[] = i18n_object.inc
|
||||
files[] = i18n.test
|
||||
configure = admin/config/regional/i18n
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Troubleshooting
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Block languages module, part of the Internationalization (https://www.drupal.org/project/i18n) package, allows the user to configure for which languages each block is visible.
|
||||
|
||||
* For a full description of the module, visit https://www.drupal.org/node/1279698
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
Internationalization - https://www.drupal.org/project/i18n
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views - https://www.drupal.org/project/i18nviews
|
||||
* Language Icons - https://www.drupal.org/project/languageicons
|
||||
* Translation Overview - https://www.drupal.org/project/translation_overview
|
||||
* Localization Client - https://www.drupal.org/project/l10n_client
|
||||
* Internationalization contributions - https://www.drupal.org/project/i18n_contrib
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
The settings for visibility per language are provided under Visibility Settings via the Languages tab when configuring a block.
|
||||
|
||||
The Languages tab also provides a setting for whether the block is translatable. For custom blocks, the block title and the block content will be translatable. For blocks defined by modules, only the block title will be translatable. If "Make this block translatable" is selected, a Translate tab will appear for that block. This tab provides a UI for adding translations of the block in each available language.
|
||||
|
||||
|
||||
TROUBLESHOOTING
|
||||
---------------
|
||||
|
||||
Conflicts with Context
|
||||
|
||||
The Block languages module conflicts with the Context module, which alters how blocks are rendered. This issue can be tracked in the Internationalization issue queue: http://drupal.org/node/1343044
|
||||
|
||||
String Errors
|
||||
|
||||
The user must allow your used string format to be translated on admin/config/regional/i18n/strings or you are going to have a error message like "The string blocks:block:1:body for textgroup blocks is not allowed for translation because of its text format."
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -8,9 +8,9 @@ files[] = i18n_block.inc
|
||||
files[] = i18n_block.test
|
||||
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Contact translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, helps with the multilingual configuration of the site contact forms. This module makes contact categories and replies available for translation.
|
||||
|
||||
* For a full description of the module, visit https://www.drupal.org/node/1396984
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes, visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. See https://drupal.org/documentation/install/modules-themes/modules-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
1. Enable the Contact translation module included with the Internationalization module.
|
||||
2. Go to Administration > Structure > Contact form.
|
||||
3. Click edit for the form to configure.
|
||||
4. Click the Translate tab.
|
||||
5. Click the translate link for a language.
|
||||
6. Translate the Category and Auto-reply text.
|
||||
7. Click Save translation.
|
||||
8. Repeat steps 5 to 7 for each language.
|
||||
9. Repeat steps 2 to 8 for all forms.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -5,9 +5,9 @@ dependencies[] = i18n_string
|
||||
package = Multilingual - Internationalization
|
||||
core = 7.x
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Field translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, allows for translation of text associated with a field's settings including the label, help text, default value, and list options.
|
||||
|
||||
* For a full description of the module, visit this page https://www.drupal.org/node/1279346
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://drupal.org/documentation/install/modules-themes/modules-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
1. Enable the Field translation module included with Internationalization.
|
||||
2. Go to Administration > Configuration > Regional and language > Translate interface.
|
||||
3. Click on Filter Translatable Strings field set and limit search to fields.
|
||||
4. Edit the desired field and Save.
|
||||
For the translation to be displayed, you need to use some of the Field Formatters provided by this module whose name usually ends up in 'translated'. For most core fields it is Default translated.
|
||||
|
||||
Note: The Field Translation module does not provide content translation for fields. This functionality is provided by the Entity Translation (ET) module.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -6,9 +6,9 @@ package = Multilingual - Internationalization
|
||||
core = 7.x
|
||||
files[] = i18n_field.inc
|
||||
files[] = i18n_field.test
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -446,3 +446,69 @@ function i18n_field_type_info($type = NULL, $property = NULL) {
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_field_info_alter().
|
||||
*/
|
||||
function i18n_field_field_info_alter(&$field_info) {
|
||||
foreach(array_keys($field_info) as $type) {
|
||||
$field_info[$type]['property_callbacks'][] = 'i18n_field_entity_property_callback';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to translate entity property info for a fields.
|
||||
*
|
||||
* @see entity_metadata_field_entity_property_info()
|
||||
* @see entity_metadata_field_default_property_callback()
|
||||
* @see i18n_field_i18n_object_info_alter()
|
||||
* @see hook_module_implements_alter()
|
||||
*/
|
||||
function i18n_field_entity_property_callback(&$info, $entity_type, $field, $instance, $field_type) {
|
||||
global $language;
|
||||
|
||||
// This could create a endless recursion if it's called during rebuilding the
|
||||
// cache for i18n_object_info(). So if the cache of i18n_object_info isn't
|
||||
// available yet we assume the worst case, leave the info alone but trigger a
|
||||
// rebuild of the property when hook_i18n_object_info_alter is invoked. At
|
||||
// that point the info is available and we can rely on it.
|
||||
if (!$info = &drupal_static('i18n_object_info')) {
|
||||
$i18n_field_entity_property_callback_fallback = &drupal_static(__FUNCTION__);
|
||||
$i18n_field_entity_property_callback_fallback = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
$name = $field['field_name'];
|
||||
$property = &$info[$entity_type]['bundles'][$instance['bundle']]['properties'][$name];
|
||||
$property['label'] = i18n_field_translate_property($instance, 'label', $language->language);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_i18n_object_info_alter().
|
||||
*/
|
||||
function i18n_field_i18n_object_info_alter(&$info) {
|
||||
if (drupal_static('i18n_field_entity_property_callback')) {
|
||||
if ($info = drupal_static('i18n_object_info')) {
|
||||
// Clean static and permanent cache of the data and then re-run the property
|
||||
// building.
|
||||
drupal_static_reset('entity_get_property_info');
|
||||
cache_clear_all('entity_property_info:' . $GLOBALS['language']->language, 'cache');
|
||||
entity_get_property_info();
|
||||
}
|
||||
else {
|
||||
watchdog('i18n_field', 'Unable to run fall-back handling for entity property translation due missing "i18n_object_info" cache', array(), WATCHDOG_WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_module_implements_alter().
|
||||
*/
|
||||
function i18n_field_module_implements_alter(&$implementations, $hook) {
|
||||
if ($hook == 'i18n_object_info_alter') {
|
||||
// Move our hook implementation to the bottom.
|
||||
$group = $implementations['i18n_field'];
|
||||
unset($implementations['i18n_field']);
|
||||
$implementations['i18n_field'] = $group;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Multilingual forum module, part of the Internationalization (https://www.drupal.org/project/i18n) package, helps with the multilingual configuration of the site’s forums.
|
||||
|
||||
* For a full description of the module visit https://www.drupal.org/node/1396988
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
INSTALLATION
|
||||
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. See https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
To configure forum vocabulary
|
||||
|
||||
1. Enable the Multilingual forum module included with Internationalization.
|
||||
2. Go to Administration > Structure > Taxonomy.
|
||||
3. Click "edit vocabulary" for the Forums vocabulary.
|
||||
4. Choose the translation mode (Localize or Translate).
|
||||
5. Click "Save and translate" button.
|
||||
6. Click "translate" link for a language.
|
||||
7. Translate the "Name" and "Description" for the forum.
|
||||
8. Click "Save translation" button.
|
||||
9. Repeat steps 6 to 8 for each language.
|
||||
|
||||
To configure forum terms
|
||||
|
||||
1. Go to Administration > Structure > Forums.
|
||||
2. Click "edit" link for a forum or container.
|
||||
3. Click "Translate" tab.
|
||||
4. Click "translate" link for a language.
|
||||
5. Translate the "Name" and "Description" for the term.
|
||||
6. Click "Save translation" button.
|
||||
7. Repeat steps 4 to 6 for each language.
|
||||
8. Repeat all steps for all terms.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -7,9 +7,9 @@ package = Multilingual - Internationalization
|
||||
core = 7.x
|
||||
files[] = i18n_forum.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Troubleshooting
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Menu translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, allows users to select a translation mode for each menu.
|
||||
|
||||
* For a full description of the module, visit this page:
|
||||
https://www.drupal.org/node/1113982
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes:
|
||||
https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
To link menu item menus to nodes, it is useful to have the following modules:
|
||||
|
||||
* Entity translation i18n menu module, a sub module of Entity translation (https://www.drupal.org/project/entity_translation)
|
||||
* Menu translation node module (https://www.drupal.org/project/i18n_menu_node)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
Language-specific menus
|
||||
1. To create or edit a menu, navigate to Structure > Menus > (menu to edit) > Edit.
|
||||
2. In the Translation mode section, choose Fixed Language and a Language field will appear.
|
||||
3. Select a language, select Save, and add or update the menu items as needed.
|
||||
The menu block will only appear when viewing content in the same language.
|
||||
|
||||
There are three modes available:
|
||||
|
||||
Translate and Localize:
|
||||
You can create one menu for all languages, and translate or localize each menu item. There are two ways that menu items will be translated.
|
||||
1. You can set a language when creating a custom menu item so that the menu item will only show up for that language. Menu items that link to nodes in a particular language will be treated this way.
|
||||
2. You can localize other custom menu items without a language (for example, menu items linking to Views pages). Use the Translate tab to translate the menu item title and description. Translators can also use the "Translate interface" pages to translate these menu items.
|
||||
|
||||
Fixed Language:
|
||||
If you choose Fixed Language, you'll have to set up a separate menu in each language. This could become tedious if have a lot of languages enabled on your site, but is useful if the content or menu structure is different for each language.
|
||||
|
||||
No Multilingual Options:
|
||||
Only the menu will be translatable.
|
||||
|
||||
TROUBLESHOOTING
|
||||
---------------
|
||||
|
||||
A menu item linked to a node will be displayed only when the node language matches the page language. This is due to how the menu system works and the "Language selection" feature in i18n. Therefore, to get translated menus items that link to nodes, you first need translated content. For more information visit https://www.drupal.org/docs/7/multilingual/translating-content.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -10,9 +10,9 @@ core = 7.x
|
||||
files[] = i18n_menu.inc
|
||||
files[] = i18n_menu.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -53,6 +53,24 @@ function i18n_menu_menu_alter(&$items) {
|
||||
$items['admin/structure/menu/item/%menu_link'] = $items['admin/structure/menu/item/%menu_link/edit'];
|
||||
$items['admin/structure/menu/item/%menu_link']['type'] = MENU_CALLBACK;
|
||||
$items['admin/structure/menu/item/%menu_link/edit']['type'] = MENU_DEFAULT_LOCAL_TASK;
|
||||
$items['admin/structure/menu/manage/%menu']['title callback'] = 'i18n_menu_menu_overview_title';
|
||||
}
|
||||
|
||||
/**
|
||||
* Preprocess theme_menu_admin_overview to translate menu name and description
|
||||
*
|
||||
* @param $variables
|
||||
*/
|
||||
function i18n_menu_preprocess_menu_admin_overview(&$variables) {
|
||||
$variables['title'] = i18n_string(array('menu', 'menu', $variables['name'], 'title'), $variables['title']);
|
||||
$variables['description'] = i18n_string(array('menu', 'menu', $variables['name'], 'description'), $variables['description']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Title callback for the menu overview page and links.
|
||||
*/
|
||||
function i18n_menu_menu_overview_title($menu) {
|
||||
return i18n_string(array('menu', 'menu', $menu['menu_name'], 'title'), $menu['title']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -726,15 +744,19 @@ function i18n_menu_form_menu_edit_item_alter(&$form, &$form_state) {
|
||||
* Add a "translate" link in operations column for each menu item.
|
||||
*/
|
||||
function i18n_menu_form_menu_overview_form_alter(&$form, &$form_state) {
|
||||
foreach (element_children($form) as $element) {
|
||||
if (substr($element, 0, 5) == 'mlid:') {
|
||||
$mlid = $form[$element]['#item']['mlid'];
|
||||
if (i18n_get_object('menu', $mlid)->get_translate_access()) {
|
||||
$form[$element]['operations']['translate'] = array(
|
||||
'#type' => 'link',
|
||||
'#title' => t('translate'),
|
||||
'#href' => "admin/structure/menu/item/{$mlid}/translate",
|
||||
);
|
||||
if (i18n_menu_mode($form['#menu']['menu_name'], I18N_MODE_MULTIPLE)) {
|
||||
foreach (element_children($form) as $element) {
|
||||
if (substr($element, 0, 5) == 'mlid:') {
|
||||
$item = $form[$element]["#item"];
|
||||
$mlid = $form[$element]['#item']['mlid'];
|
||||
if (i18n_get_object('menu', $mlid)->get_translate_access()) {
|
||||
$form[$element]['operations']['translate'] = array(
|
||||
'#type' => 'link',
|
||||
'#title' => t('translate'),
|
||||
'#href' => "admin/structure/menu/item/{$mlid}/translate",
|
||||
);
|
||||
$form[$element]['title']['#markup'] = l(_i18n_menu_link_title($item), $item['href'], $item['localized_options']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -901,93 +923,25 @@ function i18n_menu_query_features_menu_link_alter($query) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_init().
|
||||
* Implements hook_query_TAG_alter()
|
||||
*
|
||||
* Using tag 'preferred_menu_links' added in menu_link_get_preferred().
|
||||
* See http://drupal.org/node/1854134
|
||||
*/
|
||||
function i18n_menu_init() {
|
||||
function i18n_menu_query_preferred_menu_links_alter(QueryAlterableInterface $query) {
|
||||
global $language;
|
||||
// Get queried tables.
|
||||
$tables = $query->getTables();
|
||||
|
||||
// The only way to override the default preferred menu link for a path is to
|
||||
// inject it into the static cache of the function menu_link_get_preferred().
|
||||
|
||||
// The problem with the default implementation is that it does not take the
|
||||
// language of a menu link into account. Whe having different menu trees for
|
||||
// different menus, this means that the active trail will not work for all but
|
||||
// one language.
|
||||
|
||||
// The code below is identical to the mentioned function except the added
|
||||
// language condition on the query.
|
||||
|
||||
// TODO: Adding an alter tag to the query would allow to do this with a simple
|
||||
// hook_query_alter() implementation.
|
||||
|
||||
$preferred_links = &drupal_static('menu_link_get_preferred');
|
||||
|
||||
$path = $_GET['q'];
|
||||
|
||||
// Look for the correct menu link by building a list of candidate paths,
|
||||
// which are ordered by priority (translated hrefs are preferred over
|
||||
// untranslated paths). Afterwards, the most relevant path is picked from
|
||||
// the menus, ordered by menu preference.
|
||||
$item = menu_get_item($path);
|
||||
$path_candidates = array();
|
||||
// 1. The current item href.
|
||||
$path_candidates[$item['href']] = $item['href'];
|
||||
// 2. The tab root href of the current item (if any).
|
||||
if ($item['tab_parent'] && ($tab_root = menu_get_item($item['tab_root_href']))) {
|
||||
$path_candidates[$tab_root['href']] = $tab_root['href'];
|
||||
}
|
||||
// 3. The current item path (with wildcards).
|
||||
$path_candidates[$item['path']] = $item['path'];
|
||||
// 4. The tab root path of the current item (if any).
|
||||
if (!empty($tab_root)) {
|
||||
$path_candidates[$tab_root['path']] = $tab_root['path'];
|
||||
}
|
||||
// Retrieve a list of menu names, ordered by preference.
|
||||
$menu_names = menu_get_active_menu_names();
|
||||
// Use an illegal menu name as the key for the preferred menu link.
|
||||
$selected_menu = MENU_PREFERRED_LINK;
|
||||
// Put the selected menu at the front of the list.
|
||||
array_unshift($menu_names, $selected_menu);
|
||||
|
||||
$query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
|
||||
$query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
|
||||
$query->fields('ml');
|
||||
// Weight must be taken from {menu_links}, not {menu_router}.
|
||||
$query->addField('ml', 'weight', 'link_weight');
|
||||
$query->fields('m');
|
||||
$query->condition('ml.link_path', $path_candidates, 'IN');
|
||||
|
||||
// Only look menu links with none or the current language.
|
||||
$query->condition('ml.language', array(LANGUAGE_NONE, i18n_language_interface()->language), 'IN');
|
||||
|
||||
// Sort candidates by link path and menu name.
|
||||
$candidates = array();
|
||||
foreach ($query->execute() as $candidate) {
|
||||
$candidate['weight'] = $candidate['link_weight'];
|
||||
$candidates[$candidate['link_path']][$candidate['menu_name']] = $candidate;
|
||||
// Add any menus not already in the menu name search list.
|
||||
if (!in_array($candidate['menu_name'], $menu_names)) {
|
||||
$menu_names[] = $candidate['menu_name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Store the most specific link for each menu. Also save the most specific
|
||||
// link of the most preferred menu in $preferred_link.
|
||||
foreach ($path_candidates as $link_path) {
|
||||
if (isset($candidates[$link_path])) {
|
||||
foreach ($menu_names as $menu_name) {
|
||||
if (empty($preferred_links[$path][$menu_name]) && isset($candidates[$link_path][$menu_name])) {
|
||||
$candidate_item = $candidates[$link_path][$menu_name];
|
||||
$map = explode('/', $path);
|
||||
_menu_translate($candidate_item, $map);
|
||||
if ($candidate_item['access']) {
|
||||
$preferred_links[$path][$menu_name] = $candidate_item;
|
||||
if (empty($preferred_links[$path][MENU_PREFERRED_LINK])) {
|
||||
// Store the most specific link.
|
||||
$preferred_links[$path][MENU_PREFERRED_LINK] = $candidate_item;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($tables as $alias => $table) {
|
||||
if ($table['table'] == 'menu_links') {
|
||||
// Add language filter, ensuring that we don't have any collision when
|
||||
// determining the active menu trail when there are multiple menu items
|
||||
// with same link path but different languages.
|
||||
if ($language) {
|
||||
$query->condition('language', array($language->language, LANGUAGE_NONE), 'IN');
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Multilingual content module, part of the Internationalization (https://www.drupal.org/project/i18n) package, provides extended multilingual options for nodes. These options help accommodate a variety of translation workflows by controlling how the language for nodes is set.
|
||||
|
||||
Note that the Multilingual content module lives in the i18n_node directory in the Internationalization package. Don't confuse this module with the core Content translation module.
|
||||
|
||||
* For a full description of the module visit https://www.drupal.org/node/1279644
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. See https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
For each content type, the following Extended language options are available under the Multilingual Settings tab
|
||||
1. "Set current language as default for new content" can be useful for content that is community-generated.
|
||||
2. "Require language" prevents users from creating 'Language neutral' nodes.
|
||||
3. "Lock language" prevents users from changing the language of a node after it's created.
|
||||
|
||||
Site-wide Settings for Node Translation
|
||||
1. There are also site-wide settings provided to help streamline how multilingual content is created. Navigate to Config > Regional and language > Multilingual settings > Node Options.
|
||||
2. "Switch interface for translating" switches the language of the user interface to the chosen language when a user translates a node. This is useful if users speak the language in which the translation is written. It means that after the node translation is saved, the language of the UI will match the language of the node.
|
||||
3. "Hide content translation links" will prevent the language switcher links from appearing in nodes and teasers. This is useful if a language switcher block is enabled on the site.
|
||||
4.You can also select the default language for new nodes if the corresponding content type doesn't have language support. By default, it is set to be in the default language of the site, but this can be changed to be language neutral. This is a useful option when thinking about forward compatibility for adding multilingual support to these content types in the future.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -9,9 +9,9 @@ configure = admin/config/regional/i18n/node
|
||||
files[]=i18n_node.test
|
||||
files[]=i18n_node.variable.inc
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -506,8 +506,11 @@ function _i18n_node_form_node_form_alter($form, &$form_state) {
|
||||
}
|
||||
}
|
||||
elseif (variable_get('i18n_node_default_language_none', 0) && !isset($form['#node']->nid)) {
|
||||
// Override locale module setting default language to nodes. It is already in form_state.
|
||||
$form['language']['#value'] = $form_state['values']['language'] = LANGUAGE_NONE;
|
||||
// Only do this if the language is really disabled
|
||||
if (variable_get('language_content_type_' . $node->type, 0) == 0) {
|
||||
// Override locale module setting default language to nodes. It is already in form_state.
|
||||
$form['language']['#value'] = $form_state['values']['language'] = LANGUAGE_NONE;
|
||||
}
|
||||
}
|
||||
// Translate field names for title and body for the node edit form.
|
||||
if (!empty($form['title']['#title'])) {
|
||||
|
||||
@@ -6,9 +6,9 @@ core = 7.x
|
||||
|
||||
files[] = i18n_path.inc
|
||||
files[] = i18n_path.test
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Redirect translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, improves search engine optimization (SEO) for multilingual websites.
|
||||
|
||||
It redirects anonymous users (including web crawlers) to the translation of the page in the requested language, if it exists, using a 301 redirect code.
|
||||
|
||||
* For a full description of the module, visit this page:
|
||||
https://www.drupal.org/node/1280468
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes:
|
||||
https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
The Translation redirect module requires the implementation of hook_i18n_translate_path by another module for the redirect page to be determined. Currently, the Multilingual content, Path translation, and Taxonomy translation modules implement this hook.
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
No configuration is necessary.
|
||||
|
||||
For node translation, enable the Multilingual content and the Translation redirect modules. For non-node pages, the redirection hook must be implemented by the relevant module.
|
||||
For example, for taxonomy pages, you should enable the Taxonomy translation module because the module provides the necessary hook code. If you are using the Path translation module to create translation sets for non-node pages, then it implements the hook code for determining the redirection page.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -4,9 +4,9 @@ dependencies[] = i18n
|
||||
package = Multilingual - Internationalization
|
||||
core = 7.x
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Multilingual select module, part of the Internationalization (https://www.drupal.org/project/i18n) package, allows the user to define whether content is filtered by language on pages provided by Drupal core.
|
||||
|
||||
* For a full description of the module visit https://www.drupal.org/node/1279512
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
* Variable (https://www.drupal.org/project/variable)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. See https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
The module allows you to configure whether or not to filter pages by the current language. If the Taxonomy translation submodule is also enabled, an option will be available for how taxonomy term pages are filtered. It also allows the exclusion of the module’s language selection handling for some elements and certain paths.
|
||||
|
||||
1. Enable the Multilingual select module included with Internationalization.
|
||||
2. Go to Configuration > Regional and language > Multilingual settings > Selection.
|
||||
3. Select nodes and taxonomy can be filtered by language in the Content to Filter by Language field set.
|
||||
4. The "Content Selection Mode" allows content with specific tags to be skipped by entering a list of tags.
|
||||
5. The "Enable for Specific Pages" field set allows specific pages to be included by path.
|
||||
6. After making choices click Save configuration.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -6,9 +6,9 @@ core = 7.x
|
||||
configure = admin/config/regional/i18n/select
|
||||
files[] = i18n_select.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The String translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, provides support for other modules to translate user-defined strings. This is an API module that must be enabled only when required by other modules in the i18n package.
|
||||
|
||||
|
||||
* For a full description of the module, visit this page:
|
||||
https://www.drupal.org/node/1279668
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes:
|
||||
https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
Strings will be translated from the source languages. By default the source language is the site's default language, so changing the default language could break these translations.
|
||||
|
||||
1. You can set which language is used as the source language via Administration > Configuration > Regional and language > Multilingual settings > Strings. By default, only plain strings are enabled, so regular blocks are not fully translatable.
|
||||
2. To allow Filtered HTML, Full HTML or Plain text select the appropriate radio box(es) and Save configuration.
|
||||
3. To select the strings to be translated navigate to Administration > Configuration > Regional and language > Translate interface and select on Stings vertical tab. From here you can select which text groups to translate and select the Refresh strings tab.
|
||||
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
The String translation module allows you to configure which text formats are translatable. Formats like PHP Filter and Full HTML are translated before they are processed, so allowing a translator to edit these can be a security risk. This is particularly problematic when importing translations in bulk from a CSV file, since the translator's access to the import formats isn't verified by Drupal. After updating this setting, be sure to refresh the strings via Administration > Configuration > Regional and language > Translate interface > Strings so that strings in forbidden formats are deleted.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -10,9 +10,9 @@ files[] = i18n_string.inc
|
||||
files[] = i18n_string.test
|
||||
configure = admin/config/regional/i18n/strings
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ files[] = i18n_sync.install
|
||||
files[] = i18n_sync.module.inc
|
||||
files[] = i18n_sync.node.inc
|
||||
files[] = i18n_sync.test
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Taxonomy translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, provides multiple options to translate taxonomy vocabularies and terms. For each vocabulary, there are four types of behaviors to choose from: Language-independent terms, Language-specific terms, Localized terms, and Mixed-language vocabulary.
|
||||
|
||||
* For a full description of the module visit https://www.drupal.org/node/1114016
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization - https://www.drupal.org/project/i18n
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views - https://www.drupal.org/project/i18nviews
|
||||
* Language Icons - https://www.drupal.org/project/languageicons
|
||||
* Translation Overview - https://www.drupal.org/project/translation_overview
|
||||
* Localization Client - https://www.drupal.org/project/l10n_client
|
||||
* Internationalization contributions - https://www.drupal.org/project/i18n_contrib
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
Language-independent terms - only vocabulary will be translatable.
|
||||
1. Navigate to Structure > Taxonomy.
|
||||
2. Select the "edit vocabulary" link.
|
||||
3. Select the "No multilingual options for terms".
|
||||
|
||||
Language-specific terms - vocabulary is only used for content in that language. The terms will only be available if the term language matches the UI language.
|
||||
1. Navigate to Structure > Taxonomy and select the "edit vocabulary link".
|
||||
2. Choose "Fixed Language" and a Language drop-down field will be displayed.
|
||||
3. Select the language.
|
||||
4. Select "Fixed Language" and Save.
|
||||
|
||||
Localized terms - Terms are common for all languages, but their name and description may be localized.
|
||||
1. Navigate to Structure > Taxonomy > vocabulary-to-edit > Edit.
|
||||
2. Select "Localize" and select Save.
|
||||
3. Edit a term and there will be a Translate tab. Select this tab.
|
||||
4. Select Translate, translate the Name and Description, select "Save translation", and repeat for all languages.
|
||||
5. Repeat the process for all terms.
|
||||
6. Navigate to Structure > Content types > term-to-edit > Manage display.
|
||||
7. By default, the term reference is set to Link. Change this to "Link (localized)" and Save.
|
||||
The vocabulary will be appropriate for the language.
|
||||
|
||||
Mixed-language vocabulary - Use for vocabularies with terms in multiple languages.
|
||||
1. Navigate to Structure > Taxonomy > vocabulary-to-edit > Edit.
|
||||
2. Select the Translate radio button and Save.
|
||||
3. Edit a vocabulary term and there will be a new Language field. Choose a language and then select Save and translate.
|
||||
4. There are two options, the user can either select "Add translation link" or the user can select an existing term in the Select translations form.
|
||||
5. Create translations for the terms and add terms for specific languages only.
|
||||
Now if the user edits a node associated with this vocabulary, only the relevant terms will appear.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -11,9 +11,9 @@ files[] = i18n_taxonomy.pages.inc
|
||||
files[] = i18n_taxonomy.admin.inc
|
||||
files[] = i18n_taxonomy.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -1096,7 +1096,7 @@ function i18n_taxonomy_get_tree($vid, $langcode, $parent = 0, $max_depth = NULL,
|
||||
$query->join('taxonomy_term_hierarchy', 'h', 'h.tid = t.tid');
|
||||
$result = $query
|
||||
->addTag('translatable')
|
||||
->addTag('term_access')
|
||||
->addTag('taxonomy_term_access')
|
||||
->fields('t')
|
||||
->fields('h', array('parent'))
|
||||
->condition('t.vid', $vid)
|
||||
@@ -1270,3 +1270,22 @@ function i18n_taxonomy_modules_enabled($modules) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_views_pre_render().
|
||||
*/
|
||||
function i18n_taxonomy_views_pre_render(&$view) {
|
||||
if(!module_exists('rules_scheduler')) {
|
||||
global $language;
|
||||
|
||||
foreach ($view->result as $delta => $term){
|
||||
if (isset($term->tid)) {
|
||||
i18n_string_translate_langcode($language->language);
|
||||
$localized_term = i18n_taxonomy_localize_terms(taxonomy_term_load($term->tid));
|
||||
$term->tid = $localized_term->tid;
|
||||
$term->taxonomy_term_data_name = $localized_term->name;
|
||||
$term->taxonomy_term_data_description = $localized_term->description;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ function _i18n_taxonomy_autocomplete($langcode, $vids, $tags_typed = '') {
|
||||
$query = db_select('taxonomy_term_data', 't')
|
||||
->fields('t', array('tid', 'name'));
|
||||
$query->addTag('translatable');
|
||||
$query->addTag('term_access');
|
||||
$query->addTag('taxonomy_term_access');
|
||||
// Disable i18n_select for this query
|
||||
$query->addTag('i18n_select');
|
||||
// Add language condition
|
||||
|
||||
@@ -6,9 +6,9 @@ core = 7.x
|
||||
|
||||
files[] = i18n_translation.inc
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The User mail translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, translates emails sent from the User module.
|
||||
|
||||
* For a full description of the module, visit this page:
|
||||
https://www.drupal.org/node/133977
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes:
|
||||
https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
Internationalization (https://www.drupal.org/project/i18n)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. Visit https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
To configure email translations
|
||||
1. Navigate to Administration > Configuration > Regional and language > Multilingual settings and select the variables tab.
|
||||
2. Select the "User emails" tab. Select the variables you would like translated and Save configuration.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -4,9 +4,9 @@ core = 7.x
|
||||
package = Multilingual - Internationalization
|
||||
dependencies[] = i18n_variable
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
function i18n_user_mail_alter(&$message) {
|
||||
if ($message['module'] == 'user') {
|
||||
$language = $message['language'];
|
||||
$language = (isset($message['language']) ? $message['language'] : language_default());
|
||||
$variables = array('user' => $message['params']['account']);
|
||||
$key = $message['key'];
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Requirements
|
||||
* Recommended modules
|
||||
* Installation
|
||||
* Configuration
|
||||
* Maintainers
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
The Variable translation module, part of the Internationalization (https://www.drupal.org/project/i18n) package, allows the user to translate text and settings that are stored in Drupal as variables. These variables include text such as 'site name' and 'site slogan', as well as settings like 'Default front page' and 'Default 404 page'.
|
||||
|
||||
* For a full description of the module, visit https://www.drupal.org/node/1113374
|
||||
|
||||
* To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/i18n
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
------------
|
||||
|
||||
This module requires the following modules:
|
||||
|
||||
* Internationalization (https://www.drupal.org/project/i18n)
|
||||
* Variable (https://www.drupal.org/project/variable)
|
||||
|
||||
|
||||
RECOMMENDED MODULES
|
||||
-------------------
|
||||
|
||||
* Internationalization Views (https://www.drupal.org/project/i18nviews)
|
||||
* Language Icons (https://www.drupal.org/project/languageicons)
|
||||
* Translation Overview (https://www.drupal.org/project/translation_overview)
|
||||
* Localization Client (https://www.drupal.org/project/l10n_client)
|
||||
* Internationalization contributions (https://www.drupal.org/project/i18n_contrib)
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
* This is a submodule of the Internationalization module. Install the Internationalization module as you would normally install a contributed Drupal module. See https://www.drupal.org/docs/7/extending-drupal-7/installing-contributed-modules-find-import-enable-configure-drupal-7 for further information.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
To enable multilingual variables
|
||||
|
||||
1. Enable the Variable translation module included with the Internationalization package.
|
||||
2. Go to Administration > Configuration > Regional and language > Multilingual settings.
|
||||
3. Click on the Variables tab.
|
||||
4. Select the variables that will be multilingual.
|
||||
5. Click Save configuration button.
|
||||
|
||||
Once you have the correct settings, they'll be marked with "This is a multilingual variable" when you go to the corresponding administration pages. You must switch the site language while in the administration pages to set the variables for each language. A language switcher link will appear at the top of each administrative page that has multilingual variables.
|
||||
|
||||
|
||||
MAINTAINERS
|
||||
-----------
|
||||
|
||||
* Jose Reyero - https://www.drupal.org/u/jose-reyero
|
||||
* Florian Weber (webflo) - https://www.drupal.org/u/webflo
|
||||
* Peter Philipp - https://www.drupal.org/u/das-peter
|
||||
* Joseph Olstad - https://www.drupal.org/u/joseph.olstad
|
||||
* Nathaniel Catchpole - https://www.drupal.org/u/catch
|
||||
@@ -10,9 +10,9 @@ configure = admin/config/regional/i18n/variable
|
||||
files[] = i18n_variable.class.inc
|
||||
files[] = i18n_variable.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ package = Testing
|
||||
core = 6.x
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-10-22
|
||||
version = "7.x-1.14"
|
||||
; Information added by Drupal.org packaging script on 2017-01-31
|
||||
version = "7.x-1.15"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1477154943"
|
||||
datestamp = "1485834792"
|
||||
|
||||
|
||||
@@ -1588,7 +1588,7 @@ class views_join {
|
||||
$extras[] = $extra;
|
||||
}
|
||||
// Otherwise - and if we have a value - use it for a field-to-value condition.
|
||||
elseif (!empty($info['value'])) {
|
||||
elseif (isset($info['value'])) {
|
||||
// Convert a single-valued array of values to the single-value case,
|
||||
// and transform from IN() notation to = notation
|
||||
if (is_array($info['value']) && count($info['value']) == 1) {
|
||||
|
||||
@@ -64,6 +64,11 @@ Drupal.Views.parseQueryString = function (query) {
|
||||
* Helper function to return a view's arguments based on a path.
|
||||
*/
|
||||
Drupal.Views.parseViewArgs = function (href, viewPath) {
|
||||
|
||||
// Provide language prefix.
|
||||
if (Drupal.settings.pathPrefix) {
|
||||
var viewPath = Drupal.settings.pathPrefix + viewPath;
|
||||
}
|
||||
var returnObj = {};
|
||||
var path = Drupal.Views.getPath(href);
|
||||
// Ensure we have a correct path.
|
||||
|
||||
+1
@@ -38,6 +38,7 @@ class views_handler_argument_term_node_tid extends views_handler_argument_many_t
|
||||
function title_query() {
|
||||
$titles = array();
|
||||
$result = db_select('taxonomy_term_data', 'td')
|
||||
->addTag('term_access')
|
||||
->fields('td', array('name'))
|
||||
->condition('td.tid', $this->value)
|
||||
->execute();
|
||||
|
||||
+5
@@ -22,6 +22,7 @@ class views_handler_field_taxonomy extends views_handler_field {
|
||||
parent::construct();
|
||||
$this->additional_fields['vid'] = 'vid';
|
||||
$this->additional_fields['tid'] = 'tid';
|
||||
$this->additional_fields['name'] = 'name';
|
||||
$this->additional_fields['vocabulary_machine_name'] = array(
|
||||
'table' => 'taxonomy_vocabulary',
|
||||
'field' => 'machine_name',
|
||||
@@ -65,9 +66,13 @@ class views_handler_field_taxonomy extends views_handler_field {
|
||||
$term = new stdClass();
|
||||
$term->tid = $tid;
|
||||
$term->vid = $this->get_value($values, 'vid');
|
||||
$term->name = $this->get_value($values, 'name');
|
||||
$term->vocabulary_machine_name = $values->{$this->aliases['vocabulary_machine_name']};
|
||||
$this->options['alter']['make_link'] = TRUE;
|
||||
$uri = entity_uri('taxonomy_term', $term);
|
||||
if (isset($uri['options'])) {
|
||||
$this->options['alter'] = array_merge($this->options['alter'], $uri['options']);
|
||||
}
|
||||
$this->options['alter']['path'] = $uri['path'];
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -139,6 +139,7 @@ class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument
|
||||
// if unverified tids left - verify them and cache results
|
||||
if (count($test)) {
|
||||
$query = db_select('taxonomy_term_data', 'td');
|
||||
$query->addTag('term_access');
|
||||
$query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
|
||||
$query->fields('td');
|
||||
$query->fields('tv', array('machine_name'));
|
||||
@@ -167,6 +168,7 @@ class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument
|
||||
case 'name':
|
||||
case 'convert':
|
||||
$query = db_select('taxonomy_term_data', 'td');
|
||||
$query->addTag('term_access');
|
||||
$query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
|
||||
$query->fields('td');
|
||||
$query->fields('tv', array('machine_name'));
|
||||
@@ -202,6 +204,7 @@ class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument
|
||||
$arg_keys = array_flip($args);
|
||||
|
||||
$query = db_select('taxonomy_term_data', 'td');
|
||||
$query->addTag('term_access');
|
||||
$query->condition('tid', $args);
|
||||
$query->addField('td', 'tid', 'tid');
|
||||
if (!empty($vocabularies)) {
|
||||
|
||||
@@ -289,7 +289,14 @@ class views_plugin_cache extends views_plugin {
|
||||
|
||||
function get_results_key() {
|
||||
if (!isset($this->_results_key)) {
|
||||
$this->_results_key = $this->view->name . ':' . $this->display->id . ':results:' . $this->get_cache_key();
|
||||
$key_data = array();
|
||||
foreach (array('exposed_info', 'page', 'sort', 'order', 'items_per_page', 'offset') as $key) {
|
||||
if (isset($_GET[$key])) {
|
||||
$key_data[$key] = $_GET[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$this->_results_key = $this->view->name . ':' . $this->display->id . ':results:' . $this->get_cache_key($key_data);
|
||||
}
|
||||
|
||||
return $this->_results_key;
|
||||
@@ -298,6 +305,7 @@ class views_plugin_cache extends views_plugin {
|
||||
function get_output_key() {
|
||||
if (!isset($this->_output_key)) {
|
||||
$key_data = array(
|
||||
'result' => $this->view->result,
|
||||
'theme' => $GLOBALS['theme'],
|
||||
);
|
||||
$this->_output_key = $this->view->name . ':' . $this->display->id . ':output:' . $this->get_cache_key($key_data);
|
||||
|
||||
@@ -41,7 +41,7 @@ class views_plugin_cache_time extends views_plugin_cache {
|
||||
'#maxlength' => '30',
|
||||
'#description' => t('Length of time in seconds raw query results should be cached.'),
|
||||
'#default_value' => $this->options['results_lifespan_custom'],
|
||||
'#process' => array('form_process_select','ctools_dependent_process'),
|
||||
'#process' => array('ctools_dependent_process'),
|
||||
'#dependency' => array(
|
||||
'edit-cache-options-results-lifespan' => array('custom'),
|
||||
),
|
||||
@@ -60,7 +60,7 @@ class views_plugin_cache_time extends views_plugin_cache {
|
||||
'#maxlength' => '30',
|
||||
'#description' => t('Length of time in seconds rendered HTML output should be cached.'),
|
||||
'#default_value' => $this->options['output_lifespan_custom'],
|
||||
'#process' => array('form_process_select','ctools_dependent_process'),
|
||||
'#process' => array('ctools_dependent_process'),
|
||||
'#dependency' => array(
|
||||
'edit-cache-options-output-lifespan' => array('custom'),
|
||||
),
|
||||
|
||||
@@ -118,6 +118,8 @@ class views_plugin_display_page extends views_plugin_display {
|
||||
'access arguments' => $access_arguments,
|
||||
// Identify URL embedded arguments and correlate them to a handler
|
||||
'load arguments' => array($this->view->name, $this->display->id, '%index'),
|
||||
// Make sure the menu router knows where views_page is.
|
||||
'module' => 'views',
|
||||
);
|
||||
$menu = $this->get_option('menu');
|
||||
if (empty($menu)) {
|
||||
@@ -182,6 +184,8 @@ class views_plugin_display_page extends views_plugin_display {
|
||||
'title' => $tab_options['title'],
|
||||
'description' => $tab_options['description'],
|
||||
'menu_name' => $tab_options['name'],
|
||||
// Make sure the menu router knows where views_page is.
|
||||
'module' => 'views',
|
||||
);
|
||||
switch ($tab_options['type']) {
|
||||
default:
|
||||
|
||||
@@ -146,7 +146,7 @@ class views_plugin_style_jump_menu extends views_plugin_style {
|
||||
$lookup_options = array();
|
||||
// We need to check if the path is absolute
|
||||
// or else language is not taken in account.
|
||||
if ($this->view->display[$this->view->current_display]->display_options['fields'][$this->options['path']]['absolute']) {
|
||||
if (!empty($this->view->display[$this->view->current_display]->display_options['fields'][$this->options['path']]['absolute'])) {
|
||||
$lookup_options['absolute'] = TRUE;
|
||||
}
|
||||
$lookup_url = url($_GET['q'], $lookup_options);
|
||||
|
||||
@@ -5,9 +5,9 @@ core = 7.x
|
||||
dependencies[] = views
|
||||
hidden = TRUE
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-06-15
|
||||
version = "7.x-3.14"
|
||||
; Information added by Drupal.org packaging script on 2017-02-22
|
||||
version = "7.x-3.15"
|
||||
core = "7.x"
|
||||
project = "views"
|
||||
datestamp = "1466019588"
|
||||
datestamp = "1487784193"
|
||||
|
||||
|
||||
@@ -328,9 +328,9 @@ files[] = tests/views_cache.test
|
||||
files[] = tests/views_view.test
|
||||
files[] = tests/views_ui.test
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-06-15
|
||||
version = "7.x-3.14"
|
||||
; Information added by Drupal.org packaging script on 2017-02-22
|
||||
version = "7.x-3.15"
|
||||
core = "7.x"
|
||||
project = "views"
|
||||
datestamp = "1466019588"
|
||||
datestamp = "1487784193"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ dependencies[] = views
|
||||
files[] = views_ui.module
|
||||
files[] = plugins/views_wizard/views_ui_base_views_wizard.class.php
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-06-15
|
||||
version = "7.x-3.14"
|
||||
; Information added by Drupal.org packaging script on 2017-02-22
|
||||
version = "7.x-3.15"
|
||||
core = "7.x"
|
||||
project = "views"
|
||||
datestamp = "1466019588"
|
||||
datestamp = "1487784193"
|
||||
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
/**
|
||||
* @file
|
||||
* Provides an action for creating a zip archive of selected files.
|
||||
*
|
||||
* An entry in the {file_managed} table is created for the newly created archive,
|
||||
* and it is marked as permanent or temporary based on the operation settings.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_action_info().
|
||||
*/
|
||||
function views_bulk_operations_archive_action_info() {
|
||||
$actions = array();
|
||||
if (function_exists('zip_open')) {
|
||||
@@ -71,6 +75,10 @@ function views_bulk_operations_archive_action($file, $context) {
|
||||
$archive_file->filemime = file_get_mimetype($destination);
|
||||
$archive_file->uid = $user->uid;
|
||||
$archive_file->status = $context['settings']['temporary'] ? FALSE : FILE_STATUS_PERMANENT;
|
||||
// Clear filesize() cache to avoid private file system differences in
|
||||
// filesize.
|
||||
// @see https://www.drupal.org/node/2743999
|
||||
clearstatcache();
|
||||
file_save($archive_file);
|
||||
|
||||
$url = file_create_url($archive_file->uri);
|
||||
@@ -100,8 +108,11 @@ function views_bulk_operations_archive_action_form($context) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assembles a sanitized and unique URI for the archive, and returns it for
|
||||
* usage by the action callback (views_bulk_operations_archive_action).
|
||||
* Assembles a sanitized and unique URI for the archive.
|
||||
*
|
||||
* @returns array
|
||||
* A URI array used by the action callback
|
||||
* (views_bulk_operations_archive_action).
|
||||
*/
|
||||
function views_bulk_operations_archive_action_submit($form, $form_state) {
|
||||
// Validate the scheme, fallback to public if it's somehow invalid.
|
||||
@@ -156,10 +167,12 @@ function views_bulk_operations_archive_action_views_bulk_operations_form($option
|
||||
/**
|
||||
* Create a sanitized and unique version of the provided filename.
|
||||
*
|
||||
* @param $filename
|
||||
* String filename
|
||||
* @param string $filename
|
||||
* The filename to create.
|
||||
* @param array $archive_list
|
||||
* The list of files already in the archive.
|
||||
*
|
||||
* @return
|
||||
* @return string
|
||||
* The new filename.
|
||||
*/
|
||||
function _views_bulk_operations_archive_action_create_filename($filename, $archive_list) {
|
||||
@@ -167,7 +180,7 @@ function _views_bulk_operations_archive_action_create_filename($filename, $archi
|
||||
// some filesystems, not many applications handle them well.
|
||||
$filename = preg_replace('/[\x00-\x1F]/u', '_', $filename);
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
// These characters are not allowed in Windows filenames
|
||||
// These characters are not allowed in Windows filenames.
|
||||
$filename = str_replace(array(':', '*', '?', '"', '<', '>', '|'), '_', $filename);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Implements a generic entity change owner action.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_action_info().
|
||||
*/
|
||||
function views_bulk_operations_change_owner_action_info() {
|
||||
return array(
|
||||
'views_bulk_operations_change_owner_action' => array(
|
||||
'type' => 'entity',
|
||||
'label' => t('Change owner'),
|
||||
'configurable' => TRUE,
|
||||
'behavior' => array('changes_property'),
|
||||
'triggers' => array('any'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Action function.
|
||||
*/
|
||||
function views_bulk_operations_change_owner_action($entity, $context) {
|
||||
$entity->uid = $context['owner_uid'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Action form function.
|
||||
*/
|
||||
function views_bulk_operations_change_owner_action_form($context, &$form_state) {
|
||||
$form['owner_username'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#maxlength' => USERNAME_MAX_LENGTH,
|
||||
'#title' => t('Owner'),
|
||||
'#required' => TRUE,
|
||||
'#description' => t('Choose the user you would like to set as the owner.'),
|
||||
'#autocomplete_path' => 'user/autocomplete',
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Action form validate function.
|
||||
*
|
||||
* Checks that the submitted text is a valid username.
|
||||
*/
|
||||
function views_bulk_operations_change_owner_action_validate($form, $form_state) {
|
||||
if (!user_load_by_name($form_state['values']['owner_username'])) {
|
||||
form_set_error('owner_username', t('Valid username required.'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action form submit function.
|
||||
*
|
||||
* Pass submitted username back to views_bulk_operations_change_owner.
|
||||
*/
|
||||
function views_bulk_operations_change_owner_action_submit($form, $form_state) {
|
||||
$user = user_load_by_name($form_state['values']['owner_username']);
|
||||
return array('owner_uid' => $user->uid);
|
||||
}
|
||||
@@ -24,11 +24,46 @@ function views_bulk_operations_delete_action_info() {
|
||||
);
|
||||
}
|
||||
|
||||
function views_bulk_operations_delete_item_views_bulk_operations_form($settings) {
|
||||
$form = array();
|
||||
$form['log'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Log individual deletions'),
|
||||
'#description' => t('Note: Deleting large amounts of entities will generate large amounts of log messages.'),
|
||||
'#default_value' => !empty($settings['log']),
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
function views_bulk_operations_delete_item($entity, $context) {
|
||||
$info = entity_get_info($context['entity_type']);
|
||||
$entity_id = $entity->{$info['entity keys']['id']};
|
||||
|
||||
entity_delete($context['entity_type'], $entity_id);
|
||||
|
||||
// Add a message to the watchdog if we've been configured to do so.
|
||||
if (!empty($context['settings']['log'])) {
|
||||
// Log an appropriate message for this entity type, using the format from
|
||||
// the node, taxonomy and user module for their entity types.
|
||||
switch ($context['entity_type']) {
|
||||
case 'node':
|
||||
watchdog('content', '@type: deleted %title.', array('@type' => $entity->type, '%title' => $entity->title));
|
||||
break;
|
||||
|
||||
case 'taxonomy_term':
|
||||
watchdog('taxonomy', 'Deleted term %name.', array('%name' => $entity->name), WATCHDOG_NOTICE);
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
watchdog('user', 'Deleted user: %name %email.', array('%name' => $entity->name, '%email' => '<' . $entity->mail . '>'), WATCHDOG_NOTICE);
|
||||
break;
|
||||
|
||||
default:
|
||||
watchdog('entity', 'Deleted @type %label.', array('@type' => $context['entity_type'], '%label' => entity_label($context['entity_type'], $entity)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function views_bulk_operations_delete_revision($entity, $context) {
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file VBO action to modify entity values (properties and fields).
|
||||
* @file
|
||||
* VBO action to modify entity values (properties and fields).
|
||||
*/
|
||||
|
||||
// Specifies that all available values should be shown to the user for editing.
|
||||
define('VBO_MODIFY_ACTION_ALL', '_all_');
|
||||
|
||||
/**
|
||||
* Implements hook_action_info().
|
||||
*/
|
||||
function views_bulk_operations_modify_action_info() {
|
||||
return array('views_bulk_operations_modify_action' => array(
|
||||
'type' => 'entity',
|
||||
'label' => t('Modify entity values'),
|
||||
'behavior' => array('changes_property'),
|
||||
// This action only works when invoked through VBO. That's why it's
|
||||
// declared as non-configurable to prevent it from being shown in the
|
||||
// "Create an advanced action" dropdown on admin/config/system/actions.
|
||||
'configurable' => FALSE,
|
||||
'vbo_configurable' => TRUE,
|
||||
'triggers' => array('any'),
|
||||
));
|
||||
return array(
|
||||
'views_bulk_operations_modify_action' => array(
|
||||
'type' => 'entity',
|
||||
'label' => t('Modify entity values'),
|
||||
'behavior' => array('changes_property'),
|
||||
// This action only works when invoked through VBO. That's why it's
|
||||
// declared as non-configurable to prevent it from being shown in the
|
||||
// "Create an advanced action" dropdown on admin/config/system/actions.
|
||||
'configurable' => FALSE,
|
||||
'vbo_configurable' => TRUE,
|
||||
'triggers' => array('any'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,7 +34,7 @@ function views_bulk_operations_modify_action_info() {
|
||||
* replacing the existing values, or appending to them (based on user input).
|
||||
*/
|
||||
function views_bulk_operations_modify_action($entity, $context) {
|
||||
list(,,$bundle_name) = entity_extract_ids($context['entity_type'], $entity);
|
||||
list(,, $bundle_name) = entity_extract_ids($context['entity_type'], $entity);
|
||||
// Handle Field API fields.
|
||||
if (!empty($context['selected']['bundle_' . $bundle_name])) {
|
||||
// The pseudo entity is cloned so that changes to it don't get carried
|
||||
@@ -38,7 +44,7 @@ function views_bulk_operations_modify_action($entity, $context) {
|
||||
// Get this field's language. We can just pull it from the pseudo entity
|
||||
// as it was created using field_attach_form and entity_language so it's
|
||||
// already been figured out if this field is translatable or not and
|
||||
// applied the appropriate language code to the field
|
||||
// applied the appropriate language code to the field.
|
||||
$language = key($pseudo_entity->{$key});
|
||||
// Replace any tokens that might exist in the field columns.
|
||||
foreach ($pseudo_entity->{$key}[$language] as $delta => &$item) {
|
||||
@@ -58,9 +64,11 @@ function views_bulk_operations_modify_action($entity, $context) {
|
||||
if ($field_info['cardinality'] != FIELD_CARDINALITY_UNLIMITED && $field_count > $field_info['cardinality']) {
|
||||
$entity_label = entity_label($context['entity_type'], $entity);
|
||||
$warning = t('Tried to set !field_count values for field !field_name that supports a maximum of !cardinality.',
|
||||
array('!field_count' => $field_count,
|
||||
'!field_name' => $field_info['field_name'],
|
||||
'!cardinality' => $field_info['cardinality']));
|
||||
array(
|
||||
'!field_count' => $field_count,
|
||||
'!field_name' => $field_info['field_name'],
|
||||
'!cardinality' => $field_info['cardinality'],
|
||||
));
|
||||
drupal_set_message($warning, 'warning', FALSE);
|
||||
}
|
||||
|
||||
@@ -76,11 +84,17 @@ function views_bulk_operations_modify_action($entity, $context) {
|
||||
}
|
||||
|
||||
// Handle properties.
|
||||
// Use the wrapper to set property values, since some properties need
|
||||
// additional massaging by their setter callbacks.
|
||||
// The wrapper will automatically modify $entity itself.
|
||||
$wrapper = entity_metadata_wrapper($context['entity_type'], $entity);
|
||||
// The default setting for 'revision' property (create new revisions) should
|
||||
// be respected for nodes. This requires some special treatment.
|
||||
if ($context['entity_type'] == 'node' && in_array('revision', variable_get('node_options_' . $bundle_name)) && !in_array('revision', $context['selected']['properties'])) {
|
||||
$wrapper->revision->set(1);
|
||||
}
|
||||
|
||||
if (!empty($context['selected']['properties'])) {
|
||||
// Use the wrapper to set property values, since some properties need
|
||||
// additional massaging by their setter callbacks.
|
||||
// The wrapper will automatically modify $entity itself.
|
||||
$wrapper = entity_metadata_wrapper($context['entity_type'], $entity);
|
||||
foreach ($context['selected']['properties'] as $key) {
|
||||
if (!$wrapper->$key->access('update')) {
|
||||
// No access.
|
||||
@@ -113,7 +127,8 @@ function views_bulk_operations_modify_action($entity, $context) {
|
||||
* entity bundle, as provided by field_attach_form().
|
||||
*/
|
||||
function views_bulk_operations_modify_action_form($context, &$form_state) {
|
||||
// This action form uses admin-provided settings. If they were not set, pull the defaults now.
|
||||
// This action form uses admin-provided settings. If they were not set, pull
|
||||
// the defaults now.
|
||||
if (!isset($context['settings'])) {
|
||||
$context['settings'] = views_bulk_operations_modify_action_views_bulk_operations_form_options();
|
||||
}
|
||||
@@ -126,7 +141,8 @@ function views_bulk_operations_modify_action_form($context, &$form_state) {
|
||||
// and filled with form data.
|
||||
// After submit, the pseudo-entities get passed to the actual action
|
||||
// (views_bulk_operations_modify_action()) which copies the data from the
|
||||
// relevant pseudo-entity constructed here to the actual entity being modified.
|
||||
// relevant pseudo-entity constructed here to the actual entity being
|
||||
// modified.
|
||||
$form_state['entities'] = array();
|
||||
|
||||
$info = entity_get_info($entity_type);
|
||||
@@ -151,7 +167,16 @@ function views_bulk_operations_modify_action_form($context, &$form_state) {
|
||||
'#title' => $property['label'],
|
||||
);
|
||||
|
||||
$determined_type = ($property['type'] == 'boolean') ? 'checkbox' : 'textfield';
|
||||
// According to _views_bulk_operations_modify_action_get_properties
|
||||
// we have fixed list of supported types. Most of these types are string
|
||||
// and only some of them has options list.
|
||||
if (isset($property['options list'])) {
|
||||
$determined_type = ($property['type'] == 'list') ? 'checkboxes' : 'select';
|
||||
}
|
||||
else {
|
||||
$determined_type = ($property['type'] == 'boolean') ? 'checkbox' : 'textfield';
|
||||
}
|
||||
|
||||
$form['properties'][$key] = array(
|
||||
'#type' => $determined_type,
|
||||
'#title' => $property['label'],
|
||||
@@ -189,7 +214,7 @@ function views_bulk_operations_modify_action_form($context, &$form_state) {
|
||||
}
|
||||
}
|
||||
|
||||
// Going to need this for multilingual nodes
|
||||
// Going to need this for multilingual nodes.
|
||||
global $language;
|
||||
foreach ($bundles as $bundle_name => $bundle) {
|
||||
$bundle_key = $info['entity keys']['bundle'];
|
||||
@@ -202,8 +227,8 @@ function views_bulk_operations_modify_action_form($context, &$form_state) {
|
||||
$entity = entity_create($context['entity_type'], $default_values);
|
||||
$form_state['entities'][$bundle_name] = $entity;
|
||||
|
||||
// Show the more detailed label only if the entity type has multiple bundles.
|
||||
// Otherwise, it would just be confusing.
|
||||
// Show the more detailed label only if the entity type has multiple
|
||||
// bundles. Otherwise, it would just be confusing.
|
||||
if (count($info['bundles']) > 1) {
|
||||
$label = t('Fields for @bundle_key @label', array('@bundle_key' => $bundle_key, '@label' => $bundle['label']));
|
||||
}
|
||||
@@ -417,9 +442,9 @@ function views_bulk_operations_modify_action_submit($form, $form_state) {
|
||||
* Properties that can't be changed are entity keys, timestamps, and the ones
|
||||
* without a setter callback.
|
||||
*
|
||||
* @param $entity_type
|
||||
* @param string $entity_type
|
||||
* The entity type whose properties will be fetched.
|
||||
* @param $display_values
|
||||
* @param array $display_values
|
||||
* An optional, admin-provided list of properties and fields that should be
|
||||
* displayed for editing, used to filter the returned list of properties.
|
||||
*/
|
||||
@@ -435,8 +460,17 @@ function _views_bulk_operations_modify_action_get_properties($entity_type, $disp
|
||||
}
|
||||
}
|
||||
// List of supported types.
|
||||
$supported_types = array('text', 'token', 'integer', 'decimal', 'date', 'duration',
|
||||
'boolean', 'uri', 'list');
|
||||
$supported_types = array(
|
||||
'text',
|
||||
'token',
|
||||
'integer',
|
||||
'decimal',
|
||||
'date',
|
||||
'duration',
|
||||
'boolean',
|
||||
'uri',
|
||||
'list',
|
||||
);
|
||||
$property_info = entity_get_property_info($entity_type);
|
||||
if (empty($property_info['properties'])) {
|
||||
// Stop here if no properties were found.
|
||||
@@ -484,9 +518,9 @@ function _views_bulk_operations_modify_action_get_properties($entity_type, $disp
|
||||
* (through the action settings) then only bundles that have at least one field
|
||||
* selected are returned.
|
||||
*
|
||||
* @param $entity_type
|
||||
* @param string $entity_type
|
||||
* The entity type whose bundles will be fetched.
|
||||
* @param $context
|
||||
* @param array $context
|
||||
* The VBO context variable.
|
||||
*/
|
||||
function _views_bulk_operations_modify_action_get_bundles($entity_type, $context) {
|
||||
@@ -594,8 +628,8 @@ function views_bulk_operations_modify_action_views_bulk_operations_form($options
|
||||
}
|
||||
foreach ($info['bundles'] as $bundle_name => $bundle) {
|
||||
$bundle_key = $info['entity keys']['bundle'];
|
||||
// Show the more detailed label only if the entity type has multiple bundles.
|
||||
// Otherwise, it would just be confusing.
|
||||
// Show the more detailed label only if the entity type has multiple
|
||||
// bundles. Otherwise, it would just be confusing.
|
||||
if (count($info['bundles']) > 1) {
|
||||
$label = t('Fields for @bundle_key @label', array('@bundle_key' => $bundle_key, '@label' => $bundle['label']));
|
||||
}
|
||||
|
||||
+23
-11
@@ -1,17 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* VBO action to cancel user accounts.
|
||||
*/
|
||||
* @file
|
||||
* VBO action to cancel user accounts.
|
||||
*/
|
||||
|
||||
function views_bulk_operations_user_cancel_action_info() {
|
||||
return array('views_bulk_operations_user_cancel_action' => array(
|
||||
'type' => 'user',
|
||||
'label' => t('Cancel user account'),
|
||||
'configurable' => TRUE,
|
||||
'behavior' => array('deletes_property'),
|
||||
'triggers' => array('any'),
|
||||
));
|
||||
return array(
|
||||
'views_bulk_operations_user_cancel_action' => array(
|
||||
'type' => 'user',
|
||||
'label' => t('Cancel user account'),
|
||||
'configurable' => TRUE,
|
||||
'behavior' => array('deletes_property'),
|
||||
'triggers' => array('any'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function views_bulk_operations_user_cancel_action_form($context) {
|
||||
@@ -75,7 +77,17 @@ function views_bulk_operations_user_cancel_action($account, $context) {
|
||||
if (!empty($context['user_cancel_notify'])) {
|
||||
_user_mail_notify('status_canceled', $account);
|
||||
}
|
||||
user_delete($account->uid);
|
||||
// In cases when nodes are to be reassigned to UID 0, the user_delete must
|
||||
// not run until *after* the user_cancel has been invoked, otherwise the
|
||||
// nodes are deleted before they can be reassigned. Adding the user delete
|
||||
// to the batch queue ensures things happen in the correct sequence.
|
||||
$batch = array(
|
||||
'operations' => array(
|
||||
array('user_delete', array($account->uid)),
|
||||
),
|
||||
'file' => drupal_get_path('module', 'node') . '/node.admin.inc',
|
||||
);
|
||||
batch_set($batch);
|
||||
watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ description = Provides permission-based access control for actions. Used by View
|
||||
package = Administration
|
||||
core = 7.x
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-07-01
|
||||
version = "7.x-3.3"
|
||||
; Information added by Drupal.org packaging script on 2017-02-21
|
||||
version = "7.x-3.4"
|
||||
core = "7.x"
|
||||
project = "views_bulk_operations"
|
||||
datestamp = "1435764542"
|
||||
datestamp = "1487698687"
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
.vbo-select-all-markup, .vbo-table-select-all-markup {
|
||||
.vbo-select-all-markup,
|
||||
.vbo-table-select-all-markup {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -15,9 +16,10 @@
|
||||
.views-table-row-select-all td {
|
||||
text-align: center;
|
||||
}
|
||||
.vbo-table-select-all-pages, .vbo-table-select-this-page {
|
||||
margin: 0 !important;
|
||||
padding: 2px 5px !important;
|
||||
.vbo-views-form .vbo-table-select-all-pages,
|
||||
.vbo-views-form .vbo-table-select-this-page {
|
||||
margin: 0;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
/* Generic "select all" */
|
||||
@@ -30,6 +32,6 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.vbo-fieldset-select-all div {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
(function ($) {
|
||||
// Polyfill for jQuery less than 1.6.
|
||||
if (typeof $.fn.prop != 'function') {
|
||||
jQuery.fn.extend({
|
||||
prop: jQuery.fn.attr
|
||||
});
|
||||
}
|
||||
|
||||
Drupal.behaviors.vbo = {
|
||||
attach: function(context) {
|
||||
$('.vbo-views-form', context).each(function() {
|
||||
Drupal.vbo.initTableBehaviors(this);
|
||||
Drupal.vbo.initGenericBehaviors(this);
|
||||
Drupal.vbo.toggleButtonsState(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -32,7 +40,8 @@
|
||||
// This is the "select all" checkbox in (each) table header.
|
||||
$('.vbo-table-select-all', form).click(function() {
|
||||
var table = $(this).closest('table')[0];
|
||||
$('input[id^="edit-views-bulk-operations"]:not(:disabled)', table).attr('checked', this.checked);
|
||||
$('input[id^="edit-views-bulk-operations"]:not(:disabled)', table).prop('checked', this.checked);
|
||||
Drupal.vbo.toggleButtonsState(form);
|
||||
|
||||
// Toggle the visibility of the "select all" row (if any).
|
||||
if (this.checked) {
|
||||
@@ -83,35 +92,43 @@
|
||||
$('.vbo-select-all-markup', form).show();
|
||||
|
||||
$('.vbo-select-this-page', form).click(function() {
|
||||
$('input[id^="edit-views-bulk-operations"]', form).attr('checked', this.checked);
|
||||
$('.vbo-select-all-pages', form).attr('checked', false);
|
||||
$('input[id^="edit-views-bulk-operations"]', form).prop('checked', this.checked);
|
||||
Drupal.vbo.toggleButtonsState(form);
|
||||
$('.vbo-select-all-pages', form).prop('checked', false);
|
||||
|
||||
// Toggle the "select all" checkbox in grouped tables (if any).
|
||||
$('.vbo-table-select-all', form).attr('checked', this.checked);
|
||||
$('.vbo-table-select-all', form).prop('checked', this.checked);
|
||||
});
|
||||
$('.vbo-select-all-pages', form).click(function() {
|
||||
$('input[id^="edit-views-bulk-operations"]', form).attr('checked', this.checked);
|
||||
$('.vbo-select-this-page', form).attr('checked', false);
|
||||
$('input[id^="edit-views-bulk-operations"]', form).prop('checked', this.checked);
|
||||
Drupal.vbo.toggleButtonsState(form);
|
||||
$('.vbo-select-this-page', form).prop('checked', false);
|
||||
|
||||
// Toggle the "select all" checkbox in grouped tables (if any).
|
||||
$('.vbo-table-select-all', form).attr('checked', this.checked);
|
||||
$('.vbo-table-select-all', form).prop('checked', this.checked);
|
||||
|
||||
// Modify the value of the hidden form field.
|
||||
$('.select-all-rows', form).val(this.checked);
|
||||
});
|
||||
|
||||
// Toggle submit buttons' "disabled" states with the state of the operation
|
||||
// selectbox.
|
||||
$('select[name="operation"]', form).change(function () {
|
||||
Drupal.vbo.toggleButtonsState(form);
|
||||
});
|
||||
|
||||
$('.vbo-select', form).click(function() {
|
||||
// If a checkbox was deselected, uncheck any "select all" checkboxes.
|
||||
if (!this.checked) {
|
||||
$('.vbo-select-this-page', form).attr('checked', false);
|
||||
$('.vbo-select-all-pages', form).attr('checked', false);
|
||||
$('.vbo-select-this-page', form).prop('checked', false);
|
||||
$('.vbo-select-all-pages', form).prop('checked', false);
|
||||
// Modify the value of the hidden form field.
|
||||
$('.select-all-rows', form).val('0')
|
||||
|
||||
var table = $(this).closest('table')[0];
|
||||
if (table) {
|
||||
// Uncheck the "select all" checkbox in the table header.
|
||||
$('.vbo-table-select-all', table).attr('checked', false);
|
||||
$('.vbo-table-select-all', table).prop('checked', false);
|
||||
|
||||
// If there's a "select all" row, hide it.
|
||||
if ($('.vbo-table-select-this-page', table).length) {
|
||||
@@ -121,7 +138,24 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Drupal.vbo.toggleButtonsState(form);
|
||||
});
|
||||
}
|
||||
|
||||
Drupal.vbo.toggleButtonsState = function(form) {
|
||||
// If no rows are checked, disable any form submit actions.
|
||||
var selectbox = $('select[name="operation"]', form);
|
||||
var checkedCheckboxes = $('.vbo-select:checked', form);
|
||||
var buttons = $('[id^="edit-select"] input[type="submit"]', form);
|
||||
|
||||
if (selectbox.length) {
|
||||
var has_selection = checkedCheckboxes.length && selectbox.val() !== '0';
|
||||
buttons.prop('disabled', !has_selection);
|
||||
}
|
||||
else {
|
||||
buttons.prop('disabled', !checkedCheckboxes.length);
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
+2
-1
@@ -6,7 +6,8 @@
|
||||
function views_bulk_operations_views_data_alter(&$data) {
|
||||
foreach (entity_get_info() as $entity_type => $info) {
|
||||
if (isset($info['base table']) && isset($data[$info['base table']]['table'])) {
|
||||
$data[$info['base table']]['views_bulk_operations'] = array(
|
||||
$data[$info['base table']]['views_bulk_operations']['moved to'] = array('views_entity_' . $entity_type, 'views_bulk_operations');
|
||||
$data['views_entity_' . $entity_type]['views_bulk_operations'] = array(
|
||||
'title' => $data[$info['base table']]['table']['group'],
|
||||
'group' => t('Bulk operations'),
|
||||
'help' => t('Provide a checkbox to select the row for bulk operations.'),
|
||||
|
||||
+26
-30
@@ -6,7 +6,7 @@
|
||||
* Implements the Views Form API.
|
||||
*/
|
||||
|
||||
class views_bulk_operations_handler_field_operations extends views_handler_field {
|
||||
class views_bulk_operations_handler_field_operations extends views_handler_field_entity {
|
||||
var $revision = FALSE;
|
||||
|
||||
function init(&$view, &$options) {
|
||||
@@ -46,6 +46,12 @@ class views_bulk_operations_handler_field_operations extends views_handler_field
|
||||
unset($operation_options['use_queue']);
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether this is a revision.
|
||||
$table_data = views_fetch_data($this->table);
|
||||
if (!empty($table_data['table']['revision'])) {
|
||||
$this->revision = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function option_definition() {
|
||||
@@ -186,6 +192,14 @@ class views_bulk_operations_handler_field_operations extends views_handler_field
|
||||
$dom_id . '-selected' => array(1),
|
||||
),
|
||||
);
|
||||
$form['vbo_operations'][$operation_id]['skip_permission_check'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Skip permission step'),
|
||||
'#default_value' => !empty($operation_options['skip_permission_check']),
|
||||
'#dependency' => array(
|
||||
$dom_id . '-selected' => array(1),
|
||||
),
|
||||
);
|
||||
|
||||
$form['vbo_operations'][$operation_id] += $operation->adminOptionsForm($dom_id, $this);
|
||||
}
|
||||
@@ -263,19 +277,20 @@ class views_bulk_operations_handler_field_operations extends views_handler_field
|
||||
// At this point, the query has already been run, so we can access the results
|
||||
// in order to get the base key value (for example, nid for nodes).
|
||||
foreach ($this->view->result as $row_index => $row) {
|
||||
$entity_id = $this->get_value($row);
|
||||
$this->view->row_index = $row_index;
|
||||
$id = $this->get_value($row, $this->real_field);
|
||||
|
||||
if ($this->options['vbo_settings']['force_single']) {
|
||||
$form[$this->options['id']][$row_index] = array(
|
||||
'#type' => 'radio',
|
||||
'#parents' => array($this->options['id']),
|
||||
'#return_value' => $entity_id,
|
||||
'#return_value' => $id,
|
||||
);
|
||||
}
|
||||
else {
|
||||
$form[$this->options['id']][$row_index] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#return_value' => $entity_id,
|
||||
'#return_value' => $id,
|
||||
'#default_value' => FALSE,
|
||||
'#attributes' => array('class' => array('vbo-select')),
|
||||
);
|
||||
@@ -293,9 +308,12 @@ class views_bulk_operations_handler_field_operations extends views_handler_field
|
||||
if (empty($options['selected'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$operation = views_bulk_operations_get_operation($operation_id, $entity_type, $options);
|
||||
if (!$operation || !$operation->access($user)) {
|
||||
if (!$operation) {
|
||||
continue;
|
||||
}
|
||||
$skip_permission_check = $operation->getAdminOption('skip_permission_check', FALSE);
|
||||
if (!$operation->access($user) && !$skip_permission_check) {
|
||||
continue;
|
||||
}
|
||||
$selected[$operation_id] = $operation;
|
||||
@@ -318,29 +336,7 @@ class views_bulk_operations_handler_field_operations extends views_handler_field
|
||||
* the entity type that VBO is operating on.
|
||||
*/
|
||||
public function get_entity_type() {
|
||||
$base_table = $this->view->base_table;
|
||||
|
||||
// If the current field is under a relationship you can't be sure that the
|
||||
// base table of the view is the base table of the current field.
|
||||
// For example a field from a node author on a node view does have users as base table.
|
||||
if (!empty($this->options['relationship']) && $this->options['relationship'] != 'none') {
|
||||
$relationships = $this->view->display_handler->get_option('relationships');
|
||||
$options = $relationships[$this->options['relationship']];
|
||||
$data = views_fetch_data($options['table']);
|
||||
$base_table = $data[$options['field']]['relationship']['base'];
|
||||
}
|
||||
// The base table is now known, use it to determine the entity type.
|
||||
foreach (entity_get_info() as $entity_type => $info) {
|
||||
if (isset($info['base table']) && $info['base table'] == $base_table) {
|
||||
return $entity_type;
|
||||
}
|
||||
elseif (isset($info['revision table']) && $info['revision table'] == $base_table) {
|
||||
$this->revision = TRUE;
|
||||
return $entity_type;
|
||||
}
|
||||
}
|
||||
// This should never happen.
|
||||
_views_bulk_operations_report_error("Could not determine the entity type for VBO field on views base table %table", array('%table' => $base_table));
|
||||
return FALSE;
|
||||
return $this->entity_type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ function views_bulk_operations_drush_execute($vid = NULL, $operation_id = NULL)
|
||||
$current = 1;
|
||||
foreach ($view->result as $row_index => $result) {
|
||||
$rows[$row_index] = array(
|
||||
'entity_id' => $vbo->get_value($result),
|
||||
'entity_id' => $result->{$vbo->real_field},
|
||||
'views_row' => array(),
|
||||
'position' => array(
|
||||
'current' => $current++,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name = Views Bulk Operations
|
||||
description = Provides a way of selecting multiple rows and applying operations to them.
|
||||
dependencies[] = entity
|
||||
dependencies[] = views
|
||||
dependencies[] = views (>=3.12)
|
||||
package = Views
|
||||
core = 7.x
|
||||
php = 5.2.9
|
||||
@@ -9,9 +9,9 @@ php = 5.2.9
|
||||
files[] = plugins/operation_types/base.class.php
|
||||
files[] = views/views_bulk_operations_handler_field_operations.inc
|
||||
|
||||
; Information added by Drupal.org packaging script on 2015-07-01
|
||||
version = "7.x-3.3"
|
||||
; Information added by Drupal.org packaging script on 2017-02-21
|
||||
version = "7.x-3.4"
|
||||
core = "7.x"
|
||||
project = "views_bulk_operations"
|
||||
datestamp = "1435764542"
|
||||
datestamp = "1487698687"
|
||||
|
||||
|
||||
+35
-11
@@ -45,6 +45,7 @@ function views_bulk_operations_load_action_includes() {
|
||||
'archive.action',
|
||||
'argument_selector.action',
|
||||
'book.action',
|
||||
'change_owner.action',
|
||||
'delete.action',
|
||||
'modify.action',
|
||||
'script.action',
|
||||
@@ -75,7 +76,7 @@ function views_bulk_operations_load_action_includes() {
|
||||
*/
|
||||
function views_bulk_operations_cron() {
|
||||
db_delete('queue')
|
||||
->condition('name', db_like('views_bulk_operations_active_queue_'), 'LIKE')
|
||||
->condition('name', db_like('views_bulk_operations_active_queue_') . '%', 'LIKE')
|
||||
->condition('created', REQUEST_TIME - 86400, '<')
|
||||
->execute();
|
||||
}
|
||||
@@ -214,7 +215,12 @@ function views_bulk_operations_get_operation_info($operation_id = NULL) {
|
||||
function views_bulk_operations_get_operation($operation_id, $entity_type, $options) {
|
||||
$operations = &drupal_static(__FUNCTION__);
|
||||
|
||||
if (!isset($operations[$operation_id])) {
|
||||
// Create a unique hash of the options.
|
||||
$cid = md5(serialize($options));
|
||||
|
||||
// See if there's a cached copy of the operation, including entity type and
|
||||
// options.
|
||||
if (!isset($operations[$operation_id][$entity_type][$cid])) {
|
||||
// Intentionally not using views_bulk_operations_get_operation_info() here
|
||||
// since it's an expensive function that loads all the operations on the
|
||||
// system, despite the fact that we might only need a few.
|
||||
@@ -223,14 +229,14 @@ function views_bulk_operations_get_operation($operation_id, $entity_type, $optio
|
||||
$operation_info = $plugin['list callback']($operation_id);
|
||||
|
||||
if ($operation_info) {
|
||||
$operations[$operation_id] = new $plugin['handler']['class']($operation_id, $entity_type, $operation_info, $options);
|
||||
$operations[$operation_id][$entity_type][$cid] = new $plugin['handler']['class']($operation_id, $entity_type, $operation_info, $options);
|
||||
}
|
||||
else {
|
||||
$operations[$operation_id] = FALSE;
|
||||
$operations[$operation_id][$entity_type][$cid] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return $operations[$operation_id];
|
||||
return $operations[$operation_id][$entity_type][$cid];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -638,11 +644,11 @@ function theme_views_bulk_operations_confirmation($variables) {
|
||||
// All rows on all pages have been selected, so show a count of additional items.
|
||||
if ($select_all_pages) {
|
||||
$more_count = $vbo->view->total_rows - count($vbo->view->result);
|
||||
$items[] = t('...and <strong>!count</strong> more.', array('!count' => $more_count));
|
||||
$items[] = t('...and %count more.', array('%count' => $more_count));
|
||||
}
|
||||
|
||||
$count = format_plural(count($entities), 'item', '@count items');
|
||||
$output = theme('item_list', array('items' => $items, 'title' => t('You selected the following <strong>!count</strong>:', array('!count' => $count))));
|
||||
$output = theme('item_list', array('items' => $items, 'title' => t('You selected the following %count:', array('%count' => $count))));
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -902,10 +908,16 @@ function views_bulk_operations_adjust_selection($queue_name, $operation, $option
|
||||
}
|
||||
|
||||
$vbo = _views_bulk_operations_get_field($view);
|
||||
|
||||
// Call views_handler_field_entity::pre_render() to get the entities.
|
||||
$vbo->pre_render($view->result);
|
||||
|
||||
$rows = array();
|
||||
foreach ($view->result as $row_index => $result) {
|
||||
// Set the row index.
|
||||
$view->row_index = $row_index;
|
||||
$rows[$row_index] = array(
|
||||
'entity_id' => $vbo->get_value($result),
|
||||
'entity_id' => $vbo->get_value($result, $vbo->real_field),
|
||||
'views_row' => array(),
|
||||
'position' => array(
|
||||
'current' => ++$context['sandbox']['progress'],
|
||||
@@ -1075,7 +1087,8 @@ function views_bulk_operations_queue_item_process($queue_item_data, &$log = NULL
|
||||
}
|
||||
|
||||
// If the current entity can't be accessed, skip it and log a notice.
|
||||
if (!_views_bulk_operations_entity_access($operation, $entity_type, $entity, $account)) {
|
||||
$skip_permission_check = $operation->getAdminOption('skip_permission_check');
|
||||
if (!$skip_permission_check && !_views_bulk_operations_entity_access($operation, $entity_type, $entity, $account)) {
|
||||
$message = 'Skipped %operation on @type %title due to insufficient permissions.';
|
||||
$arguments = array(
|
||||
'%operation' => $operation->label(),
|
||||
@@ -1127,12 +1140,22 @@ function views_bulk_operations_direct_adjust(&$selection, $vbo) {
|
||||
if ($field_name != $vbo->options['id']) {
|
||||
unset($view->field[$field_name]);
|
||||
}
|
||||
else {
|
||||
// Get hold of the new VBO field.
|
||||
$new_vbo = $view->field[$field_name];
|
||||
}
|
||||
}
|
||||
|
||||
$view->execute($vbo->view->current_display);
|
||||
|
||||
// Call views_handler_field_entity::pre_render() to get the entities.
|
||||
$new_vbo->pre_render($view->result);
|
||||
|
||||
$results = array();
|
||||
foreach ($view->result as $row_index => $result) {
|
||||
$results[$row_index] = $vbo->get_value($result);
|
||||
// Set the row index.
|
||||
$view->row_index = $row_index;
|
||||
$results[$row_index] = $new_vbo->get_value($result, $new_vbo->real_field);
|
||||
}
|
||||
$selection = $results;
|
||||
}
|
||||
@@ -1160,9 +1183,10 @@ function views_bulk_operations_direct_process($operation, $rows, $options) {
|
||||
}
|
||||
$entities = _views_bulk_operations_entity_load($entity_type, $entity_ids, $options['revision']);
|
||||
|
||||
$skip_permission_check = $operation->getAdminOption('skip_permission_check');
|
||||
// Filter out entities that can't be accessed.
|
||||
foreach ($entities as $id => $entity) {
|
||||
if (!_views_bulk_operations_entity_access($operation, $entity_type, $entity)) {
|
||||
if (!$skip_permission_check && !_views_bulk_operations_entity_access($operation, $entity_type, $entity, $account)) {
|
||||
$context['results']['log'][] = t('Skipped %operation on @type %title due to insufficient permissions.', array(
|
||||
'%operation' => $operation->label(),
|
||||
'@type' => $entity_type,
|
||||
|
||||
+15
-5
@@ -114,15 +114,25 @@ function views_bulk_operations_rules_action_info() {
|
||||
function views_bulk_operations_views_list() {
|
||||
$selectable_displays = array();
|
||||
foreach (views_get_enabled_views() as $name => $base_view) {
|
||||
$view = $base_view->clone_view();
|
||||
foreach ($base_view->display as $display_name => $display) {
|
||||
$view = $base_view->clone_view();
|
||||
$view->build($display_name);
|
||||
$vbo = _views_bulk_operations_get_field($view);
|
||||
if ($vbo) {
|
||||
$selectable_displays[$view->name . '|' . $display_name] = check_plain($view->human_name) . ' | ' . check_plain($display->display_title);
|
||||
if (!$view->set_display($display_name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Initialize the style plugin and only continue to initialize handlers
|
||||
// if the style uses fields.
|
||||
if (!$view->init_style() || !$view->style_plugin->uses_fields()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$view->init_handlers($display_name);
|
||||
if (_views_bulk_operations_get_field($view)) {
|
||||
$selectable_displays[$view->name . '|' . $display_name] = check_plain($view->human_name . ' | ' . $display->display_title);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $selectable_displays;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user