Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
geobrowser_drupal_module/mpiwg_geobrowser.module
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
72 lines (58 sloc)
3.24 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once drupal_get_path("module", "mpiwg_geobrowser") . '/includes/panels.inc'; | |
function mpiwg_geobrowser_init() { | |
if ($_GET['q'] == 'system/ajax' && $_POST["form_id"] == "mpiwg_geobrowser_datasource_edit_form") { | |
module_load_include('inc', 'mpiwg_geobrowser', 'plugins/content_types/mpiwg_geobrowser_datasource'); | |
} | |
} | |
function mpiwg_geobrowser_page_alter(&$page) { | |
$current_object = menu_get_object(); | |
if (!isset($current_object->type) || $current_object->type != 'mpiwg_geobrowser') { | |
return; | |
} | |
drupal_add_css(drupal_get_path('module', 'mpiwg_geobrowser') . '/css/mpiwg_geobrowser_style.css', array('group' => CSS_DEFAULT, 'type' => 'file')); | |
drupal_add_js(drupal_get_path('module', "mpiwg_geobrowser") . '/lib/moment.min.js'); | |
drupal_add_js(drupal_get_path('module', "mpiwg_geobrowser") . '/lib/filesaver/FileSaver.min.js'); | |
#drupal_add_js(libraries_get_path("platin") . '/platin.js'); | |
drupal_add_js(libraries_get_path("platin") . '/devel/platin.js'); | |
drupal_add_css(drupal_get_path('module', 'mpiwg_geobrowser') . '/lib/GeoTemCo/css/platin.css', array('group' => CSS_DEFAULT, 'type' => 'file')); | |
drupal_add_css(libraries_get_path("platin") . '/devel/css/platin.css'); | |
drupal_add_css(libraries_get_path("platin") . '/devel/css/style.css'); | |
$geoTemCoIntegration = ' | |
<script type="text/javascript"> | |
var mpiwg_geobrowser_widgetsCount = 0; | |
var mpiwg_geobrowser_widgetsLoaded = 0; | |
var mpiwg_geobrowser_noWidgetLoaded = true; | |
var widgetLoadedEvent = new Event("mpiwg_geobrowser_widget_loaded"); | |
var allWidgetsLoadedEvent = new Event("mpiwg_geobrowser_all_widgets_loaded"); | |
Drupal.behaviors.mpiwg_geobrowser_entity = { | |
attach: function (context, settings) { | |
// jQuery(document).ready(function(){ | |
if (context[0] !== undefined && context[0].attributes !== undefined) { | |
var contextAttributes = context[0].attributes; | |
for (i=0; i<contextAttributes.length; i++) { | |
if (contextAttributes[i].name == "id" && contextAttributes[i].value == "panels-ipe-edit-control-form") { | |
window.location.reload(); | |
} | |
} | |
} | |
document.addEventListener("mpiwg_geobrowser_widget_loaded", function (e) { | |
if (mpiwg_geobrowser_noWidgetLoaded) { | |
mpiwg_geobrowser_widgetsCount = mpiwg_geobrowser_widgetsCount; | |
mpiwg_geobrowser_noWidgetLoaded = false; | |
} | |
mpiwg_geobrowser_widgetsLoaded++; | |
if (mpiwg_geobrowser_widgetsLoaded == mpiwg_geobrowser_widgetsCount) { | |
document.dispatchEvent(allWidgetsLoadedEvent); | |
} | |
}, false); | |
// }); | |
} | |
} | |
</script> | |
'; | |
$page['content']['system_main']['mpiwg_geobrowser_core'] = array( | |
'#markup' => $geoTemCoIntegration, | |
'#weight' => -99, | |
); | |
} |