Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

groupeditor.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: groupeditor.php,v 1.1 2001/04/24 09:39:43 bf Exp $
5 //
6 // Adam Fallert <FallertA@umsystem.edu>
7 // Created on: <3-Oct-2001 14:36:00>
8 //
9 // This source file is part of Exponential Basic, publishing software.
10 // Copyright (C) 1999-2000 eZ systems as
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( "ezuser/classes/ezuser.php" );
33 // include_once( "ezuser/classes/ezusergroup.php" );
34
35 // include_once( "ezgroupeventcalendar/classes/ezgroupeditor.php" );
36 // include_once( "ezgroupeventcalendar/classes/ezgroupnoshow.php" );
37
38
39 if ( isset( $DeleteEditor ) )
40 {
41 $editor = new eZGroupEditor();
42 if( $RemoveMemberIdArray )
43 {
44 foreach ( $RemoveMemberIdArray as $id )
45 {
46 $editor = new eZGroupEditor( $id );
47 $editor->delete();
48 }
49 }
50 }
51
52
53 if ( isset( $NewEditor ) and isset( $id ))
54 {
55
56 $editor = new eZGroupEditor( $id );
57
58 $group = new eZUserGroup( $GroupID);
59 $editor->setGroup( $group );
60
61 $editor->store();
62 }
63
64 if ( isset( $Store ) )
65 {
66 $i=0;
67 foreach ( $IDArray as $id )
68 {
69 $editor = new eZGroupEditor( $id );
70
71 $user = new eZUser( $MemberID[$i]);
72 $editor->setUser( $user );
73
74 $group = new eZUserGroup( $GroupID);
75 $editor->setGroup( $group );
76
77 $editor->store();
78
79 $i++;
80 }
81 }
82
83
84 $t = new eZTemplate( "kernel/ezgroupeventcalendar/admin/" . $ini->variable( "eZGroupEventCalendarMain", "AdminTemplateDir" ),
85 "kernel/ezgroupeventcalendar/admin/intl", $Language, "groupeditor.php" );
86
87 $locale = new eZLocale( $Language );
88
89 $t->set_file( "group_editor_tpl", "groupeditor.tpl" );
90
91 $t->setAllStrings();
92
93 //Display block
94 $t->set_block( "group_editor_tpl", "group_list_tpl", "group_list" );
95 $t->set_block( "group_list_tpl", "group_item_tpl", "group_item" );
96 $t->set_block( "group_item_tpl", "editor_list_tpl", "editor_list" );
97 $t->set_block( "editor_list_tpl", "editor_tpl", "editor" );
98 $t->set_block( "group_item_tpl", "no_editor_tpl", "no_editor" );
99
100 //Edit block
101 $t->set_block( "group_editor_tpl", "group_edit_tpl", "group_edit" );
102 $t->set_block( "group_edit_tpl", "none_selected_tpl", "none_selected" );
103 $t->set_block( "group_edit_tpl", "editor_name_list_tpl", "editor_name_list" );
104 $t->set_block( "editor_name_list_tpl", "editor_name_item_tpl", "editor_name_item" );
105 $t->set_block( "editor_name_item_tpl", "editor_name_tpl", "editor_name" );
106
107
108
109 if( isset( $Action ) && $Action == "Display" )
110 {
111 $t->set_var( "group_edit", "" );
112
113 //Groups that shouldn't be displayed
114 $noShowGroup = new eZGroupNoShow();
115
116 $groups = new eZUserGroup();
117 $groupsList = $groups->getAll();
118
119 foreach ( $groupsList as $group )
120 {
121 $editors = new eZGroupEditor();
122 $editorsList = $editors->getByGroup( $group->id() );
123
124 if( $noShowGroup->groupEntry( $group->id() ) == false )
125 {
126 $t->set_var( "editor", "" );
127 $t->set_var( "editor_list", "" );
128 $t->set_var( "no_editor", "" );
129 if( $editorsList )
130 {
131 foreach( $editorsList as $editor )
132 {
133 if( $user = new eZUser( $editor->userID() ) )
134 {
135 $t->set_var( "group_editor_id", $user->id() );
136 $t->set_var( "group_editor_fname", $user->firstName() );
137 $t->set_var( "group_editor_lname", $user->lastName() );
138 if( $editor->userID() != 0 )
139 $t->parse( "editor", "editor_tpl", true );
140 }
141 else
142 {
143 $editor->delete( $editor->id() );
144 }
145 }
146
147
148 $t->parse( "editor_list", "editor_list_tpl", true );
149 }
150 else
151 {
152 $t->set_var( "editor", "" );
153 $t->set_var( "editor_list", "" );
154 $t->parse( "no_editor", "no_editor_tpl", true );
155 }
156
157 if ( ( $i % 2 ) == 0 )
158 {
159 $td_class = "bglight";
160 }
161 else
162 {
163 $td_class = "bgdark";
164 }
165
166 $t->set_var( "bgcolor", $td_class );
167 $t->set_var( "group_id", $group->id() );
168 $t->set_var( "group_name", $group->name() );
169 $t->parse( "group_item", "group_item_tpl", true );
170
171 $i++;
172 }
173 }
174 $t->parse( "group_list", "group_list_tpl", true );
175
176 $groupsList = $editors->listGroups();
177
178 if( $groupsList != false )
179 {
180 foreach( $groupsList as $groups )
181 {
182 $group = new eZUserGroup( $groups->groupID() );
183 if( !$group->name() )
184 {
185 print( "we have found a group that doesn't exist anymore<br>\n" );
186 $editors->removeDeletedGroup( $groups->groupID() );
187 }
188 }
189 }
190 }
191
192 if( isset( $Action ) && $Action == "Edit" )
193 {
194 $t->set_var( "group_list", "" );
195 $t->set_var( "editor_name_list", "" );
196 $t->set_var( "none_selected", "" );
197
198 $editors = new eZGroupEditor();
199 $editorsList = $editors->getByGroup( $GroupID );
200
201 $group = new eZUserGroup($GroupID);
202 $t->set_var( "group_name", $group->name() );
203 $t->set_var( "group_id", $group->id() );
204
205 if( $editorsList )
206 {
207 foreach( $editorsList as $editor )
208 {
209 $groupsList = $group->users( $editor->groupID(), "name", false, false );
210
211 $t->set_var( "editor_name", "" );
212 foreach ( $groupsList as $user )
213 {
214 $t->set_var( "user_is_selected", $user->id() == $editor->userID() ? "selected" : "" );
215 $t->set_var( "group_editor_user_fname", $user->firstName() );
216 $t->set_var( "group_editor_user_lname", $user->lastName() );
217 $t->set_var( "group_editor_user_id", $user->id() );
218 $t->parse( "editor_name", "editor_name_tpl", true );
219 }
220
221 $t->set_var( "editor_id", $editor->id() );
222
223 if ( ( $i % 2 ) == 0 )
224 {
225 $td_class = bglight;
226 }
227 else
228 {
229 $td_class = bgdark;
230 }
231
232 $t->set_var( "bgcolor", $td_class );
233 $t->parse( "editor_name_item", "editor_name_item_tpl", true );
234
235 $i++;
236 }
237 $t->parse( "editor_name_list", "editor_name_list_tpl", true );
238 }
239 else
240 $t->parse( "none_selected", "none_selected_tpl" );
241
242
243 $t->parse( "group_edit", "group_edit_tpl", true );
244 }
245
246 $t->pparse( "output", "group_editor_tpl" );
247
248 ?>
$i
$i
Definition: admin/adlist.php:91
$group
$group
Definition: admin/articleedit.php:799
eZGroupEditor
Definition: ezgroupeditor.php:33
eZGroupNoShow
Definition: ezgroupnoshow.php:34
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZUserGroup
Definition: ezusergroup.php:66
eZUser
Definition: ezuser.php:76
$Language
$Language
Definition: classes/admin/linklist.php:65
$ini
$ini
Definition: classes/admin/linklist.php:64
$Action
$Action
Definition: companysearch.php:80
$id
$id
Definition: companytypelist.php:193
$editor
$editor
Definition: eventedit.php:316
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$noShowGroup
$noShowGroup
Definition: ezgroupeventcalendar/user/dayview.php:188
$groupsList
$groupsList
Definition: ezgroupeventcalendar/user/dayview.php:185
$locale
$locale
Definition: groupeditor.php:87
$t
if(isset( $DeleteEditor)) if(isset( $NewEditor) and isset( $id)) if(isset( $Store)) $t
Definition: groupeditor.php:84
$GroupID
$GroupID
Definition: rssheadlines.php:51
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.