Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezimagecatalogue/admin/imageedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: imageedit.php 9794 2003-03-25 14:49:48Z br $
5 //
6 // Created on: <09-Jan-2001 10:45:44 ce>
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( "classes/ezhttptool.php" );
28 // include_once( "ezuser/classes/ezuser.php" );
29 // include_once( "ezuser/classes/ezpermission.php" );
30 // include_once( "ezuser/classes/ezobjectpermission.php" );
31 // include_once( "ezuser/classes/ezauthor.php" );
32
33 $user =& eZUser::currentUser();
34
35 $CurrentCategoryID = eZHTTPTool::getVar( "CategoryID" );
36 $CategoryID = eZHTTPTool::getVar( "CategoryID" );
37
38 if ( !$user )
39 {
40 eZHTTPTool::header( "Location: /error/403/" );
41 exit();
42 }
43
44 if ( isset( $NewCategory ) )
45 {
46 eZHTTPTool::header( "Location: /imagecatalogue/category/new/$CurrentCategoryID/" );
47 exit();
48 }
49
50 if ( isset( $Cancel ) )
51 {
52 eZHTTPTool::header( "Location: /imagecatalogue/image/list/$CurrentCategoryID/" );
53 exit();
54 }
55
56 if ( isset( $DeleteImages ) )
57 {
58 $Action = "DeleteImages";
59 }
60
61 if ( isset( $DeleteCategories ) )
62 {
63 $Action = "DeleteCategories";
64 }
65
66 if ( isset( $UpdateImages ) )
67 {
68 $Action = "UpdateImages";
69 }
70
71 if (isset( $Action ) && $Action == "New" )
72 {
73 $Name = false;
74 $Description = false;
75 $sectionID = false;
76 $Caption = false;
77 $ImageID = false;
78 $readGroupArrayID[0] = -1;
79 $writeGroupArrayID[0] = -1;
80 $uploadGroupArrayID[0] = -1;
81 }
82
83 // include_once( "classes/INIFile.php" );
84 // include_once( "classes/eztemplate.php" );
85 // include_once( "classes/ezlog.php" );
86
87 // // include_once( "classes/ezfile.php" );
88 // include_once( "classes/ezimagefile.php" );
89
90 // include_once( "ezimagecatalogue/classes/ezimage.php" );
91 // include_once( "ezimagecatalogue/classes/ezimagecategory.php" );
92
93 $ini =& eZINI::instance( 'site.ini' );
94 $Language = $ini->variable( "eZImageCatalogueMain", "Language" );
95
96 $t = new eZTemplate( "kernel/ezimagecatalogue/admin/" . $ini->variable( "eZImageCatalogueMain", "AdminTemplateDir" ),
97 "kernel/ezimagecatalogue/admin/intl/", $Language, "imageedit.php" );
98
99 $t->setAllStrings();
100
101 $t->set_file( "image_edit_page", "imageedit.tpl" );
102
103 $t->set_block( "image_edit_page", "value_tpl", "value" );
104 $t->set_block( "image_edit_page", "multiple_value_tpl", "multiple_value" );
105 $t->set_block( "image_edit_page", "image_tpl", "image" );
106 $t->set_block( "image_edit_page", "errors_tpl", "errors" );
107
108 $t->set_block( "image_edit_page", "write_group_item_tpl", "write_group_item" );
109 $t->set_block( "image_edit_page", "read_group_item_tpl", "read_group_item" );
110
111 $t->set_block( "image_edit_page", "photographer_item_tpl", "photographer_item" );
112 $t->set_block( "image_edit_page", "image_variation_tpl", "variation" );
113 $t->set_block( "image_edit_page", "article_item_tpl", "article_item" );
114 $t->set_block( "image_edit_page", "product_item_tpl", "product_item" );
115 $t->set_block( "image_edit_page", "image_info_tpl", "image_info" );
116
117 $t->set_var( "image_info", "" );
118
119 $t->set_var( "errors", "&nbsp;" );
120
121 $t->set_var( "name_value", "$Name" );
122 $t->set_var( "image_description", "$Description" );
123 $t->set_var( "caption_value", "$Caption" );
124
125 $error = false;
126 $nameCheck = true;
127 $captionCheck = false;
128 $descriptionCheck = false;
129 $fileCheck = true;
130 $permissionCheck = true;
131
132 $t->set_block( "errors_tpl", "error_name_tpl", "error_name" );
133 $t->set_var( "error_name", "&nbsp;" );
134
135 $t->set_block( "errors_tpl", "error_caption_tpl", "error_caption" );
136 $t->set_var( "error_caption", "&nbsp;" );
137
138 $t->set_block( "errors_tpl", "error_file_upload_tpl", "error_file_upload" );
139 $t->set_var( "error_file_upload", "&nbsp" );
140
141 $t->set_block( "errors_tpl", "error_description_tpl", "error_description" );
142 $t->set_var( "error_description", "&nbsp;" );
143
144 // Check for errors when inserting or updating.
145 if ( $Action == "Insert" || $Action == "Update" )
146 {
147 if ( $nameCheck )
148 {
149 if ( empty ( $Name ) )
150 {
151 $t->parse( "error_name", "error_name_tpl" );
152 $error = true;
153 }
154 }
155
156 if ( $captionCheck )
157 {
158 if ( empty ( $Caption ) )
159 {
160 $t->parse( "error_caption", "error_caption_tpl" );
161 $error = true;
162 }
163 }
164
165 if ( $descriptionCheck )
166 {
167 if ( empty ( $Description ) )
168 {
169 $t->parse( "error_description", "error_description_tpl" );
170 $error = true;
171 }
172 }
173
174 if( $permissionCheck )
175 {
176 if ( !( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w', $user ) == true
177 || eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'u' )
178 || eZImageCategory::isOwner( eZUser::currentUser(), $CategoryID ) ) )
179 {
180 eZHTTPTool::header( "Location: /error/403/" );
181 exit();
182 }
183 }
184
185 if ( $fileCheck )
186 {
187 $file = new eZPBImageFile();
188 if ( $file->getUploadedFile( "userfile" ) )
189 {
190 $imageTest = new eZImage();
191 if ( $imageTest->checkImage( $file ) and $imageTest->setImage( $file ) )
192 {
193 $fileOK = true;
194 }
195 else
196 {
197 $error = true;
198 $t->parse( "error_file_upload", "error_file_upload_tpl" );
199 }
200 }
201 else
202 {
203 if ( $Action == "Insert" )
204 {
205 $error = true;
206 $t->parse( "error_file_upload", "error_file_upload_tpl" );
207 }
208 }
209 }
210
211 if ( $error )
212 {
213 $t->parse( "errors", "errors_tpl" );
214 if( count( $WriteGroupArrayID ) > 0 )
215 {
216 foreach( $WriteGroupArrayID as $unf )
217 {
218 if( $unf == 0 )
219 $writeGroupArrayID[] = -1;
220 else
221 $writeGroupArrayID[] = $unf;
222 }
223 }
224 if( count( $ReadGroupArrayID ) > 0 )
225 {
226 foreach( $ReadGroupArrayID as $unf )
227 {
228 if( $unf == 0 )
229 $readGroupArrayID[] = -1;
230 else
231 $readGroupArrayID[] = $unf;
232 }
233 }
234 }
235 }
236
237 // Insert if error == false
238 if ( $Action == "Insert" && $error == false )
239 {
240 $image = new eZImage();
241 $image->setName( $Name );
242 $image->setCaption( $Caption );
243 $image->setDescription( $Description );
244 $image->setUser( $user );
245
246 $image->setImage( $file );
247
248 $category = new eZImageCategory( $CategoryID );
249
250 if ( trim( $NewPhotographerName ) != "" &&
251 trim( $NewPhotographerEmail ) != "" )
252 {
253 $author = new eZAuthor( );
254 $author->setName( $NewPhotographerName );
255 $author->setEmail( $NewPhotographerEmail );
256 $author->store();
257 $image->setPhotographer( $author );
258 }
259 else
260 {
261 $image->setPhotographer( $PhotoID );
262 }
263
264 $image->store();
265
266 $ImageID = $image->id();
267
268 if ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ) // user had write permission
269 {
270 changePermissions( $ImageID, $ReadGroupArrayID, 'r' );
271 changePermissions( $ImageID, $WriteGroupArrayID, 'w' );
272 }
273 else if ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'u' ) ) // user had upload permission only, change ownership, set special rights..
274 {
275 eZObjectPermission::removePermissions( $ImageID, "imagecatalogue_image", 'w' ); // no write
276 eZObjectPermission::removePermissions( $ImageID, "imagecatalogue_image", 'r' ); // all read
277 eZObjectPermission::setPermission( -1, $ImageID, "imagecatalogue_image", 'r' );
278 $image->setUser( $category->user() );
279 $image->store();
280 }
281 else
282 {
283 eZHTTPTool::header( "Location: /error/403/" );
284 exit();
285 }
286
287 $image->setCategoryDefinition( $category );
288
289 if( !isset( $CategoryArray ) || !is_array( $CategoryArray ) || count( $CategoryArray ) == 0 )
290 $CategoryArray = array();
291
292 $categories = array_unique( array_merge( $CategoryArray, array( $CategoryID ) ) );
293
294 foreach ( $categories as $categoryItem )
295 {
297 // this may be unnecessary or even wrong, as the image may not have been stored yet
298 if( eZObjectPermission::hasPermission( $categoryItem, "imagecatalogue_category", 'w' ) )
299 eZImageCategory::addImage( $image, $categoryItem );
300 }
301
302 eZPBLog::writeNotice( "Picture added to catalogue: $image->name() from IP: $REMOTE_ADDR" );
303
304 eZHTTPTool::header( "Location: /imagecatalogue/image/list/" . $CategoryID . "/" );
305 exit();
306 }
307
308 // Update if error == false
309 if ( $Action == "Update" && $error == false )
310 {
311 $image = new eZImage( $ImageID );
312 $image->setName( $Name );
313 if ( trim( $NewPhotographerName ) != "" && trim( $NewPhotographerEmail ) != "" )
314 {
315 $author = new eZAuthor( );
316 $author->setName( $NewPhotographerName );
317 $author->setEmail( $NewPhotographerEmail );
318 $author->store();
319 $image->setPhotographer( $author );
320 }
321 else
322 {
323 $image->setPhotographer( $PhotoID );
324 }
325
326 $image->setCaption( $Caption );
327 $image->setDescription( $Description );
328
329 $category = new eZImageCategory( $CategoryID );
330 if ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'w' ) ) // user had write permission
331 {
332 changePermissions( $ImageID, $ReadGroupArrayID, 'r' );
333 changePermissions( $ImageID, $WriteGroupArrayID, 'w' );
334 }
335 else if ( eZObjectPermission::hasPermission( $CategoryID, "imagecatalogue_category", 'u' ) ) // user had upload permission only, change ownership, set special rights..
336 {
337 eZObjectPermission::removePermissions( $ImageID, "imagecatalogue_image", 'w' ); // no write
338 eZObjectPermission::removePermissions( $ImageID, "imagecatalogue_image", 'r' ); // all read
339 eZObjectPermission::setPermission( -1, $ImageID, "imagecatalogue_image", 'r' );
340
341 $image->setUser( $category->user() );
342 $image->store();
343 }
344 else
345 {
346 eZHTTPTool::header( "Location: /error/403/" );
347 exit();
348 }
349
350 $categories = $image->categories();
351 foreach( $categories as $categoryItem )
352 {
353 eZImageCategory::removeImage( $image, $categoryItem );
354 }
355
356 $image->setCategoryDefinition( $category );
357
358 if( !isset( $CategoryArray ) || !is_array( $CategoryArray ) || count( $CategoryArray ) == 0 )
359 $CategoryArray = array();
360
361 $categories = array_unique( array_merge( $CategoryArray, array( $CategoryID ) ) );
362
363 foreach ( $categories as $categoryItem )
364 {
365 if( eZObjectPermission::hasPermission( $categoryItem, "imagecatalogue_category", "w" ) )
366 {
367 eZImageCategory::addImage( $image, $categoryItem );
368 }
369 }
370
371 $category->addImage( $image );
372
373 if ( $fileOK )
374 {
375 $image->setImage( $file );
376 }
377
378 $image->store();
379
380 // include_once( "classes/ezhttptool.php" );
381 eZHTTPTool::header( "Location: /imagecatalogue/image/list/" . $CurrentCategoryID . "/" );
382 exit();
383 }
384 else if ( $Action == "Update" && $error == true )
385 {
386 $t->set_var( "name_value", $Name );
387 $t->set_var( "caption_value", $Caption );
388 $t->set_var( "image_description", $Description );
389 if( $ImageID )
390 {
391 $image = new eZImage( $ImageID );
392
393 $t->set_var( "image_id", $image->id() );
394 $t->set_var( "image_alt", $image->caption() );
395
396 $variation = $image->requestImageVariation( 150, 150 );
397
398 $t->set_var( "image_src", "/" .$variation->imagePath() );
399 $t->set_var( "image_width", $variation->width() );
400 $t->set_var( "image_height", $variation->height() );
401 $t->set_var( "image_file_name", $image->originalFileName() );
402 }
403 $t->parse( "image", "image_tpl" );
404 $t->set_var( "action_value", "update" );
405 }
406
407 // Delete an image
408 if ( $Action == "DeleteImages" )
409 {
410 if ( count ( $ImageArrayID ) != 0 )
411 {
412 foreach ( $ImageArrayID as $ImageID )
413 {
414 $image = new eZImage( $ImageID );
415 $image->delete();
416 }
417 }
418
419 // include_once( "classes/ezhttptool.php" );
420 eZHTTPTool::header( "Location: /imagecatalogue/image/list/" . $CurrentCategoryID . "/" );
421 exit();
422 }
423
424 // Update captions
425 if ( $Action == "UpdateImages" )
426
427 {
428 for ( $i = 0; $i < count( $ImageUpdateArrayID ); $i++ )
429 {
430 if ( $NewCaption[$i] != $OldCaption[$i] )
431 {
432 $image = new eZImage($ImageUpdateArrayID[$i]);
433 $image->setCaption( $NewCaption[$i] );
434 $image->store();
435 }
436 }
437
438 // include_once( "classes/ezhttptool.php" );
439 eZHTTPTool::header( "Location: /imagecatalogue/image/list/" . $CurrentCategoryID . "/" );
440 exit();
441 }
442
443
444 // Delete a category
445 if( $Action == "DeleteCategories" )
446 {
447 if( count( $CategoryArrayID ) > 0 )
448 {
449 foreach( $CategoryArrayID as $categoryID )
450 {
451 $category = new eZImageCategory( $categoryID );
452 $category->delete();
453 }
454 }
455
456 // include_once( "classes/ezhttptool.php" );
457 eZHTTPTool::header( "Location: /imagecatalogue/image/list/" . $CurrentCategoryID . "/" );
458 exit();
459 }
460
461 // Set the default values to null
462 if ( $Action == "New" || ( $Action == "Insert" && $error == true ) )
463 {
464 $t->set_var( "action_value", "Insert" );
465 if( $ImageID == "" )
466 {
467 $t->set_var( "image", "" );
468 $t->set_var( "image_id", "" );
469 }
470 else
471 {
472 $image = new eZImage( $ImageID );
473
474 $t->set_var( "image_id", $image->id() );
475 $t->set_var( "image_alt", $image->caption() );
476
477 $variation = $image->requestImageVariation( 150, 150 );
478
479 $t->set_var( "image_src", "/" .$variation->imagePath() );
480 $t->set_var( "image_width", $variation->width() );
481 $t->set_var( "image_height", $variation->height() );
482 $t->set_var( "image_file_name", $image->originalFileName() );
483 $t->parse( "image", "image_tpl" );
484
485 }
486
487 // author select
488
489 $author = new eZAuthor();
490 $authorArray = $author->getAll();
491 $t->set_var( "selected", "" );
492 foreach ( $authorArray as $author )
493 {
494 $t->set_var( "photo_id", $author->id() );
495 $t->set_var( "photo_name", $author->name() );
496 $t->parse( "photographer_item", "photographer_item_tpl", true );
497 }
498
499 }
500
501 // Sets the values to the current image
502 if ( $Action == "Edit" )
503 {
504 $image = new eZImage( $ImageID );
505
506 $t->set_var( "image_id", $image->id() );
507 $t->set_var( "name_value", $image->name() );
508 $t->set_var( "caption_value", $image->caption() );
509 $t->set_var( "image_description", $image->description() );
510 $t->set_var( "action_value", "update" );
511
512 $t->set_var( "image_alt", $image->caption() );
513
514 $photographer = $image->photographer();
515 $PhotographerID = $photographer->id();
516
517 // author select
518
519 $author = new eZAuthor();
520 $authorArray = $author->getAll();
521 foreach ( $authorArray as $author )
522 {
523 if ( $PhotographerID == $author->id() )
524 {
525 $t->set_var( "selected", "selected" );
526 }
527 else
528 {
529 $t->set_var( "selected", "" );
530 }
531 $t->set_var( "photo_id", $author->id() );
532 $t->set_var( "photo_name", $author->name() );
533 $t->parse( "photographer_item", "photographer_item_tpl", true );
534 }
535
536 $variation = $image->requestImageVariation( 150, 150 );
537
538 $t->set_var( "image_src", "/" .$variation->imagePath() );
539 $t->set_var( "image_width", $variation->width() );
540 $t->set_var( "image_height", $variation->height() );
541 $t->set_var( "image_file_name", $image->originalFileName() );
542 $t->parse( "image", "image_tpl" );
543
544 $variationList = $image->variations();
545 for ( $i = 0; $i < count( $variationList ); $i++ )
546 {
547 if ( $variationList[$i]->height() == $image->height() &&
548 $variationList[$i]->width() == $image->width() )
549 {
550 $value = array_slice( $variationList, $i, 1 );
551 $variationList = array_merge( $value, array_slice( $variationList, 0, $i - 1 ), array_slice( $variationList, $i + 1 ) );
552 break;
553 }
554 }
555
556 $info_items = 0;
557 $t->set_var( "variation_item", "" );
558 foreach ( $variationList as $variation )
559 {
560 $t->set_var( "variation_id", $variation->id() );
561 $t->set_var( "variation_width", $variation->width() );
562 $t->set_var( "variation_height", $variation->height() );
563
564 $t->parse( "variation", "image_variation_tpl", true );
565 $info_items++;
566 }
567
568 $t->set_var( "article_item", "" );
569 $articles = $image->articles();
570 foreach( $articles as $article )
571 {
572 if ( ( $user ) &&
573 ( eZObjectPermission::hasPermission( $article->id(), "article_article", "r", $user ) ) )
574 {
575 $t->set_var( "article_id", $article->id() );
576 $t->set_var( "article_name", $article->name() );
577
578 $t->parse( "article_item", "article_item_tpl", true );
579 $info_items++;
580 }
581 }
582
583 $t->set_var( "product_item", "" );
584 $products = $image->products();
585 foreach( $products as $product )
586 {
587 $t->set_var( "product_id", $product->id() );
588 $t->set_var( "product_name", $product->name() );
589
590 $t->parse( "product_item", "product_item_tpl", true );
591 $info_items++;
592 }
593
594 if( $info_items > 0 )
595 $t->parse( "image_info", "image_info_tpl", false );
596 $objectPermission = new eZObjectPermission();
597
598 $readGroupArrayID =& $objectPermission->getGroups( $image->id(), "imagecatalogue_image", "r", false );
599 $writeGroupArrayID =& $objectPermission->getGroups( $image->id(), "imagecatalogue_image", "w", false );
600 }
601
602 $category = new eZImageCategory() ;
603 $categoryList =& $category->getTree( );
604
605 $tree = new eZImageCategory();
606 $treeArray =& $tree->getTree();
607 $user =& eZUser::currentUser();
608
609 $catCount = count( $treeArray );
610 $t->set_var( "num_select_categories", min( $catCount, 10 ) );
611
612 foreach ( $treeArray as $catItem )
613 {
614 if ( eZObjectPermission::hasPermission( $catItem[0]->id(), "imagecatalogue_category", 'w', $user ) == true
615 || eZObjectPermission::hasPermission( $catItem[0]->id(), "imagecatalogue_category", 'u' )
616 || eZImageCategory::isOwner( eZUser::currentUser(), $catItem[0]->id() ) )
617 {
618 if ( $Action == "Edit" )
619 {
620 $defCat = $image->categoryDefinition();
621
622 if ( is_a( $defCat, "eZImageCategory" ) )
623 {
624 if ( $image->existsInCategory( $catItem[0] ) &&
625 ( $defCat->id() != $catItem[0]->id() ) )
626 {
627 $t->set_var( "multiple_selected", "selected" );
628 }
629 else
630 {
631 $t->set_var( "multiple_selected", "" );
632 }
633 }
634 else
635 {
636 $t->set_var( "multiple_selected", "" );
637 }
638
639 if ( is_a( $defCat, "eZImageCategory" ) )
640 {
641 if ( $defCat->id() == $catItem[0]->id() )
642 {
643 $t->set_var( "selected", "selected" );
644 }
645 else
646 {
647 $t->set_var( "selected", "" );
648 }
649 }
650 else
651 {
652 $t->set_var( "selected", "" );
653 }
654 }
655 else
656 {
657 if ( $CategoryID == $catItem[0]->id() )
658 $t->set_var( "selected", "selected" );
659 else
660 $t->set_var( "selected", "" );
661
662 $t->set_var( "multiple_selected", "" );
663 }
664
665
666 $t->set_var( "option_value", $catItem[0]->id() );
667 $t->set_var( "option_name", $catItem[0]->name() );
668
669 if ( $catItem[1] > 0 )
670 $t->set_var( "option_level", str_repeat( "&nbsp;", $catItem[1] ) );
671 else
672 $t->set_var( "option_level", "" );
673
674
675 $t->parse( "value", "value_tpl", true );
676 $t->parse( "multiple_value", "multiple_value_tpl", true );
677 }
678 }
679
680
681
682 // Print out all the groups.
683 $groups =& eZUserGroup::getAll();
684 foreach ( $groups as $group )
685 {
686 $t->set_var( "group_id", $group->id() );
687 $t->set_var( "group_name", $group->name() );
688
689 $t->set_var( "is_write_selected1", "" );
690 $t->set_var( "is_read_selected1", "" );
691 $t->set_var( "read_everybody", "" );
692 $t->set_var( "write_everybody", "" );
693
694 if ( $readGroupArrayID )
695 {
696 foreach ( $readGroupArrayID as $readGroup )
697 {
698 if ( $readGroup == $group->id() )
699 {
700 $t->set_var( "is_read_selected1", "selected" );
701 }
702 elseif ( $readGroup == -1 )
703 {
704 $t->set_var( "read_everybody", "selected" );
705 }
706 else
707 {
708 $t->set_var( "is_read_selected", "" );
709 }
710 }
711 }
712 if ( $Action == "New" )
713 $t->set_var( "read_everybody", "selected" );
714 $t->parse( "read_group_item", "read_group_item_tpl", true );
715
716 if ( $writeGroupArrayID )
717 {
718 foreach ( $writeGroupArrayID as $writeGroup )
719 {
720 if ( $writeGroup == $group->id() )
721 {
722 $t->set_var( "is_write_selected1", "selected" );
723 }
724 elseif ( $writeGroup == -1 )
725 {
726 $t->set_var( "write_everybody", "selected" );
727 }
728 else
729 {
730 $t->set_var( "is_write_selected", "selected" );
731 }
732 }
733 }
734 else
735 {
736 $t->set_var( "write_everybody", "selected" );
737 }
738
739 $t->parse( "write_group_item", "write_group_item_tpl", true );
740 }
741
742 $t->pparse( "output", "image_edit_page" );
743
744 /******* FUNCTIONS ****************************/
745
746 function changePermissions( $objectID, $groups , $permission )
747 {
748 eZObjectPermission::removePermissions( $objectID, "imagecatalogue_image", $permission );
749 if ( count( $groups ) > 0 )
750 {
751 foreach ( $groups as $groupItem )
752 {
753 if ( $groupItem == 0 )
754 $group = -1;
755 else
756 $group = new eZUserGroup( $groupItem );
757
758 eZObjectPermission::setPermission( $group, $objectID, "imagecatalogue_image", $permission );
759 }
760 }
761
762 }
763
764 ?>
$i
$i
Definition: admin/adlist.php:91
$authorArray
$authorArray
Definition: admin/articleedit.php:835
$group
$group
Definition: admin/articleedit.php:799
$author
$author
Definition: admin/articleedit.php:834
$Description
$Description
Definition: articlelistrss.php:38
$article
$article
Definition: articlelog.php:45
$articles
$articles
Definition: authorview.php:64
eZAuthor
Definition: ezauthor.php:40
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZHTTPTool\getVar
static getVar( $name, $onlyCheckPost=false)
Definition: ezhttptool.php:55
eZImageCategory
Definition: ezimagecategory.php:43
eZImageCategory\isOwner
static isOwner( $user, $imageCategory=false)
Definition: ezimagecategory.php:480
eZImageCategory\addImage
static addImage( $value, $categoryid=false)
Definition: ezimagecategory.php:547
eZImageCategory\removeImage
static removeImage( $value, $categoryid=false)
Definition: ezimagecategory.php:594
eZImage
Definition: ezimage.php:95
eZObjectPermission
Definition: ezobjectpermission.php:55
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZObjectPermission\setPermission
static setPermission( $group, $objectID, $moduleTable, $permission)
Definition: ezobjectpermission.php:236
eZObjectPermission\removePermissions
static removePermissions( $objectID, $moduleTable, $permission)
Definition: ezobjectpermission.php:320
eZPBImageFile
Definition: ezpbimagefile.php:71
eZPBLog\writeNotice
static writeNotice( $notice)
Definition: ezpblog.php:166
eZTemplate
Definition: eztemplate.php:107
eZUserGroup
Definition: ezusergroup.php:66
eZUserGroup\getAll
static & getAll( $as_object=true)
Definition: ezusergroup.php:197
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$ImageID
$ImageID
Definition: companytypelist.php:201
$permission
$permission
Definition: eventedit.php:315
$categories
$categories
Definition: ezarticle/admin/categoryedit.php:636
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$captionCheck
$captionCheck
Definition: ezimagecatalogue/admin/imageedit.php:127
$CategoryID
$CategoryID
Definition: ezimagecatalogue/admin/imageedit.php:36
$t
$t
Definition: ezimagecatalogue/admin/imageedit.php:96
$treeArray
$treeArray
Definition: ezimagecatalogue/admin/imageedit.php:606
$descriptionCheck
$descriptionCheck
Definition: ezimagecatalogue/admin/imageedit.php:128
$user
$user
Definition: ezimagecatalogue/admin/imageedit.php:33
$tree
$tree
Definition: ezimagecatalogue/admin/imageedit.php:605
$Language
$Language
Definition: ezimagecatalogue/admin/imageedit.php:94
$groups
foreach( $treeArray as $catItem) $groups
Definition: ezimagecatalogue/admin/imageedit.php:683
$catCount
$catCount
Definition: ezimagecatalogue/admin/imageedit.php:609
$permissionCheck
$permissionCheck
Definition: ezimagecatalogue/admin/imageedit.php:130
$category
if( $Action=="Insert"|| $Action=="Update") if( $Action=="Insert" && $error==false) if( $Action=="Update" && $error==false) else if( $Action=="Update" && $error==true) if( $Action=="DeleteImages") if( $Action=="UpdateImages") if( $Action=="DeleteCategories") if( $Action=="New"||( $Action=="Insert" && $error==true)) if( $Action=="Edit") $category
Definition: ezimagecatalogue/admin/imageedit.php:602
$nameCheck
$nameCheck
Definition: ezimagecatalogue/admin/imageedit.php:126
$categoryList
$categoryList
Definition: ezimagecatalogue/admin/imageedit.php:603
changePermissions
changePermissions( $objectID, $groups, $permission)
Definition: ezimagecatalogue/admin/imageedit.php:746
$CurrentCategoryID
$CurrentCategoryID
Definition: ezimagecatalogue/admin/imageedit.php:35
$fileCheck
$fileCheck
Definition: ezimagecatalogue/admin/imageedit.php:129
$ini
if(! $user) if(isset( $NewCategory)) if(isset( $Cancel)) if(isset( $DeleteImages)) if(isset( $DeleteCategories)) if(isset( $UpdateImages)) if(isset( $Action) && $Action=="New") $ini
Definition: ezimagecatalogue/admin/imageedit.php:93
$error
$error
Definition: ezimagecatalogue/admin/imageedit.php:125
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
exit
exit
Definition: folder.php:81
$product
$product
Definition: homepage.php:202
$Name
$Name
Definition: polledit.php:250
$categoryID
else $categoryID
Definition: productview.php:66
$image
$image
Definition: user/articlelist.php:242
$info_items
if( $category !=-1) $info_items
Definition: user/imageview.php:118
$products
$products
Definition: user/imageview.php:142
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.