Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbulkmail/admin/categorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorylist.php 9623 2002-06-11 08:20:30Z jhe $
5 //
6 // Created on: <18-Apr-2001 10:26:26 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/ezbulkmail.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "classes/ezhttptool.php" );
32 // include_once( "classes/eztemplate.php" );
33 // include_once( "classes/INIFile.php" );
34 // include_once( "classes/ezlist.php" );
35
36 $mailCount = false;
37
38 if ( isset( $Ok ) || isset( $New ) )
39 {
40 (new eZBulkMailCategory())->setSingleList( false );
41 if ( isset( $SingleListID ) && $SingleListID != -1 )
42 {
43 (new eZBulkMailCategory())->setSingleList( $SingleListID );
44 }
45 }
46
47 if ( isset( $New ) )
48 {
49 eZHTTPTool::header( "Location: /bulkmail/categoryedit/0" );
50 exit();
51 }
52
53 if ( isset( $Delete ) )
54 {
55 if ( count( $CategoryArrayID ) > 0 )
56 {
57 foreach ( $CategoryArrayID as $categoryID )
58 {
59 eZBulkMailCategory::delete( $categoryID );
60 }
61 }
62 if ( count( $BulkMailArrayID ) > 0 )
63 {
64 foreach ( $BulkMailArrayID as $bulkmailID )
65 {
66 eZBulkMail::delete( $bulkmailID );
67 }
68 }
69 }
70
71 $Language = $ini->variable( "eZBulkMailMain", "Language" );
72 $t = new eZTemplate( "kernel/ezbulkmail/admin/" . $ini->variable( "eZBulkMailMain", "AdminTemplateDir" ),
73 "kernel/ezbulkmail/admin/intl", $Language, "categorylist.php" );
74
75 $iniLanguage = new eZINI( "kernel/ezbulkmail/admin/intl/" . $Language . "/categorylist.php.ini", false );
76
77 $locale = new eZLocale( $Language );
78 $t->set_file( "category_list_tpl", "categorylist.tpl" );
79
80 $t->setAllStrings();
81 $t->set_var( "site_style", $SiteDesign );
82
83 $t->set_block( "category_list_tpl", "category_tpl", "category" );
84 $t->set_block( "category_tpl", "category_item_tpl", "category_item" );
85 $t->set_block( "category_list_tpl", "bulkmail_tpl", "bulkmail" );
86 $t->set_block( "bulkmail_tpl", "bulkmail_item_tpl", "bulkmail_item" );
87 $t->set_block( "category_list_tpl", "single_category_item_tpl", "single_category_item" );
88 $t->set_var( "single_category_item", "" );
89 $t->set_var( "category", "" );
90 $t->set_var( "category_item", "" );
91 $t->set_var( "bulkmail", "" );
92 $t->set_var( "bulkmail_item", "" );
93 $t->set_var( "current_category_name", "" );
94 $t->set_var( "current_category_id", "" );
95
97 $singleListCategoryID = eZBulkMailCategory::singleList( false );
98 if ( $singleListCategoryID == false )
99 $t->set_var( "multi_list_selected", "selected" );
100 else
101 $t->set_var( "multi_list_selected", "" );
102
103 $categories = eZBulkMailCategory::getAll();
104 $i = 0;
105 foreach ( $categories as $categoryitem )
106 {
107 $t->set_var( "category_name", $categoryitem->name() );
108 $t->set_var( "category_description", $categoryitem->description() );
109 $t->set_var( "subscription_count", $categoryitem->subscriberCount() );
110 $t->set_var( "category_id", $categoryitem->id() );
111 if ( $categoryitem->isPublic() )
112 $t->set_var( "category_is_public", $iniLanguage->variable( "strings", "yes" ) );
113 else
114 $t->set_var( "category_is_public", $iniLanguage->variable( "strings", "no" ) );
115
116 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
117
118 $t->parse( "category_item", "category_item_tpl", true );
119 $i++;
120
121 // also parse of the upper category single list select
122 if ( $singleListCategoryID == $categoryitem->id() )
123 $t->set_var( "single_list_selected", "selected" );
124 else
125 $t->set_var( "single_list_selected", "" );
126
127 $t->parse( "single_category_item", "single_category_item_tpl", true );
128 }
129
130 if ( $i > 0 )
131 $t->parse( "category", "category_tpl" );
132
133 if ( is_numeric( $CategoryID ) && $CategoryID > 0 )
134 {
135 $category = new eZBulkMailCategory( $CategoryID );
136 $t->set_var( "current_category_name", $category->name() );
137 $t->set_var( "current_category_id", $category->id() );
138 $mail = $category->mail( $Offset, 20 );
139 $mailCount = $category->mailCount();
140 $i = 0;
141 foreach ( $mail as $mailItem )
142 {
143 $t->set_var( "bulkmail_id", $mailItem->id() );
144 $t->set_var( "bulkmail_subject", $mailItem->subject() );
145
146 if ( !$mailItem->isDraft() )
147 {
148 $t->set_var( "sent_date", $locale->format( $mailItem->date() ) );
149 }
150 else
151 {
152 $t->set_var( "sent_date", $iniLanguage->variable( "strings", "not_sent" ) );
153 }
154
155 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
156
157 $t->parse( "bulkmail_item", "bulkmail_item_tpl", true );
158 $i++;
159 }
160 if ( $i > 0 )
161 $t->parse( "bulkmail", "bulkmail_tpl" );
162 }
163
164 eZList::drawNavigator( $t, $mailCount, 20, $Offset, "category_list_tpl" );
165 $t->pparse( "output", "category_list_tpl" );
166
167 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZBulkMail\delete
delete( $id=-1)
Definition: ezbulkmail.php:122
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZINI
Reads and writes .ini style configuration files.
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
$ini
$ini
Definition: classes/admin/linklist.php:64
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$iniLanguage
$iniLanguage
Definition: ezbulkmail/admin/categorylist.php:75
$Language
if(isset( $Ok)||isset( $New)) if(isset( $New)) if(isset( $Delete)) $Language
Definition: ezbulkmail/admin/categorylist.php:71
$mailCount
$mailCount
Definition: ezbulkmail/admin/categorylist.php:36
$locale
$locale
Definition: ezbulkmail/admin/categorylist.php:77
$t
$t
Definition: ezbulkmail/admin/categorylist.php:72
$i
$i
Definition: ezbulkmail/admin/categorylist.php:104
$singleListCategoryID
$singleListCategoryID
Definition: ezbulkmail/admin/categorylist.php:97
$categories
$categories
Definition: ezbulkmail/admin/categorylist.php:103
$mail
$mail
Definition: ezbulkmail/admin/maillist.php:61
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
exit
exit
Definition: folder.php:81
$categoryID
else $categoryID
Definition: productview.php:66
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.