Révision 582db59d
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/includes/theme.inc | ||
---|---|---|
1710 | 1710 |
* copy if none of the enabled modules or the active theme implement any |
1711 | 1711 |
* preprocess or process functions or override this theme implementation. |
1712 | 1712 |
* |
1713 |
* @param $variables |
|
1714 |
* An associative array containing the keys 'text', 'path', and 'options'. |
|
1715 |
* See the l() function for information about these variables. |
|
1713 |
* @param array $variables |
|
1714 |
* An associative array containing the keys: |
|
1715 |
* - text: The text of the link. |
|
1716 |
* - path: The internal path or external URL being linked to. It is used as |
|
1717 |
* the $path parameter of the url() function. |
|
1718 |
* - options: (optional) An array that defaults to empty, but can contain: |
|
1719 |
* - attributes: Can contain optional attributes: |
|
1720 |
* - class: must be declared in an array. Example: 'class' => |
|
1721 |
* array('class_name1','class_name2'). |
|
1722 |
* - title: must be a string. Example: 'title' => 'Example title' |
|
1723 |
* - Others are more flexible as long as they work with |
|
1724 |
* drupal_attributes($variables['options']['attributes]). |
|
1725 |
* - html: Boolean flag that tells whether text contains HTML or plain |
|
1726 |
* text. If set to TRUE, the text value will not be sanitized so the |
|
1727 |
calling function must ensure that it already contains safe HTML. |
|
1728 |
* The elements $variables['options']['attributes'] and |
|
1729 |
* $variables['options']['html'] are used in this function similarly to the |
|
1730 |
* way that $options['attributes'] and $options['html'] are used in l(). |
|
1731 |
* The link itself is built by the url() function, which takes |
|
1732 |
* $variables['path'] and $variables['options'] as arguments. |
|
1716 | 1733 |
* |
1717 | 1734 |
* @see l() |
1735 |
* @see url() |
|
1718 | 1736 |
*/ |
1719 | 1737 |
function theme_link($variables) { |
1720 | 1738 |
return '<a href="' . check_plain(url($variables['path'], $variables['options'])) . '"' . drupal_attributes($variables['options']['attributes']) . '>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '</a>'; |
Formats disponibles : Unified diff
Update Drupal core to version 7.40