Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezforum/user/categorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorylist.php 7428 2001-09-24 14:03:59Z jhe $
5 //
6 // Christoffer A. Elo
7 // Created on: <17-Oct-2000 13:50:26 ce>
8 //
9 // This source file is part of Exponential Basic, publishing software.
10 //
11 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
12 //
13 // This program is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
26 //
27
28 // include_once( "classes/INIFile.php" );
29 $ini =& eZINI::instance( 'site.ini' );
30
31 $Language = $ini->variable( "eZForumMain", "Language" );
32
33 // include_once( "classes/eztemplate.php" );
34 // include_once( "classes/ezdb.php" );
35 // include_once( "ezforum/classes/ezforumcategory.php" );
36
37 $t = new eZTemplate( "kernel/ezforum/user/" . $ini->variable( "eZForumMain", "TemplateDir" ),
38 "kernel/ezforum/user/intl", $Language, "categorylist.php" );
39 $t->setAllStrings();
40
41 $t->set_file( Array( "categorylist" => "categorylist.tpl" ) );
42
43 $t->set_block( "categorylist", "category_item_tpl", "category_item" );
44
45 $category = new eZForumCategory();
46 $categoryList = $category->getAllCategories();
47 if ( !$categoryList )
48 {
49 $languageIni = new eZINI( "kernel/ezforum/user/intl/" . $Language . "/categorylist.php.ini", false );
50 $noitem = $languageIni->variable( "strings", "noitem" );
51
52 $t->set_var( "next", "" );
53 $t->set_var( "previous", "" );
54 $t->set_var( "category_item", $noitem );
55 }
56 else
57 {
58 $i=0;
59 foreach ( $categoryList as $categoryItem )
60 {
61 if ( ( $i %2 ) == 0 )
62 $t->set_var( "td_class", "bgdark" );
63 else
64 $t->set_var( "td_class", "bglight" );
65
66 $t->set_var( "category_id", $categoryItem->id() );
67 $t->set_var( "category_name", $categoryItem->name() );
68 $t->set_var( "category_description", $categoryItem->description() );
69 $i++;
70
71 $t->parse( "category_item", "category_item_tpl", true);
72 }
73 }
74
75 $t->pparse( "output", "categorylist" );
76
77 ?>
$i
$i
Definition: admin/adlist.php:91
eZForumCategory
Definition: ezforumcategory.php:44
eZINI
Reads and writes .ini style configuration files.
eZTemplate
Definition: eztemplate.php:107
$category
$category
Definition: ezforum/user/categorylist.php:45
$t
$t
Definition: ezforum/user/categorylist.php:37
$Language
$Language
Definition: ezforum/user/categorylist.php:31
$ini
$ini
Definition: ezforum/user/categorylist.php:29
$categoryList
$categoryList
Definition: ezforum/user/categorylist.php:46
$languageIni
$languageIni
Definition: pendinglist.php:43
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.