44
44
$this->setName($gallery->i18n('Hybrid'));
45
45
$this->setDescription(
46
46
$gallery->i18n('Combined album/image/slideshow dynamic view'));
47
$this->setVersion('1.0.0');
48
$this->setRequiredCoreApi(array(6, 0));
49
$this->setRequiredThemeApi(array(2, 0));
47
$this->setVersion('1.1.0');
48
$this->setRequiredCoreApi(array(7, 0));
49
$this->setRequiredThemeApi(array(2, 2));
50
50
$this->setStandardSettings(array(
51
51
'rows' => 30, 'columns' => 2,
52
52
'albumFrame' => '', 'itemFrame' => '', 'colorpack' => '',
60
60
'photoBlocks' => serialize(array(
61
61
array('exif.ExifInfo', array()),
62
62
array('comment.ViewComments', array()))),
63
'showText' => 1, 'showAlbumDate' => 1, 'showImageDate' => 1, 'showDateInViewer' => 1,
64
'showSize' => 1, 'showViewCount' => 1, 'showAlbumOwner' => 0, 'showImageOwner' => 0,
65
'thumbTitle' => 'none',
70
* @see GalleryTheme::getSettings()
72
function getSettings($itemId=null) {
73
list ($ret, $settings, $params) = parent::getSettings($itemId);
75
return array($ret->wrap(__FILE__, __LINE__), null);
78
/* Add in our custom settings */
79
$settings[] = array('key' => 'showText',
80
'name' => $this->translate('Show text with thumbnails'),
82
'value' => $params['showText']);
83
$settings[] = array('key' => 'showAlbumDate',
84
'name' => $this->translate('Show dates for albums'),
86
'value' => $params['showAlbumDate']);
87
$settings[] = array('key' => 'showImageDate',
88
'name' => $this->translate('Show dates with thumbnails'),
90
'value' => $params['showImageDate']);
91
$settings[] = array('key' => 'showDateInViewer',
92
'name' => $this->translate('Show dates in image view'),
94
'value' => $params['showDateInViewer']);
95
$settings[] = array('key' => 'showSize',
96
'name' => $this->translate('Show album sizes'),
98
'value' => $params['showSize']);
99
$settings[] = array('key' => 'showViewCount',
100
'name' => $this->translate('Show view counts'),
101
'type' => 'checkbox',
102
'value' => $params['showViewCount']);
103
$settings[] = array('key' => 'thumbTitle',
104
'name' => $this->translate('Mouseover on thumbnails'),
105
'type' => 'single-select',
107
'none' => $this->translate('None'),
108
'title' => $this->translate('Title'),
109
'date' => $this->translate('Date'),
110
'datetime' => $this->translate('Date/Time'),
111
'titledate' => $this->translate('Title (Date)'),
112
'titledatetime' => $this->translate('Title (Date/Time)')),
113
'value' => $params['thumbTitle']);
115
return array(null, $settings);
67
119
* @see GalleryTheme::showAlbumPage
69
121
function showAlbumPage(&$template, $item, $params, $childIds) {
70
$ret = $this->loadCommonTemplateData($template, $item, $params,
71
array('owner', 'viewCount', 'parents', 'systemLinks', 'itemLinks',
72
'childItemLinksDetailed', 'permissions', 'jumpRange'),
74
if ($ret->isError()) {
123
$urlGenerator =& $gallery->getUrlGenerator();
125
$data = array('parents', 'systemLinks', 'itemLinks',
126
'itemSummaries', 'childItemLinksDetailed', 'permissions', 'jumpRange');
127
if ($params['showSize']) {
128
$data[] = 'descendentCount';
130
if ($params['showViewCount']) {
131
$data[] = 'viewCount';
133
if ($params['showAlbumOwner'] || $params['showImageOwner']) {
136
$ret = $this->loadCommonTemplateData($template, $item, $params, $data, $childIds);
75
138
return array($ret->wrap(__FILE__, __LINE__), null);
77
140
$theme =& $template->getVariableByReference('theme');
79
142
list ($ret, $imageWidths, $imageHeights) =
80
143
$this->_buildItemList($childIds, $theme['children']);
81
if ($ret->isError()) {
82
145
return array($ret->wrap(__FILE__, __LINE__), null);
114
179
if (!empty($renderId)) {
115
180
/* Render this item */
116
181
list ($ret, $image) = GalleryCoreApi::loadEntitiesById($renderId);
117
if ($ret->isError()) {
118
183
return array($ret->wrap(__FILE__, __LINE__), null);
120
$template->setVariable('theme', array('item' => $item->getMemberData(),
121
'image' => $image->getMemberData()));
122
return array(GalleryStatus::success(), 'render.tpl');
185
$template->setVariable('theme', array('item' => (array)$item,
186
'image' => (array)$image));
187
return array(null, 'render.tpl');
125
190
if (!empty($detail)) {
126
191
/* View item details */
127
192
$ret = $this->loadCommonTemplateData($template, $item, $params,
128
193
array('owner', 'viewCount'));
129
if ($ret->isError()) {
130
195
return array($ret->wrap(__FILE__, __LINE__), null);
132
197
$theme =& $template->getVariableByReference('theme');
133
198
list ($ret, $thumbnail) =
134
199
GalleryCoreApi::fetchThumbnailsByItemIds(array($item->getId()));
135
if ($ret->isError()) {
136
201
return array($ret->wrap(__FILE__, __LINE__), null);
138
203
if (!empty($thumbnail)) {
139
$theme['thumbnail'] = $thumbnail[$item->getId()]->getMemberData();
204
$theme['thumbnail'] = (array)$thumbnail[$item->getId()];
141
206
$template->style('themes/hybrid/theme.css');
142
return array(GalleryStatus::success(), 'detail.tpl');
207
return array(null, 'detail.tpl');
145
210
/* Otherwise, redirect to parent with initial view of this item */
146
211
list ($ret, $parent) = GalleryCoreApi::loadEntitiesById($item->getParentId());
147
if ($ret->isError()) {
148
213
return array($ret->wrap(__FILE__, __LINE__), null);
150
215
$theme =& $template->getVariableByReference('theme');
151
216
list ($ret, $childIds) =
152
217
GalleryCoreApi::fetchChildItemIds($parent, null, null, $theme['actingUserId']);
153
if ($ret->isError()) {
154
219
return array($ret->wrap(__FILE__, __LINE__), null);
156
221
$perPage = $this->getPageSize($params);
188
253
function showAdminPage(&$template, $item, $params, $templateFile) {
189
254
$ret = $this->loadCommonTemplateData(
190
255
$template, $item, $params, array('parents', 'systemLinks'));
191
if ($ret->isError()) {
192
257
return array($ret->wrap(__FILE__, __LINE__), null);
195
return array(GalleryStatus::success(), 'theme.tpl');
260
return array(null, 'theme.tpl');
199
264
* @see GalleryTheme::showErrorPage
201
266
function showErrorPage(&$template) {
202
return array(GalleryStatus::success(), 'error.tpl');
267
return array(null, 'error.tpl');
223
288
$imageWidths = $imageHeights = $childItems = array();
224
289
if (!empty($childIds)) {
225
290
$ret = GalleryCoreApi::studyPermissions($childIds);
226
if ($ret->isError()) {
227
292
return array($ret->wrap(__FILE__, __LINE__), null, null);
229
294
list ($ret, $childItems) = GalleryCoreApi::loadEntitiesById($childIds);
230
if ($ret->isError()) {
231
296
return array($ret->wrap(__FILE__, __LINE__), null, null);
233
298
list ($ret, $preferredFullImages) =
234
299
GalleryCoreApi::fetchPreferredsByItemIds($childIds);
235
if ($ret->isError()) {
236
301
return array($ret->wrap(__FILE__, __LINE__), null, null);
238
303
list ($ret, $resizedImages) =
239
304
GalleryCoreApi::fetchResizesByItemIds($childIds);
240
if ($ret->isError()) {
241
306
return array($ret->wrap(__FILE__, __LINE__), null, null);
243
308
list ($ret, $thumbnails) =
244
309
GalleryCoreApi::fetchThumbnailsByItemIds($childIds);
245
if ($ret->isError()) {
246
311
return array($ret->wrap(__FILE__, __LINE__), null, null);