Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/messageview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: messageview.php,v 1.3 2001/07/20 11:19:36 jakobn Exp $
5 //
6 // Created on: <06-Jun-2001 10:27:02 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 $ini =& eZINI::instance( 'site.ini' );
35 $Language = $ini->variable( "eZMessageMain", "Language" );
36
37 $t = new eZTemplate( "kernel/ezmessage/user/" . $ini->variable( "eZMessageMain", "TemplateDir" ),
38 "kernel/ezmessage/user/intl", $Language, "messageview.php" );
39
40 $locale = new eZLocale( $Language );
41
42 $t->set_file( "message_page_tpl", "messageview.tpl" );
43
44 $t->setAllStrings();
45
46 $message = new eZMessage( );
47
48 if ( $message->get( $MessageID ) )
49 {
50 $toUser =& $message->toUser();
51 $fromUser =& $message->fromUser();
52 $currentUser =& eZUser::currentUser();
53
54 if ( $currentUser->id() != $toUser->id() && $currentUser->id() != $fromUser->id() )
55 {
56 // access denied
57 eZHTTPTool::header( "Location: /error/403/" );
58 exit();
59 }
60 if ( $currentUser->id() == $toUser->id() )
61 {
62 $message->setIsRead( true );
63 $message->store();
64 }
65 $messageArray =& $message->messagesToUser( $user );
66
67 $created = $message->created();
68 $t->set_var( "message_date", $locale->format( $created ) );
69
70 $fromUser = $message->fromUser();
71 $t->set_var( "message_id", $message->id() );
72 $t->set_var( "from_user_first_name", $fromUser->firstName() );
73 $t->set_var( "from_user_last_name", $fromUser->lastName() );
74 $t->set_var( "message_user_id", $fromUser->id() );
75
76 $t->set_var( "message_subject", $message->subject() );
77 $t->set_var( "message_show_message", $message->render( $message->description() ) );
78 $t->set_var( "message_message", $message->description() );
79
80 $t->pparse( "output", "message_page_tpl" );
81 }
82 else
83 {
84 // message not found
85 eZHTTPTool::header( "Location: /error/404/" );
86 exit();
87 }
88
89 ?>
90
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLocale
Definition: ezlocale.php:119
eZMessage
Definition: ezmessage.php:39
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$messageArray
$messageArray
Definition: ezmessage/admin/messagelist.php:85
exit
exit
Definition: folder.php:81
$currentUser
$currentUser
Definition: surveyedit.php:54
$user
$user
Definition: user/adlist.php:39
$locale
$locale
Definition: user/messageview.php:40
$t
$t
Definition: user/messageview.php:37
$Language
$Language
Definition: user/messageview.php:35
$ini
$ini
Definition: user/messageview.php:34
$message
$message
Definition: user/messageview.php:46
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.