Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

attributelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: attributelist.php 9758 2003-01-14 16:20:19Z br $
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 $article = new eZArticle( $ArticleID );
37 $category = $article->categoryDefinition( );
38 $CategoryID = $category->id();
39
40 if( isset( $DeleteSelected ) )
41 {
42 $count = count( $TypeArrayID );
43
44 for( $i = 0; $i < $count; $i++ )
45 {
46 $type = new eZArticleType( $TypeArrayID[$i] );
47 $article->deleteAttributesByType( $type );
48 }
49 eZArticleTool::deleteCache( $ArticleID, $CategoryID, $CategoryArray );
50 }
51
52 if( isset( $NewType ) )
53 {
54
55 $types = $article->types();
56 $typeExists = false;
57
58 foreach ( $types as $type )
59 {
60 if( $type->id() == $TypeID )
61 {
62 $typeExists = true;
63 }
64 }
65
66 if( !$typeExists )
67 {
68 $type = new eZArticleType( $TypeID );
69 $attributes = $type->attributes();
70
71 foreach( $attributes as $attribute )
72 {
73 $attribute->setValue( $article, htmlspecialchars( "" ) );
74 }
75 }
76 }
77
78 $ini =& eZINI::instance( 'site.ini' );
79
80 $Language = $ini->variable( "eZArticleMain", "Language" );
81
82 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
83 "kernel/ezarticle/admin/intl/", $Language, "attribute.php" );
84
85 $t->setAllStrings();
86
87 $t->set_file( array(
88 "arttribute_list_page_tpl" => "attributelist.tpl"
89 ) );
90
91 $t->set_block( "arttribute_list_page_tpl", "type_list_tpl", "type_list" );
92 $t->set_block( "type_list_tpl", "type_item_tpl", "type_item" );
93 $t->set_block( "arttribute_list_page_tpl", "type_list_select_tpl", "type_list_select" );
94 $t->set_block( "arttribute_list_page_tpl", "no_types_select_item_tpl", "no_types_select_item" );
95 $t->set_block( "type_list_select_tpl", "type_item_select_tpl", "type_item_select" );
96 $t->set_block( "arttribute_list_page_tpl", "no_types_item_tpl", "no_types_item" );
97
98
99 $types = $article->types();
100
101 $typeCount = count( $types );
102
103 if( $typeCount > 0 )
104 {
105 $i=0;
106 foreach( $types as $type )
107 {
108 if ( ( $i % 2 ) == 0 )
109 {
110 $t->set_var( "td_class", "bglight" );
111 }
112 else
113 {
114 $t->set_var( "td_class", "bgdark" );
115 }
116 $t->set_var( "type_id", $type->id() );
117 $t->set_var( "type_name", $type->name() );
118 $t->parse( "type_item", "type_item_tpl", true );
119 $i++;
120 }
121 $t->parse( "type_list", "type_list_tpl" );
122 $t->set_var( "no_types_item", "" );
123 }
124 else
125 {
126 $t->parse( "no_types_item", "no_types_item_tpl" );
127 $t->set_var( "type_list", "" );
128 }
129
130 $types =& eZArticleType::getAll();
131 $t->set_var( "selected", "" );
132 $t->set_var( "type_id", "" );
133 $t->set_var( "type_name", "" );
134
135 $typeCount = count( $types );
136
137 if( $typeCount > 0 )
138 {
139 foreach( $types as $type )
140 {
141 $t->set_var( "type_id", $type->id() );
142 $t->set_var( "type_name", $type->name() );
143
144 $t->parse( "type_item_select", "type_item_select_tpl", true );
145 }
146
147
148 $t->parse( "type_list_select", "type_list_select_tpl" );
149 $t->set_var( "no_types_select_item", "" );
150 }
151 else
152 {
153 $t->parse( "no_types_select_item", "no_types_select_item_tpl" );
154 $t->set_var( "type_list_select", "" );
155 }
156
157 $typeCount = count( $types );
158
159
160
161 $t->set_var( "article_name", $article->name() );
162 $t->set_var( "article_id", $article->id() );
163
164 $t->set_var( "site_style", $SiteDesign );
165
166 $t->pparse( "output", "arttribute_list_page_tpl" );
167
168 ?>
$i
$i
Definition: admin/adlist.php:91
$category
$category
Definition: attributelist.php:37
$CategoryID
$CategoryID
Definition: attributelist.php:38
$t
$t
Definition: attributelist.php:82
$article
$article
Definition: attributelist.php:36
$ini
if(isset( $DeleteSelected)) if(isset( $NewType)) $ini
Definition: attributelist.php:78
$Language
$Language
Definition: attributelist.php:80
$types
$types
Definition: attributelist.php:99
$typeCount
$typeCount
Definition: attributelist.php:101
eZArticleTool\deleteCache
static deleteCache( $ArticleID, $CategoryID, $CategoryArray)
Definition: ezarticletool.php:52
eZArticleType
Definition: ezarticletype.php:46
eZArticleType\getAll
& getAll()
Definition: ezarticletype.php:157
eZArticle
Definition: ezarticle.php:82
eZTemplate
Definition: eztemplate.php:107
$type
$type
Definition: classes/admin/linkselect.php:220
$ArticleID
$ArticleID
Definition: export.php:48
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$count
$count
Definition: onlinetypelist.php:108
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.