Mercurial > hg > mpiwg_geobrowser
annotate plugins/content_types/mpiwg_geobrowser_plot.inc @ 1:ea066ce001bd
bug fixes, works now without admin rights
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Fri, 29 May 2015 13:59:32 +0200 |
parents | b57c7821382f |
children |
rev | line source |
---|---|
0 | 1 <?php |
2 | |
3 $plugin = array( | |
4 'single' => TRUE, | |
5 'title' => t('plot'), | |
6 'description' => t('shows the plot widget.'), | |
7 'category' => t('mpiwg geobrowser'), | |
8 'edit form' => 'mpiwg_geobrowser_mpiwg_geobrowser_plot_edit_form', | |
9 'render callback' => 'mpiwg_geobrowser_mpiwg_geobrowser_plot_render', | |
10 'admin info' => 'mpiwg_geobrowser_mpiwg_geobrowser_plot_admin_info', | |
11 'defaults' => array() | |
12 ); | |
13 | |
14 function mpiwg_geobrowser_mpiwg_geobrowser_plot_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 <div id="plotContainerDiv" style="position:relative;"></div> | |
24 <script type="text/javascript"> | |
1
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
25 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
26 if (typeof FuzzyTimelineWidget_l=="undefined") |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
27 { |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
28 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
29 |
0 | 30 var timeDiv = document.getElementById("plotContainerDiv"); |
31 var time = new WidgetWrapper(); | |
32 var timeWidget = new FuzzyTimelineWidget(time,timeDiv,{timeTitle: "Publication Date"}); | |
33 var mpiwg_geobrowser_plotInitialized = false; | |
1
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
34 mpiwg_geobrowser_widgetsCount++; |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
35 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
36 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
37 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
38 |
0 | 39 jq1110(document).ready(function() { |
40 if (mpiwg_geobrowser_plotInitialized == false) { | |
41 if (timeDiv) { | |
42 time.display(); | |
43 } | |
44 mpiwg_geobrowser_plotInitialized = true; | |
45 document.dispatchEvent(widgetLoadedEvent); | |
46 } | |
47 }); | |
1
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
48 FuzzyTimelineWidget_l = true; |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
49 } |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
50 |
ea066ce001bd
bug fixes, works now without admin rights
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
51 |
0 | 52 </script> |
53 '; | |
54 | |
55 return $block; | |
56 } | |
57 | |
58 function mpiwg_geobrowser_mpiwg_geobrowser_plot_admin_info($subtype, $conf, $contexts) { | |
59 if (!empty($conf)) { | |
60 $block = new stdClass; | |
61 $block->title = 'map'; | |
62 $block->content = t('showing the basic map.'); | |
63 return $block; | |
64 } | |
65 } | |
66 | |
67 function mpiwg_geobrowser_mpiwg_geobrowser_plot_edit_form($form, &$form_state) { | |
68 return $form; | |
69 } | |
70 | |
71 function mpiwg_geobrowser_mpiwg_geobrowser_plot_edit_form_submit($form, &$form_state) { | |
72 foreach (array_keys($form_state['plugin']['defaults']) as $key) { | |
73 if (isset($form_state['values'][$key])) { | |
74 $form_state['conf'][$key] = $form_state['values'][$key]; | |
75 } | |
76 } | |
77 } |