Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezmail/user/folderedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: folderedit.php 7641 2001-10-03 08:44:34Z fh $
5 //
6 // Created on: <16-Feb-2001 14:33:48 fh>
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( "ezmail/classes/ezmailfolder.php" );
28 // include_once( "classes/ezhttptool.php" );
29 // include_once( "classes/eztemplate.php" );
30
31 // check that the folder beeing viewed is your folder
32 if ( $FolderID != 0 && !eZMailFolder::isOwner( eZUser::currentUser(), $FolderID ) )
33 {
34 eZHTTPTool::header( "Location: /error/403/" );
35 exit();
36 }
37
38 $ini =& eZINI::instance( 'site.ini' );
39 $Language = $ini->variable( "eZMailMain", "Language" );
40
41 if( isset( $Cancel ) )
42 {
43 eZHTTPTool::header( "Location: /mail/folderlist" );
44 exit();
45 }
46
47 if( isset( $Ok ) && $Name != "" )
48 {
49
50 if( $FolderID == 0 )
51 {
52 $folder = new eZMailFolder();
53 }
54 else
55 {
56 $folder = new eZMailFolder( $FolderID );
57 if( $folder->isChild( $ParentID, true ) )
58 {
59 eZHTTPTool::header( "Location: /mail/folderlist" );
60 exit();
61 }
62 }
63
64 $folder->setName( $Name );
65 $folder->setParent( $ParentID );
66 $folder->setUser( eZUser::currentUser() );
67 $folder->store();
68 $FolderID = $folder->id();
69 eZHTTPTool::header( "Location: /mail/folder/$FolderID" );
70 exit();
71 }
72
73
74 $t = new eZTemplate( "kernel/ezmail/user/" . $ini->variable( "eZMailMain", "TemplateDir" ),
75 "kernel/ezmail/user/intl/", $Language, "folderedit.php" );
76 $t->setAllStrings();
77
78 $t->set_file( array(
79 "folder_edit_page_tpl" => "folderedit.tpl"
80 ) );
81
82 $t->set_block( "folder_edit_page_tpl", "folder_item_tpl", "folder_item" );
83 $t->set_var( "folder_item", "" );
84 $t->set_var( "folder_name", "" );
85 $t->set_var( "current_folder_id", $FolderID );
86
87 if( $FolderID != 0 )
88 {
89 $folder = new eZMailFolder( $FolderID );
90 $parentID = $folder->parentID();
91 $t->set_var( "folder_name", htmlspecialchars( $folder->name() ) );
92 }
93
94 $folders = eZMailFolder::getByUser();
95 foreach( $folders as $folderItem )
96 {
97 if( $folderItem->id() != $FolderID )
98 {
99 $t->set_var( "folder_parent_id", $folderItem->id() );
100 $t->set_var( "folder_parent_name", $folderItem->name() );
101
102 if( isset( $parentID ) && $folderItem->id() == $parentID )
103 $t->set_var( "is_selected", "selected" );
104 else
105 $t->set_var( "is_selected", "" );
106
107 $t->parse( "folder_item", "folder_item_tpl", true );
108 }
109 }
110
111 $t->pparse( "output", "folder_edit_page_tpl" );
112
113 ?>
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\isOwner
static isOwner( $user, $folderID)
Definition: ezmailfolder.php:571
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$folder
if(!isset( $FolderID)) $folder
Definition: ezfilemanager/admin/browse.php:74
$folders
if( $FolderID !=0) $folders
Definition: ezmail/user/folderedit.php:94
$Language
$Language
Definition: ezmail/user/folderedit.php:39
$t
if(isset( $Cancel)) if(isset( $Ok) && $Name !="") $t
Definition: ezmail/user/folderedit.php:74
$ini
if( $FolderID !=0 &&!eZMailFolder::isOwner(eZUser::currentUser(), $FolderID)) $ini
Definition: ezmail/user/folderedit.php:38
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.