class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController

	def widget1
		vertical = 2
		horizontal = 6 

		vertical = @wiget_options[:vertical] if (@wiget_options.has_key?(:vertical) && @wiget_options[:vertical] < vertical)
		horizontal = @wiget_options[:horizontal] if (@wiget_options.has_key?(:horizontal) && @wiget_options[:horizontal] < horizontal)	
		
		@settings = {"vertical"=>vertical,"horizontal"=>horizontal}   #[note] horizontal has it's limitation from 2 to 6
		@class = "c" + @settings["horizontal"].to_s
		@total = @settings["vertical"] * @settings["horizontal"]
		@rnd = Random.new
		@images = []
		for i in 0..@total-1
			@sn = @rnd.rand(0...GalleryImage.count)
			if @sn < 0 
				@sn = @sn * -1
			end
			image = GalleryImage.skip(@sn).limit(1).first
			values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
			@images << values
		end
	end
	def widget2

	end

end
