Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

todomenulist.php
Go to the documentation of this file.
1 <?php
3 // $Id: todomenulist.php 6968 2001-09-05 11:53:39Z jhe $
4 //
5 // Definition of todo list.
6 //
7 // Created on: <04-Sep-2000 16:53:15 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
30 //$ini = new eZINI( "site.ini");
31 $ini =& eZINI::instance( 'site.ini' );
32
33 $Language = $ini->variable( "eZTodoMain", "Language" );
34 $NotDoneID = $ini->variable( "eZTodoMain", "NotDoneID" );
35
36 $iniLanguage = new eZINI( "kernel/eztodo/user/intl/$Language/todolist.php.ini", false );
37
38 // include_once( "classes/eztemplate.php" );
39
40 // include_once( "ezuser/classes/ezuser.php" );
41 // include_once( "eztodo/classes/eztodo.php" );
42
43 $user =& eZUser::currentUser();
44
45 $t = new eZTemplate( "kernel/eztodo/user/" . $ini->variable( "eZTodoMain", "TemplateDir" ),
46 "kernel/eztodo/user/intl/", $Language, "todomenulist.php" );
47 $t->setAllStrings();
48 $t->set_file( "todo_list_page", "todomenulist.tpl" );
49
50 $t->set_block( "todo_list_page", "todo_item_tpl", "todo_item" );
51 $t->set_block( "todo_list_page", "no_item_tpl", "no_item" );
52
53 $todo = new eZTodo();
54 $todo_array = array();
55
56 if ( $user )
57 {
58 $todo_array = $todo->getByLimit( $user->id(), 5, $NotDoneID, 0 );
59 }
60
61 $i=0;
62 if ( count( $todo_array ) > 0 ) {
63 foreach ( $todo_array as $todoItem )
64 {
65 if ( ( $i %2 ) == 0 )
66 $t->set_var( "td_class", "bgdark" );
67 else
68 $t->set_var( "td_class", "bglight" );
69
70 $t->set_var( "todo_id", $todoItem->id() );
71 $t->set_var( "todo_name", $todoItem->name() );
72
73 $t->set_var( "no_item", "" );
74
75 $t->parse( "todo_item", "todo_item_tpl", true );
76 $i++;
77 }
78 }
79 else
80 {
81 $t->set_var( "todo_item", "" );
82 $t->parse( "no_item", "no_item_tpl" );
83 }
84
85 $t->pparse( "output", "todo_list_page" );
86
87 ?>
eZINI
Reads and writes .ini style configuration files.
eZTemplate
Definition: eztemplate.php:107
eZTodo
Definition: eztodo.php:39
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$iniLanguage
$iniLanguage
Definition: todomenulist.php:36
$t
$t
Definition: todomenulist.php:45
$i
if( $user) $i
Definition: todomenulist.php:61
$user
$user
Definition: todomenulist.php:43
$todo_array
$todo_array
Definition: todomenulist.php:54
$Language
$Language
Definition: todomenulist.php:33
$ini
$ini
Definition: todomenulist.php:31
$todo
$todo
Definition: todomenulist.php:53
$NotDoneID
$NotDoneID
Definition: todomenulist.php:34
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.