fixes #911 new method pwg.history.log (to be used by PhotoSwipe, in SmartPocket or BootstrapDarkroom)

This commit is contained in:
plegall
2022-08-26 16:58:11 +02:00
parent 1b66ca73f9
commit 002abf87df
2 changed files with 40 additions and 0 deletions
+27
View File
@@ -585,6 +585,33 @@ SELECT
);
}
/**
* API method
* Log a new line in visit history
* @since 13
*/
function ws_history_log($params, &$service)
{
global $logger, $page;
if (!empty($params['section']) and in_array($params['section'], get_enums(HISTORY_TABLE, 'section')))
{
$page['section'] = $params['section'];
}
if (!empty($params['cat_id']))
{
$page['category'] = array('id' => $params['cat_id']);
}
if (!empty($params['tags_string']) and preg_match('/^\d+(,\d+)*$/', $params['tags_string']))
{
$page['tag_ids'] = explode(',', $params['tags_string']);
}
pwg_log($params['image_id'], 'picture');
}
/**
* API method
* Returns lines of an history search