diff options
-rw-r--r-- | timelinejs.module | 16 | ||||
-rw-r--r-- | timelinejs_embed.tpl.php | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/timelinejs.module b/timelinejs.module index db7034b..1afff83 100644 --- a/timelinejs.module +++ b/timelinejs.module @@ -68,6 +68,13 @@ function timelinejs_theme($existing, $type, $theme, $path) { 'lang_js' => NULL, ), ), + 'timelinejs_embed' => array( + 'template' => 'timelinejs_embed', + 'variables' => array( + 'nid' => NULL, + 'lang' => NULL, + ), + ), 'timelinejs_json' => array( 'template' => 'timelinejs_json', 'variables' => array('headline', 'date', 'text', 'media', 'events'), @@ -252,7 +259,7 @@ function timelinejs($nid = NULL, $width = '960px', $height = '600px') { $height = '100%'; } - return theme('timelinejs', array( + $output = theme('timelinejs', array( 'nid' => $nid, 'lang' => $language->language, 'width' => $width, @@ -267,6 +274,13 @@ function timelinejs($nid = NULL, $width = '960px', $height = '600px') { 'font' => variable_get('timelinejs_font', 'Bevan-PotanoSans'), 'library_path' => $library_path, )); + + $output .= theme('timelinejs_embed', array( + 'nid' => $nid, + 'lang' => $language->language, + )); + + return $output; } /** diff --git a/timelinejs_embed.tpl.php b/timelinejs_embed.tpl.php new file mode 100644 index 0000000..cc5a18a --- /dev/null +++ b/timelinejs_embed.tpl.php @@ -0,0 +1,3 @@ +<br /> +<?php global $base_url; ?> +<?php print t('Embed code'); ?>: <textarea rows="1" style="width: 90%;"><iframe src="<?php print $base_url; ?>/<?php print $lang; ?>/node/<?php print $nid; ?>" height="300px" width="100%" allowfullscreen frameborder="0"></textarea> |