Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezsearch/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 9824 2003-06-02 08:00:43Z jhe $
5 //
6 // Created on: <08-Jun-2001 13:10:36 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/ezhttptool.php" );
28 // include_once( "classes/INIFile.php" );
29 // include_once( "classes/eztemplate.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32
33 $Language = $ini->variable( "eZSearchMain", "Language" );
34 $SearchModules = $ini->variable( "eZSearchMain", "SearchModules" );
35
36 $moduleArray = explode( ";", $SearchModules );
37
38 // init the section
39 if ( isset ($SectionIDOverride) )
40 {
41 // include_once( "ezsitemanager/classes/ezsection.php" );
42
43 $sectionObject =& eZSection::globalSectionObject( $SectionIDOverride );
44 $sectionObject->setOverrideVariables();
45 }
46
47 $t = new eZTemplate( "kernel/ezsearch/user/" . $ini->variable( "eZSearchMain", "TemplateDir" ),
48 "kernel/ezsearch/user/intl/", $Language, "search.php" );
49
50 $t->set_file( "search_tpl", "search.tpl" );
51
52 $t->set_block( "search_tpl", "search_type_tpl", "search_type" );
53 $t->set_block( "search_type_tpl", "search_sub_module_tpl", "search_sub_module" );
54 $t->set_block( "search_sub_module_tpl", "search_sub_module_name_tpl", "search_sub_module_name" );
55 $t->set_block( "search_sub_module_tpl", "search_item_tpl", "search_item" );
56
57 $t->setAllStrings();
58
59 $Limit = 20;
60 $Offset = 0;
61
62 $tmpSearchText = str_replace( "<", "&lt;", $SearchText );
63 $tmpSearchText = str_replace( ">", "&gt;", $tmpSearchText );
64 $t->set_var( "search_text", $tmpSearchText );
65 $t->set_var( "search_type", '' );
66
67 foreach ( $moduleArray as $module )
68 {
69 $module = strtolower( $module );
70 unset( $SearchResult );
71 if ( file_exists( "kernel/$module/user/searchsupplier.php" ) )
72 {
73 include( "kernel/$module/user/searchsupplier.php" );
74
75 $t->set_var( "search_item", "" );
76 $t->set_var( "module_name", $ModuleName );
77 $i = 0;
78 if ( isset( $SearchResult[0] ) && !is_array( $SearchResult[0] ) )
79 {
80 $SearchResult = array( $SearchResult );
81 }
82
83 $t->set_var( "search_sub_module", "" );
84 foreach ( $SearchResult as $Result )
85 {
86 if ( !is_null( $Result ) &&
87 !is_int( $Result ) &&
88 !is_string( $Result ) && count( $Result ) > 0 &&
89 ( isset( $Result["Result"] ) && !is_null( $Result["Result"] ) ) &&
90 !is_int( $Result["Result"] ) && count( $Result["Result"] ) > 0 )
91 {
92 $ResultArrayDetailViewPath = $Result["DetailViewPath"];
93 $ResultArray = $Result["Result"];
94
95 foreach ( $ResultArray as $res )
96 {
97 if ( ( $i % 2 ) == 0 )
98 $t->set_var( "td_class", "bglight" );
99 else
100 $t->set_var( "td_class", "bgdark" );
101 if ( isset( $Result["SuffixVariable"] ) && $Result["SuffixVariable"] )
102 $t->set_var( "search_link", $Result["DetailViewPath"] . $res->id() . $Result["SuffixVariable"]);
103 else
104 $t->set_var( "search_link", $Result["DetailViewPath"] . $res->id() );
105 $t->set_var( "search_name", $res->name() );
106 $t->set_var( "icon_src", $Result["IconPath"] );
107 $t->parse( "search_item", "search_item_tpl", true );
108 $i++;
109 }
110 }
111
112 $t->set_var( "search_more_link", isset( $Result["DetailedSearchPath"] ) ? $Result["DetailedSearchPath"] . "?" .
113
114 $Result["DetailedSearchVariable"] . "=". urlencode( $SearchText ) : false );
115
116 $t->set_var( "search_count", isset( $Result["SearchCount"] ) && $Result["SearchCount"] ? $Result["SearchCount"] : count( is_array( $Result ) && !empty( $Result["Result"] ) ? $Result["Result"] : array() ) );
117
118 if ( isset( $Result["SubModuleName"] ) )
119 {
120 $t->set_var( "sub_module_name", $Result["SubModuleName"] );
121 $t->parse( "search_sub_module_name", "search_sub_module_name_tpl" );
122 }
123 else
124 {
125 $t->set_var( "search_sub_module_name", "" );
126 }
127
128 $t->parse( "search_sub_module", "search_sub_module_tpl", true );
129 $t->set_var( "search_item", "" );
130 }
131 $t->parse( "search_type", "search_type_tpl", true );
132 }
133 }
134
135 $t->pparse( "output", "search_tpl" );
136
137 ?>
$Result
if( $module->isCurrentAction( 'NewApplication')) if( $module->isCurrentAction( 'DeleteApplicationList')) return $Result
Definition: action.php:36
$i
$i
Definition: admin/adlist.php:91
$sectionObject
$sectionObject
Definition: articleheaderlist.php:49
eZSection\globalSectionObject
static & globalSectionObject( $sectionID)
Definition: ezsection.php:366
eZTemplate
Definition: eztemplate.php:107
$module
$module
Definition: classes/admin/linkselect.php:219
file_exists
static file_exists( $inifilename)
Definition: eZPBINIFile.php:195
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$ModuleName
$ModuleName
Definition: ezarticle/user/searchsupplier.php:30
$SearchResult
$SearchResult[0]["DetailedSearchPath"]
Definition: ezarticle/user/searchsupplier.php:31
$Limit
$Limit
Definition: ezsearch/user/search.php:59
$Offset
$Offset
Definition: ezsearch/user/search.php:60
$Language
$Language
Definition: ezsearch/user/search.php:33
$t
if(isset($SectionIDOverride)) $t
Definition: ezsearch/user/search.php:47
$ini
$ini
Definition: ezsearch/user/search.php:31
$tmpSearchText
$tmpSearchText
Definition: ezsearch/user/search.php:62
$moduleArray
$moduleArray
Definition: ezsearch/user/search.php:36
$SearchModules
$SearchModules
Definition: ezsearch/user/search.php:34
$res
$res
Definition: ezstats/admin/cron.php:45
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.