Merge branch '5.3'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / IImageViewerAction.class.php
1 <?php
2
3 namespace wcf\data;
4
5 /**
6 * Every database object action providing images for .wcfImageViewer() must implement this interface.
7 *
8 * @author Alexander Ebert
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\Data
12 */
13 interface IImageViewerAction
14 {
15 /**
16 * Validates parameters to load the next images.
17 */
18 public function validateLoadNextImages();
19
20 /**
21 * Returns a list of images, array indices given for 'images' are discarded (series and series 'url' are optional).
22 * The first response (offset = 0) must return the total number of images.
23 *
24 * Each requests contains three parameters:
25 * - offset: number of already loaded image
26 * - maximumHeight: image provided in 'url' must be as close as possible to this value
27 * - maximumWidth: see above
28 * - targetImageID: preload all images which are before the target image id as well as the next X images (optional, always present but might be '0')
29 *
30 * Each image can specify a link which should not point to the image itself, instead it should provide a viewable
31 * page directly related to the image (e.g. photo page). The 'fullURL' parameter is optional and results in the
32 * link "View original image" and should lead to the original exceeding lager than the image specified with 'url'.
33 *
34 * Expected return value:
35 * array(
36 * 'images' => array(
37 * array(
38 * 'image' => array(
39 * 'height' => 768,
40 * [ 'fullURL' => 'http://example.com/path/to/full/image.png', ]
41 * [ 'link' => 'http://example.com/index.php/123-MyImage/', ]
42 * 'title' => 'My first picture',
43 * 'url' => 'http://example.com/path/to/large/image.png',
44 * 'width' => 1024
45 * ),
46 * 'thumbnail' => array(
47 * 'height' => 148,
48 * 'url' => 'http://example.com/path/to/thumbnail.png',
49 * 'width' => 148
50 * ),
51 * [ 'series' => array(
52 * 'title' => 'My image series,
53 * [ 'link' => 'http://example.com/link/to/image/series/ ]
54 * ), ]
55 * 'user' => array(
56 * 'avatarURL' => 'http://link/to/avatar.png',
57 * 'link' => 'http://example.com/index.php/123-FooBar/',
58 * 'username' => 'FooBar'
59 * )
60 * ),
61 * // ...
62 * ),
63 * [ 'items' => 123 ]
64 * )
65 *
66 * @return array
67 */
68 public function loadNextImages();
69 }