Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

subscriptionlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: subscriptionlist.php 8249 2001-11-02 08:23:41Z ce $
5 //
6 // Created on: <18-Apr-2001 13:36:21 fh>
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/ezbulkmailcategory.php" );
28 // include_once( "ezbulkmail/classes/ezbulkmailsubscriptionaddress.php" );
29 // include_once( "ezbulkmail/classes/ezbulkmailusersubscripter.php" );
30
31 // include_once( "ezuser/classes/ezuser.php" );
32 // include_once( "classes/ezhttptool.php" );
33 // include_once( "classes/eztemplate.php" );
34 // include_once( "classes/INIFile.php" );
35
36 $Language = $ini->variable( "eZBulkMailMain", "Language" );
37 $TemplateDir = $ini->variable( "eZBulkMailMain", "TemplateDir" );
38
39 if ( $ini->variable( "eZBulkMailMain", "UseEZUser" ) == "enabled" )
40 {
41 $user = eZUser::currentUser();
42 $subscriptionaddress = new eZBulkMailUserSubscripter( $user );
43 if( !is_object ( $user ) )
44 {
45 eZHTTPTool::header( "Location: /user/login/?RedirectURL=/bulkmail/subscriptionlist/" );
46 exit();
47 }
48 }
49 else
50 {
51 $subscriptionaddress = eZBulkMailSubscriptionAddress::getByEmail( $session->variable( "BulkMailAddress" ) );
52 if( is_object( $subscriptionaddress ) == false )
53 {
54 eZHTTPTool::header( "Location: /bulkmail/login" );
55 exit();
56 }
57
58 }
59
60
61
62 if( isset ( $Ok ) )
63 {
64 $subscriptionaddress->unsubscribe( true );
65
66 foreach( $CategoryArrayID as $categoryID )
67 {
68 $subscriptionaddress->subscribe( $categoryID );
69 }
70
71 for( $i=0;$i<count($CategoryAll);$i++ )
72 {
73 $subscriptionaddress->addDelay( $CategoryAll[$i], $SendDelay[$i] );
74 }
75
77 eZHTTPTool::header( "Location: /bulkmail/subscriptionlist/" );
78 exit();
79 }
80
81 $t = new eZTemplate( "kernel/ezbulkmail/user/" . $ini->variable( "eZBulkMailMain", "TemplateDir" ),
82 "kernel/ezbulkmail/user/intl", $Language, "subscriptionlist.php" );
83
84 $t->set_file( array(
85 "subscription_list_tpl" => "subscriptionlist.tpl"
86 ) );
87
88 $t->setAllStrings();
89 $t->set_var( "site_style", $SiteDesign );
90
91 $t->set_block( "subscription_list_tpl", "category_tpl", "category" );
92 $t->set_block( "category_tpl", "category_item_tpl", "category_item" );
93 $t->set_block( "subscription_list_tpl", "no_categories_tpl", "no_categories" );
94 $t->set_var( "category", "" );
95 $t->set_var( "category_item", "" );
96 $t->set_var( "email_value", "" );
97 $t->set_var( "current_email", "" );
98
99 // List all the avaliable categories if there is a valid current address
100 $haystack = $subscriptionaddress->subscriptions( false );
101
102 $categories = eZBulkMailCategory::getAll( false );
103 foreach ( $categories as $categoryitem )
104 {
105 $t->set_var( "category_name", $categoryitem->name() );
106 $t->set_var( "category_description", $categoryitem->description() );
107 $t->set_var( "category_id", $categoryitem->id() );
108 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
109 if( isset ( $haystack ) && in_array ( $categoryitem->id(), $haystack ) )
110 $t->set_var( "is_checked", "checked" );
111 else
112 $t->set_var( "is_checked", "" );
113
114 $setting = $categoryitem->settings( $subscriptionaddress );
115
116 $t->set_var( "delay_0", "" );
117 $t->set_var( "delay_1", "" );
118 $t->set_var( "delay_2", "" );
119 $t->set_var( "delay_3", "" );
120
121 if ( is_a( $setting, "eZBulkMailCategorySettings" ) || is_a( $setting, "eZBulkMailUserCategorySettings" ) )
122 {
123 $delay = $setting->delay();
124 if ( $delay == 1 )
125 $t->set_var( "delay_1", "selected" );
126 if ( $delay == 2 )
127 $t->set_var( "delay_2", "selected" );
128 if ( $delay == 3 )
129 $t->set_var( "delay_3", "selected" );
130 if ( $delay == 4 )
131 $t->set_var( "delay_4", "selected" );
132 }
133 else
134 $t->set_var( "delay_0", "selected" );
135
136
137 $t->parse( "category_item", "category_item_tpl", true );
138 $i++;
139 }
140 if ( $i > 0 )
141 {
142 $t->set_var( "no_categories", "" );
143 $t->parse( "category", "category_tpl" );
144 }
145 else
146 {
147 $t->parse( "no_categories", "no_categories_tpl" );
148 }
149
150 $t->pparse( "output", "subscription_list_tpl" );
151
152 ?>
$i
$i
Definition: admin/adlist.php:91
$session
$session
Definition: admin/articlelist.php:44
eZBulkMailSubscriptionAddress\getByEmail
getByEmail( $email)
Definition: ezbulkmailsubscriptionaddress.php:150
eZBulkMailUserSubscripter
Definition: ezbulkmailusersubscripter.php:42
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$ini
$ini
Definition: classes/admin/linklist.php:64
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
exit
exit
Definition: folder.php:81
$categoryID
else $categoryID
Definition: productview.php:66
$haystack
$haystack
Definition: subscriptionlist.php:100
$TemplateDir
$TemplateDir
Definition: subscriptionlist.php:37
$t
if(is_object( $subscriptionaddress)==false) if(isset( $Ok)) $t
Definition: subscriptionlist.php:81
$Language
$Language
Definition: subscriptionlist.php:36
$categories
$categories
Definition: subscriptionlist.php:102
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.