Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbulkmail/admin/mailview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: mailview.php 8513 2001-11-19 11:29:38Z jhe $
5 //
6 // Created on: <23-Oct-2000 17:53:46 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( "ezbulkmail/classes/ezbulkmail.php" );
28 // include_once( "ezbulkmail/classes/ezbulkmailtemplate.php" );
29
30 // include_once( "classes/INIFile.php" );
31 // include_once( "classes/eztemplate.php" );
32 // include_once( "classes/ezlocale.php" );
33 // include_once( "ezuser/classes/ezuser.php" );
34 // include_once( "classes/ezhttptool.php" );
35
36
37 if ( isset( $Edit ) )
38 {
39 eZHTTPTool::header( "Location: /bulkmail/mailedit/$MailID" );
40 exit();
41 }
42
43 if ( isset( $Send ) )
44 {
45 $mail = new eZBulkMail( $MailID );
46 $categoryArray = $mail->categories();
47 if ( count( $categoryArray ) > 0 )
48 {
49 $mail->send();
50
51 foreach ( $categoryArray as $category )
52 {
53 $subscribers = $category->subscribers( true );
54 foreach ( $subscribers as $subscripter )
55 {
56 $settings = $category->settings( $subscripter );
57 if ( ( is_a( $setting, "eZBulkMailCategorySettings" ) ) && ( $settings->delay() != 0 ) )
58 {
59 $mail->addToDelayList( $subscripter->id(), $category->id(), $settings->delay() );
60 }
61 }
62 }
63
64 $catID = $categoryArray[0]->id();
65 eZHTTPTool::header( "Location: /bulkmail/categorylist/$catID" );
66 exit();
67 }
68 else
69 {
70 echo "An error occured during sending....";
71 }
72 }
73
74 $ini =& eZINI::instance( 'site.ini' );
75 $Language = $ini->variable( "eZBulkMailMain", "Language" );
76
77 $t = new eZTemplate( "kernel/ezbulkmail/admin/" . $ini->variable( "eZBulkMailMain", "AdminTemplateDir" ),
78 "kernel/ezbulkmail/admin/intl/", $Language, "mailview.php" );
79 $t->setAllStrings();
80
81 $t->set_file( "mail_view_page_tpl", "mailview.tpl" );
82
83
84 $t->set_var( "site_style", $SiteDesign );
85 $t->set_block( "mail_view_page_tpl", "send_button_tpl", "send_button" );
86 $t->set_block( "mail_view_page_tpl", "edit_button_tpl", "edit_button" );
87 $t->set_var( "send_button", "" );
88 $t->set_var( "edit_button", "" );
89
91 if ( $SendButton == true )
92 $t->parse( "send_button", "send_button_tpl", false );
93 if ( $EditButton == true )
94 $t->parse( "edit_button", "edit_button_tpl", false );
95
96 $mail = new eZBulkMail( $MailID );
97 if ( is_object( $mail ) )
98 {
99 $fromString = $mail->fromName() . " &lt;" . $mail->sender() ."&gt;";
100 $t->set_var( "current_mail_id", $MailID );
101 $t->set_var( "from", $fromString );
102 $t->set_var( "subject", $mail->subject() );
103
105 $body = $mail->body();
106 $template = $mail->template();
107 if ( is_object( $template ) )
108 $body = $template->header() . $body . $template->footer();
109 $t->set_var( "mail_body", nl2br( $body ) );
110
111 $category = $mail->categories();
112 if ( count( $category ) > 0 )
113 {
114 $t->set_var( "category", $category[0]->name() );
115 }
116 }
117 else
118 {
119 eZHTTPTool::header( "Location: /bulkmail/drafts/" );
120 exit();
121 }
122
123
124 $t->pparse( "output", "mail_view_page_tpl" );
125
126 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$categoryArray
$categoryArray
Definition: adedit.php:379
eZBulkMail
Definition: ezbulkmail.php:46
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$ini
if(isset( $Edit)) if(isset( $Send)) $ini
Definition: ezbulkmail/admin/mailview.php:74
$t
$t
Definition: ezbulkmail/admin/mailview.php:77
$Language
$Language
Definition: ezbulkmail/admin/mailview.php:75
$mail
$mail
Definition: ezbulkmail/admin/mailview.php:96
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$Edit
$Edit
Definition: ezmessage/user/messageedit.php:120
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.