Mercurial > hg > mpiwg_geobrowser
comparison plugins/content_types/mpiwg_geobrowser_storyTelling.inc @ 0:b57c7821382f
initial
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 28 May 2015 10:28:12 +0200 |
parents | |
children | ea066ce001bd |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b57c7821382f |
---|---|
1 <?php | |
2 | |
3 $plugin = array( | |
4 'single' => TRUE, | |
5 'title' => t('storytelling'), | |
6 'description' => t('shows the storytelling widget.'), | |
7 'category' => t('mpiwg geobrowser'), | |
8 'edit form' => 'mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_edit_form', | |
9 'render callback' => 'mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_render', | |
10 'admin info' => 'mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_admin_info', | |
11 'defaults' => array() | |
12 ); | |
13 | |
14 function mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_render($subtype, $conf, $panel_args, $context = NULL) { | |
15 $block = new stdClass(); | |
16 | |
17 // initial content is blank | |
18 $block->title = ''; | |
19 $block->content = ''; | |
20 | |
21 // Add in the content | |
22 $block->content .= ' | |
23 <fieldset id="storytellingContainerDiv" style="position:relative;"> | |
24 <legend>Data History</legend> | |
25 </fieldset> | |
26 <script type="text/javascript"> | |
27 var storytellingDiv = document.getElementById("storytellingContainerDiv"); | |
28 var storytelling = new WidgetWrapper(); | |
29 var storytellingWidget = new StorytellingWidget(storytelling,storytellingDiv); | |
30 var mpiwg_geobrowser_storyTellingInitialized = false; | |
31 mpiwg_geobrowser_widgetsCount++; | |
32 jq1110(document).ready(function() { | |
33 if (mpiwg_geobrowser_storyTellingInitialized == false) { | |
34 if (storytellingDiv) { | |
35 storytelling.display(); | |
36 } | |
37 mpiwg_geobrowser_storyTellingInitialized = true; | |
38 document.dispatchEvent(widgetLoadedEvent); | |
39 } | |
40 }); | |
41 </script> | |
42 '; | |
43 | |
44 return $block; | |
45 } | |
46 | |
47 function mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_admin_info($subtype, $conf, $contexts) { | |
48 if (!empty($conf)) { | |
49 $block = new stdClass; | |
50 $block->title = 'map'; | |
51 $block->content = t('showing the basic map.'); | |
52 return $block; | |
53 } | |
54 } | |
55 | |
56 function mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_edit_form($form, &$form_state) { | |
57 return $form; | |
58 } | |
59 | |
60 function mpiwg_geobrowser_mpiwg_geobrowser_storyTelling_edit_form_submit($form, &$form_state) { | |
61 foreach (array_keys($form_state['plugin']['defaults']) as $key) { | |
62 if (isset($form_state['values'][$key])) { | |
63 $form_state['conf'][$key] = $form_state['values'][$key]; | |
64 } | |
65 } | |
66 } |