Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

menulist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menulist.php 7507 2001-09-27 10:43:55Z ce $
5 //
6 // Created on: <10-May-2001 15:33:23 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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlist.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
33 $Limit = $ini->variable( "eZSiteManagerMain", "AdminListLimit" );
34
35 // include_once( "ezsitemanager/classes/ezmenu.php" );
36
37 $t = new eZTemplate( "kernel/ezsitemanager/admin/" . $ini->variable( "eZSiteManagerMain", "AdminTemplateDir" ),
38 "kernel/ezsitemanager/admin/" . "/intl", $Language, "menulist.php" );
39 $t->setAllStrings();
40
41 $t->set_file( array(
42 "menu_page" => "menulist.tpl"
43 ) );
44
45 $t->set_block( "menu_page", "menu_list_tpl", "menu_list" );
46 $t->set_block( "menu_list_tpl", "menu_item_tpl", "menu_item" );
47
48 // path
49 $t->set_block( "menu_page", "path_item_tpl", "path_item" );
50
51
52 if ( !isset( $Offset ) )
53 $Offset = 0;
54
55 $t->set_var( "site_style", $SiteDesign );
56 $t->set_var( "menu_list", "" );
57 $t->set_var( "path_item", "" );
58 $menuList =& eZMenu::getByParent( $ParentID, $Offset, $Limit );
59 $totalCount =& eZMenu::count( $ParentID );
60
61 $menu = new eZMenu( $ParentID );
62 // path
63 $pathArray =& $menu->path();
64 foreach ( $pathArray as $path )
65 {
66 $t->set_var( "category_id", $path[0] );
67
68 $t->set_var( "category_name", $path[1] );
69
70 $t->parse( "path_item", "path_item_tpl", true );
71 }
72
73 if ( count ( $menuList ) > 0 )
74 {
75 $i=0;
76 foreach( $menuList as $menu )
77 {
78 if ( ( $i %2 ) == 0 )
79 $t->set_var( "td_class", "bglight" );
80 else
81 $t->set_var( "td_class", "bgdark" );
82
83 $t->set_var( "menu_id", $menu->id() );
84 $t->set_var( "menu_name", $menu->name() );
85 $t->set_var( "menu_link", $menu->link() );
86
87 $t->parse( "menu_item", "menu_item_tpl", true );
88 $i++;
89 }
90 $t->parse( "menu_list", "menu_list_tpl" );
91 }
92 eZList::drawNavigator( $t, $totalCount, $Limit, $Offset, "menu_page" );
93
94 $t->set_var( "menu_start", $Offset + 1 );
95 $t->set_var( "menu_end", min( $Offset + $Limit, $totalCount ) );
96 $t->set_var( "menu_total", $totalCount );
97
98 $t->pparse( "output", "menu_page" );
99
100 ?>
$i
$i
Definition: admin/adlist.php:91
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZMenu
Definition: ezmenu.php:45
eZMenu\getByParent
static & getByParent( $parent=0, $offset=0, $limit=20)
Definition: ezmenu.php:206
eZMenu\count
static count( $parent=0)
Definition: ezmenu.php:236
eZTemplate
Definition: eztemplate.php:107
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
$Limit
$Limit
Definition: menulist.php:33
$t
$t
Definition: menulist.php:37
$menu
$menu
Definition: menulist.php:61
$pathArray
$pathArray
Definition: menulist.php:63
$Language
$Language
Definition: menulist.php:32
$ini
$ini
Definition: menulist.php:31
$menuList
$menuList
Definition: menulist.php:58
$totalCount
$totalCount
Definition: menulist.php:59
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.