summaryrefslogtreecommitdiff
path: root/timelinejs.module
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2012-08-02 16:41:37 -0300
committerSilvio <silvio@socioambiental.org>2012-08-02 16:41:37 -0300
commitd6d6b670401e28caff59f330d3d2843d65b85de9 (patch)
treebb83b20c977bee5f7c5f7cde13e5ca747de7992c /timelinejs.module
parent0984f3d81efe59a3028b3f00a1f9afb8926da885 (diff)
downloadtimelinejs-d6d6b670401e28caff59f330d3d2843d65b85de9.tar.gz
timelinejs-d6d6b670401e28caff59f330d3d2843d65b85de9.tar.bz2
More changes in the timelinejs_json
Diffstat (limited to 'timelinejs.module')
-rw-r--r--timelinejs.module13
1 files changed, 9 insertions, 4 deletions
diff --git a/timelinejs.module b/timelinejs.module
index 33020ed..5f948fe 100644
--- a/timelinejs.module
+++ b/timelinejs.module
@@ -109,6 +109,7 @@ function timelinejs_load_events($nid) {
function timelinejs_json($nid) {
// Sanitization and basic data.
$nid = (int) $nid;
+ $node = node_load($nid);
$nodes = timelinejs_load_events($nid);
foreach ($nodes as $node) {
@@ -116,10 +117,15 @@ function timelinejs_json($nid) {
}
foreach ($items as $event) {
- $events[] = theme('timelinejs_json_event', array('event' => $event));
- $events = implode(',', $events);
+ $output[] = theme('timelinejs_json_event', array('event' => $event));
+ $events = implode(',', $output);
}
+ // TODO
+ $text = $media = NULL;
+ $headline = $node->title;
+ $date = $node->field_data['und']['0']['value'];
+
print theme('timelinejs_json', array(
'headline' => $headline,
'date' => $date,
@@ -139,8 +145,7 @@ function timelinejs($nid) {
return theme('timelinejs', array(
'width' => '960px',
'height' => '500px',
- 'source' => '/sites/boletim/files/timeline-saude-indigena_2.json',
- //'source' => '/timelinejs/json/'. (int) $nid,
+ 'source' => '/timelinejs/json/'. (int) $nid,
'css' => '/sites/boletim/themes/boletimclean/timeline.css'
));
}