From adb2ce46c140efc132354dd70e8cd8abcc9ccad3 Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 3 Aug 2012 16:34:23 -0300 Subject: Check for a timeline.css in the current theme instead of using a hardcoded value --- timelinejs.module | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'timelinejs.module') diff --git a/timelinejs.module b/timelinejs.module index f1de06d..340e1ea 100644 --- a/timelinejs.module +++ b/timelinejs.module @@ -117,17 +117,20 @@ function timelinejs_json($nid) { * Menu callback. * * @todo - * Check for a timeline.css in the current theme instead of using a hardcoded value. * Dimensions should be configurable. */ function timelinejs($nid) { global $language; + global $theme; + + $path = drupal_get_path('theme', $theme); + $css = (file_exists($path .'/timeline.css')) ? '/'. $path .'/timeline.css' : NULL; return theme('timelinejs', array( 'width' => '960px', 'height' => '500px', 'source' => '/timelinejs/json/'. (int) $nid, - 'css' => '/sites/boletim/themes/boletimclean/timeline.css', + 'css' => $css, 'lang' => '/sites/all/libraries/timelinejs/compiled/js/locale/'. $language->language .'.js', )); } -- cgit v1.2.3