Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

persontypeedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: persontypeedit.php 9529 2002-05-14 11:17:05Z jhe $
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 /*
28 Redigerer person typer.
29 */
30
31 // include_once( "classes/INIFile.php" );
32 // include_once( "classes/ezhttptool.php" );
33
34 $ini =& eZINI::instance( 'site.ini' );
35 $Language = $ini->variable( "eZContactMain", "Language" );
36 $DOC_ROOT = $ini->variable( "eZContactMain", "DocumentRoot" );
37
38 // include_once( "classes/eztemplate.php" );
39 // include_once( "common/ezphputils.php" );
40
41 // include_once( "ezuser/classes/ezuser.php" );
42 // include_once( "ezuser/classes/ezusergroup.php" );
43 // include_once( "ezuser/classes/ezmodule.php" );
44 // include_once( "ezuser/classes/ezpermission.php" );
45
46 // include_once( "ezcontact/classes/ezperson.php" );
47 // include_once( "ezcontact/classes/ezpersontype.php" );
48
49 require( "kernel/ezuser/admin/admincheck.php" );
50
51 // Legge til
52 if ( isset( $Action ) && $Action == "insert" )
53 {
54 if ( eZPermission::checkPermission( $user, "eZContact", "AdminAdd" ) )
55 {
56 $type = new eZPersonType();
57 $type->setName( $PersonTypeName );
58 $type->setDescription( $PersonTypeDescription );
59 $type->store();
60
61 eZHTTPTool::header( "Location: /contact/persontypelist/" );
62 }
63 else
64 {
65 print( "Du har ikke rettigheter.");
66 }
67 }
68
69 // Oppdatere
70 if ( isset( $Action ) && $Action == "update" )
71 {
72 if ( eZPermission::checkPermission( $user, "eZContact", "AdminModify" ) )
73 {
74 $type = new eZPersonType();
75 $type->get( $PID );
76 print ( "$PID ..." );
77
78 $type->setName( $PersonTypeName );
79 $type->setDescription( $PersonTypeDescription );
80 $type->update();
81
82 eZHTTPTool::header( "Location: /contact/persontypelist/" );
83 }
84 else
85 {
86 print( "Du har ikke rettigheter.");
87 }
88 }
89
90 // Slette
91 if ( isset( $Action ) && $Action == "delete" )
92 {
93 if ( eZPermission::checkPermission( $user, "eZContact", "AdminDelete" ) )
94 {
95 $type = new eZPersonType();
96 $type->get( $PID );
97 $type->delete( );
98 eZHTTPTool::header( "Location: /contact/persontypelist/" );
99 }
100 else
101 {
102 print( "Du har ikke rettigheter.");
103 }
104 }
105
106 $t = new eZTemplate( $DOC_ROOT . "/" . $ini->variable( "eZContactMain", "TemplateDir" ), $DOC_ROOT . "/intl", $Language, "persontypeedit.php" );
107 $t->setAllStrings();
108
109 $t->set_file( array(
110 "persontype_edit_page" => "persontypeedit.tpl"
111 ) );
112
113 $t->set_var( "submit_text", "Legg til" );
114 $t->set_var( "action_value", "insert" );
115 $t->set_var( "persontype_id", "" );
116 $t->set_var( "head_line", "Legg til ny persontype" );
117
118 // Editere
119 if ( isset( $Action ) && $Action == "edit" )
120 {
121 $type = new eZPersonType();
122 $type->get( $PID );
123
124 $PersonTypeName = $type->name();
125 $PersonTypeDescription = $type->description();
126
127 $t->set_var( "submit_text", "Lagre endringer" );
128 $t->set_var( "action_value", "update" );
129 $t->set_var( "persontype_id", $PID );
130 $t->set_var( "head_line", "Rediger persontype" );
131
132 }
133
134 // Sette tempalte variabler
135 $t->set_var( "document_root", $DOC_ROOT );
136 $t->set_var( "persontype_name", $PersonTypeName );
137 $t->set_var( "description", $PersonTypeDescription );
138
139 $t->pparse( "output", "persontype_edit_page" );
140
141 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPermission\checkPermission
static checkPermission( $user, $moduleName, $permissionName)
Definition: ezpermission.php:430
eZTemplate
Definition: eztemplate.php:107
$type
$type
Definition: classes/admin/linkselect.php:220
$Action
$Action
Definition: companysearch.php:80
$DOC_ROOT
$DOC_ROOT
Definition: persontypeedit.php:36
$Language
$Language
Definition: persontypeedit.php:35
$ini
$ini
Definition: persontypeedit.php:34
$t
if(isset( $Action) && $Action=="insert") if(isset( $Action) && $Action=="update") if(isset( $Action) && $Action=="delete") $t
Definition: persontypeedit.php:106
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.