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
14/*
15 * smarty_function_reindex_file_pixel: Display a 1x1 transparent gif image that will start a background reindexation process of a file
16 *
17 * params:
18 *  - id: id of the file to reindex
19 */
20function smarty_function_reindex_file_pixel($params, $smarty)
21{
22	if (! is_array($params) || ! isset($params['id']) || ( $id = (int) $params['id'] ) <= 0) {
23		return '';
24	}
25
26	global $tikiroot;
27	return '<img src="' . $tikiroot . 'reindex_file.php?id=' . $id . '" width="1" height="1" />';
28}
29