[pLog-svn] r6302 - in plog/trunk: class/action/admin class/action/admin/chooser class/controller class/view/admin/chooser js/ui/pages templates/admin templates/admin/chooser

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Apr 8 08:31:56 EDT 2008


Author: mark
Date: 2008-04-08 08:31:56 -0400 (Tue, 08 Apr 2008)
New Revision: 6302

Added:
   plog/trunk/class/action/admin/chooser/adminpictureselectaction.class.php
   plog/trunk/class/view/admin/chooser/adminpictureselectview.class.php
   plog/trunk/js/ui/pages/pictureselect.js
   plog/trunk/templates/admin/chooser/pictureselect.template
Removed:
   plog/trunk/class/action/admin/chooser/adminuserpictureselectaction.class.php
   plog/trunk/class/view/admin/chooser/adminuserpictureselectview.class.php
   plog/trunk/js/ui/pages/userpictureselect.js
   plog/trunk/templates/admin/chooser/userpictureselect.template
Modified:
   plog/trunk/class/action/admin/adminaddresourceaction.class.php
   plog/trunk/class/controller/admincontrollermap.properties.php
   plog/trunk/js/ui/pages/usersettings.js
   plog/trunk/templates/admin/usersettings.template
Log:
Modify the "userPictureSelect" chooser to a more generic "pictureSelect".

Now we just need to pass the "pictureId"(dom id) into the chooser, the chooser will return the resource information to pictureId.

For example, if we set the pictureId to "userPicture", then chooser will return the resource id to "userPictureId" and image.src to "userPicture"...

It is easier for developer to use it anywhere if he need a simple picture chooser.

Modified: plog/trunk/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourceaction.class.php	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/class/action/admin/adminaddresourceaction.class.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -31,8 +31,8 @@
 			
 			if( $this->_destView == "resourceList" )
 				$view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => 0 ));
-			elseif ($this->_destView == "userPictureSelect" )
-				$view = new AdminUserPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
+			elseif ($this->_destView == "pictureSelect" )
+				$view = new AdminPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
 			else
 				$view = new AdminNewResourceView( $this->_blogInfo );
 				
@@ -81,8 +81,8 @@
 				$this->_view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId, "gotoLastPage" => true ));
 				$this->_view->setValue( "destination", $this->_destination );
 			}
