summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2018-07-03 16:00:22 -0300
committerSilvio <silvio@socioambiental.org>2018-07-03 16:00:22 -0300
commit9826a88694a0f1ad35ed5c9da2287f366ad890f7 (patch)
treee305c500aefad12572836e1eb64cf8e1172d274f
parentf56b5020a92d581cc6a9c61f56e78c6cbb305ad0 (diff)
downloadtimelinejs-9826a88694a0f1ad35ed5c9da2287f366ad890f7.tar.gz
timelinejs-9826a88694a0f1ad35ed5c9da2287f366ad890f7.tar.bz2
Adds embed code textarea
-rw-r--r--timelinejs.module16
-rw-r--r--timelinejs_embed.tpl.php3
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>