Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezmail/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 9805 2003-04-10 14:48:45Z br $
5 //
6 // Created on: <13-Aug-2001 10:17:53 jhe>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 // Copyright (C) 1999-2001 eZ systems as
10 //
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
24 //
25
26 // include_once( "classes/INIFile.php" );
27 // include_once( "classes/eztemplate.php" );
28
29 // include_once( "ezmail/classes/ezmail.php" );
30
31 $ini =& eZINI::globalINI();
32 $Language = $ini->variable( "eZMailMain", "Language" );
33
34 $t = new eZTemplate( "kernel/ezmail/user/" . $ini->variable( "eZMailMain", "TemplateDir" ),
35 "kernel/ezmail/user/intl/", $Language, "search.php" );
36
37 $t->setAllStrings();
38
39 $t->set_file( "search_tpl", "search.tpl" );
40
41 $t->set_block( "search_tpl", "mail_line_tpl", "mail_line" );
42 $t->set_block( "search_tpl", "folder_item_tpl", "folder_item" );
43
44 $t->set_block( "mail_line_tpl", "mail_item_tpl", "mail_item" );
45 $t->set_block( "mail_line_tpl", "mail_item_unread_tpl", "mail_item_unread" );
46
47 $t->set_block( "mail_item_tpl", "mail_unread_tpl", "mail_unread" );
48 $t->set_block( "mail_item_tpl", "mail_read_tpl", "mail_read" );
49 $t->set_block( "mail_item_tpl", "mail_forwarded_tpl", "mail_forwarded" );
50 $t->set_block( "mail_item_tpl", "mail_replied_tpl", "mail_replied" );
51 $t->set_block( "mail_item_tpl", "mail_repliedall_tpl", "mail_repliedall" );
52 $t->set_block( "mail_item_tpl", "mail_edit_item_tpl", "mail_edit_item" );
53 $t->set_var( "mail_unread", "" );
54 $t->set_var( "mail_read", "" );
55 $t->set_var( "mail_forwarded", "" );
56 $t->set_var( "mail_replied", "" );
57 $t->set_var( "mail_repliedall", "" );
58 $t->set_var( "mail_edit_item", "" );
59
60 $t->set_var( "site_style", $SiteDesign );
61 $t->set_var( "search_string", htmlspecialchars( $SearchText ) );
62
63 if ( isset( $Move ) )
64 {
65 $folder = new eZMailFolder( $FolderSelectID );
66 foreach ( $MailArrayID as $mailitemID )
67 $folder->addMail( $mailitemID );
68 }
69
70 $mailList = eZMail::search( $SearchText );
71
72 $i = 0;
73 foreach ( $mailList as $mailItem )
74 {
75 $t->set_var( "mail_id", $mailItem->id() );
76 $t->set_var( "mail_subject", htmlspecialchars( $mailItem->subject() ), "-" );
77 $t->set_var( "mail_sender", htmlspecialchars( $mailItem->sender() ) );
78
79 $folder = $mailItem->folder( true );
80 if ( $folder )
81 {
82 $t->set_var( "mail_folder_id", $folder->id() );
83 $t->set_var( "mail_folder", $folder->name() );
84 if ( $folder->folderType() == DRAFTS )
85 $t->parse( "mail_edit_item", "mail_edit_item_tpl" );
86 else
87 $t->set_var( "mail_edit_item", "" );
88 }
89 else
90 {
91 $t->set_var( "mail_folder_id", "" );
92 $t->set_var( "mail_folder", "" );
93 }
94
95
96 switch ( $mailItem->status() )
97 {
98 case UNREAD : $t->parse( "mail_status_renderer", "mail_unread_tpl", false ); break;
99 case READ : $t->parse( "mail_status_renderer", "mail_read_tpl", false ); break;
100 case REPLIED : $t->parse( "mail_status_renderer", "mail_replied_tpl", false ); break;
101 case FORWARDED : $t->parse( "mail_status_renderer", "mail_forwarded_tpl", false ); break;
102 case MAIL_SENT : $t->parse( "mail_status_renderer", "mail_read_tpl", false ); break;
103 }
104
105 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
106
107 if ( $mailItem->status() == UNREAD )
108 $t->parse( "mail_line", "mail_item_unread_tpl", true );
109 else
110 $t->parse( "mail_line", "mail_item_tpl", true );
111
112 $i++;
113 }
114
115 foreach ( array( INBOX, SENT, DRAFTS, TRASH ) as $specialfolder )
116 {
117 $folderItem = eZMailFolder::getSpecialFolder( $specialfolder );
118 $t->set_var( "folder_id", $folderItem->id() );
119 $t->set_var( "folder_name", $folderItem->name() );
120 $t->parse( "folder_item", "folder_item_tpl", true );
121 }
122
123 $folders = eZMailFolder::getByUser();
124 foreach ( $folders as $folderItem )
125 {
126 $t->set_var( "folder_id", $folderItem->id() );
127 $t->set_var( "folder_name", $folderItem->name() );
128 $t->parse( "folder_item", "folder_item_tpl", true );
129 }
130
131 $t->pparse( "output", "search_tpl" );
132
133 ?>
eZMailFolder
Definition: ezmailfolder.php:49
eZMailFolder\getByUser
static getByUser( $user=false, $withSpecialFolders=false, $parentFolder=-1)
Definition: ezmailfolder.php:328
eZMailFolder\getSpecialFolder
static getSpecialFolder( $specialType, $user=false)
Definition: ezmailfolder.php:477
eZMail\search
static search( $text, $user=-1)
Definition: ezmail.php:1150
eZTemplate
Definition: eztemplate.php:107
globalINI
static & globalINI( $type="SiteIni", $file="settings/site.ini")
Definition: eZPBINIFile.php:482
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$folder
if(!isset( $FolderID)) $folder
Definition: ezfilemanager/admin/browse.php:74
$t
$t
Definition: ezmail/user/search.php:34
$mailList
if(isset( $Move)) $mailList
Definition: ezmail/user/search.php:70
$i
$i
Definition: ezmail/user/search.php:72
$Language
$Language
Definition: ezmail/user/search.php:32
$ini
$ini
Definition: ezmail/user/search.php:31
$folders
foreach( $mailList as $mailItem) foreach(array(INBOX, SENT, DRAFTS, TRASH) as $specialfolder) $folders
Definition: ezmail/user/search.php:123
REPLIED
const REPLIED
Definition: ezmail.php:52
FORWARDED
const FORWARDED
Definition: ezmail.php:53
READ
const READ
Definition: ezmail.php:51
MAIL_SENT
const MAIL_SENT
Definition: ezmail.php:54
UNREAD
const UNREAD
Definition: ezmail.php:50
SENT
const SENT
Definition: ezmailfolder.php:45
DRAFTS
const DRAFTS
Definition: ezmailfolder.php:44
INBOX
const INBOX
Definition: ezmailfolder.php:43
TRASH
const TRASH
Definition: ezmailfolder.php:46
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.