Révision f9d4b898
Ajouté par Assos Assos il y a environ 3 ans
drupal7/sites/all/modules/token/tests/token_test.info | ||
---|---|---|
5 | 5 |
files[] = token_test.module |
6 | 6 |
hidden = TRUE |
7 | 7 |
|
8 |
; Information added by Drupal.org packaging script on 2017-01-25
|
|
9 |
version = "7.x-1.7"
|
|
8 |
; Information added by Drupal.org packaging script on 2021-03-02
|
|
9 |
version = "7.x-1.8"
|
|
10 | 10 |
core = "7.x" |
11 | 11 |
project = "token" |
12 |
datestamp = "1485316088" |
|
13 |
|
|
12 |
datestamp = "1614719852" |
drupal7/sites/all/modules/token/token.info | ||
---|---|---|
1 | 1 |
name = Token |
2 | 2 |
description = Provides a user interface for the Token API and some missing core tokens. |
3 | 3 |
core = 7.x |
4 |
dependencies[] = system (>=7.23) |
|
4 | 5 |
files[] = token.test |
5 | 6 |
|
6 |
; Information added by Drupal.org packaging script on 2017-01-25
|
|
7 |
version = "7.x-1.7"
|
|
7 |
; Information added by Drupal.org packaging script on 2021-03-02
|
|
8 |
version = "7.x-1.8"
|
|
8 | 9 |
core = "7.x" |
9 | 10 |
project = "token" |
10 |
datestamp = "1485316088" |
|
11 |
|
|
11 |
datestamp = "1614719852" |
drupal7/sites/all/modules/token/token.module | ||
---|---|---|
161 | 161 |
'attributes' => array(), |
162 | 162 |
'empty' => '', |
163 | 163 |
'caption' => '', |
164 |
'colgroups' => array(), |
|
165 |
'sticky' => TRUE, |
|
164 | 166 |
), |
165 | 167 |
'file' => 'token.pages.inc', |
166 | 168 |
); |
... | ... | |
1228 | 1230 |
if (!isset($cache[$mlid])) { |
1229 | 1231 |
$cache[$mlid] = array(); |
1230 | 1232 |
$plid = db_query("SELECT plid FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField(); |
1231 |
while ($plid && $parent = token_menu_link_load($plid)) { |
|
1233 |
while ($plid && $plid != $mlid && $parent = token_menu_link_load($plid)) {
|
|
1232 | 1234 |
$cache[$mlid] = array($plid => $parent['title']) + $cache[$mlid]; |
1233 | 1235 |
$plid = $parent['plid']; |
1234 | 1236 |
} |
drupal7/sites/all/modules/token/token.test | ||
---|---|---|
956 | 956 |
'last' => 'b', |
957 | 957 |
'value:0' => 'a', |
958 | 958 |
'value:2' => 'c', |
959 |
'value:#property' => NULL, |
|
959 | 960 |
'count' => 4, |
960 | 961 |
'keys' => '2, 0, 4, 1', |
961 | 962 |
'keys:value:3' => '1', |
... | ... | |
1080 | 1081 |
$edit['body[value]'] = 'This is the test token title block.'; |
1081 | 1082 |
$this->drupalPost('admin/structure/block/add', $edit, 'Save block'); |
1082 | 1083 |
// Ensure token validation is working on the block. |
1083 |
$this->assertText('The Block title is using the following invalid tokens: [user:name].');
|
|
1084 |
$this->assertText('Block title is using the following invalid tokens: [user:name].'); |
|
1084 | 1085 |
|
1085 | 1086 |
// Create the block for real now with a valid title. |
1086 | 1087 |
$edit['title'] = '[current-page:title] block title'; |
drupal7/sites/all/modules/token/token.tokens.inc | ||
---|---|---|
848 | 848 |
// [array:value:*] dynamic tokens. |
849 | 849 |
if ($value_tokens = token_find_with_prefix($tokens, 'value')) { |
850 | 850 |
foreach ($value_tokens as $key => $original) { |
851 |
if ($key[0] !== '#' && isset($array[$key])) {
|
|
851 |
if (array_key_exists($key, $array) && in_array($key, $keys)) {
|
|
852 | 852 |
$replacements[$original] = token_render_array_value($array[$key], $options); |
853 | 853 |
} |
854 | 854 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules