Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

onlinetypelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: onlinetypelist.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
28 // include_once( "ezaddress/classes/ezonlinetype.php" );
29
30 $language_file = "onlinetype.php";
31 $page_path = "/address/onlinetype";
32
33 $item_type = new eZOnlineType();
34 $item_type_array = $item_type->getAll();
35 $move_item = true;
36
37 $ini =& eZINI::instance( 'site.ini' );
38 $Language = $ini->variable( "eZAddressMain", "Language" );
39 $DOC_ROOT = $ini->variable( "eZAddressMain", "DocumentRoot" );
40
41 // include_once( "classes/eztemplate.php" );
42
43 // include_once( "ezuser/classes/ezuser.php" );
44 // include_once( "ezuser/classes/ezusergroup.php" );
45 // include_once( "ezuser/classes/ezmodule.php" );
46 // include_once( "ezuser/classes/ezpermission.php" );
47
48 require( "kernel/ezuser/admin/admincheck.php" );
49
50 $t = new eZTemplate( "kernel/ezaddress/admin/" . $ini->variable( "eZAddressMain", "AdminTemplateDir" ),
51 "kernel/ezaddress/admin/" . "/intl", $Language, $language_file );
52 $t->setAllStrings();
53
54 $item_error = true;
55
56 if( empty( $HTTP_REFERER ) )
57 {
58 if( empty( $BackUrl ) )
59 {
60 $back_command = "$page_path/list";
61 }
62 else
63 {
64 $back_command = $BackUrl;
65 }
66 }
67 else
68 {
69 $back_command = $HTTP_REFERER;
70 }
71
72 $t->set_file( array(
73 "list_page" => "onlinelist.tpl",
74 ) );
75 $t->set_block( "list_page", "list_item_tpl", "list_item" );
76 $t->set_block( "list_item_tpl", "line_item_tpl", "line_item" );
77 $t->set_block( "list_page", "no_line_item_tpl", "no_line_item" );
78
79 $t->set_block( "line_item_tpl", "item_plain_tpl", "item_plain" );
80 $t->set_block( "line_item_tpl", "item_linked_tpl", "item_linked" );
81 $t->set_block( "line_item_tpl", "item_link_true_tpl", "item_link_true" );
82 $t->set_block( "line_item_tpl", "item_link_false_tpl", "item_link_false" );
83 $t->set_block( "line_item_tpl", "item_visual_true_tpl", "item_visual_true" );
84 $t->set_block( "line_item_tpl", "item_visual_false_tpl", "item_visual_false" );
85 $t->set_block( "line_item_tpl", "item_move_up_tpl", "item_move_up" );
86 $t->set_block( "line_item_tpl", "item_separator_tpl", "item_separator" );
87 $t->set_block( "line_item_tpl", "item_move_down_tpl", "item_move_down" );
88 $t->set_block( "line_item_tpl", "no_item_move_up_tpl", "no_item_move_up" );
89 $t->set_block( "line_item_tpl", "no_item_separator_tpl", "no_item_separator" );
90 $t->set_block( "line_item_tpl", "no_item_move_down_tpl", "no_item_move_down" );
91
92 $t->set_var( "no_line_item", "" );
93 $t->set_var( "line_item", "" );
94 $t->set_var( "list_item", "" );
95
96 $t->set_var( "item_up_command", "$page_path/up" );
97 $t->set_var( "item_down_command", "$page_path/down" );
98 $t->set_var( "item_edit_command", "$page_path/edit" );
99 $t->set_var( "item_delete_command", "$page_path/delete" );
100 $t->set_var( "item_view_command", "$page_path/view" );
101 $t->set_var( "item_list_command", "$page_path/list" );
102 $t->set_var( "item_new_command", "$page_path/new" );
103 $t->set_var( "item_id", isset( $ItemID ) ? $ItemID : false );
104 $t->set_var( "item_name", isset( $ItemName ) ? $ItemName : false );
105 $t->set_var( "back_url", $back_command );
106 $t->set_var( "item_back_command", $back_command );
107
108 $count = count( $item_type_array );
109
110
111 $i = 0;
112 foreach( $item_type_array as $item )
113 {
114 $t->set_var( "item_move_up", "" );
115 $t->set_var( "no_item_move_up", "" );
116 $t->set_var( "item_move_down", "" );
117 $t->set_var( "no_item_move_down", "" );
118 $t->set_var( "item_separator", "" );
119 $t->set_var( "no_item_separator", "" );
120
121 $t->set_var( "item_plain", "" );
122 $t->set_var( "item_linked", "" );
123 $t->set_var( "item_link_true", "" );
124 $t->set_var( "item_link_false", "" );
125 $t->set_var( "item_visual_true", "" );
126 $t->set_var( "item_visual_false", "" );
127
128 if ( ( $i %2 ) == 0 )
129 $t->set_var( "bg_color", "bglight" );
130 else
131 $t->set_var( "bg_color", "bgdark" );
132
133 $t->set_var( "item_id", $item->id() );
134 $t->set_var( "item_name", $item->name() );
135 $t->set_var( "item_prefix", $item->urlPrefix() );
136
137 if ( $item->prefixLink() )
138 $t->parse( "item_link_true", "item_link_true_tpl" );
139 else
140 $t->parse( "item_link_false", "item_link_false_tpl" );
141 if ( $item->prefixVisual() )
142 $t->parse( "item_visual_true", "item_visual_true_tpl" );
143 else
144 $t->parse( "item_visual_false", "item_visual_false_tpl" );
145
146 if ( isset( $SortPage ) )
147 {
148 $t->set_var( "item_sort_command", $SortPage );
149 $t->parse( "item_linked", "item_linked_tpl" );
150 }
151 else
152 {
153 $t->parse( "item_plain", "item_plain_tpl" );
154 }
155
156 if ( $i > 0 && isset( $move_item ) )
157 {
158 $t->parse( "item_move_up", "item_move_up_tpl" );
159 }
160 else
161 {
162 $t->parse( "no_item_move_up", "no_item_move_up_tpl" );
163 }
164
165 if ( $i > 0 && $i < $count - 1 && isset( $move_item ) )
166 {
167 $t->parse( "item_separator", "item_separator_tpl" );
168 }
169 else
170 {
171 $t->parse( "no_item_separator", "no_item_separator_tpl" );
172 }
173
174 if ( $i < $count - 1 && isset( $move_item ) )
175 {
176 $t->parse( "item_move_down", "item_move_down_tpl" );
177 }
178 else
179 {
180 $t->parse( "no_item_move_down", "no_item_move_down_tpl" );
181 }
182
183 $t->parse( "line_item", "line_item_tpl", true );
184
185 $i++;
186 }
187
188 if( $count < 1 )
189 {
190 $t->parse( "no_line_item", "no_line_item_tpl" );
191 }
192 else
193 {
194 $t->parse( "list_item", "list_item_tpl" );
195 }
196
197 $t->pparse( "output", "list_page" );
198
199 ?>
eZTemplate
Definition: eztemplate.php:107
$item
$item
Definition: classes/admin/linklist.php:228
$SortPage
$SortPage
Definition: consultationtypelist.php:51
$DOC_ROOT
$DOC_ROOT
Definition: onlinetypelist.php:39
$t
$t
Definition: onlinetypelist.php:50
$item_error
$item_error
Definition: onlinetypelist.php:54
$language_file
$language_file
Definition: onlinetypelist.php:30
$i
$i
Definition: onlinetypelist.php:111
$Language
$Language
Definition: onlinetypelist.php:38
$ini
$ini
Definition: onlinetypelist.php:37
$item_type_array
$item_type_array
Definition: onlinetypelist.php:34
$item_type
$item_type
Definition: onlinetypelist.php:33
$page_path
$page_path
Definition: onlinetypelist.php:31
$move_item
$move_item
Definition: onlinetypelist.php:35
$count
$count
Definition: onlinetypelist.php:108
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.