Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezlink/user/menubox.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menubox.php 8886 2002-01-04 14:51:51Z kaid $
5 //
6 // Created on: <17-Oct-2000 12:16:07 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/ezcachefile.php" );
29 $ini =& eZINI::instance( 'site.ini' );
30
31 $Language = $ini->variable( "eZLinkMain", "Language" );
32
33 $PageCaching = $ini->variable( "eZLinkMain", "PageCaching");
34
35 unset( $menuCachedFile );
36 // do the caching
37 if ( $PageCaching == "enabled" )
38 {
39 $menuCacheFile = new eZCacheFile( "kernel/ezlink/cache",
40 array( "menubox", $GlobalSiteDesign ),
41 "cache", "," );
42
43 if ( $menuCacheFile->exists() )
44 {
45 print( $menuCacheFile->contents() );
46 }
47 else
48 {
49 createLinkMenu( $menuCacheFile, $ini, $Language, $GlobalSiteDesign );
50 }
51 }
52 else
53 {
54 createLinkMenu( false, $ini, $Language, $GlobalSiteDesign );
55 }
56
57 function createLinkMenu( $menuCacheFile = false, $ini = null, $Language = null, $GlobalSiteDesign = null)
58 {
59 // global $ini;
60 // global $Language;
61 // global $menuCachedFile;
62 // global $GlobalSiteDesign;
63
64 // include_once( "classes/eztemplate.php" );
65
66 // include_once( "ezlink/classes/ezlinkcategory.php" );
67 // include_once( "ezlink/classes/ezlink.php" );
68 // include_once( "ezlink/classes/ezhit.php" );
69
70 $t = new eZTemplate( "kernel/ezlink/user/" . $ini->variable( "eZLinkMain", "TemplateDir" ),
71 "kernel/ezlink/user/intl", $Language, "categorylist.php" );
72
73 $t->setAllStrings();
74
75 $t->set_file( array(
76 "menu_box_tpl" => "menubox.tpl"
77 ) );
78
79 $t->set_block( "menu_box_tpl", "link_category_tpl", "link_category" );
80 $t->set_block( "menu_box_tpl", "no_link_category_tpl", "no_link_category" );
81
82 $t->set_var( "link_category", "" );
83 $t->set_var( "no_link_category", "" );
84
85 // List all categories
86 $linkCategory = new eZLinkCategory();
87
88 $linkCategory_array = $linkCategory->getByParent( 0 );
89
90 if ( count( $linkCategory_array ) == 0 )
91 {
92 $t->set_var( "category_list", "" );
93 $t->parse( "no_link_category", "no_link_category_tpl" );
94 }
95 else
96 {
97 foreach( $linkCategory_array as $categoryItem )
98 {
99 $link_category_id = $categoryItem->id();
100
101 $t->set_var( "linkcategory_id", $link_category_id );
102 $t->set_var( "linkcategory_name", $categoryItem->name() );
103
104 $t->parse( "link_category", "link_category_tpl", true );
105 }
106 }
107 if ( !isset( $LGID ) )
108 $LGID = "";
109 $t->set_var( "linkcategory_id", $LGID );
110
111 $t->set_var( "sitedesign", $GlobalSiteDesign );
112
113 if ( is_a( $menuCacheFile, "eZCacheFile" ) )
114 {
115 $output = $t->parse( "output", "menu_box_tpl" );
116 $menuCacheFile->store( $output );
117 print( $output );
118 }
119 else
120 {
121 $t->pparse( "output", "menu_box_tpl" );
122 }
123 }
124
125 ?>
$linkCategory
$linkCategory
Definition: admin/linkcategorylist.php:90
eZLinkCategory
Definition: ezlinkcategory.php:37
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Language
$Language
Definition: ezlink/user/menubox.php:31
createLinkMenu
createLinkMenu( $menuCacheFile=false, $ini=null, $Language=null, $GlobalSiteDesign=null)
Definition: ezlink/user/menubox.php:57
$ini
$ini
Definition: ezlink/user/menubox.php:29
$PageCaching
$PageCaching
Definition: ezlink/user/menubox.php:33
$output
$output
Definition: formpreview.php:81
$GlobalSiteDesign
global $GlobalSiteDesign
Definition: latestmessages.php:52
$linkCategory_array
$linkCategory_array
Definition: user/linkcategorylist.php:120
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.