Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

folder.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: folder.php 7816 2001-10-12 12:27:35Z jhe $
5 //
6 // Created on: <14-Sep-2001 14:39:54 jhe>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 // Copyright (C) 1999-2001 eZ systems as
10 //
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
24 //
25
26 // include_once( "ezfilemanager/classes/ezvirtualfolder.php" );
27 // include_once( "ezcontact/classes/ezperson.php" );
28 // include_once( "ezcontact/classes/ezcompany.php" );
29
30 $top = (new eZVirtualFolder())->getIDByParent( "Contact" );
31 if ( !$top )
32 {
33 $contact = new eZVirtualFolder();
34 $contact->setName( "Contact" );
35 $contact->setParent( 0 );
36 $contact->store();
37 $top = $contact->ID();
38 }
39
40 if ( $CompanyEdit )
41 {
42 $parent = (new eZVirtualFolder())->getIDByParent( "Company", $top );
43 if ( !$parent )
44 {
45 $companyFolder = new eZVirtualFolder();
46 $companyFolder->setName( "Company" );
47 $companyFolder->setParent( $top );
48 $companyFolder->store();
49 $parent = $companyFolder->ID();
50 }
51 $element = new eZCompany( $item_id );
52 }
53 else
54 {
55 $parent = (new eZVirtualFolder())->getIDByParent( "Person", $top );
56 if ( !$parent )
57 {
58 $personFolder = new eZVirtualFolder();
59 $personFolder->setName( "Person" );
60 $personFolder->setParent( $top );
61 $personFolder->store();
62 $parent = $personFolder->ID();
63 }
64 $element = new eZPerson( $item_id );
65 }
66 $id = (new eZVirtualFolder())->getIDByParent( $element->name(), $parent );
67 if ( !$id )
68 {
69 $newFolder = new eZVirtualFolder();
70 $newFolder->setName( $element->name() );
71 $newFolder->setParent( $parent );
72 $newFolder->store();
73 $id = $newFolder->ID();
74 eZObjectPermission::setPermission( -1, $id, "filemanager_folder", "r" );
75 eZObjectPermission::setPermission( -1, $id, "filemanager_folder", "w" );
76 eZObjectPermission::setPermission( -1, $id, "filemanager_folder", "u" );
77 }
78
79 // include_once( "classes/ezhttptool.php" );
80 eZHTTPTool::header( "Location: /filemanager/list/$id/" );
81 exit;
82
83 ?>
eZCompany
Definition: ezcompany.php:54
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZObjectPermission\setPermission
static setPermission( $group, $objectID, $moduleTable, $permission)
Definition: ezobjectpermission.php:236
eZPerson
Definition: ezperson.php:43
eZVirtualFolder
Definition: ezvirtualfolder.php:43
$CompanyEdit
$CompanyEdit
Definition: companyedit.php:32
exit
exit
Definition: folder.php:81
$id
$id
Definition: folder.php:66
$element
if(! $parent) $element
Definition: folder.php:64
$top
$top
Definition: folder.php:30
$item_id
$item_id
Definition: personedit.php:76
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.