diff options
| author | Silvio <silvio@socioambiental.org> | 2018-07-03 15:36:02 -0300 | 
|---|---|---|
| committer | Silvio <silvio@socioambiental.org> | 2018-07-03 15:36:02 -0300 | 
| commit | f56b5020a92d581cc6a9c61f56e78c6cbb305ad0 (patch) | |
| tree | 0c398c3aea12e3871f499055d21032f75361f308 | |
| parent | 1126dad8254623dee4063b7a7d739900ef96ceac (diff) | |
| download | timelinejs-f56b5020a92d581cc6a9c61f56e78c6cbb305ad0.tar.gz timelinejs-f56b5020a92d581cc6a9c61f56e78c6cbb305ad0.tar.bz2  | |
Make timeline logo link to content
| -rw-r--r-- | timelinejs.module | 8 | ||||
| -rw-r--r-- | timelinejs.tpl.php | 5 | 
2 files changed, 9 insertions, 4 deletions
diff --git a/timelinejs.module b/timelinejs.module index 5f15a4a..db7034b 100644 --- a/timelinejs.module +++ b/timelinejs.module @@ -55,6 +55,7 @@ function timelinejs_theme($existing, $type, $theme, $path) {        'template'  => 'timelinejs',        'variables' => array(          'module_path'   => drupal_get_path('module', 'timelinejs'), +        'nid'           => NULL,          'width'         => NULL,          'height'        => NULL,          'source'        => NULL, @@ -64,6 +65,7 @@ function timelinejs_theme($existing, $type, $theme, $path) {          'js'            => '/' . timelinejs_library_path() . '/compiled/js/timeline.js',          'font'          => NULL,          'lang'          => NULL, +        'lang_js'       => NULL,        ),      ),      'timelinejs_json' => array( @@ -251,6 +253,8 @@ function timelinejs($nid = NULL, $width = '960px', $height = '600px') {    }    return theme('timelinejs', array( +    'nid'          => $nid, +    'lang'         => $language->language,      'width'        => $width,      'height'       => $height,      'source'       => $source, @@ -258,8 +262,8 @@ function timelinejs($nid = NULL, $width = '960px', $height = '600px') {      // Use timelinejs from CDN until we fix it's direct inclusion      // See https://gitlab.com/socioambiental/widgets/issues/2      'js'           => 'https://cdn.knightlab.com/libs/timeline/latest/js/timeline-min.js', -    //'js'           => '/' . $library_path . '/compiled/js/timeline-min.js', -    'lang'         => '/' . $library_path . '/compiled/js/locale/' . $language->language . '.js', +    //'js'         => '/' . $library_path . '/compiled/js/timeline-min.js', +    'lang_js'      => '/' . $library_path . '/compiled/js/locale/' . $language->language . '.js',      'font'         => variable_get('timelinejs_font', 'Bevan-PotanoSans'),      'library_path' => $library_path,    )); diff --git a/timelinejs.tpl.php b/timelinejs.tpl.php index 4393264..a551df4 100644 --- a/timelinejs.tpl.php +++ b/timelinejs.tpl.php @@ -1,5 +1,6 @@ +<?php global $base_url; ?>  <!-- BEGIN Timeline Embed --> -<img style="z-index: 99999999; position: fixed; margin-top: 10px; margin-left: 10px;" src="/<?php print $module_path; ?>/images/isa-icon.png" alt="Instituto Socioambiental"> +<a href="<?php print $base_url; ?>/<?php print $lang; ?>/node/<?php print $nid; ?>"><img style="z-index: 99999999; position: fixed; margin-top: 10px; margin-left: 10px;" src="/<?php print $module_path; ?>/images/isa-icon.png" alt="Instituto Socioambiental"></a>  <div id="timeline-embed" style="width:<?print $width; ?>; height: <?php print $height; ?>;"></div>  <script type="text/javascript">    var timeline_config = { @@ -11,7 +12,7 @@        css:           "<?php print $css; ?>",        js:            "<?php print $js; ?>",        font:          "<?php print $font; ?>", -      lang:          "<?php print $lang; ?>" +      lang:          "<?php print $lang_js; ?>"    }    // Used to open links in the parent iframe when showing as a widget  | 
