Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezlink/admin/attributeedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: attributeedit.php 6220 2001-07-20 11:15:21Z jakobn $
5 //
6 // Created on: <29-Jun-2001 13:57:58 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( "classes/ezhttptool.php" );
28
29 if ( isset( $Cancel ) )
30 {
31 eZHTTPTool::header( "Location: /link/linkedit/edit/$LinkID/" );
32 exit();
33 }
34
35 // include_once( "classes/INIFile.php" );
36 // include_once( "classes/eztemplate.php" );
37 // include_once( "classes/ezlocale.php" );
38 // include_once( "classes/ezcurrency.php" );
39
40 $ini =& eZINI::instance( 'site.ini' );
41 $Language = $ini->variable( "eZLinkMain", "Language" );
42
43 // include_once( "ezlink/classes/ezlinkcategory.php" );
44 // include_once( "ezlink/classes/ezlink.php" );
45
46 // include_once( "ezlink/classes/ezlinktype.php" );
47 // include_once( "ezlink/classes/ezlinkattribute.php" );
48
49 $link = new eZLink( $LinkID );
50
51 if ( $Action == "Update" )
52 {
53 if ( $TypeID == -1 )
54 {
55 $link->removeType();
56 }
57 else
58 {
59 $link->setType( new eZLinkType( $TypeID ) );
60
61 $i = 0;
62 if ( count( $AttributeValue ) > 0 )
63 {
64 foreach ( $AttributeValue as $attribute )
65 {
66 $att = new eZLinkAttribute( $AttributeID[$i] );
67
68 $att->setValue( $link, $attribute );
69
70 $i++;
71 }
72 }
73 }
74
75 if ( isset( $OK ) )
76 {
77 eZHTTPTool::header( "Location: /link/linkedit/edit/$LinkID/" );
78 exit();
79 }
80 }
81
82 $t = new eZTemplate( "kernel/ezlink/admin/" . $ini->variable( "eZLinkMain", "AdminTemplateDir" ),
83 "kernel/ezlink/admin/intl/", $Language, "attributeedit.php" );
84
85 $t->setAllStrings();
86
87 $t->set_file( "attribute_edit_page", "attributeedit.tpl" );
88
89 $t->set_block( "attribute_edit_page", "attribute_list_tpl", "attribute_list" );
90 $t->set_block( "attribute_list_tpl", "attribute_tpl", "attribute" );
91
92 $t->set_block( "attribute_edit_page", "type_tpl", "type" );
93
94
95 //default values
96
97 if ( $Action == "Edit" )
98 {
99
100 }
101
102 $type = new eZLinkType( );
103 $types = $type->getAll();
104
105 $type = $link->type();
106
107
108 foreach ( $types as $typeItem )
109 {
110 if ( $type )
111 {
112 if ( $type->id() == $typeItem->id() )
113 {
114 $t->set_var( "selected", "selected" );
115 }
116 else
117 {
118 $t->set_var( "selected", "" );
119 }
120 }
121 else
122 {
123 $t->set_var( "selected", "" );
124 }
125
126 $t->set_var( "type_id", $typeItem->id( ) );
127 $t->set_var( "type_name", $typeItem->name( ) );
128
129 $t->parse( "type", "type_tpl", true );
130 }
131
132
133 if ( $type )
134 {
135 $attributes = $type->attributes();
136
137 foreach ( $attributes as $attribute )
138 {
139 $t->set_var( "attribute_id", $attribute->id( ) );
140 $t->set_var( "attribute_name", $attribute->name( ) );
141 $t->set_var( "attribute_value", $attribute->value( $link ) );
142
143 $t->parse( "attribute", "attribute_tpl", true );
144 }
145 }
146
147 if ( count( $attributes ) > 0 )
148 {
149 $t->parse( "attribute_list", "attribute_list_tpl" );
150 }
151 else
152 {
153 $t->set_var( "attribute_list", "" );
154 }
155
156 $t->set_var( "link_name", $link->title() );
157 $t->set_var( "link_id", $LinkID );
158
159 $t->pparse( "output", "attribute_edit_page" );
160
161 ?>
$i
$i
Definition: admin/adlist.php:91
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLinkAttribute
Definition: ezlinkattribute.php:33
eZLinkType
Definition: ezlinktype.php:33
eZLink
Definition: ezlink.php:65
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$t
if( $Action=="Update") $t
Definition: ezlink/admin/attributeedit.php:82
$link
$link
Definition: ezlink/admin/attributeedit.php:49
$ini
if(isset( $Cancel)) $ini
Definition: ezlink/admin/attributeedit.php:40
$Language
$Language
Definition: ezlink/admin/attributeedit.php:41
$types
$types
Definition: ezlink/admin/attributeedit.php:103
$type
if( $Action=="Edit") $type
Definition: ezlink/admin/attributeedit.php:102
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.