Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbug/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 8504 2001-11-19 09:46:46Z jhe $
5 //
6 // Created on: <04-Dec-2000 11:40:06 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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezlist.php" );
31
32 // include_once( "ezbug/classes/ezbugcategory.php" );
33 // include_once( "ezbug/classes/ezbugmodule.php" );
34 // include_once( "ezbug/classes/ezbug.php" );
35
36 // include_once( "ezuser/classes/ezuser.php" );
37
38 $ini = eZINI::instance( 'site.ini' );
39
40 $Language = $ini->variable( "eZBugMain", "Language" );
41 $UserLimit = $ini->variable( "eZBugMain", "UserSearchLimit" );
42
43 $t = new eZTemplate( "kernel/ezbug/user/" . $ini->variable( "eZBugMain", "TemplateDir" ),
44 "kernel/ezbug/user/intl/", $Language, "search.php" );
45
46 $t->setAllStrings();
47
48 $t->set_file( array(
49 "bug_list_page_tpl" => "search.tpl"
50 ) );
51
52
53 // bug
54 $t->set_block( "bug_list_page_tpl", "bug_list_tpl", "bug_list" );
55 $t->set_block( "bug_list_tpl", "bug_item_tpl", "bug_item" );
56 $t->set_block( "bug_item_tpl", "bug_is_closed_tpl", "bug_is_closed" );
57 $t->set_block( "bug_item_tpl", "bug_is_open_tpl", "bug_is_open" );
58
59 if ( !$Offset )
60 $Offset = 0;
61
62 // bugs
63 $bug = new eZBug();
64 if ( $SearchText )
65 {
66 $bugList = $bug->search( $SearchText, $Offset, $UserLimit );
67 $bugCount = $bug->searchCount( $SearchText );
68 $t->set_var( "query_text", urlencode( $SearchText ) );
69 }
70 else
71 {
72 $t->set_var( "query_text", "" );
73 }
74
75
76
77 $locale = new eZLocale( $Language );
78 $i=0;
79 $t->set_var( "bug_list", "" );
80
81 if ( count ( $bugList ) > 0 )
82 {
83 foreach ( $bugList as $bug )
84 {
85 $t->set_var( "bug_id", $bug->id() );
86 $t->set_var( "bug_name", $bug->name() );
87
88 $pri =& $bug->priority();
89 $status =& $bug->status();
90
91 if ( $pri )
92 {
93 $t->set_var( "bug_priority", $pri->name() );
94 }
95 else
96 {
97 $t->set_var( "bug_priority", "" );
98 }
99
100 if ( $status )
101 {
102 $t->set_var( "bug_status", $status->name() );
103 }
104 else
105 {
106 $t->set_var( "bug_status", "" );
107 }
108
109 if ( $bug->isClosed() == true )
110 {
111 $t->parse( "bug_is_closed", "bug_is_closed_tpl" );
112 $t->set_var( "bug_is_open", "" );
113 }
114 else
115 {
116 $t->set_var( "bug_is_closed", "" );
117 $t->parse( "bug_is_open", "bug_is_open_tpl" );
118 }
119
120 if ( ( $i % 2 ) == 0 )
121 {
122 $t->set_var( "td_class", "bglight" );
123 }
124 else
125 {
126 $t->set_var( "td_class", "bgdark" );
127 }
128
129 $t->parse( "bug_item", "bug_item_tpl", true );
130 $i++;
131 }
132 }
133 eZList::drawNavigator( $t, $bugCount, $UserLimit, $Offset, "bug_list_page_tpl" );
134
135 if ( count( $bugList ) > 0 )
136 $t->parse( "bug_list", "bug_list_tpl" );
137 else
138 $t->set_var( "bug_list", "" );
139
140 $t->pparse( "output", "bug_list_page_tpl" );
141
142 ?>
$bugList
$bugList
Definition: admin/buglist.php:147
$status
$status
Definition: bugedit.php:473
$pri
$pri
Definition: bugpreview.php:70
eZBug
Definition: ezbug.php:80
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$UserLimit
$UserLimit
Definition: ezbug/user/search.php:41
$locale
$locale
Definition: ezbug/user/search.php:77
$t
$t
Definition: ezbug/user/search.php:43
$bug
$bug
Definition: ezbug/user/search.php:63
$i
$i
Definition: ezbug/user/search.php:78
$Language
$Language
Definition: ezbug/user/search.php:40
$ini
$ini
Definition: ezbug/user/search.php:38
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.