[pLog-svn] r4749 - in plog/trunk: class/action/admin class/dao templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Feb 17 18:04:37 EST 2007


Author: oscar
Date: 2007-02-17 18:04:37 -0500 (Sat, 17 Feb 2007)
New Revision: 4749

Modified:
   plog/trunk/class/action/admin/adminlocationdisplayaction.class.php
   plog/trunk/class/dao/locations.class.php
   plog/trunk/templates/admin/editposts.template
   plog/trunk/templates/admin/resources.template
Log:
Added support for plotting all the locations associated to resources given an album


Modified: plog/trunk/class/action/admin/adminlocationdisplayaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminlocationdisplayaction.class.php	2007-02-17 22:47:05 UTC (rev 4748)
+++ plog/trunk/class/action/admin/adminlocationdisplayaction.class.php	2007-02-17 23:04:37 UTC (rev 4749)
@@ -25,12 +25,17 @@
 				$this->_view = new AdminBlogLocationsView( $this->_blogInfo );
 				$this->_view->setLocations( $locations );
 			}
+			elseif( $albumId = $this->_request->getValue( "albumId" )) {
+				$locations = $locs->getResourceLocations( $this->_blogInfo->getId(), $albumId );
+				$this->_view = new AdminBlogLocationsView( $this->_blogInfo );
+				$this->_view->setLocations( $locations );
+			}			
 			else {
 				die( "Incorrect parameters" );
 			}
 			
-			$this->_view->setWidth( $this->_request->getValue( "width" ));
-			$this->_view->setHeight( $this->_request->getValue( "height" ));
+			$this->_view->setWidth( $this->_request->getValue( "width", 590 ));
+			$this->_view->setHeight( $this->_request->getValue( "height", 500 ));
 			
 			$this->setCommonData();
 			

Modified: plog/trunk/class/dao/locations.class.php
===================================================================
--- plog/trunk/class/dao/locations.class.php	2007-02-17 22:47:05 UTC (rev 4748)
+++ plog/trunk/class/dao/locations.class.php	2007-02-17 23:04:37 UTC (rev 4749)
@@ -167,8 +167,6 @@
 			          WHERE l.id = gr.loc_id AND l.blog_id = '".Db::qstr( $blogId )."' AND gr.owner_id = '".Db::qstr( $blogId )."'";
 			if( $albumId != -1 )
 				$query .= " AND gr.album_id = '".Db::qstr( $albumId )."'";
-				
-			print($query);
 			
 			$result = $this->Execute( $query );
 			if( !$result )
@@ -192,8 +190,6 @@
 		{			
 			$query = "SELECT DISTINCT l.* FROM ".$this->getPrefix()."locations AS l, ".$this->getPrefix()."articles AS a
 			          WHERE l.id = a.loc_id AND l.blog_id = '".Db::qstr( $blogId )."' AND a.blog_id = '".Db::qstr( $blogId )."'";
-				
-			print($query);
 			
 			$result = $this->Execute( $query );
 			if( !$result )

Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template	2007-02-17 22:47:05 UTC (rev 4748)
+++ plog/trunk/templates/admin/editposts.template	2007-02-17 23:04:37 UTC (rev 4749)
@@ -142,7 +142,7 @@
 							  {if $post->hasLocationData()}
 							    <br/><span style="font-weight:normal">
 							    {assign var=location value=$post->getLocation()}
-								{$locale->tr("location")}: {location_display location=$location width=350 height=350}
+								{$locale->tr("location")}: <a href="javascript:void(0)" onClick="window.open('?op=adminLocationDisplay&locId={$location->getId()}','Location Viewer','scrollbars=no,resizable=no,toolbar=no,height=500,width=590')">{$location->getDescription()}</a>
 								</span>
 							  {/if}
 							{/if}

Modified: plog/trunk/templates/admin/resources.template
===================================================================
--- plog/trunk/templates/admin/resources.template	2007-02-17 22:47:05 UTC (rev 4748)
+++ plog/trunk/templates/admin/resources.template	2007-02-17 23:04:37 UTC (rev 4749)
@@ -99,7 +99,10 @@
  </td>
  <td>
     <a href="admin.php?op=resources&amp;albumId={$resalbum->getId()}&amp;page=1"><img src="imgs/admin/icon_folder-72.png" border="0" alt="folder" /></a><br/>
-    <a href="admin.php?op=resources&amp;albumId={$resalbum->getId()}&amp;page=1">{$resalbum->getName()}</a>
+    <a href="admin.php?op=resources&amp;albumId={$resalbum->getId()}&amp;page=1">{$resalbum->getName()}</a><br/>
+	{if $location_data_enabled}
+	{$locale->tr("locations")}: <a href="javascript:void(0)" onClick="window.open('?op=adminLocationDisplay&albumId={$resalbum->getId()}','Location Viewer','scrollbars=no,resizable=no,toolbar=no,height=500,width=590')">{$locale->tr("view")}</a>
+	{/if}
  </td>
  <td>
   <div class="list_action_button"> 
@@ -137,14 +140,8 @@
   <a href="admin.php?op=resourceInfo&amp;resourceId={$resource->getId()}">{$resource->getFileName()}</a>
   {if $resource->hasLocationData()}
     {assign var=location value=$resource->getLocation()}
-    <!-- a href="#" id="res_{$resource->getId()}">
-      <img src="imgs/admin/icon_globe-16.png" alt="Location Data" />
-    </a>
-    <script type="text/javascript">
-      o = new Lifetype.UI.Overlay( {literal}{{/literal}url:plogBaseUrl + "/" + scriptName + "?op=locationDisplay&locId={$location->getId()}&height=350&width=350",height:350,width:350,context:"res_{$resource->getId()}",showCloseButton:true{literal}}{/literal});
-	</script -->
 	<br/>
-	{$locale->tr("location")}: {location_display location=$location width=350 height=350}
+	{$locale->tr("location")}: <a href="javascript:void(0)" onClick="window.open('?op=adminLocationDisplay&locId={$location->getId()}','Location Viewer','scrollbars=no,resizable=no,toolbar=no,height=500,width=590')">{$location->getDescription()}</a>
   {/if}
  </td>
  <td>



More information about the pLog-svn mailing list