-			elseif ($this->_destView == "userPictureSelect" ) {
-				$this->_view = new AdminUserPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
+			elseif ($this->_destView == "pictureSelect" ) {
+				$this->_view = new AdminPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
 				$this->_view->setValue( "destination", $this->_destination );
 			}
 			else {

Copied: plog/trunk/class/action/admin/chooser/adminpictureselectaction.class.php (from rev 6301, plog/trunk/class/action/admin/chooser/adminuserpictureselectaction.class.php)
===================================================================
--- plog/trunk/class/action/admin/chooser/adminpictureselectaction.class.php	                        (rev 0)
+++ plog/trunk/class/action/admin/chooser/adminpictureselectaction.class.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -0,0 +1,53 @@
+<?php
+
+	
+	
+    
+
+    /**
+     * \ingroup Action
+     * @private
+     *
+     * Deletes a resource from the blog
+     */
+    class AdminPictureSelectAction extends AdminAction
+    {
+		
+    	var $_albumId;
+		
+    	/**
+		* Constructor. If nothing else, it also has to call the constructor of the parent
+         * class, BlogAction with the same parameters
+         */
+        function AdminPictureSelectAction( $actionInfo, $request )
+        {
+        	$this->AdminAction( $actionInfo, $request );
+        }
+		
+		function validate()
+		{
+			// if the album id is not vald, let's start from the top album again
+			$this->_albumId = $this->_request->getValue( "albumId" );
+			$val = new IntegerValidator();
+			if( !$val->validate( $this->_albumId ))
+				$this->_albumId = 0;
+			
+			return true;
+		}
+		
+        /**
+			* Carries out the specified action
+         */
+        function perform()
+        {
+			$pictureId = Textfilter::filterAllHTML( $this->_request->getValue( "pictureId" ) );
+            $this->_view = new AdminPictureSelectView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
+            $this->_view->setValue( 'pictureId', $pictureId );
+            $this->_view->_pagerUrl = "?op=pictureSelect&amp;pictureId=".$pictureId."&amp;page=";
+            
+            $this->setCommonData();
+			
+            return true;
+        }
+    }
+?>
\ No newline at end of file

Deleted: plog/trunk/class/action/admin/chooser/adminuserpictureselectaction.class.php
===================================================================
--- plog/trunk/class/action/admin/chooser/adminuserpictureselectaction.class.php	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/class/action/admin/chooser/adminuserpictureselectaction.class.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -1,50 +0,0 @@
-<?php
-
-	
-	
-    
-
-    /**
-     * \ingroup Action
-     * @private
-     *
-     * Deletes a resource from the blog
-     */
-    class AdminUserPictureSelectAction extends AdminAction
-    {
-		
-    	var $_albumId;
-		
-    	/**
-		* Constructor. If nothing else, it also has to call the constructor of the parent
-         * class, BlogAction with the same parameters
-         */
-        function AdminUserPictureSelectAction( $actionInfo, $request )
-        {
-        	$this->AdminAction( $actionInfo, $request );
-        }
-		
-		function validate()
-		{
-			// if the album id is not vald, let's start from the top album again
-			$this->_albumId = $this->_request->getValue( "albumId" );
-			$val = new IntegerValidator();
-			if( !$val->validate( $this->_albumId ))
-				$this->_albumId = 0;
-			
-			return true;
-		}
-		
-        /**
-			* Carries out the specified action
-         */
-        function perform()
-        {
-			
-            $this->_view = new AdminUserPictureSelectView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
-            $this->setCommonData();
-			
-            return true;
-        }
-    }
-?>
\ No newline at end of file

Modified: plog/trunk/class/controller/admincontrollermap.properties.php
===================================================================
--- plog/trunk/class/controller/admincontrollermap.properties.php	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/class/controller/admincontrollermap.properties.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -249,7 +249,7 @@
 	// control center
 	$actions["controlCenter"] = "AdminControlCenterAction";
 	// user picture selector
-	$actions["userPictureSelect"] = "AdminUserPictureSelectAction";
+	$actions["pictureSelect"] = "AdminPictureSelectAction";
 	// blog template selector
 	$actions["blogTemplateChooser"] = "AdminBlogTemplateChooserAction";
 	// clean up

Copied: plog/trunk/class/view/admin/chooser/adminpictureselectview.class.php (from rev 6301, plog/trunk/class/view/admin/chooser/adminuserpictureselectview.class.php)
===================================================================
--- plog/trunk/class/view/admin/chooser/adminpictureselectview.class.php	                        (rev 0)
+++ plog/trunk/class/view/admin/chooser/adminpictureselectview.class.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -0,0 +1,31 @@
+<?php
+
+	
+	
+	
+
+    /**
+     * \ingroup View
+     * @private
+     *
+	 * we can extend from AdminResourcesListView and we will save a lot of code...
+	 */
+	class AdminPictureSelectView extends AdminResourcesListView
+	{
+		var $_albumId;
+		
+		function AdminPictureSelectView( $blogInfo, $params = Array())
+		{
+			$this->AdminResourcesListView( $blogInfo, $params );
+		
+			$this->_templateName = "chooser/pictureselect";
+			$this->_resourceType = GalleryConstants::GALLERY_RESOURCE_IMAGE;
+		}
+		
+		function render()
+		{
+			parent::render();
+		}
+	}
+
+?>
\ No newline at end of file

Deleted: plog/trunk/class/view/admin/chooser/adminuserpictureselectview.class.php
===================================================================
--- plog/trunk/class/view/admin/chooser/adminuserpictureselectview.class.php	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/class/view/admin/chooser/adminuserpictureselectview.class.php	2008-04-08 12:31:56 UTC (rev 6302)
@@ -1,33 +0,0 @@
-<?php
-
-	
-	
-	
-
-    /**
-     * \ingroup View
-     * @private
-     *
-	 * we can extend from AdminResourcesListView and we will save a lot of code...
-	 */
-	class AdminUserPictureSelectView extends AdminResourcesListView
-	{
-		var $_albumId;
-		
-		function AdminUserPictureSelectView( $blogInfo, $params = Array())
-		{
-			$this->AdminResourcesListView( $blogInfo, $params );
-		
-			$this->_templateName = "chooser/userpictureselect";
-			$this->_resourceType = GalleryConstants::GALLERY_RESOURCE_IMAGE;
-		}
-		
-		function render()
-		{
-			$this->_pagerUrl = "?op=userPictureSelect&amp;page=";
-			
-			parent::render();
-		}
-	}
-
-?>
\ No newline at end of file

Copied: plog/trunk/js/ui/pages/pictureselect.js (from rev 6301, plog/trunk/js/ui/pages/userpictureselect.js)
===================================================================
--- plog/trunk/js/ui/pages/pictureselect.js	                        (rev 0)
+++ plog/trunk/js/ui/pages/pictureselect.js	2008-04-08 12:31:56 UTC (rev 6302)
@@ -0,0 +1,45 @@
+Lifetype.UI.Pages.PictureSelect = function() {}
+
+/**
+ * Used in the 'user profile' screen where users can pick an image from their collection
+ * and set it as their 'avatar'
+ *
+ * @param resId
+ * @param url
+ * @return nothing
+ */
+Lifetype.UI.Pages.PictureSelect.returnResourceInformation = function(pictureId, resId, url)
+{
+	// set the picture id
+    element = parent.opener.document.getElementById( pictureId+'Id' );
+    if( element )
+    	element.value = resId;
+    // and reload the image path
+    element = parent.opener.document.getElementById( pictureId );
+    if( element )
+    	element.src = url;
+}
+
+Lifetype.UI.Pages.PictureSelect.toggle = function( sectionId )
+{
+	// get the dom object with such section
+	element = document.getElementById( sectionId );
+
+	currentStatus = element.style.display;
+
+	// and toggle its visibility
+	if( element.style.display == 'none' )
+		element.style.display = 'block';
+	else
+		element.style.display = 'none';
+
+	return true;
+}
+
+Lifetype.UI.Pages.PictureSelect.showProgressBar = function( elementToHide )
+{
+	button = document.getElementById( elementToHide );
+	button.style.display = "none";     
+	bar = document.getElementById("status_bar");
+	bar.style.display = "block";
+}
\ No newline at end of file

Deleted: plog/trunk/js/ui/pages/userpictureselect.js
===================================================================
--- plog/trunk/js/ui/pages/userpictureselect.js	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/js/ui/pages/userpictureselect.js	2008-04-08 12:31:56 UTC (rev 6302)
@@ -1,17 +0,0 @@
-Lifetype.UI.Pages.UserPictureSelect = function() {}
-
-/**
- * Used in the' user profile' screen where users can pick an image from their collection
- * and set it as their 'avatar'
- *
- * @param resId
- * @param url
- * @return nothing
- */
-Lifetype.UI.Pages.UserPictureSelect.returnResourceInformation = function(resId, url)
-{
-	// set the picture id
-    parent.opener.document.userSettings.userPictureId.value = resId;
-    // and reload the image path
-    parent.opener.document.userSettings.userPicture.src = url;
-}
\ No newline at end of file

Modified: plog/trunk/js/ui/pages/usersettings.js
===================================================================
--- plog/trunk/js/ui/pages/usersettings.js	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/js/ui/pages/usersettings.js	2008-04-08 12:31:56 UTC (rev 6302)
@@ -4,7 +4,7 @@
 
 Lifetype.UI.Pages.UserSettings = function() {}
 
-Lifetype.UI.Pages.UserSettings.userPictureSelectWindow = function()
+Lifetype.UI.Pages.UserSettings.userPictureSelectWindow = function( pictureId )
 {
 	width  = 500;
 	height = 450;
@@ -12,15 +12,20 @@
 	x = parseInt(screen.width / 2.0) - (width / 2.0);
 	y = parseInt(screen.height / 2.0) - (height / 2.0);
 	
-	UserPicture = window.open( '?op=userPictureSelect', 'UserPictureSelect','top='+y+',left='+x+',scrollbars=yes,resizable=yes,toolbar=no,height='+height+',width='+width);
+	UserPicture = window.open( '?op=pictureSelect&pictureId='+pictureId, 'UserPictureSelect','top='+y+',left='+x+',scrollbars=yes,resizable=yes,toolbar=no,height='+height+',width='+width);
 }
 
 /**
  * resets the user picture/avatar in the profile page
  */
-Lifetype.UI.Pages.UserSettings.resetUserPicture = function()
+Lifetype.UI.Pages.UserSettings.resetUserPicture = function( pictureId )
 {
-    window.document.userSettings.userPictureId.value = 0;
+    // set the picture id
+    element = YAHOO.util.Dom.get( pictureId+'Id' );
+    if( element )
+    	element.value = 0;
     // and reload the image path
-    window.document.userSettings.userPicture.src = 'imgs/no-user-picture.jpg';
+	element = YAHOO.util.Dom.get( pictureId );
+    if( element )
+    	element.src = 'imgs/no-user-picture.jpg';
 }
\ No newline at end of file

Copied: plog/trunk/templates/admin/chooser/pictureselect.template (from rev 6301, plog/trunk/templates/admin/chooser/userpictureselect.template)
===================================================================
--- plog/trunk/templates/admin/chooser/pictureselect.template	                        (rev 0)
+++ plog/trunk/templates/admin/chooser/pictureselect.template	2008-04-08 12:31:56 UTC (rev 6302)
@@ -0,0 +1,135 @@
+{include file="$admintemplatepath/chooser/header.template"}
+{js src="js/ui/plogui.js"}
+{js src="js/ui/pages/pictureselect.js"}
+{literal}
+<style type="text/css">
+#resource_list_upload
+{
+    border-bottom    : 4px solid #DEDEDE;
+	border-collapse: collapse;
+	text-align: left;
+}
+</style>
+{/literal}
+<script type="text/javascript">
+{literal}
+YAHOO.util.Event.addListener( window, "load", function() {
+		var t = new Lifetype.Effects.Table( "list" );
+		t.stripe();
+		t.highlightRows();
+	});
+{/literal}
+</script>
+<div id="list_nav_bar">
+<div id="list_nav_select"> 
+<form id="resourceListAlbum" action="admin.php" method="post">
+ <fieldset>
+  <legend>{$locale->tr("show_by")}</legend>
+   <div class="list_nav_option">
+    <label for="albumId">{$locale->tr("album")}</label>
+	<br />
+    <select name="albumId" id="albumId">
+      <option value="0">{$locale->tr("root_album")}</option>
+   {foreach from=$albumsList item=albumItem}
+     {assign var=indentLevel value=$albumItem->getValue("level")}
+	 <option value="{$albumItem->getId()}" {if $album}{if $album->getName()==$albumItem->getName()}selected="selected"{/if}{/if}>
+	   {textformat indent=$indentLevel indent_char="&nbsp;&nbsp;&nbsp;"}{$albumItem->getName()}{/textformat}   
+	 </option>
+   {/foreach}
+   </select>
+   </div>
+   <div class="list_nav_option">
+    <br />
+    <input type="hidden" name="op" value="pictureSelect" />
+    <input type="submit" name="Show" value="{$locale->tr("show")}" />
+   </div>
+  </fieldset> 
+ </form> 
+ </div>
+ <br style="clear:both" />
+ </div>
+
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}
+<table id="list" class="info" summary="{$locale->tr("picture")}">
+ <thead>
+  <tr>
+   <th style="width:270px;">{$locale->tr("resource")}</th>
+   <th style="width:150px;">{$locale->tr("actions")}</th>
+  </tr> 
+ </thead>  
+ <tbody>
+  {if $album && $pager->getCurrentPage()==1}
+   <tr>
+    <td>
+     <a href="admin.php?op=pictureSelect&amp;pictureId={$pictureId}&amp;albumId={$album->getParentId()}&amp;mode={$destination}&amp;page=1">
+     <img src="imgs/admin/icon_folder-72.png" border="0" alt="Parent" />&nbsp;<br/>..</a>
+    </td>
+    <td><a onclick="Lifetype.UI.Pages.PictureSelect.toggle('resource_list_upload');" href="#upload">{$locale->tr("upload_here")}</a></td>
+   </tr>
+  {/if}
+  {foreach from=$albums item=resalbum}
+   <tr>
+    <td>
+     <a href="admin.php?op=pictureSelect&amp;pictureId={$pictureId}&amp;albumId={$resalbum->getId()}&amp;mode={$destination}&amp;page=1">
+     <img src="imgs/admin/icon_folder-72.png" border="0" alt="folder" /><br/>{$resalbum->getName()}</a><br/>
+    </td>
+    <td>
+    </td>
+   </tr>
+{/foreach}
+{foreach from=$resources item=resource}
+<tr>
+ <td>
+  {if $resource->hasPreview()}
+   <a href="javascript:Lifetype.UI.Pages.PictureSelect.returnResourceInformation('{$pictureId}','{$resource->getId()}','{$url->resourcePreviewLink($resource)}');window.close();"><img src="{$url->resourcePreviewLink($resource)}" alt="Preview" /></a>
+  {/if}
+ <a target="_blank" href="{$url->resourceLink($resource)}"><br/>{$resource->getFileName()}</a>
+ </td>
+ <td>
+ <a href="javascript:Lifetype.UI.Pages.PictureSelect.returnResourceInformation('{$pictureId}','{$resource->getId()}','{$url->rawResourcePreviewLink($resource)}');window.close();">{$locale->tr("select")}</a>
+ </td> 
+</tr>
+{/foreach}
+</tbody>
+</table>
+{if $album}
+{** show this album only if we're not browsing the root album **}
+<a name="upload"></a>
+<div id="resource_list_upload" style="display: none;">
+ <form name="uploadFile" method="post" action="admin.php" enctype="multipart/form-data">
+ <fieldset class="inputField">
+  <legend>{$locale->tr("upload_here")}</legend>
+  <div class="field">
+   <label for="resourceFile_1">{$locale->tr("file")}</label>
+   <span class="required">*</span>
+   <input type="file" name="resourceFile_1" value="" id="resourceFile_1" />
+  </div> 
+  <div class="field">
+   <label for="resourceDescription">{$locale->tr("description")}</label>
+   <span class="required">*</span>
+   <textarea name="resourceDescription" id="resourceDescription" rows="5" style="width:100%"></textarea>
+  </div> 
+  </fieldset>
+  <div class="buttons" id="buttons" style="padding-bottom:7px">
+  <input type="reset" name="resetButton" value="{$locale->tr("reset")}" />
+  <input type="submit" name="Upload" onclick="Lifetype.UI.Pages.PictureSelect.showProgressBar('buttons')" value="{$locale->tr("add")}" />
+  <input type="hidden" name="albumId" value="{$album->getId()}" />
+  <input type="hidden" name="op" value="addResource" /><br/>
+  <input type="hidden" name="destView" value="pictureSelect" />
+  <input type="hidden" name="destination" value="{$destination}" />
+  <input type="hidden" name="pictureId" value="{$pictureId}" />
+  </div>
+  <div class="status_bar" id="status_bar" style="display: none;">
+    {$locale->tr("upload_in_progress")}&nbsp;
+    <img src="imgs/admin/spinner_small.gif" alt="Spinner" />    
+  </div>
+ </form>
+</div>
+{/if}
+<div id="list_action_bar">
+  {adminpager style=list}
+  <a id="close_button" href="javascript:window.close()">{$locale->tr("close")}</a>
+</div>
+
+{include file="$admintemplatepath/chooser/footer.template"}

Deleted: plog/trunk/templates/admin/chooser/userpictureselect.template
===================================================================
--- plog/trunk/templates/admin/chooser/userpictureselect.template	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/templates/admin/chooser/userpictureselect.template	2008-04-08 12:31:56 UTC (rev 6302)
@@ -1,134 +0,0 @@
-{include file="$admintemplatepath/chooser/header.template"}
-{js src="js/ui/plogui.js"}
-{js src="js/ui/pages/userpictureselect.js"}
-{literal}
-<style type="text/css">
-#resource_list_upload
-{
-    border-bottom    : 4px solid #DEDEDE;
-	border-collapse: collapse;
-	text-align: left;
-}
-</style>
-{/literal}
-<script type="text/javascript">
-{literal}
-YAHOO.util.Event.addListener( window, "load", function() {
-		var t = new Lifetype.Effects.Table( "list" );
-		t.stripe();
-		t.highlightRows();
-	});
-{/literal}
-</script>
-<div id="list_nav_bar">
-<div id="list_nav_select"> 
-<form id="resourceListAlbum" action="admin.php" method="post">
- <fieldset>
-  <legend>{$locale->tr("show_by")}</legend>
-   <div class="list_nav_option">
-    <label for="albumId">{$locale->tr("album")}</label>
-	<br />
-    <select name="albumId" id="albumId">
-      <option value="0">{$locale->tr("root_album")}</option>
-   {foreach from=$albumsList item=albumItem}
-     {assign var=indentLevel value=$albumItem->getValue("level")}
-	 <option value="{$albumItem->getId()}" {if $album}{if $album->getName()==$albumItem->getName()}selected="selected"{/if}{/if}>
-	   {textformat indent=$indentLevel indent_char="&nbsp;&nbsp;&nbsp;"}{$albumItem->getName()}{/textformat}   
-	 </option>
-   {/foreach}
-   </select>
-   </div>
-   <div class="list_nav_option">
-    <br />
-    <input type="hidden" name="op" value="userPictureSelect" />
-    <input type="submit" name="Show" value="{$locale->tr("show")}" />
-   </div>
-  </fieldset> 
- </form> 
- </div>
- <br style="clear:both" />
- </div>
-
-  {include file="$admintemplatepath/successmessage.template"}
-  {include file="$admintemplatepath/errormessage.template"}
-<table id="list" class="info" summary="{$locale->tr("picture")}">
- <thead>
-  <tr>
-   <th style="width:270px;">{$locale->tr("resource")}</th>
-   <th style="width:150px;">{$locale->tr("actions")}</th>
-  </tr> 
- </thead>  
- <tbody>
-  {if $album && $pager->getCurrentPage()==1}
-   <tr>
-    <td>
-     <a href="admin.php?op=userPictureSelect&amp;albumId={$album->getParentId()}&amp;mode={$destination}&amp;page=1">
-     <img src="imgs/admin/icon_folder-72.png" border="0" alt="Parent" />&nbsp;<br/>..</a>
-    </td>
-    <td><a onclick="_toggle('resource_list_upload');" href="#upload">{$locale->tr("upload_here")}</a></td>
-   </tr>
-  {/if}
-  {foreach from=$albums item=resalbum}
-   <tr>
-    <td>
-     <a href="admin.php?op=userPictureSelect&amp;albumId={$resalbum->getId()}&amp;mode={$destination}&amp;page=1">
-     <img src="imgs/admin/icon_folder-72.png" border="0" alt="folder" /><br/>{$resalbum->getName()}</a><br/>
-    </td>
-    <td>
-    </td>
-   </tr>
-{/foreach}
-{foreach from=$resources item=resource}
-<tr>
- <td>
-  {if $resource->hasPreview()}
-   <a href="javascript:Lifetype.UI.Pages.UserPictureSelect.returnResourceInformation('{$resource->getId()}','{$url->resourcePreviewLink($resource)}');window.close();"><img src="{$url->resourcePreviewLink($resource)}" alt="Preview" /></a>
-  {/if}
- <a target="_blank" href="{$url->resourceLink($resource)}"><br/>{$resource->getFileName()}</a>
- </td>
- <td>
- <a href="javascript:Lifetype.UI.Pages.UserPictureSelect.returnResourceInformation('{$resource->getId()}','{$url->rawResourcePreviewLink($resource)}');window.close();">{$locale->tr("select")}</a>
- </td> 
-</tr>
-{/foreach}
-</tbody>
-</table>
-{if $album}
-{** show this album only if we're not browsing the root album **}
-<a name="upload"></a>
-<div id="resource_list_upload" style="display: none;">
- <form name="uploadFile" method="post" action="admin.php" enctype="multipart/form-data">
- <fieldset class="inputField">
-  <legend>{$locale->tr("upload_here")}</legend>
-  <div class="field">
-   <label for="resourceFile_1">{$locale->tr("file")}</label>
-   <span class="required">*</span>
-   <input type="file" name="resourceFile_1" value="" id="resourceFile_1" />
-  </div> 
-  <div class="field">
-   <label for="resourceDescription">{$locale->tr("description")}</label>
-   <span class="required">*</span>
-   <textarea name="resourceDescription" id="resourceDescription" rows="5" style="width:100%"></textarea>
-  </div> 
-  </fieldset>
-  <div class="buttons" id="buttons" style="padding-bottom:7px">
-  <input type="reset" name="resetButton" value="{$locale->tr("reset")}" />
-  <input type="submit" name="Upload" onclick="showProgressBar('buttons')" value="{$locale->tr("add")}" />
-  <input type="hidden" name="albumId" value="{$album->getId()}" />
-  <input type="hidden" name="op" value="addResource" /><br/>
-  <input type="hidden" name="destView" value="userPictureSelect" />
-  <input type="hidden" name="destination" value="{$destination}" />
-  </div>
-  <div class="status_bar" id="status_bar" style="display: none;">
-    {$locale->tr("upload_in_progress")}&nbsp;
-    <img src="imgs/admin/spinner_small.gif" alt="Spinner" />    
-  </div>
- </form>
-</div>
-{/if}
-<div id="list_action_bar">
-  {adminpager style=list}
-  <a id="close_button" href="javascript:window.close()">{$locale->tr("close")}</a>
-</div>
-
-{include file="$admintemplatepath/chooser/footer.template"}

Modified: plog/trunk/templates/admin/usersettings.template
===================================================================
--- plog/trunk/templates/admin/usersettings.template	2008-04-07 20:08:35 UTC (rev 6301)
+++ plog/trunk/templates/admin/usersettings.template	2008-04-08 12:31:56 UTC (rev 6302)
@@ -56,9 +56,9 @@
 	     <img alt="Picture" src="imgs/no-user-picture.jpg" id="userPicture" style="display:block;margin-left:auto;margin-right:auto"/>	
        {/if}
 	   <div class="formHelp">{$locale->tr("user_picture_help")}</div>
-       <a href="javascript:Lifetype.UI.Pages.UserSettings.userPictureSelectWindow();">{$locale->tr("choose")}...</a>
+       <a href="javascript:Lifetype.UI.Pages.UserSettings.userPictureSelectWindow('userPicture');">{$locale->tr("choose")}...</a>
 	   |
-	   <a href="javascript:Lifetype.UI.Pages.UserSettings.resetUserPicture();">{$locale->tr("reset")}</a>
+	   <a href="javascript:Lifetype.UI.Pages.UserSettings.resetUserPicture('userPicture');">{$locale->tr("reset")}</a>
        <input type="hidden" name="userPictureId" id="userPictureId" value="{$user->getPictureId()}" />
      </div>
     </div>



More information about the pLog-svn mailing list