Advertisement
jcisio

Untitled

Mar 7th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. commit af438d28a0bfdba290074ecd5a37897fae987c49
  2. Author: Hai-Nam Nguyen <hainam@jcisio.com>
  3. Date: Wed Mar 7 15:29:14 2012 +0100
  4.  
  5. Fix relative link in cotation block. Introduct parameter to instrument link helper function.
  6.  
  7. diff --git a/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module b/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
  8. index 0fca136..e3da31d 100644
  9. --- a/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
  10. +++ b/www/sites/all/modules/custom/lefigaro_common/lefigaro_common.module
  11. @@ -106,7 +106,7 @@ function lefigaro_common_block_fiche_valeur($id_notation) {
  12.  
  13. $output = '<div class="entete-bourse">Bourse</div>';
  14. $output .= '<div class="block-bourse-left">';
  15. - $output .= '<div class="nom"><strong>' . lefigaro_common_link_to_instrument($company['SHORT_NAME_SECURITY']['raw'], $id_notation) . '</strong></div>';
  16. + $output .= '<div class="nom"><strong>' . lefigaro_common_link_to_instrument($company['SHORT_NAME_SECURITY']['raw'], $id_notation, NULL, '', array('absolute' => TRUE))
  17. $output .= '<div class="valeur ' . lefigaro_common_updown($price['PERFORMANCE_PCT']['raw']) . '">' . $price['PRICE']['value'] . '</div>';
  18. $output .= '<div class="variation ' . lefigaro_common_updown($price['PERFORMANCE_PCT']['raw']) . '">' . $price['PERFORMANCE_PCT']['value'] . '</div>';
  19. $output .= '</div>';
  20. @@ -1064,9 +1064,10 @@ function lefigaro_common_instrument_redirect($id_notation) {
  21. * String. The base part of the url to use (eg indices-actions/cours/) before the nid. Defaults depends on instrument type.
  22. * @param $suffix
  23. * String. Last part of the url to append (eg, /historique)
  24. + * @param $options more options to pass to url()
  25. */
  26.  
  27. -function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL, $suffix = '') {
  28. +function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL, $suffix = '', $options = array()) {
  29. if (!$id_notation) {
  30. return $name;
  31. }
  32. @@ -1081,11 +1082,11 @@ function lefigaro_common_link_to_instrument($name, $id_notation, $prefix = NULL,
  33. }
  34. }
  35. $path = trim($prefix . '/' . $nid . '/' . $suffix, '/');
  36. - return l($name, $path);
  37. + return l($name, $path, $options);
  38. }
  39. //No node found, will create it on click.
  40. if ($prefix = _lefigaro_common_link_get_instrument_prefix($type)) {
  41. - return l($name, 'instrumentlink/' . $id_notation);
  42. + return l($name, 'instrumentlink/' . $id_notation, $options);
  43. }
  44. }
  45. //No know type, do not return a link but just the $name.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement