Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

admin/linkcategorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: linkcategorylist.php 7341 2001-09-19 11:35:52Z bf $
5 //
6 // Created on: <26-Oct-2000 14:55:24 ce>
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/ezlist.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32
33 $Language = $ini->variable( "eZLinkMain", "Language" );
34 $AdminLimit = $ini->variable( "eZLinkMain", "AdminLinkLimit" );
35 $DOC_ROOT = $ini->variable( "eZLinkMain", "DocumentRoot" );
36 $languageIni = new eZINI( "kernel/ezlink/admin/intl/" . $Language . "/linkcategorylist.php.ini", false );
37
38 // include_once( "ezlink/classes/ezlinkcategory.php" );
39 // include_once( "ezlink/classes/ezlink.php" );
40 // include_once( "ezlink/classes/ezhit.php" );
41
42 // include_once( "ezuser/classes/ezuser.php" );
43 // include_once( "ezuser/classes/ezusergroup.php" );
44 // include_once( "ezuser/classes/ezmodule.php" );
45 // include_once( "ezuser/classes/ezpermission.php" );
46
47 // include_once( "ezimagecatalogue/classes/ezimage.php" );
48
49 require( "kernel/ezuser/admin/admincheck.php" );
50
51 $t = new eZTemplate( "kernel/ezlink/admin/" . $ini->variable( "eZLinkMain", "AdminTemplateDir" ),
52 "kernel/ezlink/admin/intl/", $Language, "linkcategorylist.php" );
53 $t->setAllStrings();
54
55 $t->set_file( "link_page_tpl", "linkcategorylist.tpl" );
56
57 $t->set_block( "link_page_tpl", "category_list_tpl", "category_list" );
58 $t->set_block( "category_list_tpl", "category_item_tpl", "category_item" );
59
60 $t->set_block( "category_item_tpl", "image_item_tpl", "image_item" );
61 $t->set_block( "category_item_tpl", "no_image_tpl", "no_image" );
62
63 $t->set_block( "link_page_tpl", "link_list_tpl", "link_list" );
64 $t->set_block( "link_list_tpl", "link_item_tpl", "link_item" );
65
66 $t->set_block( "link_item_tpl", "image_item_tpl", "image_item" );
67 $t->set_block( "link_item_tpl", "no_image_tpl", "no_image" );
68
69
70 $t->set_block( "link_page_tpl", "path_item_tpl", "path_item" );
71
72 $t->set_var( "site_style", $SiteDesign );
73
74 if ( !isset( $Offset ) )
75 $Offset = 0;
76
77 if ( !isset( $total_sub_links ) )
78 $total_sub_links = 0;
79
80 if ( !isset( $new_sub_links ) )
81 $new_sub_links = 0;
82
83 if ( !isset( $links ) )
84 $links = 0;
85
86 if ( !isset( $categories ) )
87 $categories = false;
88
89 // List all the categoires
90 $linkCategory = new eZLinkCategory();
91
92
93 $linkCategory->get( $LinkCategoryID );
94
95 // path
96 $pathArray = $linkCategory->path();
97
98 $t->set_var( "path_item", "" );
99 foreach ( $pathArray as $path )
100 {
101 $t->set_var( "category_id", $path[0] );
102 $t->set_var( "category_name", $path[1] );
103 $t->parse( "path_item", "path_item_tpl", true );
104 }
105
106 $linkCategoryList =& $linkCategory->getByParent( $LinkCategoryID );
107
108 if ( $LinkCategoryID == "incoming" )
109 {
110 $linkCategoryList = array();
111 }
112
113 if ( count( $linkCategoryList ) == 0 )
114 {
115 $t->set_var( "categories", "" );
116 $t->set_var( "category_list", "" );
117 }
118 else
119 {
120 $i=0;
121 foreach( $linkCategoryList as $linkCategoryItem )
122 {
123 if ( ( ( $i ) % 2 ) == 0 )
124 {
125 $t->set_var( "bg_color", "bglight" );
126 }
127 else
128 {
129 $t->set_var( "bg_color", "bgdark" );
130 }
131
132 $link_category_id = $linkCategoryItem->id();
133 $t->set_var( "linkcategory_id", $link_category_id );
134 $t->set_var( "linkcategory_name", $linkCategoryItem->name() );
135 $t->set_var( "category_description", $linkCategoryItem->description() );
136 $t->set_var( "linkcategory_parent", $linkCategoryItem->parent() );
137
138 $t->set_var( "total_links", $total_sub_links );
139 $t->set_var( "new_links", $new_sub_links );
140
141 $t->set_var( "document_root", $DOC_ROOT );
142
143 $image =& $linkCategoryItem->image();
144
145 $t->set_var( "image_item", "" );
146
147 if ( is_a( $image, "eZImage" ) )
148 {
149 $imageWidth =& $ini->variable( "eZLinkMain", "CategoryImageWidth" );
150 $imageHeight =& $ini->variable( "eZLinkMain", "CategoryImageHeight" );
151
152 $variation =& $image->requestImageVariation( $imageWidth, $imageHeight );
153
154 $imageURL = "/" . $variation->imagePath();
155 $imageWidth =& $variation->width();
156 $imageHeight =& $variation->height();
157 $imageCaption =& $image->caption();
158
159 $t->set_var( "image_width", $imageWidth );
160 $t->set_var( "image_height", $imageHeight );
161 $t->set_var( "image_url", $imageURL );
162 $t->set_var( "image_caption", $imageCaption );
163 $t->set_var( "no_image", "" );
164 $t->parse( "image_item", "image_item_tpl" );
165 }
166 else
167 {
168 $t->parse( "no_image", "no_image_tpl" );
169 $t->set_var( "image_item", "" );
170 }
171
172 $categories = $languageIni->variable( "strings", "categories" );
173
174 $t->parse( "category_item", "category_item_tpl", true );
175 $i++;
176 }
177 $t->parse( "category_list", "category_list_tpl", true );
178 }
179
180 // List all the links in category
181 $link = new eZLinkCategory();
182 if ( $LinkCategoryID == "incoming" )
183 {
184 $linkList =& $link->links( $Offset, $AdminLimit, true );
185 $linkCount =& $link->linkCount( true );
186 }
187 else
188 {
189 $linkList =& $linkCategory->links( $Offset, $AdminLimit );
190 $linkCount =& $linkCategory->linkCount();
191 }
192
193 if ( !$linkList )
194 {
195 $t->set_var( "links", "" );
196 $t->set_var( "link_list", "" );
197 }
198 else
199 {
200 $i=0;
201 foreach( $linkList as $linkItem )
202 {
203 if ( ( $i %2 ) == 0 )
204 $t->set_var( "td_class", "bglight" );
205 else
206 $t->set_var( "td_class", "bgdark" );
207
208 $t->set_var( "link_id", $linkItem->id() );
209 $t->set_var( "link_name", $linkItem->name() );
210 $t->set_var( "link_description", $linkItem->description() );
211 $t->set_var( "link_keywords", $linkItem->keywords() );
212 $t->set_var( "link_created", $linkItem->created() );
213 $t->set_var( "link_modified", $linkItem->modified() );
214 $t->set_var( "link_accepted", $linkItem->id() );
215 $t->set_var( "link_url", $linkItem->url() );
216
217 $image =& $linkItem->image();
218
219 $t->set_var( "image_item", "" );
220
221 if ( $image )
222 {
223 $imageWidth =& $ini->variable( "eZLinkMain", "LinkImageWidth" );
224 $imageHeight =& $ini->variable( "eZLinkMain", "LinkImageHeight" );
225
226 $variation =& $image->requestImageVariation( $imageWidth, $imageHeight );
227
228 $imageURL = "/" . $variation->imagePath();
229 $imageWidth =& $variation->width();
230 $imageHeight =& $variation->height();
231 $imageCaption =& $image->caption();
232
233 $t->set_var( "image_width", $imageWidth );
234 $t->set_var( "image_height", $imageHeight );
235 $t->set_var( "image_url", $imageURL );
236 $t->set_var( "image_caption", $imageCaption );
237 $t->set_var( "no_image", "" );
238 $t->parse( "image_item", "image_item_tpl" );
239 }
240 else
241 {
242 $t->parse( "no_image", "no_image_tpl" );
243 }
244
245
246 $hit = new eZHit();
247 $hits = $hit->getLinkHits( $linkItem->id() );
248
249 $t->set_var( "link_hits", $hits );
250
251 $links = $languageIni->variable( "strings", "links" );
252
253 $t->parse( "link_item", "link_item_tpl", true );
254 $i++;
255 }
256 $t->parse( "link_list", "link_list_tpl", true );
257 }
258
259 eZList::drawNavigator( $t, $linkCount, $AdminLimit, $Offset, "link_page_tpl" );
260
261 $t->set_var( "categories", $categories );
262 $t->set_var( "links", $links );
263 $t->set_var( "document_root", $DOC_ROOT );
264
265 $t->set_var( "link_start", $Offset + 1 );
266 $t->set_var( "link_end", min( $Offset + $AdminLimit, $linkCount ) );
267 $t->set_var( "link_total", $linkCount );
268
269 $t->pparse( "output", "link_page_tpl" );
270
271 ?>
$i
$i
Definition: admin/adlist.php:91
$linkCategoryList
foreach( $pathArray as $path) $linkCategoryList
Definition: admin/linkcategorylist.php:106
$DOC_ROOT
$DOC_ROOT
Definition: admin/linkcategorylist.php:35
$linkCategory
$linkCategory
Definition: admin/linkcategorylist.php:90
$languageIni
$languageIni
Definition: admin/linkcategorylist.php:36
$t
$t
Definition: admin/linkcategorylist.php:51
$AdminLimit
$AdminLimit
Definition: admin/linkcategorylist.php:34
$link
$link
Definition: admin/linkcategorylist.php:181
$pathArray
$pathArray
Definition: admin/linkcategorylist.php:96
$Language
$Language
Definition: admin/linkcategorylist.php:33
$ini
$ini
Definition: admin/linkcategorylist.php:31
$linkCount
$linkCount
Definition: admin/linkcategorylist.php:190
eZHit
Definition: ezhit.php:40
eZINI
Reads and writes .ini style configuration files.
eZLinkCategory
Definition: ezlinkcategory.php:37
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZTemplate
Definition: eztemplate.php:107
$categories
$categories
Definition: ezarticle/admin/categoryedit.php:636
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$linkList
$linkList
Definition: unacceptedlist.php:66
$image
$image
Definition: user/articlelist.php:242
$links
$links
Definition: user/linkcategorylist.php:181
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.