[pLog-svn] r3711 - in plog/trunk: class/action/admin templates/admin/chooser

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Jul 10 10:50:19 GMT 2006


Author: mark
Date: 2006-07-10 10:50:18 +0000 (Mon, 10 Jul 2006)
New Revision: 3711

Modified:
   plog/trunk/class/action/admin/adminaddresourceaction.class.php
   plog/trunk/templates/admin/chooser/userpictureselect.template
Log:
Add "upload here" support for user picture selection.

Modified: plog/trunk/class/action/admin/adminaddresourceaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourceaction.class.php	2006-07-08 14:06:53 UTC (rev 3710)
+++ plog/trunk/class/action/admin/adminaddresourceaction.class.php	2006-07-10 10:50:18 UTC (rev 3711)
@@ -8,7 +8,8 @@
     include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryresources.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
-    include_once( PLOG_CLASS_PATH."class/view/admin/chooser/adminsimpleresourceslistview.class.php" );	
+    include_once( PLOG_CLASS_PATH."class/view/admin/chooser/adminsimpleresourceslistview.class.php" );
+    include_once( PLOG_CLASS_PATH."class/view/admin/chooser/adminuserpictureselectview.class.php" );
     include_once( PLOG_CLASS_PATH."class/file/fileupload.class.php" );
 
     /**
@@ -41,7 +42,9 @@
 			
 			if( $this->_destView == "resourceList" )
 				$view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => 0 ));
-			else 
+			elseif ($this->_destView == "userPictureSelect" )
+				$view = new AdminUserPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
+			else
 				$view = new AdminNewResourceView( $this->_blogInfo );
 				
 			$view->setErrorMessage( $this->_locale->tr( "error_no_resource_uploaded" ));
@@ -77,6 +80,10 @@
 				$this->_view = new AdminSimpleResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
 				$this->_view->setValue( "destination", $this->_destination );
 			}
+			elseif ($this->_destView == "userPictureSelect" ) {
+				$this->_view = new AdminUserPictureSelectView( $this->_blogInfo, Array( "albumId" => 0 ));
+				$this->_view->setValue( "destination", $this->_destination );
+			}
 			else
 				$this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_albumId ));
 			

Modified: plog/trunk/templates/admin/chooser/userpictureselect.template
===================================================================
--- plog/trunk/templates/admin/chooser/userpictureselect.template	2006-07-08 14:06:53 UTC (rev 3710)
+++ plog/trunk/templates/admin/chooser/userpictureselect.template	2006-07-10 10:50:18 UTC (rev 3711)
@@ -1,6 +1,17 @@
 {include file="$admintemplatepath/chooser/header.template"}
-        <div id="list_nav_bar">
-            <div id="list_nav_select"> 
+<script type="text/javascript" src="js/ui/plogui.js"></script>
+{literal}
+<style>
+#resource_list_upload
+{
+    border-bottom    : 4px solid #DEDEDE;
+	border-collapse: collapse;
+	text-align: left;
+}
+</style>
+{/literal}
+<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>
@@ -28,6 +39,8 @@
  <br style="clear:both" />
  </div>
  <div id="container">
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}
 <table class="info">
  <thead>
   <tr>
@@ -42,8 +55,7 @@
      <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>
-    </td>
+    <td><a onclick="_toggle('resource_list_upload');" href="#upload">{$locale->tr("upload_here")}</a></td>
    </tr>
   {/if}
   {foreach from=$albums item=resalbum}
@@ -71,9 +83,42 @@
 {/foreach}
 </tbody>
 </table>
+{if $album}
+{** show this album only if we're not browsing the root album **}
+<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="reset" value="{$locale->tr("reset")}" />
+  <input type="submit" name="Upload" onclick="_toggle('status_bar');_toggle('close_button');" 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>
+ </form>
+</div>
+{/if}
 <div id="list_action_bar">
   {include file="$admintemplatepath/adminpager.template" style=list}
-  <a href="javascript:window.close()">{$locale->tr("close")}</a>
+  <a id="close_button" href="javascript:window.close()">{$locale->tr("close")}</a>
+  <div id="status_bar" style="display: none;">
+    {$locale->tr("upload_in_progress")}&nbsp;
+    <img src="imgs/admin/spinner_small.gif" alt="Spinner" />    
+  </div>
 </div>
+<a name="upload"></a>
 </div>
 {include file="$admintemplatepath/chooser/footer.template"}
\ No newline at end of file



More information about the pLog-svn mailing list