Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/contexts/string.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* |
|
6 |
* Plugin to provide a string context |
|
5 |
* Plugin to provide a string context. |
|
7 | 6 |
*/ |
8 | 7 |
|
9 | 8 |
/** |
... | ... | |
38 | 37 |
function ctools_context_create_string($empty, $data = NULL, $conf = FALSE) { |
39 | 38 |
// The input is expected to be an object as created by ctools_break_phrase |
40 | 39 |
// which contains a group of string. |
41 |
|
|
42 | 40 |
$context = new ctools_context('string'); |
43 | 41 |
$context->plugin = 'string'; |
44 | 42 |
|
... | ... | |
46 | 44 |
return $context; |
47 | 45 |
} |
48 | 46 |
|
49 |
if ($data !== FALSE ) {
|
|
47 |
if ($data !== FALSE) { |
|
50 | 48 |
// Support the array storage from the settings form but also handle direct input from arguments. |
51 | 49 |
$context->data = is_array($data) ? $data['string'] : $data; |
52 | 50 |
$context->title = ($conf) ? check_plain($data['identifier']) : check_plain($data); |
... | ... | |
61 | 59 |
switch ($type) { |
62 | 60 |
case 'raw': |
63 | 61 |
return $context->data; |
62 |
|
|
64 | 63 |
case 'html_safe': |
65 | 64 |
return check_plain($context->data); |
65 |
|
|
66 | 66 |
case 'uppercase_words_html_safe': |
67 | 67 |
return ucwords(str_replace('-', ' ', check_plain($context->data))); |
68 | 68 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules