Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/searchform.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: searchform.php 9489 2002-04-30 09:01:53Z br $
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 // init the section
40 if ( isset ($SectionIDOverride) )
41 {
42 // include_once( "ezsitemanager/classes/ezsection.php" );
43
44 $sectionObject =& eZSection::globalSectionObject( $SectionIDOverride );
45 $sectionObject->setOverrideVariables();
46 }
47
48 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
49 "kernel/ezarticle/user/intl/", $Language, "searchform.php" );
50
51 $t->setAllStrings();
52
53 $t->set_file( "search_form_tpl", "searchform.tpl" );
54 $t->set_block( "search_form_tpl", "category_item_tpl", "category_item" );
55 $t->set_block( "search_form_tpl", "author_item_tpl", "author_item" );
56 $t->set_block( "search_form_tpl", "photographer_item_tpl", "photographer_item" );
57
58 // put authors and photographers into authors list
59 $author = new eZAuthor();
60 $authorArray = $author->getAll();
61 foreach ( $authorArray as $author )
62 {
63 $t->set_var( "author_id", $author->id() );
64 $t->set_var( "author_name", $author->name() );
65 $t->parse( "author_item", "author_item_tpl", true );
66
67 $t->set_var( "photographer_id", $author->id() );
68 $t->set_var( "photographer_name", $author->name() );
69 $t->parse( "photographer_item", "photographer_item_tpl", true );
70 }
71
72
73 $tree = new eZArticleCategory();
74 $treeArray =& $tree->getTree();
75 $user =& eZUser::currentUser();
76
77 $catCount = count( $treeArray );
78 $t->set_var( "num_select_categories", min( $catCount + 1, 10 ) );
79
80 foreach ( $treeArray as $catItem )
81 {
82 if ( eZObjectPermission::hasPermission( $catItem[0]->id(), "article_category", 'r', $user ) == true ||
83 eZArticleCategory::isOwner( eZUser::currentUser(), $catItem[0]->id() ) )
84 {
85 $t->set_var( "category_id", $catItem[0]->id() );
86 $t->set_var( "option_name", $catItem[0]->name() );
87
88 if ( $catItem[1] > 1 )
89 $t->set_var( "option_level", str_repeat( "&nbsp;&nbsp;", $catItem[1] ) );
90 else
91 $t->set_var( "option_level", "" );
92
93 $t->parse( "category_item", "category_item_tpl", true );
94 }
95 }
96
97 if ( isset ($SectionIDOverride) ) $t->set_var( "section_id", $SectionIDOverride );
98
99 $t->pparse( "output", "search_form_tpl" );
100
101 ?>
$sectionObject
$sectionObject
Definition: articleheaderlist.php:49
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
eZSection\globalSectionObject
static & globalSectionObject( $sectionID)
Definition: ezsection.php:366
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$tree
foreach( $authorArray as $author) $tree
Definition: user/searchform.php:73
$treeArray
$treeArray
Definition: user/searchform.php:74
$user
$user
Definition: user/searchform.php:75
$authorArray
$authorArray
Definition: user/searchform.php:60
$Language
$Language
Definition: user/searchform.php:37
$t
if(isset($SectionIDOverride)) $t
Definition: user/searchform.php:48
$ini
$ini
Definition: user/searchform.php:36
$catCount
$catCount
Definition: user/searchform.php:77
$author
$author
Definition: user/searchform.php:59
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.