Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

detailcategorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorylist.php,v 1.32.2.2 2001/11/21 17:34:16 br Exp $
5 //
6 // Created on: <13-Sep-2000 14:56:11 bf>
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/INIFile.php" );
28 include_once( "classes/eztemplate.php" );
29 include_once( "classes/ezlocale.php" );
30 include_once( "classes/ezcurrency.php" );
31 include_once( "classes/ezcachefile.php" );
32 include_once( "classes/ezlist.php" );
33 include_once( "classes/ezmodulelink.php" );
34 include_once( "classes/ezlinksection.php" );
35 include_once( "classes/ezlinkitem.php" );
36
37 function deleteCache( $ProductID, $CategoryID, $CategoryArray )
38 {
39 if ( get_class( $ProductID ) == "ezproduct" )
40 {
41 $CategoryID =& $ProductID->categoryDefinition( false );
42 $CategoryArray =& $ProductID->categories( false );
43 $ProductID = $ProductID->id();
44 }
45
46 $files = eZCacheFile::files( "eztrade/cache/", array( "productlist",
47 array_merge( $CategoryID, $CategoryArray ) ),
48 "cache", "," );
49 foreach( $files as $file )
50 {
51 $file->delete();
52 }
53 $files = eZCacheFile::files( "eztrade/cache/", array( "hotdealslist" ),
54 "cache", "," );
55 foreach( $files as $file )
56 {
57 $file->delete();
58 }
59 }
60
61
62 $ini =& eZINI::instance( 'site.ini' );
63
64 $Language = $ini->variable( "eZTradeMain", "Language" );
65 $Limit = $ini->variable( "eZTradeMain", "AdminProductLimit" );
66 $hotDealImageWidth = $ini->variable( "eZTradeMain", "HotDealImageWidth" );
67 $hotDealImageHeight = $ini->variable( "eZTradeMain", "HotDealImageHeight" );
68 $ShowQuantity = $ini->variable( "eZTradeMain", "ShowQuantity" ) == "true";
69
70 include_once( "eztrade/classes/ezproductcategory.php" );
71 include_once( "eztrade/classes/ezproduct.php" );
72
73 $t = new eZTemplate( "eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
74 "eztrade/admin/intl/", $Language, "detailcategorylist.php" );
75
76 // Set detail or normal mode
77 if ( isSet ( $DetailView ) )
78 {
79 $session =& eZSession::globalSession();
80 $session->setVariable( "TradeViewMode", "Detail" );
81 }
82 if ( isSet ( $NormalView ) )
83 {
84 $session =& eZSession::globalSession();
85 $session->setVariable( "TradeViewMode", "Normal" );
86 }
87
88 $checkMode =& eZSession::globalSession();
89
90 if ( $checkMode->variable( "TradeViewMode" ) == "Detail" )
91 {
92 $DetailView = true;
93 }
94 else if ( $checkMode->variable( "TradeViewMode" ) == "Normal" )
95 {
96 $NormalView = true;
97 }
98
99 $t->setAllStrings();
100
101 $t->set_file( "category_list_page_tpl", "detailcategorylist.tpl" );
102
103 // path
104 $t->set_block( "category_list_page_tpl", "path_item_tpl", "path_item" );
105
106 // category
107 $t->set_block( "category_list_page_tpl", "category_list_tpl", "category_list" );
108 $t->set_block( "category_list_tpl", "category_item_tpl", "category_item" );
109
110 $t->set_block( "category_list_page_tpl", "normal_view_button", "normal_button" );
111 $t->set_block( "category_list_page_tpl", "detail_view_button", "detail_button" );
112
113 // product
114 $t->set_block( "category_list_page_tpl", "product_list_tpl", "product_list" );
115 $t->set_block( "product_list_tpl", "normal_list_tpl", "normal_list" );
116 $t->set_block( "product_list_tpl", "detail_view_tpl", "detail_view" );
117 $t->set_block( "product_list_tpl", "update_button_tpl", "update_button" );
118
119 $t->set_block( "normal_list_tpl", "product_item_tpl", "product_item" );
120
121 $t->set_block( "product_item_tpl", "product_active_item_tpl", "product_active_item" );
122 $t->set_block( "product_item_tpl", "product_inactive_item_tpl", "product_inactive_item" );
123
124 $t->set_block( "product_item_tpl", "voucher_icon_tpl", "voucher_icon" );
125 $t->set_block( "product_item_tpl", "product_icon_tpl", "product_icon" );
126
127 $t->set_block( "product_item_tpl", "inc_vat_item_tpl", "inc_vat_item" );
128 $t->set_block( "product_item_tpl", "ex_vat_item_tpl", "ex_vat_item" );
129
130 //detail view templates
131
132 $t->set_block( "detail_view_tpl", "detail_voucher_icon_tpl", "detail_voucher_icon" );
133 $t->set_block( "detail_view_tpl", "detail_product_icon_tpl", "detail_product_icon" );
134
135 $t->set_block( "detail_view_tpl", "vat_select_tpl", "vat_select" );
136 $t->set_block( "detail_view_tpl", "box_select_tpl", "box_select" );
137 $t->set_block( "detail_view_tpl", "module_linker_button_tpl", "module_linker" );
138 $t->set_block( "detail_view_tpl", "shipping_select_tpl", "shipping_select" );
139 $t->set_block( "detail_view_tpl", "quantity_item_tpl", "quantity_item" );
140 $t->set_block( "quantity_item_tpl", "day_item_tpl", "day_item" );
141 $t->set_block( "detail_view_tpl", "section_item_tpl", "section_item" );
142 $t->set_block( "section_item_tpl", "link_item_tpl", "link_item" );
143
144 //$t->set_block( "product_item_tpl", "inc_vat_item_tpl", "inc_vat_item" );
145 //$t->set_block( "product_item_tpl", "ex_vat_item_tpl", "ex_vat_item" );
146 $t->set_block( "detail_view_tpl", "product_image_tpl", "product_image" );
147 $t->set_block( "detail_view_tpl", "no_product_image_tpl", "no_product_image" );
148 $t->set_block( "detail_view_tpl", "main_image_tpl", "main_image" );
149 $t->set_block( "detail_view_tpl", "no_main_image_tpl", "no_main_image" );
150 $t->set_block( "detail_view_tpl", "value_tpl", "value" );
151 $t->set_block( "detail_view_tpl", "multiple_value_tpl", "multiple_value" );
152 $t->set_block( "detail_view_tpl", "image_tpl", "image" );
153 // move up / down
154 $t->set_block( "detail_view_tpl", "detail_absolute_placement_item_tpl", "detail_absolute_placement_item" );
155 $t->set_block( "detail_view_tpl", "detail_inc_vat_item_tpl", "detail_inc_vat_item" );
156 $t->set_block( "detail_view_tpl", "detail_ex_vat_item_tpl", "detail_ex_vat_item" );
157
158 // move up / down
159 // $t->set_block( "product_list_tpl", "absolute_placement_header_tpl", "absolute_placement_header" );
160 $t->set_block( "product_item_tpl", "absolute_placement_item_tpl", "absolute_placement_item" );
161 $t->set_var( "site_style", $SiteStyle );
162
163
164 // $category = new eZProductCategory( 1 );
165 // $category->copy( true );
166
167 // die();
168
169 $category = new eZProductCategory();
170 $category->get( $ParentID );
171
172 // move products up / down
173 if ( $category->sortMode() == "absolute_placement" )
174 {
175 if ( is_numeric( $MoveUp ) )
176 {
177 $category->moveUp( $MoveUp );
178 deleteCache( $MoveUp, false, false );
179 }
180 if ( is_numeric( $MoveDown ) )
181 {
182 $category->moveDown( $MoveDown );
183 deleteCache( $MoveDown, false, false );
184 }
185 }
186
187 // path
188 $pathArray =& $category->path();
189
190 $t->set_var( "path_item", "" );
191 foreach ( $pathArray as $path )
192 {
193 $t->set_var( "category_id", $path[0] );
194
195 $t->set_var( "category_name", $path[1] );
196
197 $t->parse( "path_item", "path_item_tpl", true );
198 }
199
200
201
202 $categoryList =& $category->getByParent( $category );
203
204 // categories
205 $i = 0;
206 $t->set_var( "category_list", "" );
207
208 foreach ( $categoryList as $categoryItem )
209 {
210 $t->set_var( "category_id", $categoryItem->id() );
211
212 $t->set_var( "category_name", $categoryItem->name() );
213
214 $parent = $categoryItem->parent();
215
216
217 if ( ( $i % 2 ) == 0 )
218 {
219 $t->set_var( "td_class", "bglight" );
220 }
221 else
222 {
223 $t->set_var( "td_class", "bgdark" );
224 }
225 $t->set_var( "category_description", $categoryItem->description() );
226
227 $t->parse( "category_item", "category_item_tpl", true );
228 $i++;
229 }
230
231 if ( count( $categoryList ) > 0 )
232 $t->set_var( "csv_dir", $ini->variable( "eZTradeMain", "CSVImportPath" ) );
233
234 if ( count( $categoryList ) > 0 )
235 $t->parse( "category_list", "category_list_tpl" );
236 else
237 $t->set_var( "category_list", "" );
238
239
240 if ( !isset( $Limit ) or !is_numeric( $Limit ) )
241 $Limit = 10;
242 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
243 $Offset = 0;
244
246 // Display Product List Bulk Editor Mode
247
248 // Products
249 $TotalTypes =& $category->productCount( $category->sortMode(), true, true );
250 $productList =& $category->products( $category->sortMode(), true, $Offset, $Limit, true );
251
252 $locale = new eZLocale( $Language );
253 $i = 0;
254 $t->set_var( "product_list", "" );
255
256 /*if ( $category->sortMode() == "absolute_placement" )
257 {
258 $t->parse( "absolute_placement_header", "absolute_placement_header_tpl" );
259 }
260 else
261 {
262 $t->set_var( "absolute_placement_header", "" );
263 }*/
264
265 $categoryList = $category->getTree( );
266
267 foreach ( $productList as $product )
268 {
269 $t->set_var( "category_array_id", $i );
270 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
271 $t->set_var( "product_id", $product->id() );
272
273 // $category = new eZProductCategory();
274
275 $t->set_var( "value", "" );
276 $t->set_var( "multiple_value", "" );
277 foreach ( $categoryList as $catItem )
278 {
279 $defCat = $product->categoryDefinition();
280 if ( $product->existsInCategory( $catItem[0] )
281 && ( $defCat->id() != $catItem[0]->id() ) )
282 {
283 $t->set_var( "multiple_selected", "selected" );
284 }
285 else
286 {
287 $t->set_var( "multiple_selected", "" );
288 }
289
290 if ( $defCat->id() == $catItem[0]->id() )
291 {
292 $t->set_var( "selected", "selected" );
293 }
294 else
295 {
296 $t->set_var( "selected", "" );
297 }
298
299 $t->set_var( "option_value", $catItem[0]->id() );
300 $t->set_var( "option_name", $catItem[0]->name() );
301
302 if ( $catItem[1] > 0 )
303 $t->set_var( "option_level", str_repeat( "&nbsp;", $catItem[1] ) );
304 else
305 $t->set_var( "option_level", "" );
306
307 $t->parse( "value", "value_tpl", true );
308 $t->parse( "multiple_value", "multiple_value_tpl", true );
309 }
310
311 $t->set_var( "product_image", "" );
312 $t->set_var( "no_product_image", "" );
313 $image = $product->thumbnailImage();
314
315 if ( $image )
316 {
317 $thumbnail =& $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
318
319 if ( $thumbnail )
320 {
321 $t->set_var( "thumbnail_image_uri", "/" . $thumbnail->imagePath() );
322 $t->set_var( "thumbnail_image_width", $thumbnail->width() );
323 $t->set_var( "thumbnail_image_height", $thumbnail->height() );
324 $t->parse( "product_image", "product_image_tpl" );
325 }
326 }
327 else
328 {
329 $t->set_var( "product_image", "" );
330 $t->parse( "no_product_image", "no_product_image_tpl" );
331 }
332
333 $t->set_var( "main_image", "" );
334 $t->set_var( "no_main_image", "" );
335
336 $image = $product->mainImage();
337
338 if ( $image )
339 {
340 $thumbnail =& $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
341
342 if ( $thumbnail )
343 {
344 $t->set_var( "main_image_uri", "/" . $thumbnail->imagePath() );
345 $t->set_var( "main_image_width", $thumbnail->width() );
346 $t->set_var( "main_image_height", $thumbnail->height() );
347 $t->parse( "main_image", "main_image_tpl" );
348 }
349 }
350 else
351 {
352 $t->set_var( "main_image", "" );
353 $t->parse( "no_main_image", "no_main_image_tpl" );
354 }
355
356 // die($product->brief());
357 // rendering contains html
358
359 $t->set_var( "product_name", htmlspecialchars($product->name()) );
360 $t->set_var( "product_number", $product->productNumber() );
361
362 if ( isSet ( $DetailView ) )
363 {
364 $t->set_var( "brief_value", $product->briefPlain() );
365 $t->set_var( "description_value", $product->descriptionPlain() );
366 }else{
367 $t->set_var( "brief_value", $product->brief() );
368 $t->set_var( "description_value", $product->description() );
369 }
370
371 $t->set_var( "is_hot_deal_checked", "" );
372 if ( $product->isHotDeal() == true )
373 $t->set_var( "is_hot_deal_checked", "checked" );
374
375 $t->set_var( "showproduct_checked", "" );
376 if ( $product->showProduct() == true )
377 $t->set_var( "showproduct_checked", "checked" );
378
379 $t->set_var( "showprice_checked", "" );
380 if ( $product->showPrice() == true )
381 $t->set_var( "showprice_checked", "checked" );
382
383 $t->set_var( "discontinued_checked", "" );
384 if ( $product->discontinued() == true )
385 $t->set_var( "discontinued_checked", "checked" );
386
387 $t->set_var( "include_vat", "" );
388 $t->set_var( "exclude_vat", "" );
389 if ( $product->includesVAT() == true )
390 $t->set_var( "include_vat", "selected" );
391 else
392 $t->set_var( "exclude_vat", "selected" );
393
394 // show the VAT values
395 $t->set_var( "vat_select", "" );
396 $vat = new eZVATType();
397 $vatTypes = $vat->getAll();
398 $VatType =& $product->vatType();
399
400 foreach ( $vatTypes as $type )
401 {
402 if ( $VatType and ( $VatType->id() == $type->id() ) )
403 {
404 $t->set_var( "vat_selected", "selected" );
405 }
406 else
407 {
408 $t->set_var( "vat_selected", "" );
409 }
410
411 $t->set_var( "vat_id", $type->id() );
412 $t->set_var( "vat_name", $type->name() . " (" . $type->value() . ")%" );
413
414 $t->parse( "vat_select", "vat_select_tpl", true );
415 }
416
417 // show the box types
418 $t->set_var( "box_select", "" );
419 $box = new eZBoxType();
420 $boxTypes = $box->getAll();
421 $BoxType =& $product->boxType();
422 foreach ( $boxTypes as $type )
423 {
424 if ( $BoxType and ( $BoxType->id() == $type->id() ) )
425 $t->set_var( "box_selected", "selected" );
426 else
427 $t->set_var( "box_selected", "" );
428 $t->set_var( "box_id", $type->id() );
429 // $t->set_var( "box_name", $type->name()." (".$type->length()."x".$type->width()."x".$type->height()." in)" );
430 $t->set_var( "box_name", $type->name() );
431 $t->parse( "box_select", "box_select_tpl", true );
432 }
433
434 // show shipping groups
435
436 $t->set_var( "shipping_select", "" );
437 $group = new eZShippingGroup();
438 $groups =& $group->getAll();
439 $ShippingGroup =& $product->shippingGroup();
440
441 foreach ( $groups as $group )
442 {
443 if ( $ShippingGroup and $ShippingGroup->id() == $group->id() )
444 {
445 $t->set_var( "selected", "selected" );
446 }
447 else
448 {
449 $t->set_var( "selected", "" );
450 }
451
452 $t->set_var( "shipping_group_id", $group->id() );
453
454 $t->set_var( "shipping_group_name", $group->name() );
455
456 $t->parse( "shipping_select", "shipping_select_tpl", true );
457 }
458
459 $weight = $product->weight();
460 if ($weight)
461 $t->set_var( "weight_value", $weight );
462 else
463 $t->set_var( "weight_value", "" );
464
465 // Show quantity
466 $Quantity = $product->totalQuantity();
467 $t->set_var( "quantity_item", "" );
468 $t->set_var( "quantity_value", $Quantity );
469
470 // show expected stock date
471
472 if ( $product->stockDate() )
473 {
474 $Stock = new eZDate();
475 $Stock->setTimeStamp( $product->stockDate() );
476 $StockYear = $Stock->year();
477 $StockMonth = $Stock->month();
478 $StockDay = $Stock->day();
479 }
480 else
481 {
482 $StockYear = "";
483 $StockMonth = "";
484 $StockDay = "";
485 }
486
487 for ( $j = 1; $j <= 31; $j++ )
488 {
489 $t->set_var( "day_id", $j );
490 $t->set_var( "day_value", $j );
491 $t->set_var( "selected", "" );
492 if ( $StockDay == $j )
493 $t->set_var( "selected", "selected" );
494 if ( $StockDay == "" and $j == date(j) )
495 $t->set_var( "selected", "selected" );
496 $t->parse( "day_item", "day_item_tpl", true );
497 }
498
499 $month_array = array( 1 => "select_january",
500 2 => "select_february",
501 3 => "select_march",
502 4 => "select_april",
503 5 => "select_may",
504 6 => "select_june",
505 7 => "select_july",
506 8 => "select_august",
507 9 => "select_september",
508 10 => "select_october",
509 11 => "select_november",
510 12 => "select_december" );
511
512 foreach ( $month_array as $month )
513 $t->set_var( $month, "" );
514 $var_name =& $month_array[$StockMonth];
515 if ( $var_name == "" )
516 $var_name =& $month_array[date(n)];
517 $t->set_var( $var_name, "selected" );
518 if ( $StockYear )
519 $t->set_var( "stockyear", $StockYear );
520 else
521 $t->set_var( "stockyear", date(Y) );
522
523 if ( $ShowQuantity )
524 $t->parse( "quantity_item", "quantity_item_tpl" );
525
526 $t->set_var( "product_price", "" );
527 $t->set_var( "product_price_inc_vat", "" );
528 if ( $product->hasPrice() )
529 {
530 // $price = new eZCurrency( $product->price() );
531
532 // $t->set_var( "product_price", $locale->format( $price ) );
533
534 $t->set_var( "product_price", $product->localePrice( $PricesIncludeVAT ) );
535
536 }
537
538
539 $t->set_var( "external_link", $product->externalLink() );
540 $t->set_var( "keywords_value", $product->keywords() );
541
542 $priceArray = "";
543 $options =& $product->options();
544 $high = 0;
545 $low = 0;
546 foreach ( $options as $option )
547 {
548 if ( get_class( $option ) == "ezoption" )
549 {
550 $optionValues =& $option->values();
551 if ( count( $optionValues ) > 1 )
552 {
553 $j=0;
554 $priceArray = array();
555 foreach ( $optionValues as $optionValue )
556 {
557 $priceArray[$j] = $optionValue->price();
558 $j++;
559 }
560 $high += max( $priceArray );
561 $low += min( $priceArray );
562 }
563 }
564 }
565 /* if ( count( $options ) > 0 )
566 {
567 $low = new eZCurrency( $low + $product->price() );
568 $high = new eZCurrency( $high + $product->price() );
569 if ( $low != $high )
570 $t->set_var( "product_price", $locale->format( $low ) . " - " . $locale->format( $high ) );
571 else
572 $t->set_var( "product_price", $locale->format( $low ) );
573 }
574
575 $range = $product->priceRange();
576 if ( $range )
577 {
578 $min = new eZCurrency( $range->min() );
579 $max = new eZCurrency( $range->max() );
580
581 $t->set_var( "product_price", $locale->format( $min ) . " - " . $locale->format( $max ) );
582 }
583
584 */
585 if( $product->includesVAT() == true )
586 {
587 $t->set_var( "ex_vat_item", "" );
588 $t->parse( "inc_vat_item", "inc_vat_item_tpl" );
589 }
590 else
591 {
592 $t->set_var( "inc_vat_item", "" );
593 $t->parse( "ex_vat_item", "ex_vat_item_tpl" );
594 }
595
596
597
598 $t->set_var( "product_active_item", "" );
599 $t->set_var( "product_inactive_item", "" );
600 if ( $product->showProduct() )
601 {
602 $t->parse( "product_active_item", "product_active_item_tpl" );
603 }
604 else
605 {
606 $t->parse( "product_inactive_item", "product_inactive_item_tpl" );
607 }
608
609 $t->set_var( "category_id", $category->id() );
610
611 if ( isSet ( $DetailView ) )
612 {
613 if ( $category->sortMode() == "absolute_placement" )
614 {
615 $t->parse( "detail_absolute_placement_item", "detail_absolute_placement_item_tpl" );
616 }
617 else
618 {
619 $t->set_var( "detail_absolute_placement_item", "" );
620 }
621 }
622 else
623 {
624 if ( $category->sortMode() == "absolute_placement" )
625 {
626 $t->parse( "absolute_placement_item", "absolute_placement_item_tpl" );
627 }
628 else
629 {
630 $t->set_var( "absolute_placement_item", "" );
631 }
632 }
633
634 $t->set_var( "product_icon", "" );
635 $t->set_var( "voucher_icon", "" );
636 $t->set_var( "detail_product_icon", "" );
637 $t->set_var( "detail_voucher_icon", "" );
638
639 // If product type == 1, render the product object as a product
640 // If product type == 1, render the product object as a voucher
641 if ( isSet ( $DetailView ) )
642 {
643 if ( $product->productType() == 1 )
644 {
645 $t->set_var( "url_action", "productedit" );
646 $t->parse( "detail_product_icon", "detail_product_icon_tpl" );
647 }
648 if ( $product->productType() == 2 )
649 {
650 $t->set_var( "url_action", "voucher" );
651 $t->parse( "detail_voucher_icon", "detail_voucher_icon_tpl" );
652 }
653 }
654 else
655 {
656 if ( $product->productType() == 1 )
657 {
658 $t->set_var( "url_action", "productedit" );
659 $t->parse( "product_icon", "product_icon_tpl" );
660 }
661 if ( $product->productType() == 2 )
662 {
663 $t->set_var( "url_action", "voucher" );
664 $t->parse( "voucher_icon", "voucher_icon_tpl" );
665 }
666 }
667 // link list
668 $module_link = new eZModuleLink( "eZTrade", "Product", $product->id() );
669 $sections =& $module_link->sections();
670 $t->set_var( "section_item", "" );
671 foreach ( $sections as $section )
672 {
673 $t->set_var( "link_item", "" );
674 $t->set_var( "section_name", $section->name() );
675 $t->set_var( "section_id", $section->id() );
676 $links =& $section->links();
677 foreach ( $links as $link )
678 {
679 $t->set_var( "link_name", $link->name() );
680 $t->set_var( "link_url", $link->url() );
681 $t->set_var( "link_id", $link->id() );
682 $t->parse( "link_item", "link_item_tpl", true );
683 }
684 $t->parse( "section_item", "section_item_tpl", true );
685 }
686
687
688 // get additional images
689 $t->set_var( "image", "" );
690 $images = $product->images();
691
692 $t->set_var( "image", "" );
693 $t->set_var( "image_list", "" );
694 $image_count = 0;
695
696 foreach ( $images as $imageArray )
697 {
698 $image = $imageArray["Image"];
699
700 // $t->set_var( "image_name", $image->name() );
701 $t->set_var( "image_caption", eZTextTool::nl2br( $image->caption() ) );
702 // $t->set_var( "image_id", $image->id() );
703
704 $variation = $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
705
706 $t->set_var( "image_url", "/" .$variation->imagePath() );
707 $t->set_var( "image_width", $variation->width() );
708 $t->set_var( "image_height", $variation->height() );
709 $t->parse( "image", "image_tpl", true );
710 }
711
712 // Set the detail or normail view
713 if ( isSet ( $DetailView ) )
714 {
715 $t->set_var( "product_item", "" );
716 $t->parse( "detail_view", "detail_view_tpl", true );
717 }
718 else
719 {
720 $t->set_var( "detail_view", "" );
721 $t->parse( "product_item", "product_item_tpl", true );
722 }
723
724 $i++;
725 }
726
727 if ( isSet ( $DetailView ) )
728 {
729 $t->set_var( "is_detail_view", "true" );
730 $t->set_var( "detail_button", "" );
731 $t->set_var( "normal_list", "" );
732 $t->parse( "update_button", "update_button_tpl" );
733 $t->parse( "normal_button", "normal_view_button" );
734 }
735 else
736 {
737 $t->set_var( "is_detail_view", "" );
738 $t->set_var( "normal_button", "" );
739 $t->set_var( "update_button", "" );
740 $t->parse( "detail_button", "detail_view_button" );
741 }
742
743 $t->set_var( "offset", $Offset );
744
745 /*
746 echo "TotalTypes:".$TotalTypes."<br>";
747 echo "Limit:".$Limit."<br>";
748 echo "Offset:".$Offset."<br>";
749 exit();
750 */
751
752 eZList::drawNavigator( $t, $TotalTypes, $Limit, $Offset, "product_list_tpl" );
753
754 if (( count( $productList ) > 0 ) and ( !isSet ($DetailView) ))
755 {
756 $t->parse( "product_list", "product_list_tpl" );
757 $t->parse( "normal_list", "normal_list_tpl" );
758 }
759
760 if ( count( $productList ) > 0 )
761 $t->parse( "product_list", "product_list_tpl" );
762 else
763 {
764 $t->set_var( "product_list", "" );
765 $t->set_var( "normal_list", "" );
766 }
767
768 $t->pparse( "output", "category_list_page_tpl" );
769
770 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$group
$group
Definition: admin/articleedit.php:799
$session
$session
Definition: admin/articlelist.php:44
$month
else $month
Definition: appointmentedit.php:660
$files
$files
Definition: articlepreview.php:91
$images
$images
Definition: articlepreview.php:146
eZBoxType
Definition: ezboxtype.php:40
eZDate
Definition: ezdate.php:46
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZModuleLink
Definition: ezmodulelink.php:65
eZProductCategory
Definition: ezproductcategory.php:90
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZShippingGroup
Definition: ezshippinggroup.php:44
eZTemplate
Definition: eztemplate.php:107
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
eZVATType
Definition: ezvattype.php:41
$module_link
$module_link
Definition: classes/admin/linklist.php:226
$sections
$sections
Definition: classes/admin/linklist.php:227
$type
$type
Definition: classes/admin/linkselect.php:220
$Limit
$Limit
Definition: detailcategorylist.php:65
$category
$category
Definition: detailcategorylist.php:169
$locale
$locale
Definition: detailcategorylist.php:252
$t
$t
Definition: detailcategorylist.php:73
$TotalTypes
$TotalTypes
Definition: detailcategorylist.php:249
$i
$i
Definition: detailcategorylist.php:205
$Language
$Language
Definition: detailcategorylist.php:64
$ini
$ini
Definition: detailcategorylist.php:62
$hotDealImageHeight
$hotDealImageHeight
Definition: detailcategorylist.php:67
$pathArray
if( $category->sortMode()=="absolute_placement") $pathArray
Definition: detailcategorylist.php:188
$categoryList
foreach( $pathArray as $path) $categoryList
Definition: detailcategorylist.php:202
deleteCache
deleteCache( $ProductID, $CategoryID, $CategoryArray)
Definition: detailcategorylist.php:37
$checkMode
if(isSet( $DetailView)) if(isSet( $NormalView)) $checkMode
Definition: detailcategorylist.php:88
$hotDealImageWidth
$hotDealImageWidth
Definition: detailcategorylist.php:66
$ShowQuantity
$ShowQuantity
Definition: detailcategorylist.php:68
$productList
$productList
Definition: detailcategorylist.php:250
$thumbnail
$thumbnail
Definition: ezarticle/admin/imagelist.php:59
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$SiteStyle
$SiteStyle
Definition: ezgroupeventcalendar/user/filelist.php:35
$j
$j
Definition: ezimagecatalogue/admin/imagelist.php:345
$section
$section
Definition: ezimagecatalogue/user/categoryedit.php:393
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$link
$link
Definition: ezlink/admin/attributeedit.php:49
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
$PricesIncludeVAT
$PricesIncludeVAT
Definition: homepage.php:47
$product
$product
Definition: homepage.php:202
$options
$options
Definition: optionlist.php:56
$box
foreach( $vatTypes as $type) $box
Definition: productedit.php:1356
$VatType
$VatType
Definition: productedit.php:1076
$vat
foreach( $categoryArray as $catItem) $vat
Definition: productedit.php:1334
$BoxType
$BoxType
Definition: productedit.php:1077
$boxTypes
$boxTypes
Definition: productedit.php:1357
$vatTypes
$vatTypes
Definition: productedit.php:1335
$image_count
$image_count
Definition: productpreview.php:204
$Quantity
if( $product->catalogNumber() !="") $Quantity
Definition: productpreview.php:491
$image
$image
Definition: user/articlelist.php:242
$links
$links
Definition: user/linkcategorylist.php:181
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.