1 |
2
|
Manuela
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category module
|
5 |
|
|
* @package Form
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
|
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
8 |
|
|
* @link http://www.websitebaker2.org/
|
9 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
10 |
|
|
* @platform WebsiteBaker 2.8.x
|
11 |
|
|
* @requirements PHP 5.2.2 and higher
|
12 |
|
|
* @version $Id$
|
13 |
|
|
* @filesource $HeadURL$
|
14 |
|
|
* @lastmodified $Date$
|
15 |
|
|
* @description
|
16 |
|
|
*/
|
17 |
|
|
// Must include code to stop this file being access directly
|
18 |
|
|
/* -------------------------------------------------------- */
|
19 |
|
|
if(defined('WB_PATH') == false)
|
20 |
|
|
{
|
21 |
|
|
// Stop this file being access directly
|
22 |
|
|
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
23 |
|
|
}
|
24 |
|
|
/* -------------------------------------------------------- */
|
25 |
|
|
|
26 |
|
|
function form_search($func_vars) {
|
27 |
|
|
extract($func_vars, EXTR_PREFIX_ALL, 'func');
|
28 |
|
|
|
29 |
|
|
// how many lines of excerpt we want to have at most
|
30 |
|
|
$max_excerpt_num = $func_default_max_excerpt;
|
31 |
|
|
$divider = ".";
|
32 |
|
|
$result = false;
|
33 |
|
|
|
34 |
|
|
// fetch all form-fields on this page
|
35 |
|
|
$table = TABLE_PREFIX."mod_form_fields";
|
36 |
|
|
$query = $func_database->query("
|
37 |
|
|
SELECT title, value
|
38 |
|
|
FROM $table
|
39 |
|
|
WHERE section_id='$func_section_id'
|
40 |
|
|
ORDER BY position ASC
|
41 |
|
|
");
|
42 |
|
|
// now call print_excerpt() only once for all items
|
43 |
|
|
if($query->numRows() > 0) {
|
44 |
|
|
$text="";
|
45 |
|
|
while($res = $query->fetchRow()) {
|
46 |
|
|
$text .= $res['title'].$divider.$res['value'].$divider;
|
47 |
|
|
}
|
48 |
|
|
$mod_vars = array(
|
49 |
|
|
'page_link' => $func_page_link,
|
50 |
|
|
'page_link_target' => "#wb_section_$func_section_id",
|
51 |
|
|
'page_title' => $func_page_title,
|
52 |
|
|
'page_description' => $func_page_description,
|
53 |
|
|
'page_modified_when' => $func_page_modified_when,
|
54 |
|
|
'page_modified_by' => $func_page_modified_by,
|
55 |
|
|
'text' => $text,
|
56 |
|
|
'max_excerpt_num' => $max_excerpt_num
|
57 |
|
|
);
|
58 |
|
|
if(print_excerpt2($mod_vars, $func_vars)) {
|
59 |
|
|
$result = true;
|
60 |
|
|
}
|
61 |
|
|
}
|
62 |
|
|
return $result;
|
63 |
|
|
}
|