Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

categorytreelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorytreelist.php 6233 2001-07-20 11:42:02Z jakobn $
5 //
6 // Created on: <12-Dec-2000 14:43:08 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
32 $ini =& eZINI::instance( 'site.ini' );
33 $Language = $ini->variable( "eZTradeMain", "Language" );
34
35 // include_once( "eztrade/classes/ezproduct.php" );
36 // include_once( "eztrade/classes/ezproductcategory.php" );
37
38 $t = new eZTemplate( "kernel/eztrade/user/" . $ini->variable( "eZTradeMain", "TemplateDir" ),
39 "kernel/eztrade/user/intl/", $Language, "categorytreelist.php" );
40
41 $t->set_file( "category_list_page_tpl", "categorytreelist.tpl" );
42
43 $t->set_block( "category_list_page_tpl", "category_list_tpl", "category_list" );
44 $t->set_block( "category_list_tpl", "top_category_tpl", "top_category" );
45 $t->set_block( "top_category_tpl", "level_1_category_tpl", "level_1_category" );
46
47
48 $t->setAllStrings();
49
50 $category = new eZProductCategory( );
51 $category->get( $CategoryID );
52
53
54 $categoryList =& $category->getByParent( $category );
55
56 // categories
57 foreach ( $categoryList as $categoryItem )
58 {
59 $t->set_var( "top_category_id", $categoryItem->id() );
60 $t->set_var( "top_category_name", $categoryItem->name() );
61
62 $subItemList =& $category->getByParent( $categoryItem );
63
64 $t->set_var( "level_1_category", "" );
65
66 // sub categories
67 foreach ( $subItemList as $categoryItem )
68 {
69 $t->set_var( "category_id", $categoryItem->id() );
70 $t->set_var( "category_name", $categoryItem->name() );
71 $t->parse( "level_1_category", "level_1_category_tpl", true );
72 }
73 $t->parse( "top_category", "top_category_tpl", true );
74 }
75
76 if ( count( $categoryList ) == 0 )
77 {
78 $t->set_var( "category_list", "" );
79 }
80 else
81 {
82 $t->parse( "category_list", "category_list_tpl" );
83 }
84
85 $t->pparse( "output", "category_list_page_tpl" );
86 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$category
$category
Definition: categorytreelist.php:50
$t
$t
Definition: categorytreelist.php:38
$Language
$Language
Definition: categorytreelist.php:33
$ini
$ini
Definition: categorytreelist.php:32
$categoryList
$categoryList
Definition: categorytreelist.php:54
eZProductCategory
Definition: ezproductcategory.php:90
eZTemplate
Definition: eztemplate.php:107
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.