Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/admin/attributeedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: attributeedit.php 6206 2001-07-19 12:19:22Z jakobn $
5 //
6 // Created on: <05-Jun-2001 13:07:24 pkej>
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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30
31 // include_once( "ezarticle/classes/ezarticle.php" );
32 // include_once( "ezarticle/classes/ezarticleattribute.php" );
33 // include_once( "ezarticle/classes/ezarticletype.php" );
34 // include_once( "ezarticle/classes/ezarticletool.php" );
35
36 if( isset( $Cancel ) )
37 {
38 eZHTTPTool::header( "Location: /article/articleedit/attributelist/$ArticleID" );
39 exit();
40 }
41
42 $article = new eZArticle( $ArticleID );
43 $category = $article->categoryDefinition( );
44 $CategoryID = $category->id();
45 $thisType = new eZArticleType( $TypeID );
46
47 if( isset( $OK ) )
48 {
49 $count = count( $AttributeID );
50
51 for( $i = 0; $i < $count; $i++ )
52 {
53 $attribute = new eZArticleAttribute( $AttributeID[$i] );
54 $attribute->setValue( $article, htmlspecialchars( $AttributeValue[$i] ) );
55 }
56 eZArticleTool::deleteCache( $ArticleID, $CategoryID, $CategoryArray );
57 eZHTTPTool::header( "Location: /article/articleedit/attributelist/$ArticleID" );
58 exit();
59 }
60
61 $ini =& eZINI::instance( 'site.ini' );
62
63 $Language = $ini->variable( "eZArticleMain", "Language" );
64
65 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
66 "kernel/ezarticle/admin/intl/", $Language, "attribute.php" );
67
68 $t->setAllStrings();
69
70 $t->set_file( array(
71 "attribute_edit_page_tpl" => "attributeedit.tpl"
72 ) );
73
74 $t->set_block( "attribute_edit_page_tpl", "attribute_list_tpl", "attribute_list" );
75 $t->set_block( "attribute_list_tpl", "attribute_item_tpl", "attribute_item" );
76 $t->set_block( "attribute_edit_page_tpl", "no_attributes_item_tpl", "no_attributes_item" );
77 $t->set_block( "attribute_edit_page_tpl", "no_selected_type_item_tpl", "no_selected_type_item" );
78
79 $ActionValue = "insert";
80
81 $types =& $thisType->getAll();
82
83 $typeCount = count( $types );
84
85 if( $thisType->id() > 0 )
86 {
87 $attributes =& $thisType->attributes();
88
89 $attributeCount = count( $attributes );
90
91 if( $attributeCount > 0 )
92 {
93 foreach( $attributes as $attribute )
94 {
95 $t->set_var( "attribute_id", $attribute->id() );
96 $t->set_var( "attribute_name", $attribute->name() );
97 $t->set_var( "attribute_value", $attribute->value( $article ) );
98 $t->parse( "attribute_item", "attribute_item_tpl", true );
99 }
100
101
102 $t->set_var( "no_attributes_item", "" );
103 $t->set_var( "no_selected_type_item", "" );
104 $t->parse( "attribute_list", "attribute_list_tpl" );
105 }
106 else
107 {
108 $t->set_var( "attribute_list", "" );
109 $t->set_var( "no_selected_type_item", "" );
110 $t->parse( "no_attributes_item", "no_attributes_item_tpl" );
111 }
112 }
113 else
114 {
115 $t->set_var( "attribute_list", "" );
116 $t->set_var( "no_attributes_item", "" );
117 $t->parse( "no_selected_type_item", "no_selected_type_item_tpl" );
118 }
119
120 $t->set_var( "this_type_id", $thisType->id() );
121 $t->set_var( "type_name", $thisType->name() );
122 $t->set_var( "action_value", $ActionValue );
123 $t->set_var( "article_name", $article->name() );
124 $t->set_var( "article_id", $article->id() );
125
126 $t->set_var( "site_style", $SiteDesign );
127
128 $t->pparse( "output", "attribute_edit_page_tpl" );
129
130 ?>
$i
$i
Definition: admin/adlist.php:91
eZArticleAttribute
Definition: ezarticleattribute.php:49
eZArticleTool\deleteCache
static deleteCache( $ArticleID, $CategoryID, $CategoryArray)
Definition: ezarticletool.php:52
eZArticleType
Definition: ezarticletype.php:46
eZArticle
Definition: ezarticle.php:82
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$ArticleID
$ArticleID
Definition: export.php:48
$category
$category
Definition: ezarticle/admin/attributeedit.php:43
$CategoryID
$CategoryID
Definition: ezarticle/admin/attributeedit.php:44
$t
$t
Definition: ezarticle/admin/attributeedit.php:65
$ini
if(isset( $OK)) $ini
Definition: ezarticle/admin/attributeedit.php:61
$ActionValue
$ActionValue
Definition: ezarticle/admin/attributeedit.php:79
$Language
$Language
Definition: ezarticle/admin/attributeedit.php:63
$types
$types
Definition: ezarticle/admin/attributeedit.php:81
$article
if(isset( $Cancel)) $article
Definition: ezarticle/admin/attributeedit.php:42
$typeCount
$typeCount
Definition: ezarticle/admin/attributeedit.php:83
$thisType
$thisType
Definition: ezarticle/admin/attributeedit.php:45
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
exit
exit
Definition: folder.php:81
$count
$count
Definition: onlinetypelist.php:108
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.