Commit | Line | Data |
---|---|---|
dd5df48e | 1 | <?php |
a9229942 | 2 | |
dd5df48e AE |
3 | namespace wcf\data; |
4 | ||
5 | /** | |
6 | * Every database object action providing images for .wcfImageViewer() must implement this interface. | |
a9229942 TD |
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> | |
dd5df48e | 11 | */ |
a9229942 TD |
12 | interface IImageViewerAction |
13 | { | |
14 | /** | |
15 | * Validates parameters to load the next images. | |
16 | */ | |
17 | public function validateLoadNextImages(); | |
18 | ||
19 | /** | |
20 | * Returns a list of images, array indices given for 'images' are discarded (series and series 'url' are optional). | |
21 | * The first response (offset = 0) must return the total number of images. | |
22 | * | |
23 | * Each requests contains three parameters: | |
24 | * - offset: number of already loaded image | |
25 | * - maximumHeight: image provided in 'url' must be as close as possible to this value | |
26 | * - maximumWidth: see above | |
27 | * - 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') | |
28 | * | |
29 | * Each image can specify a link which should not point to the image itself, instead it should provide a viewable | |
30 | * page directly related to the image (e.g. photo page). The 'fullURL' parameter is optional and results in the | |
31 | * link "View original image" and should lead to the original exceeding lager than the image specified with 'url'. | |
32 | * | |
33 | * Expected return value: | |
34 | * array( | |
35 | * 'images' => array( | |
36 | * array( | |
37 | * 'image' => array( | |
38 | * 'height' => 768, | |
39 | * [ 'fullURL' => 'http://example.com/path/to/full/image.png', ] | |
40 | * [ 'link' => 'http://example.com/index.php/123-MyImage/', ] | |
41 | * 'title' => 'My first picture', | |
42 | * 'url' => 'http://example.com/path/to/large/image.png', | |
43 | * 'width' => 1024 | |
44 | * ), | |
45 | * 'thumbnail' => array( | |
46 | * 'height' => 148, | |
47 | * 'url' => 'http://example.com/path/to/thumbnail.png', | |
48 | * 'width' => 148 | |
49 | * ), | |
50 | * [ 'series' => array( | |
51 | * 'title' => 'My image series, | |
52 | * [ 'link' => 'http://example.com/link/to/image/series/ ] | |
53 | * ), ] | |
54 | * 'user' => array( | |
55 | * 'avatarURL' => 'http://link/to/avatar.png', | |
56 | * 'link' => 'http://example.com/index.php/123-FooBar/', | |
57 | * 'username' => 'FooBar' | |
58 | * ) | |
59 | * ), | |
60 | * // ... | |
61 | * ), | |
62 | * [ 'items' => 123 ] | |
63 | * ) | |
64 | * | |
65 | * @return array | |
66 | */ | |
67 | public function loadNextImages(); | |
dd5df48e | 68 | } |