Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

menucategorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menucategorylist.php 7673 2001-10-05 12:37:22Z bf $
5 //
6 // Created on: <30-Sep-2001 15:53:38 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/ezlog.php" );
30
31 // include_once( "ezuser/classes/ezuser.php" );
32 // include_once( "ezuser/classes/ezpermission.php" );
33 // include_once( "ezuser/classes/ezobjectpermission.php" );
34
35 // include_once( "ezimagecatalogue/classes/ezimage.php" );
36 // include_once( "ezimagecatalogue/classes/ezimagecategory.php" );
37 // include_once( "classes/ezhttptool.php" );
38
39 $ini =& eZINI::instance( 'site.ini' );
40
41 $Language = $ini->variable( "eZImageCatalogueMain", "Language" );
42 $ImageDir = $ini->variable( "eZImageCatalogueMain", "ImageDir" );
43
44 $t = new eZTemplate( "kernel/ezimagecatalogue/user/" . $ini->variable( "eZImageCatalogueMain", "TemplateDir" ),
45 "kernel/ezimagecatalogue/user/intl/", $Language, "menucategorylist.php" );
46
47 $t->set_file( "menu_category_list_tpl", "menucategorylist.tpl" );
48
49 $t->setAllStrings();
50
51 $t->set_block( "menu_category_list_tpl", "category_list_tpl", "category_list" );
52 $t->set_block( "category_list_tpl", "category_tpl", "category" );
53
54 $category = new eZImageCategory( $CategoryID );
55
56 $user = eZUser::currentUser();
57 // Print out all the categories
58 $categoryList =& $category->getByParent( $category );
59
60 foreach ( $categoryList as $categoryItem )
61 {
62 if ( eZObjectPermission::hasPermission( $categoryItem->id(), "imagecatalogue_category", "r", $user ) ||
63 eZImageCategory::isOwner( $user, $categoryItem->id()) )
64 {
65 $t->set_var( "category_name", $categoryItem->name() );
66 $t->set_var( "category_id", $categoryItem->id() );
67
68 $t->parse( "category", "category_tpl", true );
69 }
70 }
71
72 if ( count( $categoryList ) )
73 {
74 $t->parse( "category_list", "category_list_tpl" );
75 }
76 else
77 {
78 $t->set_var( "category_list", "" );
79 }
80
81
82 $t->pparse( "output", "menu_category_list_tpl" );
83
84 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZImageCategory
Definition: ezimagecategory.php:43
eZImageCategory\isOwner
static isOwner( $user, $imageCategory=false)
Definition: ezimagecategory.php:480
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$category
$category
Definition: menucategorylist.php:54
$ImageDir
$ImageDir
Definition: menucategorylist.php:42
$t
$t
Definition: menucategorylist.php:44
$user
$user
Definition: menucategorylist.php:56
$Language
$Language
Definition: menucategorylist.php:41
$ini
$ini
Definition: menucategorylist.php:39
$categoryList
$categoryList
Definition: menucategorylist.php:58
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.