Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/user/sitemap.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: sitemap.php 9693 2002-08-07 09:37:31Z br $
5 //
6 // Created on: <06-Jun-2001 17:05: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/ezlocale.php" );
30 // include_once( "ezmail/classes/ezmail.php" );
31 // include_once( "classes/ezcachefile.php" );
32
33 // include_once( "ezuser/classes/ezuser.php" );
34 // include_once( "ezuser/classes/ezobjectpermission.php" );
35 // include_once( "classes/ezhttptool.php" );
36
37 // include_once( "ezarticle/classes/ezarticlecategory.php" );
38 // include_once( "ezarticle/classes/ezarticle.php" );
39 // include_once( "ezarticle/classes/ezarticlegenerator.php" );
40 // include_once( "ezarticle/classes/ezarticlerenderer.php" );
41
42 $Language = $ini->variable( "eZArticleMain", "Language" );
43 // sections
44 // include_once( "ezsitemanager/classes/ezsection.php" );
45
46 if ( isset( $CategoryID ) )
47 {
48 $GlobalSectionID = eZArticleCategory::sectionIDstatic ( $CategoryID );
49 }
50
51 // init the section
52 $sectionObject =& eZSection::globalSectionObject( $GlobalSectionID );
53 $sectionObject->setOverrideVariables();
54
55 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
56 "kernel/ezarticle/user/intl/", $Language, "sitemap.php" );
57
58 $t->setAllStrings();
59
60 $t->set_file( "article_sitemap_page_tpl", "sitemap.tpl" );
61
62 $t->set_block( "article_sitemap_page_tpl", "category_value_tpl", "category_value" );
63 $t->set_block( "article_sitemap_page_tpl", "article_value_tpl", "article_value" );
64 $t->set_block( "article_sitemap_page_tpl", "value_tpl", "value" );
65
66 $tree = new eZArticleCategory();
67 $treeArray = $tree->getTree( $CategoryID );
68 $user =& eZUser::currentUser();
69
70 $t->set_var( "category_value", "" );
71 $t->set_var( "article_value", "" );
72 $t->set_var( "value", "" );
73
74 if ( $CategoryID != 0 && is_numeric( $CategoryID ) )
75 {
76 $frontCategory = new eZArticleCategory( $CategoryID );
77 if ( eZObjectPermission::hasPermission( $frontCategory->id(), "article_category", 'r', $user ) == true ||
78 eZArticleCategory::isOwner( eZUser::currentUser(), $frontCategory->id() ) )
79 {
80 $articleFrontList =& $frontCategory->articles( 1, false, true, 0, 50, $frontCategory->id() );
81
82 $itemCount++;
83
84 foreach ( $articleFrontList as $article )
85 {
86
87 if ( ( $itemCount % 2 ) == 0 )
88 {
89 $t->set_var( "td_alt", "1" );
90 $t->set_var( "td_class", "bglight" );
91 }
92 else
93 {
94 $t->set_var( "td_alt", "2" );
95 $t->set_var( "td_class", "bgdark" );
96 }
97
98 $t->set_var( "option_level", $option_level );
99
100 $t->set_var( "option_value", $article->id() );
101 $t->set_var( "option_name", $article->name() );
102 $t->set_var( "category_id", $frontCategory->id() );
103 $t->parse( "value", "article_value_tpl", true );
104 $itemCount++;
105 }
106 unset( $articleFrontList );
107 }
108 }
109
110 $itemCount = 0;
111 foreach ( $treeArray as $catItem )
112 {
113 if ( eZObjectPermission::hasPermission( $catItem[0]->id(), "article_category", 'r', $user ) == true ||
114 eZArticleCategory::isOwner( eZUser::currentUser(), $catItem[0]->id() ) )
115 {
116
117 $category = new eZArticleCategory( $catItem[0]->id() );
118 if ( $category->excludeFromSearch() == false )
119 {
120 $placement = $catItem[1] - 1;
121 $option_level = str_repeat( "&nbsp;&nbsp;&nbsp;&nbsp;", $placement );
122
123 $t->set_var( "option_value", $catItem[0]->id() );
124 $t->set_var( "option_name", $catItem[0]->name() );
125 $t->set_var( "option_level", $option_level );
126
127 if ( ( $itemCount % 2 ) == 0 )
128 {
129 $t->set_var( "td_alt", "1" );
130 $t->set_var( "td_class", "bglight" );
131 }
132 else
133 {
134 $t->set_var( "td_alt", "2" );
135 $t->set_var( "td_class", "bgdark" );
136 }
137
138 $t->parse( "value", "category_value_tpl", true );
139
140 $articleList =& $category->articles( 1, false, true, 0, 50, $catItem[0]->id() );
141 $itemCount++;
142
143 foreach ( $articleList as $article )
144 {
145
146 if ( ( $itemCount % 2 ) == 0 )
147 {
148 $t->set_var( "td_alt", "1" );
149 $t->set_var( "td_class", "bglight" );
150 }
151 else
152 {
153 $t->set_var( "td_alt", "2" );
154 $t->set_var( "td_class", "bgdark" );
155 }
156
157 $t->set_var( "option_level", "&nbsp;&nbsp;&nbsp;&nbsp;" . $option_level );
158
159 $t->set_var( "option_value", $article->id() );
160 $t->set_var( "option_name", $article->name() );
161 $t->set_var( "category_id", $category->id() );
162 $t->parse( "value", "article_value_tpl", true );
163 $itemCount++;
164 }
165 }
166 unset ($articleList);
167 unset ($category);
168
169 }
170 }
171
172 $t->pparse( "output", "article_sitemap_page_tpl" );
173
174 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$article
$article
Definition: articlelog.php:45
eZArticleCategory
Definition: ezarticlecategory.php:45
eZArticleCategory\isOwner
isOwner( $user, $categoryID)
Definition: ezarticlecategory.php:825
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZSection\globalSectionObject
static & globalSectionObject( $sectionID)
Definition: ezsection.php:366
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$ini
$ini
Definition: classes/admin/linklist.php:64
$GlobalSectionID
$GlobalSectionID
Definition: ezad/user/datasupplier.php:28
$t
$t
Definition: ezarticle/user/sitemap.php:55
$treeArray
$treeArray
Definition: ezarticle/user/sitemap.php:67
$user
$user
Definition: ezarticle/user/sitemap.php:68
$sectionObject
if(isset( $CategoryID)) $sectionObject
Definition: ezarticle/user/sitemap.php:52
$tree
$tree
Definition: ezarticle/user/sitemap.php:66
$Language
$Language
Definition: ezarticle/user/sitemap.php:42
$itemCount
if( $CategoryID !=0 &&is_numeric( $CategoryID)) $itemCount
Definition: ezarticle/user/sitemap.php:110
$articleList
$articleList
Definition: pendinglist.php:112
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.