Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

menumaker.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menumaker.php 8283 2001-11-05 16:44:16Z th $
5 //
6 // Definition of ||| class
7 //
8 // Bj�rn Reiten <br@ez.no>
9 // Created on: <29-Aug-2001 16:47:13 br>
10 //
11 // This source file is part of Exponential Basic, publishing software.
12 // Copyright (C) 1999-2000 eZ systems as
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
39 function menuMaker()
40 {
41 global $CategoryID;
42 global $GlobalSiteDesign;
43 // include_once( "classes/INIFile.php" );
44 // include_once( "classes/ezcachefile.php" );
45 // include_once( "classes/eztemplate.php" );
46
47 // include_once( "ezarticle/classes/ezarticlecategory.php" );
48 // include_once( "ezarticle/classes/ezarticle.php" );
49 // include_once( "ezuser/classes/ezobjectpermission.php" );
50
51 $ini =& eZINI::instance( 'site.ini' );
52
53 $Language = $ini->variable( "eZArticleMain", "Language" );
54 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
55 "kernel/ezarticle/user/intl", $Language, "menumaker.php" );
56
57 $t->setAllStrings();
58
59 $t->set_file( array(
60 "menu_maker_tpl" => "menumaker.tpl"
61 ) );
62
63 $t->set_block( "menu_maker_tpl", "menu_box_tpl", "menu_box" );
64 $t->set_block( "menu_box_tpl", "menu_header_tpl", "menu_header" );
65 $t->set_block( "menu_box_tpl", "menu_article_tpl", "menu_article" );
66 $t->set_block( "menu_box_tpl", "menu_category_tpl", "menu_category" );
67
68 $t->set_var( "menu_box", "" );
69 $t->set_var( "menu_header", "" );
70 $t->set_var( "menu_category", "" );
71
72 if ( !isset( $CategoryID ) )
73 {
74 $category_id = 0;
75 }
76 else
77 {
78 $category_id = $CategoryID;
79 }
80
81 $articleCategory = new eZArticleCategory( $category_id );
82 $articleCategory_array = $articleCategory->getByParent( $articleCategory );
83 $article_art_array =& $articleCategory->articles( "absolute_placement", false, true, 0, 50 );
84 $i = 0;
85
86 if ( count( $article_art_array ) > 0 )
87 {
88 foreach( $article_art_array as $article_item )
89 {
90 $t->set_var( "sitedesign", $GlobalSiteDesign );
91 $t->set_var( "article_link_text", $article_item->name() );
92 $t->set_var( "article_id", $article_item->id() );
93 $t->parse( "menu_article", "menu_article_tpl", true );
94 }
95 }
96 if( count( $article_cat_array ) > 0 || count( $article_art_array ) > 0 )
97 {
98 $t->set_var( "current_category_name", $articleCategory->name() );
99 $t->parse( "menu_box", "menu_box_tpl", true );
100 }
101
102 foreach( $articleCategory_array as $categoryItem )
103 {
104 $t->set_var( "menu_header", "" );
105 $t->set_var( "menu_article", "" );
106 $t->set_var( "menu_category", "" );
107
108
109 $article_cat_array = $categoryItem->getByParent( $categoryItem );
110 $article_art_array =& $categoryItem->articles( "absolute_placement", false, true, 0, 50 );
111
112
113 if ( count( $article_cat_array ) > 0 )
114 {
115 foreach( $article_cat_array as $article_item )
116 {
117 $t->set_var( "sitedesign", $GlobalSiteDesign );
118 $t->set_var( "category_link_text", $article_item->name() );
119 $t->set_var( "category_id", $article_item->id() );
120 $t->parse( "menu_category", "menu_category_tpl", true );
121 }
122 }
123
124 if ( count( $article_art_array ) > 0 )
125 {
126 foreach( $article_art_array as $article_item )
127 {
128 $t->set_var( "sitedesign", $GlobalSiteDesign );
129 $t->set_var( "article_link_text", $article_item->name() );
130 $t->set_var( "article_id", $article_item->id() );
131 $t->parse( "menu_article", "menu_article_tpl", true );
132 }
133 }
134
135 if( count( $article_cat_array ) > 0 || count( $article_art_array ) > 0 )
136 {
137 $t->set_var( "current_category_name", $categoryItem->name() );
138 $t->parse( "menu_header", "menu_header_tpl" );
139 $t->parse( "menu_box", "menu_box_tpl", true );
140 }
141 }
142 $t->pparse( "output", "menu_maker_tpl" );
143
144 }
145
146 ?>
$i
$i
Definition: admin/adlist.php:91
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZArticleCategory
Definition: ezarticlecategory.php:45
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$Language
$Language
Definition: classes/admin/linklist.php:65
$ini
$ini
Definition: classes/admin/linklist.php:64
$GlobalSiteDesign
global $GlobalSiteDesign
Definition: latestmessages.php:52
menuMaker
menuMaker()
Definition: menumaker.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.