Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbulkmail/admin/categoryedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categoryedit.php 6209 2001-07-19 12:36:31Z jakobn $
5 //
6 // Created on: <18-Apr-2001 11:15:33 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
29 // include_once( "ezuser/classes/ezuser.php" );
30 // include_once( "ezuser/classes/ezusergroup.php" );
31 // include_once( "classes/ezhttptool.php" );
32 // include_once( "classes/eztemplate.php" );
33 // include_once( "classes/INIFile.php" );
34
35 if( isset( $Cancel ) ) // cancel pressed, redirect to categorylist page...
36 {
37 eZHTTPTool::header( "Location: /bulkmail/categorylist/" );
38 exit();
39 }
40
41 if( isset( $Ok ) ) // cancel pressed, redirect to categorylist page...
42 {
43 if( $CategoryID == 0 )
44 {
45 $category = new eZBulkMailCategory();
46 }
47 else
48 {
49 $category = new eZBulkMailCategory( $CategoryID );
50 }
51 $category->setDescription( $Description );
52 $category->setName( $Name );
53
54 if( isset( $PublicList ) )
55 $category->setIsPublic( true );
56 else
57 $category->setIsPublic( false );
58
59 $category->store();
60
61 $category->removeGroupSubscription( true );
62 if( count( $SubscriptionGroupsArrayID ) > 0 )
63 {
64 foreach( $SubscriptionGroupsArrayID as $groupID )
65 $category->addGroupSubscription( $groupID );
66 }
67 $id = $category->id();
68 eZHTTPTool::header( "Location: /bulkmail/categorylist/$id" );
69 exit();
70 }
71
72
73 $t = new eZTemplate( "kernel/ezbulkmail/admin/" . $ini->variable( "eZBulkMailMain", "AdminTemplateDir" ),
74 "kernel/ezbulkmail/admin/intl", $Language, "categoryedit.php" );
75 $t->set_file( array(
76 "category_edit_tpl" => "categoryedit.tpl"
77 ) );
78
79 $t->setAllStrings();
80 $t->set_block( "category_edit_tpl", "subscribe_group_item_tpl", "subscribe_group_item" );
81 $t->set_var( "site_style", $SiteDesign );
82
83 $t->set_var( "category_name", "" );
84 $t->set_var( "description", "" );
85 $t->set_var( "category_id", $CategoryID );
86 $t->set_var( "subscribe_group_item", "" );
87 $t->set_var( "checked", "checked" );
88
89 $subscribedGroups = array();
90 if( $CategoryID != 0 )
91 {
92 $category = new eZBulkMailCategory( $CategoryID );
93 if( is_object( $category ) )
94 {
95 $t->set_var( "category_name", $category->name() );
96 $t->set_var( "description", $category->description() );
97 $subscribedGroups = $category->groupSubscriptions( false );
98
99 if( $category->isPublic() )
100 $t->set_var( "checked", "checked" );
101 else
102 $t->set_var( "checked", "" );
103 }
104 }
105
106 // show all user groups in the list!
107 // Print out all the groups.
108 $groups =& eZUserGroup::getAll();
109 foreach ( $groups as $group )
110 {
111 $t->set_var( "group_id", $group->id() );
112 $t->set_var( "group_name", $group->name() );
113
114 $t->set_var( "selected", "" );
115 if( in_array( $group->id(), $subscribedGroups ) )
116 $t->set_var( "selected", "selected" );
117
118 $t->parse( "subscribe_group_item", "subscribe_group_item_tpl", true );
119 }
120
121 $t->pparse( "output", "category_edit_tpl" );
122
123 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$group
$group
Definition: admin/articleedit.php:799
$Description
$Description
Definition: articlelistrss.php:38
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
eZUserGroup\getAll
static & getAll( $as_object=true)
Definition: ezusergroup.php:197
$Language
$Language
Definition: classes/admin/linklist.php:65
$ini
$ini
Definition: classes/admin/linklist.php:64
$id
$id
Definition: companytypelist.php:193
$t
if(isset( $Cancel)) if(isset( $Ok)) $t
Definition: ezbulkmail/admin/categoryedit.php:73
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$subscribedGroups
$subscribedGroups
Definition: ezbulkmail/admin/categoryedit.php:89
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$groupID
$groupID
Definition: ezgroupeventcalendar/user/dayview.php:90
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.