Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

admin/templates/standard/messagesend.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: messagelist.php,v 1.4 2001/07/30 13:22:37 bf Exp $
5 //
6 // Created on: <05-Jun-2001 16:42:09 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/ezlocale.php" );
28 include_once( "classes/ezhttptool.php" );
29 include_once( "classes/eztemplate.php" );
30 include_once( "classes/INIFile.php" );
31
32 include_once( "ezmessage/classes/ezmessage.php" );
33
34
35 $t = new eZTemplate( "ezmessage/admin/" . $ini->variable( "eZMessageMain", "AdminTemplateDir" ),
36 "ezmessage/admin/intl", $Language, "messagelist.php" );
37
38 $locale = new eZLocale( $Language );
39
40 $t->set_file( "message_page_tpl", "messagelist.tpl" );
41
42 if ( isSet( $Delete ) && isSet( $DelMessage ) && count( $DelMessage ) > 0 )
43 {
44 foreach( $DelMessage as $value )
45 {
46 $message = new eZMessage( $value );
47 $toUser = $message->toUser();
48 $user =& eZUser::currentUser();
49 if ( $toUser->id() == $user->id() && $message->isRead() == true )
50 {
51 $message->delete();
52 }
53 }
54 }
55
56 $t->setAllStrings();
57
58 $t->set_block( "message_page_tpl", "message_list_tpl", "message_list" );
59 $t->set_block( "message_list_tpl", "message_item_tpl", "message_item" );
60 $t->set_block( "message_item_tpl", "message_read_tpl", "message_read" );
61 $t->set_block( "message_item_tpl", "message_unread_tpl", "message_unread" );
62
63 $user =& eZUser::currentUser();
64 $t->set_var( "user_first_name", $user->firstName() );
65 $t->set_var( "user_last_name", $user->lastName() );
66
67 $message = new eZMessage( );
68
69 $messageArray =& $message->messagesToUser( $user );
70
71 $i = 0;
72 foreach ( $messageArray as $key => $message )
73 {
74 $t->set_var( "message_id", $message->id() );
75
76 $created = $message->created();
77 $t->set_var( "message_date", $locale->format( $created ) );
78
79 $fromUser = $message->fromUser();
80 $t->set_var( "message_from_user", $fromUser->firstName() . " " . $fromUser->lastName() );
81
82 $t->set_var( "message_subject", $message->subject() );
83
84 if ( ( $i %2 ) == 0 )
85 $t->set_var( "td_class", "bglight" );
86 else
87 $t->set_var( "td_class", "bgdark" );
88
89 if ( $message->isRead() == true )
90 {
91 $t->set_var( "message_disabled", "" );
92 $t->set_var( "message_unread", "" );
93 $t->parse( "message_read", "message_read_tpl" );
94 }
95 else
96 {
97 $t->set_var( "message_disabled", "disabled" );
98 $t->set_var( "message_read", "" );
99 $t->parse( "message_unread", "message_unread_tpl" );
100 }
101
102 $i++;
103 $t->parse( "message_item", "message_item_tpl", true );
104 }
105 if ( count( $messageArray ) > 0 )
106 $t->parse( "message_list", "message_list_tpl" );
107 else
108 $t->set_var( "message_list", "" );
109
110
111 $t->pparse( "output", "message_page_tpl" );
112
113 ?>
114
$messageArray
$messageArray
Definition: admin/templates/standard/messagesend.php:69
$locale
$locale
Definition: admin/templates/standard/messagesend.php:38
$t
$t
Definition: admin/templates/standard/messagesend.php:35
$user
$user
Definition: admin/templates/standard/messagesend.php:63
$i
$i
Definition: admin/templates/standard/messagesend.php:71
$message
$message
Definition: admin/templates/standard/messagesend.php:67
eZLocale
Definition: ezlocale.php:119
eZMessage
Definition: ezmessage.php:39
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Language
$Language
Definition: classes/admin/linklist.php:65
$ini
$ini
Definition: classes/admin/linklist.php:64
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.