Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/topiclist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: topiclist.php 9552 2002-05-22 10:34:54Z jhe $
5 //
6 // Created on: <03-Sep-2001 15:35: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/ezlocale.php" );
28 // include_once( "classes/ezhttptool.php" );
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "classes/INIFile.php" );
31
32 // include_once( "ezarticle/classes/eztopic.php" );
33 $Language = $ini->variable( "eZArticleMain", "Language" );
34
35 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
36 "kernel/ezarticle/user/intl", $Language, "topiclist.php" );
37
38 $locale = new eZLocale( $Language );
39
40 $t->set_file( "topic_page_tpl", "topiclist.tpl" );
41
42 $t->setAllStrings();
43
44 $t->set_block( "topic_page_tpl", "topic_list_tpl", "topic_list" );
45 $t->set_block( "topic_list_tpl", "topic_item_tpl", "topic_item" );
46 $t->set_block( "topic_item_tpl", "article_item_tpl", "article_item" );
47
48 $topic = new eZTopic();
49
50 if ( $topic->get( $TopicID ) )
51 {
52 $topicArray = array( $topic );
53 }
54 else
55 {
56 $topicArray = $topic->getAll();
57 }
58
59 $t->set_var( "topic_item", "" );
60 $i = 0;
61
62 foreach ( $topicArray as $topic )
63 {
64 $t->set_var( "id", $topic->id() );
65 $t->set_var( "topic_name", $topic->name() );
66 $t->set_var( "topic_description", $topic->description() );
67
68 if ( ( $i % 2 ) == 0 )
69 {
70 $t->set_var( "td_class", "bglight" );
71 }
72 else
73 {
74 $t->set_var( "td_class", "bgdark" );
75 }
76
77 $articles =& $topic->articles();
78
79 $t->set_var( "article_item", "" );
80 foreach ( $articles as $article )
81 {
82 $category = $article->categoryDefinition();
83
84 $t->set_var( "category_id", $category->id() );
85 $t->set_var( "category_name", $category->name() );
86
87 $t->set_var( "article_id", $article->id() );
88 $t->set_var( "article_name", $article->name() );
89 $t->parse( "article_item", "article_item_tpl", true );
90 }
91
92 $t->parse( "topic_item", "topic_item_tpl", true );
93 $i++;
94 }
95
96 $t->parse( "topic_list", "topic_list_tpl" );
97
98 $t->pparse( "output", "topic_page_tpl" );
99
100 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$topicArray
$topicArray
Definition: admin/articleedit.php:853
$article
$article
Definition: articlelog.php:45
$articles
$articles
Definition: authorview.php:64
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZTopic
Definition: eztopic.php:41
$ini
$ini
Definition: classes/admin/linklist.php:64
$topic
$topic
Definition: user/topiclist.php:48
$locale
$locale
Definition: user/topiclist.php:38
$t
$t
Definition: user/topiclist.php:35
$i
$i
Definition: user/topiclist.php:60
$Language
$Language
Definition: user/topiclist.php:33
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.