#
# Copyright (C) 2007 Mobio Networks, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
class ListController < ApplicationController
before_filter :checkClient
def index
end
def get_images
# get all images in images directory or bn directory
if params[:bn].nil?
imgs = File::join RAILS_ROOT, 'public/images/*png'
else
imgs = File::join RAILS_ROOT, 'public/images/bn/*png'
end
files = Dir[imgs]
@names = []
files.each do |x|
filename = File.basename(x)
img = []
img[0] = filename
filename = params[:bn] + '/' + filename if params[:bn]
img[1] = filename
@names << img
end
headers['Content-Type']='application/xml'
response = ""
render :template => 'list/images.xml'
end
# Log when image is viewed
def send_log
logger.info('***** Viewed image with id: ' + params[:id])
# Have to send some dummy back otherwise server chokes on nullpointer exception
headers['Content-Type']='application/xml'
render :template => 'list/response.xml'
end
def banner
# Get ad server url from config manager
@ad_url = MOBIO_CONFIG['adserver_url']
end
def view
# Get ad server url from config manager
@ad_url = MOBIO_CONFIG['adserver_url']
end
def sponsor
headers['Content-Type']='application/xml'
response = 'sponsor ' + params[:id] + ''
render :template => 'list/response.xml'
end
# handle backurl to home
def storeBackurl
backURL("recipe_burl")
end
def set_index
end
def err
end
def err_response
end
def data_response
end
def promo
end
end