Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit af438d28a0bfdba290074ecd5a37897fae987c49
- Author: Hai-Nam Nguyen <hainam@jcisio.com>
- Date: Wed Mar 7 15:29:14 2012 +0100
- Fix relative link in cotation block. Introduct parameter to instrument link helper function.
- diff --git a/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module b/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
- index 0fca136..e3da31d 100644
- --- a/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
- +++ b/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
- @@ -106,7 +106,7 @@ function lefigaro_common_block_fiche_valeur($id_notation) {
- $output = '<div class="entete-bourse">Bourse</div>';
- $output .= '<div class="block-bourse-left">';
- - $output .= '<div class="nom"><strong>' . lefigaro_common_link_to_instrument($company['SHORT_NAME_SECURITY']['raw'], $id_notation) . '</strong></div>';
- + $output .= '<div class="nom"><strong>' . lefigaro_common_link_to_instrument($company['SHORT_NAME_SECURITY']['raw'], $id_notation, NULL, '', array('absolute' => TRUE))
- $output .= '<div class="valeur ' . lefigaro_common_updown($price['PERFORMANCE_PCT']['raw']) . '">' . $price['PRICE']['value'] . '</div>';
- $output .= '<div class="variation ' . lefigaro_common_updown($price['PERFORMANCE_PCT']['raw']) . '">' . $price['PERFORMANCE_PCT']['value'] . '</div>';
- $output .= '</div>';
- @@ -1064,9 +1064,10 @@ function lefigaro_common_instrument_redirect($id_notation) {
- * String. The base part of the url to use (eg indices-actions/cours/) before the nid. Defaults depends on instrument type.
- * @param $suffix
- * String. Last part of the url to append (eg, /historique)
- + * @param $options more options to pass to url()
- */
- -function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL, $suffix = '') {
- +function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL, $suffix = '', $options = array()) {
- if (!$id_notation) {
- return $name;
- }
- @@ -1081,11 +1082,11 @@ function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL,
- }
- }
- $path = trim($prefix . '/' . $nid . '/' . $suffix, '/');
- - return l($name, $path);
- + return l($name, $path, $options);
- }
- //No node found, will create it on click.
- if ($prefix = _lefigaro_common_link_get_instrument_prefix($type)) {
- - return l($name, 'instrumentlink/' . $id_notation);
- + return l($name, 'instrumentlink/' . $id_notation, $options);
- }
- }
- //No know type, do not return a link but just the $name.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement