Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
bibliossimo
opacce
Commits
f6210361
Commit
f6210361
authored
Feb 16, 2018
by
Ghislain Loas
Browse files
dev #71715 improve file explorer search
parent
5f2e1717
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
13 deletions
+26
-13
VERSIONS_WIP/71715
VERSIONS_WIP/71715
+2
-0
library/Class/FileManager/FileSystem.php
library/Class/FileManager/FileSystem.php
+7
-2
library/ZendAfi/View/Helper/Admin/FileManager.php
library/ZendAfi/View/Helper/Admin/FileManager.php
+10
-7
library/ZendAfi/View/Helper/Admin/Head.php
library/ZendAfi/View/Helper/Admin/Head.php
+1
-3
public/opac/java/file-manager/file-manager.css
public/opac/java/file-manager/file-manager.css
+6
-1
No files found.
VERSIONS_WIP/71715
0 → 100644
View file @
f6210361
- ticket #71715 : Explorateur de fichiers : ajout de la possiblité de rechercher des dossiers.
\ No newline at end of file
library/Class/FileManager/FileSystem.php
View file @
f6210361
...
...
@@ -332,7 +332,7 @@ class Class_FileManager_FileSystem {
$this
->
_cached_paths
[]
=
$term
.
$path
;
$closure
=
function
()
use
(
$term
,
$path
)
{
$cmd
=
sprintf
(
"
find %s
-type f
-iname
'
*%s*
'
"
,
$cmd
=
sprintf
(
'
find %s -iname
"
*%s*"
'
,
$path
,
$term
);
...
...
@@ -343,7 +343,12 @@ class Class_FileManager_FileSystem {
sort
(
$found
,
SORT_NATURAL
);
return
array_filter
(
array_map
([
$this
,
'fileAt'
],
$found
));
if
(
Class_FileManager_FileSystem
::
LISTING_LIMIT
<
count
(
$found
))
{
$this
->
_oversized
[]
=
$path
;
$found
=
array_slice
(
$found
,
0
,
Class_FileManager_FileSystem
::
LISTING_LIMIT
);
}
return
array_filter
(
array_map
([
Class_FileManager
,
'find'
],
$found
));
};
return
(
new
Storm_Cache
())
...
...
library/ZendAfi/View/Helper/Admin/FileManager.php
View file @
f6210361
...
...
@@ -407,13 +407,16 @@ class ZendAfi_View_Helper_Admin_FileManager extends ZendAfi_View_Helper_BaseHelp
protected
function
_search
(
$term
,
$item
,
$key
,
$settings
)
{
$url
=
$this
->
view
->
url
([
'search_'
.
$key
=>
null
])
.
'&search_'
.
$key
;
$onclick
=
$this
->
view
->
isPopup
()
?
sprintf
(
"var value = encodeURIComponent($(this).closest('div').find('input').val());opacDialogFromUrl(addPath('%s=' + value, '&render=popup'));return false;"
,
$url
)
:
sprintf
(
"var value = encodeURIComponent($(this).closest('div').find('input').val());document.location = '%s=' + value;return false;"
,
$url
);
return
$this
->
_tag
(
'input'
,
''
,
[
'type'
=>
'text'
,
'value'
=>
$term
,
'placeholder'
=>
$term
?
$term
:
$this
->
_
(
'Rechercher'
),
'name'
=>
'search_'
.
$key
])
.
?
sprintf
(
"var value = encodeURIComponent($(this).closest('div').find('input').val());opacDialogFromUrl(addPath('%s=' + value, '&render=popup'));"
,
$url
)
:
sprintf
(
"var value = encodeURIComponent($(this).closest('div').find('input').val());document.location = '%s=' + value;"
,
$url
);
return
$this
->
_tag
(
'input'
,
null
,
[
'type'
=>
'text'
,
'value'
=>
$term
,
'placeholder'
=>
$term
?
$term
:
$this
->
_
(
'Rechercher'
),
'name'
=>
'search_'
.
$key
,
'onkeypress'
=>
sprintf
(
'if (event.keyCode==13) {%s}'
,
$onclick
)])
.
$this
->
view
->
button
((
new
Class_Entity
)
->
setText
(
$this
->
_tag
(
'i'
,
''
,
[
'class'
=>
'fa fa-search'
]))
->
setTitle
(
$this
->
_
(
'Rechercher le terme saisie'
))
...
...
library/ZendAfi/View/Helper/Admin/Head.php
View file @
f6210361
...
...
@@ -35,10 +35,8 @@ class ZendAfi_View_Helper_Admin_Head extends ZendAfi_View_Helper_BaseHelper {
->
showNotifications
()
->
loadPrettyPhoto
();
Class_Admin_Skin
::
current
()
->
renderScriptsOn
(
$head_scripts
);
$script_loader
=
Class_ScriptLoader
::
getInstance
();
Class_Admin_Skin
::
current
()
->
renderScriptsOn
(
$script_loader
);
$script_loader
->
addJQueryReady
(
'setupAnchorsTarget();'
)
->
addJQueryReady
(
'selectArticle();'
)
->
addJQueryReady
(
'selectArticleCategory();'
)
...
...
public/opac/java/file-manager/file-manager.css
View file @
f6210361
...
...
@@ -267,11 +267,16 @@ body .file-manager .tree > ul {
padding
:
5px
;
}
body
.file-manager
.browser_tools
input
,
body
.file-manager
.admin-button
{
margin
:
5px
;
padding
:
0px
10px
;
}
body
.file-manager
.browser_tools
input
{
line-height
:
1.62em
;
}
body
.file-manager
p
,
body
#opac-dialog
p
,
body
#opac-dialog
.path_linked_to_models
,
...
...
@@ -286,4 +291,4 @@ body .file-manager #image_preview {
max-width
:
400px
;
max-height
:
200px
;
margin
:
1%
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment