Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: search.php 1457 2011-06-25 17:18:50Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/form/search.php $
15
 * @lastmodified    $Date: 2011-06-25 19:18:50 +0200 (Sat, 25 Jun 2011) $
16
 * @description     
17
 */
18
// Must include code to stop this file being access directly
19
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
20

    
21
function form_search($func_vars) {
22
	extract($func_vars, EXTR_PREFIX_ALL, 'func');
23
	
24
	// how many lines of excerpt we want to have at most
25
	$max_excerpt_num = $func_default_max_excerpt;
26
	$divider = ".";
27
	$result = false;
28
	
29
	// fetch all form-fields on this page
30
	$table = TABLE_PREFIX."mod_form_fields";
31
	$query = $func_database->query("
32
		SELECT title, value
33
		FROM $table
34
		WHERE section_id='$func_section_id'
35
		ORDER BY position ASC
36
	");
37
	// now call print_excerpt() only once for all items
38
	if($query->numRows() > 0) {
39
		$text="";
40
		while($res = $query->fetchRow()) {
41
			$text .= $res['title'].$divider.$res['value'].$divider;
42
		}
43
		$mod_vars = array(
44
			'page_link' => $func_page_link,
45
			'page_link_target' => "#wb_section_$func_section_id",
46
			'page_title' => $func_page_title,
47
			'page_description' => $func_page_description,
48
			'page_modified_when' => $func_page_modified_when,
49
			'page_modified_by' => $func_page_modified_by,
50
			'text' => $text,
51
			'max_excerpt_num' => $max_excerpt_num
52
		);
53
		if(print_excerpt2($mod_vars, $func_vars)) {
54
			$result = true;
55
		}
56
	}
57
	return $result;
58
}
59

    
60
?>
(18-18/21)