admin_owngallery.phtml 3.76 KB
<div class="anc-image-owngallery">
	
	<?php	Mage::getSingleton('core/session', array('name'=>'adminhtml'));
	 if(Mage::getSingleton('admin/session')->isLoggedIn()): ?>
		<div class="col2-set">
			<div class="col-1">
				<div class="anc-image-owngallery-main">neues Bild hochladen</div>
				<div class="anc-image-owngallery-content">
					<?php $dropzone_id = 'ancimage-dropzone-id'.$DropzoneIndex; ?> 
					<?php $ancnote_id = 'ancnote-id'; ?> 
					<div id="<?php echo $ancnote_id; ?>"></div>
					<div id="<?php echo $dropzone_id; ?>"  class="dropzone ancimage-dropzone" title="Bitte ziehen Sie aus Ihrer Galerie oder Ihrem Dateiexplorer einfach ein Bild in diesen Bereich!">
						<div class="preview-database-image">
							Lassen Sie hier Ihr Bild fallen!<br />
						</div>
					</div>
					
						<?php
						$params=$this->getRequest()->getParams();
//						D::s($params,'$params',5,1,1);
						
							$urlUploadImage= $this->getUrl('image/adminhtml_administrator/uploadImage', array('album_id'=>$params['id']));
							$formkey= Mage::getSingleton('core/session')->getFormKey(); 
						  ?>
					
					
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							Anc_Image_Typeadmin.droppableFile(
								jQuery(" #<?php echo $dropzone_id; ?>"), 
								null, 
								"<?php echo $urlUploadImage; ?>",
								jQuery(" #<?php echo $ancnote_id; ?>"), 
								"<?php echo $this->getUrl('image/adminhtml_administrator/simpleowngallery', array()) ?>  ul.gallery",
								"<?php echo $formkey?>"
							);
						}); 
					</script>						
				</div>				
				<div class="anc-image-owngallery-main">Meine Bilder (alpha)</div>
				<div class="anc-image-owngallery-content">
					<div class="anc-image-owngallery-content-view">
						<?php echo $this->getChildHtml('simpleadmingallery') ?>
					</div>					
				</div>
			</div>
			<div class="col-2">
				<div class="anc-image-owngallery-form">
					<div class="anc-image-owngallery-main">Bilddaten</div>
					<div class="anc-image-owngallery-content" id="anc-image-owngallery-form-content"></div>				
				</div>
			</div>
		</div>		


	
	
		<script type="text/javascript">
			jQuery(document).ready(function($) {
//								jQuery("a[rel^='prettyPhoto']").prettyPhoto({});
				jQuery('a.ancimage-showNcImageForm').unbind("click").click(function(e){
					e.preventDefault(); 			

					jQuery(".anc-image-owngallery * #anc-image-owngallery-form-content").load(jQuery(this).data('site'), function() {

						jQuery('#ancimage-customer_showNcImageFormDelete').submit(function() { // catch the form's submit event
							jQuery.ajax({ // create an AJAX call...
								data: jQuery(this).serialize(), // get the form data
								type: jQuery(this).attr('method'), // GET or POST
								url: jQuery(this).attr('action'), // the file to call
								success: function(response) { // on success..
									jQuery('.anc-image-owngallery * #anc-image-owngallery-form-content').html(response); // update the DIV
								}
							});
							return false; // cancel original event to prevent form submitting
						});																						
						jQuery('#ancimage-customer_showNcImageForm').submit(function() { // catch the form's submit event
							jQuery.ajax({ // create an AJAX call...
								data: jQuery(this).serialize(), // get the form data
								type: jQuery(this).attr('method'), // GET or POST
								url: jQuery(this).attr('action'), // the file to call
								success: function(response) { // on success..
									jQuery('.anc-image-owngallery * #anc-image-owngallery-form-content').html(response); // update the DIV
								}
							});
							return false; // cancel original event to prevent form submitting
						});												
					});
				});					
			});
		</script>	
	
	<?php else: ?>
		<h1>Bitte loggen Sie sich ein!</h1>
	<?php endif; ?>	
</div>