Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezfilemanager/user/search.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: search.php 9842 2003-06-05 10:40:58Z br $
5 //
6 // Created on: <10-May-2001 12:48:08 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/ezlocale.php" );
30 // include_once( "classes/ezlist.php" );
31
32 // include_once( "ezuser/classes/ezobjectpermission.php" );
33
34 // include_once( "ezfilemanager/classes/ezvirtualfile.php" );
35
36 $Language = $ini->variable( "eZFileManagerMain", "Language" );
37 $Limit = $ini->variable( "eZFileManagerMain", "SearchListLimit" );
38
39 $t = new eZTemplate( "kernel/ezfilemanager/user/" . $ini->variable( "eZFileManagerMain", "TemplateDir" ),
40 "kernel/ezfilemanager/user/intl/", $Language, "search.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( "search_list_tpl", "search.tpl" );
45
46 $t->set_block( "search_list_tpl", "file_list_tpl", "file_list" );
47 $t->set_block( "file_list_tpl", "file_tpl", "file" );
48 $t->set_block( "search_list_tpl", "empty_search_tpl", "empty_search" );
49
50 $t->set_block( "file_tpl", "read_tpl", "read" );
51
52 $t->set_var( "search_text", htmlspecialchars( $SearchText ) );
53
54 if ( !isset( $Offset ) )
55 $Offset = 0;
56
57 if ( $SearchText )
58 {
59 $file = new eZVirtualFile();
60 $fileList = $file->search( $SearchText, $Offset, $Limit );
61 $totalCount = $file->searchCount( $SearchText, $user ? $user->id() : -1 );
62
63 $t->set_var( "url_text", urlencode( $SearchText ) );
64 }
65
66 if ( count( $fileList ) > 0 )
67 {
68 foreach ( $fileList as $file )
69 {
70 $t->set_var( "file_id", $file->id() );
71 $t->set_var( "original_file_name", $file->name() );
72 $t->set_var( "file_name", $file->name() );
73 $t->set_var( "file_url", $file->name() );
74 $t->set_var( "file_description", $file->description() );
75
76 $filePath = $file->filePath( true );
77
78 $size = $file->siFileSize();
79 $t->set_var( "file_size", $size["size-string"] );
80 $t->set_var( "file_unit", $size["unit"] );
81
82 $t->set_var( "file_read", "" );
83 $t->set_var( "file_write", "" );
84 ( $i % 2 ) ? $t->set_var( "td_class", "bgdark" ) : $t->set_var( "td_class", "bglight" );
85
86 if ( eZObjectPermission::hasPermission( $file->id(), "filemanager_file", "r", $user ) ||
87 eZVirtualFile::isOwner( $user, $file->id() ) )
88 {
89 $t->parse( "read", "read_tpl" );
90 $i++;
91 }
92 else
93 {
94 $t->set_var( "read", "" );
95 }
96
97 $t->parse( "file", "file_tpl", true );
98 }
99 $t->set_var( "empty_search", "" );
100 $t->parse( "file_list", "file_list_tpl" );
101 }
102 else
103 {
104 $t->set_var( "file_list", "" );
105 $t->parse( "empty_search", "empty_search_tpl" );
106 }
107
108 eZList::drawNavigator( $t, $totalCount, $Limit, $Offset, "search_list_tpl" );
109
110 $t->set_var( "file_start", $Offset + 1 );
111 $t->set_var( "file_end", min( $Offset + $Limit, $totalCount ) );
112 $t->set_var( "file_total", $totalCount );
113
114 $t->pparse( "output", "search_list_tpl" );
115
116 ?>
$i
$i
Definition: admin/adlist.php:91
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZTemplate
Definition: eztemplate.php:107
eZVirtualFile
Definition: ezvirtualfile.php:42
eZVirtualFile\isOwner
isOwner( $user, $file)
Definition: ezvirtualfile.php:376
$ini
$ini
Definition: classes/admin/linklist.php:64
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$totalCount
$totalCount
Definition: ezarticle/admin/formlist.php:73
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$fileList
$fileList
Definition: ezfilemanager/admin/browse.php:163
$size
if($file_debug) $size
Definition: ezfilemanager/user/filedownload.php:165
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$filePath
$filePath
Definition: ezfilemanager/user/filedownload.php:50
$Limit
$Limit
Definition: ezfilemanager/user/search.php:37
$t
$t
Definition: ezfilemanager/user/search.php:39
$Language
$Language
Definition: ezfilemanager/user/search.php:36
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.