mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
fixes #1929 add parameter search on pwg.categories.getList (and use it)
This commit is contained in:
parent
d50d7ba620
commit
fdabd4a988
3 changed files with 13 additions and 2 deletions
|
@ -23,6 +23,7 @@ function linked_albums_search(searchText) {
|
|||
cat_id: 0,
|
||||
recursive: true,
|
||||
fullname: true,
|
||||
search: searchText,
|
||||
}
|
||||
} else {
|
||||
api_params = {
|
||||
|
|
|
@ -279,7 +279,16 @@ SELECT
|
|||
FROM '. CATEGORIES_TABLE .'
|
||||
'.$join_type.' JOIN '. USER_CACHE_CATEGORIES_TABLE .'
|
||||
ON id=cat_id AND user_id='.$join_user.'
|
||||
WHERE '. implode("\n AND ", $where) .'
|
||||
WHERE '. implode("\n AND ", $where);
|
||||
|
||||
if (isset($params["search"]) and $params['search'] != "")
|
||||
{
|
||||
$query .= '
|
||||
AND name LIKE \'%'.pwg_db_real_escape_string($params["search"]).'%\'
|
||||
LIMIT '.$conf["linked_album_search_limit"];
|
||||
}
|
||||
|
||||
$query.= '
|
||||
;';
|
||||
$result = pwg_query($query);
|
||||
|
||||
|
|
1
ws.php
1
ws.php
|
@ -157,6 +157,7 @@ function ws_addDefaultMethods( $arr )
|
|||
'default' => IMG_THUMB,
|
||||
'info' => implode(',', array_keys(ImageStdParams::get_defined_type_map()))
|
||||
),
|
||||
'search' => array('default' => null),
|
||||
),
|
||||
'Returns a list of categories.',
|
||||
$ws_functions_root . 'pwg.categories.php'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue