]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Googlemaps support added for ECML.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 15 Apr 2010 15:29:12 +0000 (15:29 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 15 Apr 2010 15:29:12 +0000 (15:29 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5744 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/ecml/start.php
mod/ecml/views/default/ecml/keywords/googlemaps.php [new file with mode: 0644]

index d1a86f82bfd05cc836ce99e1be6e21e365e74692..c6a9ff38b0cc2d27138280ad4038ed4eba9dccd7 100644 (file)
@@ -128,7 +128,7 @@ function ecml_parse_view($hook, $entity_type, $return_value, $params) {
  * @return unknown_type
  */
 function ecml_keyword_hook($hook, $entity_type, $return_value, $params) {
-       $keywords = array('entity', 'view', 'youtube', 'slideshare', 'vimeo');
+       $keywords = array('entity', 'view', 'youtube', 'slideshare', 'vimeo', 'googlemaps');
 
        foreach ($keywords as $keyword) {
                $return_value[$keyword] = array(
diff --git a/mod/ecml/views/default/ecml/keywords/googlemaps.php b/mod/ecml/views/default/ecml/keywords/googlemaps.php
new file mode 100644 (file)
index 0000000..c750230
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * ECML Google Maps support
+ *
+ * @package ECML
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+$src = (isset($vars['src'])) ? $vars['src'] : FALSE;
+$width = (isset($vars['width'])) ? $vars['width'] : 425;
+$height = (isset($vars['height'])) ? $vars['height'] : 350;
+
+if ($src) {
+       $embed_src = elgg_http_add_url_query_elements($src, array('output' => 'embed'));
+       $link_href = elgg_http_add_url_query_elements($src, array('source' => 'embed'));
+
+       echo "
+
+<iframe width=\"$width\" height=\"$height\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"$embed_src\"></iframe>
+<br />
+<small>
+       <a href=\"$link_href\" style=\"color:#0000FF;text-align:left\">
+               " . elgg_echo('ecml:googlemaps:view_larger_map') . "
+       </a>
+</small>
+
+";
+}
\ No newline at end of file