Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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