Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

onlinetypeedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: onlinetypeedit.php 6204 2001-07-19 12:06:56Z 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( "ezaddress/classes/ezonlinetype.php" );
28
29 $language_file = "onlinetype.php";
30 $item_type = new eZOnlineType( $OnlineTypeID );
31 if ( isset( $ItemArrayID ) and is_array( $ItemArrayID ) )
32 {
33 $item_types = array();
34 foreach( $ItemArrayID as $item_id )
35 {
36 $item_types[] = new eZOnlineType( $item_id );
37 }
38 }
39
40 $page_path = "/address/onlinetype";
41
42 $ini =& eZINI::instance( 'site.ini' );
43 $Language = $ini->variable( "eZAddressMain", "Language" );
44 $DOC_ROOT = $ini->variable( "eZAddressMain", "DocumentRoot" );
45
46 // include_once( "classes/eztemplate.php" );
47
48 // include_once( "ezuser/classes/ezuser.php" );
49 // include_once( "ezuser/classes/ezusergroup.php" );
50 // include_once( "ezuser/classes/ezmodule.php" );
51 // include_once( "ezuser/classes/ezpermission.php" );
52
53 require( "kernel/ezuser/admin/admincheck.php" );
54
55 $t = new eZTemplate( $DOC_ROOT . "/admin/" . $ini->variable( "eZAddressMain", "AdminTemplateDir" ),
56 $DOC_ROOT . "admin/intl", $Language, $language_file );
57 $t->setAllStrings();
58
59 $item_error = true;
60
61 if( empty( $HTTP_REFERER ) )
62 {
63 if( empty( $BackUrl ) )
64 {
65 $back_command = "$page_path/list";
66 }
67 else
68 {
69 $back_command = $BackUrl;
70 }
71 }
72 else
73 {
74 $back_command = $HTTP_REFERER;
75 }
76
77 if ( isset( $Delete ) and isset( $ItemArrayID ) and isset( $item_types ) )
78 {
79 foreach( $item_types as $item_type )
80 {
81 $item_type->delete( false );
82 }
83 // include_once( "classes/ezhttptool.php" );
84 eZHTTPTool::header( "Location: $page_path/list" );
85 exit();
86 }
87
88 if( isset( $Action ) && $Action == "up" )
89 {
90 $item_type->moveUp();
91 // include_once( "classes/ezhttptool.php" );
92 eZHTTPTool::header( "Location: $page_path/list" );
93 exit();
94 }
95
96 if( isset( $Action ) && $Action == "down" )
97 {
98 $item_type->moveDown();
99 // include_once( "classes/ezhttptool.php" );
100 eZHTTPTool::header( "Location: $page_path/list" );
101 exit();
102 }
103
104 if( isset( $Action ) && $Action == "insert" || isset( $Action ) && $Action == "update" )
105 {
106 if ( $Action == "insert" )
107 unset( $item_type->ID );
108 $item_type->setName( $ItemName );
109 $item_type->setURLPrefix( $Prefix );
110 $item_type->setPrefixLink( $PrefixLink );
111 $item_type->setPrefixVisual( $PrefixVisual );
112 $item_type->store();
113 // include_once( "classes/ezhttptool.php" );
114 eZHTTPTool::header( "Location: $page_path/list" );
115 }
116
117 if( isset( $Action ) && $Action == "new" )
118 {
119 $ItemID = 0;
120 $ItemName = false;
121 $Prefix = false;
122 $PrefixLink = false;
123 $PrefixVisual = false;
124 $error = false;
125 }
126
127 $t->set_file( array(
128 "list_page" => "onlineedit.tpl",
129 ) );
130 $t->set_block( "list_page", "type_edit_tpl", "type_edit" );
131
132 $t->set_block( "type_edit_tpl", "line_item_tpl", "line_item" );
133 $t->set_block( "type_edit_tpl", "no_line_item_tpl", "no_line_item" );
134
135 $t->set_var( "no_line_item", "" );
136 $t->set_var( "line_item", "" );
137
138 $t->set_var( "item_id", $ItemID );
139 $t->set_var( "item_name", $ItemName );
140 $t->set_var( "prefix", $Prefix );
141 $t->set_var( "prefix_link_checked", $PrefixLink );
142 $t->set_var( "prefix_visual_checked", $PrefixVisual );
143 $t->set_var( "back_url", $back_command );
144 $t->set_var( "item_back_command", $back_command );
145
146 if( $error == false )
147 {
148 $t->set_var( "errors", "" );
149 }
150
151 if( is_numeric( $item_type->id() ) )
152 {
153
154 print( $item_type->name() );
155 $t->set_var( "item_id", $item_type->id() );
156 $t->set_var( "item_name", $item_type->name() );
157 $t->set_var( "prefix", $item_type->urlPrefix() );
158 if ( $item_type->prefixLink() )
159 $t->set_var( "prefix_link_checked", "checked" );
160 else
161 $t->set_var( "prefix_link_checked", "" );
162 if ( $item_type->prefixVisual() )
163 $t->set_var( "prefix_visual_checked", "checked" );
164 else
165 $t->set_var( "prefix_visual_checked", "" );
166 }
167
168 if( isset( $Action ) && $Action == "edit" )
169 {
170 $action_value = "update";
171
172 if( is_numeric( $item_type->id() ) )
173 {
174 $item_error = false;
175 }
176 }
177
178 if( isset( $Action ) && $Action == "new" )
179 {
180 $action_value = "insert";
181
182 $item_error = false;
183 }
184
185 if( $item_error == true )
186 {
187 $t->parse( "no_line_item", "no_line_item_tpl" );
188 }
189 else
190 {
191 $t->parse( "line_item", "line_item_tpl" );
192 }
193
194 $t->parse( "type_edit", "type_edit_tpl", true );
195
196 $t->set_var( "form_path", $page_path );
197 $t->set_var( "action_value", $action_value );
198 $t->pparse( "output", "list_page" );
199
200 ?>
$item_types
$item_types
Definition: addresstypeedit.php:32
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$error
$error
Definition: ezarticle/admin/categoryedit.php:51
$action_value
$action_value
Definition: ezforum/admin/categoryedit.php:212
exit
exit
Definition: folder.php:81
$DOC_ROOT
$DOC_ROOT
Definition: onlinetypeedit.php:44
$t
$t
Definition: onlinetypeedit.php:55
$item_error
$item_error
Definition: onlinetypeedit.php:59
$language_file
$language_file
Definition: onlinetypeedit.php:29
$Language
$Language
Definition: onlinetypeedit.php:43
$ini
$ini
Definition: onlinetypeedit.php:42
$item_type
$item_type
Definition: onlinetypeedit.php:30
$page_path
if(isset( $ItemArrayID) and is_array( $ItemArrayID)) $page_path
Definition: onlinetypeedit.php:40
$item_id
$item_id
Definition: personedit.php:76
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.