Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

folderlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: folderlist.php 6221 2001-07-20 11:18:28Z jakobn $
5 //
6 // Created on: <23-Oct-2000 17:53:46 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( "ezuser/classes/ezuser.php" );
31 // include_once( "classes/ezhttptool.php" );
32
33 // include_once( "ezmail/classes/ezmailaccount.php" );
34 // include_once( "ezmail/classes/ezmail.php" );
35 // include_once( "ezmail/classes/ezmailfolder.php" );
36
38 if( isset( $Move ) && count( $FolderArrayID ) > 0 && $FolderSelectID != -1)
39 {
40 foreach( $FolderArrayID as $folderID )
41 {
42 $folder = new eZMailFolder( $folderID );
43 if( $folder->folderType() == USER && $folder->id() != $FolderSelectID )
44 {
45 $folder->setParent( $FolderSelectID );
46 $folder->store();
47 }
48 }
49 eZHTTPTool::header( "Location: /mail/folderlist/" );
50 exit();
51 }
52
54 if( isset( $Delete ) && count( $FolderArrayID ) > 0 )
55 {
56 foreach( $FolderArrayID as $folderID )
57 eZMailFolder::delete( $folderID );
58 }
59
61 if( isset( $NewFolder ) )
62 {
63 eZHTTPTool::header( "Location: /mail/folderedit/" );
64 exit();
65 }
66
68 if( isset( $EmptyTrash ) )
69 {
70 $trash = eZMailFolder::getSpecialFolder( TRASH );
71 $trash->deleteAll();
72 }
73
74 $ini =& eZINI::instance( 'site.ini' );
75 $Language = $ini->variable( "eZMailMain", "Language" );
76
77 $t = new eZTemplate( "kernel/ezmail/user/" . $ini->variable( "eZMailMain", "TemplateDir" ),
78 "kernel/ezmail/user/intl/", $Language, "folderlist.php" );
79 $t->setAllStrings();
80
81 $t->set_file( array(
82 "folder_list_page_tpl" => "folderlist.tpl"
83 ) );
84
85 $t->set_block( "folder_list_page_tpl", "folder_item_tpl", "folder_item" );
86 $t->set_block( "folder_list_page_tpl", "folders_item_tpl", "folders_item" );
87 $t->set_block( "folders_item_tpl", "folders_item_edit_tpl", "folders_item_edit" );
88 $t->set_block( "folders_item_tpl", "edit_empty_tpl", "edit_empty" );
89 $t->set_var( "folders_item_edit", "" );
90
91 $t->set_var( "site_style", $SiteDesign );
92
94 $i=0;
95 foreach( array( 1, 2, 3, 4 ) as $specialfolder )
96 {
97 $folderItem = eZMailFolder::getSpecialFolder( $specialfolder );
98 $t->set_var( "folder_id", $folderItem->id() );
99 $t->set_var( "folder_name", htmlspecialchars( $folderItem->name() ) );
100 $t->set_var( "folder_unread_mail_total", $folderItem->count( true ) );
101 $t->set_var( "folder_mail_total", $folderItem->count() );
102 $t->set_var( "indent", "");
103
104 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
105 $t->parse( "edit_empty", "edit_empty_tpl", false );
106 $t->parse( "folders_item", "folders_item_tpl", true );
107 $i++;
108 }
110 $userFolders = eZMailFolder::getTree( 0, -1);
111 foreach( $userFolders as $folderItem )
112 {
113 $t->set_var( "folder_id", $folderItem[0] );
114 $t->set_var( "folder_name", htmlspecialchars( $folderItem[1] ) );
115 $t->set_var( "folder_unread_mail_total", (new eZMailFolder())->count( true, $folderItem[0] ) );
116 $t->set_var( "folder_mail_total", (new eZMailFolder())->count(false, $folderItem[0] ) );
117 $t->set_var( "indent", str_repeat( "&nbsp;", 3 * $folderItem[2] ) );
118 $t->set_var( "edit_empty", "" );
119
120 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
121 $t->parse( "folders_item_edit", "folders_item_edit_tpl", false );
122 $t->parse( "folders_item", "folders_item_tpl", true );
123 $i++;
124 }
125
127 $folders = eZMailFolder::getByUser();
128 foreach( $folders as $folderItem )
129 {
130 $t->set_var( "folder_id", $folderItem->id() );
131 $t->set_var( "folder_name", $folderItem->name() );
132 $t->parse( "folder_item", "folder_item_tpl", true );
133 }
134
135 $t->pparse( "output", "folder_list_page_tpl" );
136
137 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZMailFolder
Definition: ezmailfolder.php:49
eZMailFolder\getByUser
static getByUser( $user=false, $withSpecialFolders=false, $parentFolder=-1)
Definition: ezmailfolder.php:328
eZMailFolder\delete
delete( $id=-1)
Definition: ezmailfolder.php:68
eZMailFolder\getSpecialFolder
static getSpecialFolder( $specialType, $user=false)
Definition: ezmailfolder.php:477
eZMailFolder\getTree
static & getTree( $parentID=0, $level=0)
Definition: ezmailfolder.php:360
eZTemplate
Definition: eztemplate.php:107
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$folder
if(!isset( $FolderID)) $folder
Definition: ezfilemanager/admin/browse.php:74
USER
const USER
Definition: ezmailfolder.php:42
TRASH
const TRASH
Definition: ezmailfolder.php:46
exit
exit
Definition: folder.php:81
$t
$t
Definition: folderlist.php:77
$userFolders
foreach(array(1, 2, 3, 4) as $specialfolder) $userFolders
Definition: folderlist.php:110
$i
$i
Definition: folderlist.php:94
$Language
$Language
Definition: folderlist.php:75
$ini
if(isset( $Move) &&count( $FolderArrayID) > 0 && $FolderSelectID !=-1) if(isset( $Delete) &&count( $FolderArrayID) > 0) if(isset( $NewFolder)) if(isset( $EmptyTrash)) $ini
Definition: folderlist.php:74
$folders
foreach( $userFolders as $folderItem) $folders
Definition: folderlist.php:127
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.