1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8//this script may only be included - so its better to die if called directly.
9if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__)) !== false) {
10	header("location: index.php");
11	exit;
12}
13
14function smarty_function_banner($params, $smarty)
15{
16	$bannerlib = TikiLib::lib('banner');
17	$default = ['zone' => '', 'target' => '', 'id' => ''];
18	$params = array_merge($default, $params);
19
20	extract($params);
21
22	if (empty($zone) && empty($id)) {
23		trigger_error("assign: missing 'zone' parameter");
24		return;
25	}
26	$banner = $bannerlib->select_banner($zone, $target, $id);
27
28	print($banner);
29}
30