From 10f23b7572cfa605c15e8c7fef21c7234ce32976 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 3 Jul 2018 17:03:05 -0300 Subject: Do not show embed code if already embeded --- timelinejs.module | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/timelinejs.module b/timelinejs.module index 1afff83..441f8f9 100644 --- a/timelinejs.module +++ b/timelinejs.module @@ -210,7 +210,7 @@ function timelinejs_widget($nid = NULL, $width = '960px', $height = '500px') { $output .= '' . t('Timeline: @title', array('@title' => $node->title)) . ''; $output .= ''; $output .= ''; - $output .= timelinejs($nid, $width, $height); + $output .= timelinejs($nid, $width, $height, FALSE); $output .= ''; // Avoid themeable output. @@ -221,7 +221,7 @@ function timelinejs_widget($nid = NULL, $width = '960px', $height = '500px') { /** * Menu callback. */ -function timelinejs($nid = NULL, $width = '960px', $height = '600px') { +function timelinejs($nid = NULL, $width = '960px', $height = '600px', $embed = TRUE) { global $language; global $theme; global $base_url; @@ -275,10 +275,12 @@ function timelinejs($nid = NULL, $width = '960px', $height = '600px') { 'library_path' => $library_path, )); - $output .= theme('timelinejs_embed', array( - 'nid' => $nid, - 'lang' => $language->language, - )); + if ($embed) { + $output .= theme('timelinejs_embed', array( + 'nid' => $nid, + 'lang' => $language->language, + )); + } return $output; } -- cgit v1.2.3