Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezforum/user/menubox.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menubox.php 8162 2001-11-01 15:23:40Z bf $
5 //
6 // Created on: <11-Sep-2000 22:10:06 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
30 $ini = eZINI::instance( 'site.ini' );
31 $Language = $ini->variable( "eZForumMain", "Language" );
32 $PageCaching = $ini->variable( "eZForumMain", "PageCaching" );
33
34 unset( $menuCachedFile );
35
36 // do the caching
37 if ( $PageCaching == "enabled" )
38 {
39 $menuCacheFile = new eZCacheFile( "kernel/ezforum/cache",
40 array( "menubox", $GlobalSiteDesign ),
41 "cache", "," );
42
43 if ( $menuCacheFile->exists() )
44 {
45 print( $menuCacheFile->contents() );
46 }
47 else
48 {
49 createPage( $menuCacheFile, $ini, $Language, $GlobalSiteDesign );
50 }
51 }
52 else
53 {
54 createPage( false, $ini, $Language, $GlobalSiteDesign );
55 }
56
57 function createPage( $menuCacheFile = false, $ini = null, $Language = null, $GlobalSiteDesign = null)
58 {
59 // global $ini;
60 // global $Language;
61 // global $GlobalSiteDesign;
62 ;
63 // include_once( "classes/eztemplate.php" );
64 // include_once( "classes/ezdb.php" );
65 // include_once( "ezforum/classes/ezforumcategory.php" );
66
67 $t = new eZTemplate( "kernel/ezforum/user/" . $ini->variable( "eZForumMain", "TemplateDir" ),
68 "kernel/ezforum/user/intl", $Language, "menubox.php" );
69
70 $t->setAllStrings();
71
72 $t->set_file( "menu_box_tpl", "menubox.tpl" );
73
74 // $t = new Template( "." );
75
76 // $t->set_file( Array( "categorylist_tpl" => "kernel/ezforum/user/templates/standard/categorymenu.tpl" ) );
77
78 $t->set_block( "menu_box_tpl", "category_tpl", "category" );
79
80 $category = new eZForumCategory();
81 $categories = $category->getAllCategories();
82
83 if ( !$categories )
84 {
85 $Language = $ini->variable( "eZForumMain", "Language" );
86 $nofound = new eZINI( "kernel/ezforum/user/intl/" . $Language . "/categorylist.php.ini", false );
87 $noitem = $nofound->variable( "strings", "noitem" );
88
89 $t->set_var( "category", $noitem );
90 }
91 else
92 {
93 foreach ( $categories as $category )
94 {
95 $t->set_var( "id", $category->id() );
96 $t->set_var( "name", $category->name() );
97
98 $t->parse( "category", "category_tpl", true);
99 }
100 }
101
102 $t->set_var( "sitedesign", $GlobalSiteDesign );
103
104 if ( is_a( $menuCacheFile, "eZCacheFile" ) )
105 {
106 $output = $t->parse( "output", "menu_box_tpl" );
107 // print the output the first time while printing the cache file.
108 $menuCacheFile->store( $output );
109 print( $output );
110 }
111 else
112 {
113 $t->pparse( "output", "menu_box_tpl" );
114 }
115 }
116
117 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
eZForumCategory
Definition: ezforumcategory.php:44
eZINI
Reads and writes .ini style configuration files.
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$categories
$categories
Definition: ezarticle/admin/categoryedit.php:636
$Language
$Language
Definition: ezforum/user/menubox.php:31
$ini
$ini
Definition: ezforum/user/menubox.php:30
$PageCaching
$PageCaching
Definition: ezforum/user/menubox.php:32
createPage
createPage( $menuCacheFile=false, $ini=null, $Language=null, $GlobalSiteDesign=null)
Definition: ezforum/user/menubox.php:57
$output
$output
Definition: formpreview.php:81
$GlobalSiteDesign
global $GlobalSiteDesign
Definition: latestmessages.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.