[pLog-svn] r5752 - in plog/trunk: class/template/smarty/plugins class/view js/location js/ui templates/default templates/misc
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Sun Jul 29 17:15:39 EDT 2007
Author: oscar
Date: 2007-07-29 17:15:39 -0400 (Sun, 29 Jul 2007)
New Revision: 5752
Added:
plog/trunk/templates/default/location.template
plog/trunk/templates/default/location_map.template
Removed:
plog/trunk/templates/misc/location.template
plog/trunk/templates/misc/location_map.template
Modified:
plog/trunk/class/template/smarty/plugins/function.location_display.php
plog/trunk/class/view/locationview.class.php
plog/trunk/js/location/location.js
plog/trunk/js/ui/contentoverlay.js
Log:
Added support for viewing location data via the public side of the blog.
Modified: plog/trunk/class/template/smarty/plugins/function.location_display.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.location_display.php 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/class/template/smarty/plugins/function.location_display.php 2007-07-29 21:15:39 UTC (rev 5752)
@@ -60,9 +60,10 @@
$scriptsAlreadyInPlace = true;
}
- $url = $url->getIndexUrl()."?op=locationDisplay&locId=".$location->getId()."&mapOnly=mapOnly";
+ $url = $url->getIndexUrl()."?op=locationDisplay&locId=".$location->getId();
+ //$url = "#";
- $code .= "<a href=\"{$url}\" rel=\"overlay\">".$location->getDescription()."</a>";
+ $code .= "<a id=\"loc_{$location->getId()}\" href=\"{$url}\" onClick=\"Lifetype.UI.Location.Selector.blogDisplay('{$url}&mapOnly=mapOnly');return(false);\">".$location->getDescription()."</a>";
return( $code );
}
Modified: plog/trunk/class/view/locationview.class.php
===================================================================
--- plog/trunk/class/view/locationview.class.php 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/class/view/locationview.class.php 2007-07-29 21:15:39 UTC (rev 5752)
@@ -1,9 +1,9 @@
<?php
- lt_include( PLOG_CLASS_PATH."class/view/view.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/view/blogtemplatedview.class.php" );
lt_include( PLOG_CLASS_PATH.'class/template/templateservice.class.php' );
- class LocationView extends View
+ class LocationView extends BlogTemplatedView
{
var $_blogInfo;
@@ -13,18 +13,13 @@
function LocationView( $blogInfo )
{
- $this->View();
-
- $this->_blogInfo = $blogInfo;
-
- $ts = new TemplateService();
- if( isset( $_REQUEST["mapOnly"] ))
+ $r = HttpVars::getRequest();
+ if( isset( $r["mapOnly"] ))
$template = "location_map";
else
$template = "location";
- $this->_template = $ts->Template( $template, "misc", $this->_blogInfo );
-
- $this->_template->useTemplateLoadOrder = true;
+
+ $this->BlogTemplatedView( $blogInfo, $template );
}
function setLocation( $loc )
@@ -44,8 +39,6 @@
function render()
{
- parent::render();
-
// google API key
$config =& Config::getConfig();
$this->setValue( "google_maps_api_key", $config->getValue( "google_maps_api_key" ));
@@ -57,9 +50,8 @@
// width and height
$this->setValue( 'width', $this->_width );
$this->setValue( 'height', $this->_height );
-
- $this->_template->assign( $this->_params->getAsArray());
- print( $this->_template->fetch());
+
+ return(parent::render());
}
}
?>
\ No newline at end of file
Modified: plog/trunk/js/location/location.js
===================================================================
--- plog/trunk/js/location/location.js 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/js/location/location.js 2007-07-29 21:15:39 UTC (rev 5752)
@@ -113,6 +113,15 @@
return( false );
}
+Lifetype.UI.Location.Selector.blogDisplay = function( url )
+{
+ this.o = new Lifetype.UI.ContentOverlay( YAHOO.util.Dom.generateId(), url );
+ // and bind it to the onclick event
+ this.o.show();
+
+ return( false );
+}
+
Lifetype.UI.Location.Selector.hide = function()
{
this.o.hide();
@@ -581,4 +590,4 @@
Lifetype.UI.Location.LatitudeAndLongitudeDisplayControl.prototype.getDefaultPosition = function()
{
return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
-}
+}
\ No newline at end of file
Modified: plog/trunk/js/ui/contentoverlay.js
===================================================================
--- plog/trunk/js/ui/contentoverlay.js 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/js/ui/contentoverlay.js 2007-07-29 21:15:39 UTC (rev 5752)
@@ -61,23 +61,21 @@
Lifetype.UI.ContentOverlay.prototype.show = function()
{
c = YAHOO.util.Connect.asyncRequest( 'GET', this.url, { scope:this, success: function(o) {
- this.setBody( o.responseText );
+ this.setBody( o.responseText );
this.center();
// this hack allows us to execute any javascript code that has been fetched via
// XmlHttpRequest and assigned to a node via innerHTML
s = document.createElement( 'span' );
s.innerHTML = o.responseText;
- Lifetype.execJS( s );
-
- this.render( document.body );
- Lifetype.UI.ContentOverlay.superclass.show.call( this );
-
- Lifetype.UI.ContentOverlay.Events.dataLoaded.fire( o );
+ Lifetype.execJS( s );
}
});
- return( false );
+ this.render( document.body );
+ Lifetype.UI.ContentOverlay.superclass.show.call( this );
+
+ return( false );
}
/**
Added: plog/trunk/templates/default/location.template
===================================================================
--- plog/trunk/templates/default/location.template (rev 0)
+++ plog/trunk/templates/default/location.template 2007-07-29 21:15:39 UTC (rev 5752)
@@ -0,0 +1,17 @@
+{include file="$blogtemplate/header.template"}
+<!-- Yahoo UI Library -->
+{js src="js/yui/yahoo/yahoo-min.js"}
+{js src="js/yui/dom/dom-min.js"}
+{js src="js/yui/event/event-min.js"}
+{js src="js/yui/connection/connection-min.js"}
+{js src="js/yui/container/container-min.js"}
+{js src="js/yui/animation/animation-min.js"}
+<link rel="stylesheet" type="text/css" href="js/yui/container/assets/container.css">
+<!-- LifeType UI Library -->
+{js src="js/ui/core.js"}
+{js src="js/ui/ui.js"}
+{js src="js/ui/common.js"}
+{js src="js/ui/dom.js"}
+{js src="js/ui/contentoverlay.js"}
+{include file="$blogtemplate/location_map.template"}
+{include file="$blogtemplate/footer.template"}
\ No newline at end of file
Added: plog/trunk/templates/default/location_map.template
===================================================================
--- plog/trunk/templates/default/location_map.template (rev 0)
+++ plog/trunk/templates/default/location_map.template 2007-07-29 21:15:39 UTC (rev 5752)
@@ -0,0 +1,12 @@
+<div id="mapChooserBody" style="padding: 0px;margin: 0px;">
+ <div id="map" style=" width: 651px; height: 500px;margin:0;margin-bottom:5px;padding:0;"></div>
+<!-- Google Maps library -->
+<script src="http://maps.google.com/maps?file=api&v=2&key={$google_maps_api_key}" type="text/javascript"></script>
+<script type="text/javascript" src="{$url->getBaseUrl()}/js/location/location.js"></script>
+<script type="text/javascript">
+// create the global object
+l = new Lifetype.UI.Location();
+l.init( 3 );
+l.displayLocation({literal}{{/literal}latlong:'{$loc->getLatitude()},{$loc->getLongitude()}',desc:'{$loc->getDescription()}',id:'{$loc->getId()}'{literal}}{/literal});
+</script>
+</div>
\ No newline at end of file
Deleted: plog/trunk/templates/misc/location.template
===================================================================
--- plog/trunk/templates/misc/location.template 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/templates/misc/location.template 2007-07-29 21:15:39 UTC (rev 5752)
@@ -1,23 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset={$locale->getCharset()}"/>
- <link rel="stylesheet" href="styles/admin.css" type="text/css" />
- <title>{$locale->tr("location")}</title>
-
- <!-- Yahoo UI Library -->
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/yui/yahoo/yahoo-min.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/yui/dom/dom-min.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/yui/event/event-min.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/yui/container/container-min.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/yui/animation/animation-min.js"></script>
- <!-- Lifetype UI library -->
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/ui/core.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/ui/ui.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/ui/contentoverlay.js"></script>
- <script type="text/javascript" src="{$url->getBaseUrl()}/js/ui/dom.js"></script>
-</head>
-<body>
-{include file="misc/location_map.template"}
-</body>
-</html>
\ No newline at end of file
Deleted: plog/trunk/templates/misc/location_map.template
===================================================================
--- plog/trunk/templates/misc/location_map.template 2007-07-29 21:13:19 UTC (rev 5751)
+++ plog/trunk/templates/misc/location_map.template 2007-07-29 21:15:39 UTC (rev 5752)
@@ -1,12 +0,0 @@
-<div id="mapChooserBody">
- <div id="map"></div>
-</div>
-<!-- Google Maps library -->
-<script src="http://maps.google.com/maps?file=api&v=2&key={$google_maps_api_key}" type="text/javascript"></script>
-<script type="text/javascript" src="{$url->getBaseUrl()}/js/location/location.js"></script>
-<script type="text/javascript">
-// create the global object
-//l = new Lifetype.UI.Location();
-//l.init( 3 );
-//l.displayLocation({literal}{{/literal}latlong:'{$loc->getLatitude()},{$loc->getLongitude()}',desc:'{$loc->getDescription()}',id:'{$loc->getId()}'{literal}}{/literal});
-</script>
\ No newline at end of file
More information about the pLog-svn
mailing list