Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

admin/searchform.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: searchform.php 7151 2001-09-11 21:12:17Z fh $
5 //
6 // Created on: <08-Sep-2001 10:32:19 fh>
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/ezlocale.php" );
30
31 // include_once( "ezarticle/classes/ezarticlecategory.php" );
32 // include_once( "ezarticle/classes/ezarticle.php" );
33
34 // include_once( "ezuser/classes/ezauthor.php" );
35 // include_once( "ezuser/classes/ezobjectpermission.php" );
36 $ini =& eZINI::instance( 'site.ini' );
37 $Language = $ini->variable( "eZArticleMain", "Language" );
38
39 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
40 "kernel/ezarticle/admin/intl/", $Language, "searchform.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( "search_form_tpl", "searchform.tpl" );
45 $t->set_block( "search_form_tpl", "category_item_tpl", "category_item" );
46 $t->set_block( "search_form_tpl", "author_item_tpl", "author_item" );
47 $t->set_block( "search_form_tpl", "photographer_item_tpl", "photographer_item" );
48
49 // put authors and photographers into authors list
50 $author = new eZAuthor();
51 $authorArray = $author->getAll();
52 foreach ( $authorArray as $author )
53 {
54 $t->set_var( "author_id", $author->id() );
55 $t->set_var( "author_name", $author->name() );
56 $t->parse( "author_item", "author_item_tpl", true );
57
58 $t->set_var( "photographer_id", $author->id() );
59 $t->set_var( "photographer_name", $author->name() );
60 $t->parse( "photographer_item", "photographer_item_tpl", true );
61 }
62
63
64 $tree = new eZArticleCategory();
65 $treeArray =& $tree->getTree();
66 $user =& eZUser::currentUser();
67
68 $catCount = count( $treeArray );
69 $t->set_var( "num_select_categories", min( $catCount + 1, 10 ) );
70
71 foreach ( $treeArray as $catItem )
72 {
73 if ( eZObjectPermission::hasPermission( $catItem[0]->id(), "article_category", 'w', $user ) == true ||
74 eZArticleCategory::isOwner( eZUser::currentUser(), $catItem[0]->id() ) )
75 {
76 $t->set_var( "category_id", $catItem[0]->id() );
77 $t->set_var( "option_name", $catItem[0]->name() );
78
79 if ( $catItem[1] > 1 )
80 $t->set_var( "option_level", str_repeat( "&nbsp;&nbsp;", $catItem[1] ) );
81 else
82 $t->set_var( "option_level", "" );
83
84 $t->parse( "category_item", "category_item_tpl", true );
85 }
86 }
87
88 $t->pparse( "output", "search_form_tpl" );
89
90 ?>
$tree
foreach( $authorArray as $author) $tree
Definition: admin/searchform.php:64
$t
$t
Definition: admin/searchform.php:39
$treeArray
$treeArray
Definition: admin/searchform.php:65
$user
$user
Definition: admin/searchform.php:66
$authorArray
$authorArray
Definition: admin/searchform.php:51
$Language
$Language
Definition: admin/searchform.php:37
$ini
$ini
Definition: admin/searchform.php:36
$catCount
$catCount
Definition: admin/searchform.php:68
$author
$author
Definition: admin/searchform.php:50
eZArticleCategory
Definition: ezarticlecategory.php:45
eZArticleCategory\isOwner
isOwner( $user, $categoryID)
Definition: ezarticlecategory.php:825
eZAuthor
Definition: ezauthor.php:40
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.