Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

unacceptedlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: unacceptedlist.php 9517 2002-05-08 11:07:34Z vl $
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 // include_once( "classes/eztexttool.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33
34 $Language = $ini->variable( "eZLinkMain", "Language" );
35 $AdminLimit = $ini->variable( "eZLinkMain", "AdminAcceptLimit" );
36
37 // include_once( "ezlink/classes/ezlinkcategory.php" );
38 // include_once( "ezlink/classes/ezlink.php" );
39 // include_once( "ezlink/classes/ezhit.php" );
40
41 // include_once( "ezuser/classes/ezuser.php" );
42 // include_once( "ezuser/classes/ezusergroup.php" );
43 // include_once( "ezuser/classes/ezmodule.php" );
44 // include_once( "ezuser/classes/ezpermission.php" );
45
46 require( "kernel/ezuser/admin/admincheck.php" );
47
48 $t = new eZTemplate( "kernel/ezlink/admin/" . $ini->variable( "eZLinkMain", "AdminTemplateDir" ),
49 "kernel/ezlink/admin/intl/", $Language, "unacceptedlist.php" );
50 $t->setAllStrings();
51
52 $t->set_file( "unacceptedlist", "unacceptedlist.tpl" );
53
54 $t->set_block( "unacceptedlist", "link_item_tpl", "link_item" );
55 $t->set_block( "link_item_tpl", "category_item_tpl", "category_item" );
56 $t->set_block( "link_item_tpl", "multiple_category_tpl", "multiple_category" );
57
58 $t->set_var( "site_style", $SiteDesign );
59 $t->set_var( "link_item", "" );
60
61 if ( !isset( $Offset ) )
62 $Offset = 0;
63
64 $link = new eZLink();
65
66 $linkList =& $link->getNotAccepted( $Offset, $AdminLimit );
67 $linkCount = $link->unAcceptedCount();
68
69 $category = new eZLinkCategory();
70
71 $linkCategoryList = $category->getTree();
72
73 $t->set_var( "link_count", count( $linkList ) );
74
75 $i = 0;
76
77 $catCount = count( $linkCategoryList );
78 $t->set_var( "num_select_categories", min( $catCount, 10 ) );
79
80 foreach ( $linkList as $linkItem )
81 {
82 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
83
84 $t->set_var( "link_id", $linkItem->id() );
85 $t->set_var( "link_name", $linkItem->name() );
86 $t->set_var( "link_url", eZTextTool::htmlspecialchars( $linkItem->url() ) );
87 $t->set_var( "link_description", $linkItem->description() );
88 $t->set_var( "link_keywords", $linkItem->keywords() );
89
90 $LinkCategoryIDArray = $linkItem->categories( false );
91 $mainCategory = $linkItem->categoryDefinition();
92 $linkCategoryID = $mainCategory->id();
93
94 $t->set_var( "category_item", "" );
95 $t->set_var( "multiple_category", "" );
96
97 foreach ( $linkCategoryList as $linkCategoryItem )
98 {
99 $t->set_var("link_category_id", $linkCategoryItem[0]->id() );
100 $t->set_var("link_category_name", $linkCategoryItem[0]->name() );
101
102 $t->set_var( "is_selected", $linkCategoryID == $linkCategoryItem[0]->id() ? "selected" : "" );
103
104 if ( $linkCategoryItem[1] > 0 )
105 $t->set_var( "option_level", str_repeat( "&nbsp;", $linkCategoryItem[1] ) );
106 else
107 $t->set_var( "option_level", "" );
108
109
110 if ( is_array( $LinkCategoryIDArray ) and ( $linkCategoryID != $linkCategoryItem[0]->id() )
111 and ( in_array( $linkCategoryItem[0]->id(), $LinkCategoryIDArray ) ) )
112 {
113 $t->set_var( "multiple_selected", "selected" );
114 }
115 else
116 {
117 $t->set_var( "multiple_selected", "" );
118 }
119
120 $t->parse( "multiple_category", "multiple_category_tpl", true );
121 $t->parse( "category_item", "category_item_tpl", true );
122 }
123
124 $t->set_var( "i", $i );
125 $i++;
126 $t->parse( "link_item", "link_item_tpl", true );
127 }
128 eZList::drawNavigator( $t, $linkCount, $AdminLimit, $Offset, "unacceptedlist" );
129
130 $t->set_var( "link_start", $Offset + 1 );
131 $t->set_var( "link_end", min( $Offset + $AdminLimit, $linkCount ) );
132 $t->set_var( "link_total", $linkCount );
133
134 $t->pparse( "output", "unacceptedlist" );
135
136 ?>
eZLinkCategory
Definition: ezlinkcategory.php:37
eZLink
Definition: ezlink.php:65
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZTemplate
Definition: eztemplate.php:107
eZTextTool\htmlspecialchars
static htmlspecialchars( $string)
Definition: eztexttool.php:144
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$LinkCategoryIDArray
else $LinkCategoryIDArray
Definition: linkedit.php:100
$category
$category
Definition: unacceptedlist.php:69
$t
$t
Definition: unacceptedlist.php:48
$AdminLimit
$AdminLimit
Definition: unacceptedlist.php:35
$link
$link
Definition: unacceptedlist.php:64
$i
$i
Definition: unacceptedlist.php:75
$Language
$Language
Definition: unacceptedlist.php:34
$ini
$ini
Definition: unacceptedlist.php:32
$catCount
$catCount
Definition: unacceptedlist.php:77
$linkCategoryList
$linkCategoryList
Definition: unacceptedlist.php:71
$linkList
$linkList
Definition: unacceptedlist.php:66
$linkCount
$linkCount
Definition: unacceptedlist.php:67
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.