<?php

	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
    include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );	
	
	class PluginJUploadNewResourceView extends AdminPluginTemplatedView
	{
	
		function PluginJUploadNewResourceView( $blogInfo )
		{
			$this->AdminPluginTemplatedView( $blogInfo, "jupload", "juploadnewresource" );
		}
		
		function render()
		{
			// get all the albums
			$albums = new GalleryAlbums();
			$userAlbums = $albums->getNestedAlbumList( $this->_blogInfo->getId());
			$this->notifyEvent( EVENT_ALBUMS_LOADED, Array( "albums" => &$userAlbums ));

            $config =& Config::getConfig();
            $maxFilesPerRequest = $config->getValue( "plugin_jupload_maxfilesperrequest" );
            $maxTotalRequestSize = $config->getValue( "maximum_file_upload_size" );
			
			$this->setValue( "albums", $userAlbums );
			$this->setValue( "maxFilesPerRequest", $maxFilesPerRequest );
			$this->setValue( "maxTotalRequestSize", $maxTotalRequestSize );
			
			// transfer control to the parent class
			parent::render();
		}
	}
?>