Skip to content

Commit 96435a1

Browse files
committed
Update codestyling.
1 parent ef9e52d commit 96435a1

File tree

1 file changed

+180
-166
lines changed

1 file changed

+180
-166
lines changed

theme.inc

Lines changed: 180 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -23,185 +23,199 @@
2323
* @package Themes
2424
* @subpackage Bootstrap_Matrix
2525
* @author Orestes Sanchez <orestes@estotienearreglo.es>
26-
* @version
26+
* @version
2727
*/
2828
class Bootstrap_MatrixTheme extends GalleryTheme {
2929

30-
function Bootstrap_MatrixTheme() {
31-
global $gallery;
32-
33-
$this->setId('bootstrap_matrix');
34-
$this->setName($gallery->i18n('BootstrapMatrix'));
35-
$this->setDescription($gallery->i18n('Bootstrap Gallery2 look and feel'));
36-
$this->setVersion('1.2.1');
37-
$this->setRequiredCoreApi(array(7, 20));
38-
$this->setRequiredThemeApi(array(2, 4));
39-
$this->setStandardSettings(
40-
array('rows' => 6,
41-
'columns' => 4,
42-
'aboveFoldImages' => 8,
43-
'boxesLayout' => 'left',
44-
'showImageOwner' => 0, 'showAlbumOwner' => 1,
45-
'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => '',
46-
'colorpack' => '', 'showMicroThumbs' => 0, 'dynamicLinks' => 'browse',
47-
'sidebarBlocks' => serialize(array(
48-
array('search.SearchBlock', array('showAdvancedLink' => true)),
49-
array('core.ItemLinks', array('useDropdown' => false)),
50-
array('core.PeerList', array()),
51-
array('imageblock.ImageBlock', array()))),
52-
'albumBlocks' => serialize(array(
53-
array('comment.ViewComments', array()))),
54-
'photoBlocks' => serialize(array(
55-
array('exif.ExifInfo', array()),
56-
array('comment.ViewComments', array())))));
57-
}
58-
59-
/**
60-
* @see GalleryTheme::showAlbumPage
61-
*/
62-
function showAlbumPage(&$template, $item, $params, $childIds) {
63-
global $gallery;
64-
65-
$ret = $this->loadCommonTemplateData(
66-
$template, $item, $params,
67-
array('owner', 'viewCount', 'childCount', 'descendentCount', 'parents',
68-
'systemLinks', 'itemLinks', 'itemSummaries', 'permissions',
69-
'thumbnails', 'pageNavigator', 'jumpRange'),
70-
$childIds);
71-
if ($ret) {
72-
return array($ret, null);
30+
function Bootstrap_MatrixTheme() {
31+
global $gallery;
32+
33+
$this->setId('bootstrap_matrix');
34+
$this->setName($gallery->i18n('BootstrapMatrix'));
35+
$this->setDescription($gallery->i18n('Bootstrap Gallery2 look and feel'));
36+
$this->setVersion('1.2.1');
37+
$this->setRequiredCoreApi(array(7, 20));
38+
$this->setRequiredThemeApi(array(2, 4));
39+
$this->setStandardSettings(
40+
array(
41+
'rows' => 6,
42+
'columns' => 4,
43+
'aboveFoldImages' => 8,
44+
'boxesLayout' => 'left',
45+
'showImageOwner' => 0, 'showAlbumOwner' => 1,
46+
'albumFrame' => '', 'itemFrame' => '', 'photoFrame' => '',
47+
'colorpack' => '', 'showMicroThumbs' => 0, 'dynamicLinks' => 'browse',
48+
'sidebarBlocks' => serialize(array(
49+
array('search.SearchBlock', array('showAdvancedLink' => true)),
50+
array('core.ItemLinks', array('useDropdown' => false)),
51+
array('core.PeerList', array()),
52+
array('imageblock.ImageBlock', array()),
53+
)),
54+
'albumBlocks' => serialize(array(
55+
array('comment.ViewComments', array()),
56+
)),
57+
'photoBlocks' => serialize(array(
58+
array('exif.ExifInfo', array()),
59+
array('comment.ViewComments', array()),
60+
)),
61+
));
7362
}
7463

75-
/* Add in our extra stuff */
76-
$theme =& $template->getVariableByReference('theme');
77-
$theme['debug'] = $gallery->getDebug();
78-
79-
/* Add our header and styles */
80-
return array(null, 'theme.tpl');
81-
}
82-
83-
/**
84-
* @see GalleryTheme::showPhotoPage
85-
*/
86-
function showPhotoPage(&$template, $item, $params) {
87-
global $gallery;
88-
89-
$dataTypes = array('owner', 'parents', 'systemLinks', 'itemLinks', 'permissions',
90-
'itemLinksDetailed', 'itemNavigator', 'imageViews');
91-
if (!empty($params['showMicroThumbs'])) {
92-
$dataTypes[] = 'navThumbnails';
64+
/**
65+
* @see GalleryTheme::showAlbumPage
66+
*/
67+
function showAlbumPage(&$template, $item, $params, $childIds) {
68+
global $gallery;
69+
70+
$ret = $this->loadCommonTemplateData(
71+
$template, $item, $params,
72+
array(
73+
'owner', 'viewCount', 'childCount', 'descendentCount', 'parents',
74+
'systemLinks', 'itemLinks', 'itemSummaries', 'permissions',
75+
'thumbnails', 'pageNavigator', 'jumpRange',
76+
),
77+
$childIds);
78+
if ($ret) {
79+
return array($ret, null);
80+
}
81+
82+
/* Add in our extra stuff */
83+
$theme =& $template->getVariableByReference('theme');
84+
$theme['debug'] = $gallery->getDebug();
85+
86+
/* Add our header and styles */
87+
88+
return array(null, 'theme.tpl');
9389
}
94-
$ret = $this->loadCommonTemplateData($template, $item, $params, $dataTypes);
95-
if ($ret) {
96-
return array($ret, null);
90+
91+
/**
92+
* @see GalleryTheme::showPhotoPage
93+
*/
94+
function showPhotoPage(&$template, $item, $params) {
95+
global $gallery;
96+
97+
$dataTypes = array(
98+
'owner', 'parents', 'systemLinks', 'itemLinks', 'permissions',
99+
'itemLinksDetailed', 'itemNavigator', 'imageViews',
100+
);
101+
if (! empty($params['showMicroThumbs'])) {
102+
$dataTypes[] = 'navThumbnails';
103+
}
104+
$ret = $this->loadCommonTemplateData($template, $item, $params, $dataTypes);
105+
if ($ret) {
106+
return array($ret, null);
107+
}
108+
109+
/* Add in our extra stuff */
110+
$theme =& $template->getVariableByReference('theme');
111+
$theme['debug'] = $gallery->getDebug();
112+
113+
return array(null, 'theme.tpl');
97114
}
98-
99-
/* Add in our extra stuff */
100-
$theme =& $template->getVariableByReference('theme');
101-
$theme['debug'] = $gallery->getDebug();
102-
103-
return array(null, 'theme.tpl');
104-
}
105-
106-
/**
107-
* @see GalleryTheme::showModulePage
108-
*/
109-
function showModulePage(&$template, $item, $params, $templateFile) {
110-
global $gallery;
111-
$ret = $this->loadCommonTemplateData(
112-
$template, $item, $params, array('parents', 'systemLinks'));
113-
if ($ret) {
114-
return array($ret, null);
115+
116+
/**
117+
* @see GalleryTheme::showModulePage
118+
*/
119+
function showModulePage(&$template, $item, $params, $templateFile) {
120+
global $gallery;
121+
$ret = $this->loadCommonTemplateData(
122+
$template, $item, $params, array('parents', 'systemLinks'));
123+
if ($ret) {
124+
return array($ret, null);
125+
}
126+
/* Add in our extra stuff */
127+
$theme =& $template->getVariableByReference('theme');
128+
$theme['debug'] = $gallery->getDebug();
129+
130+
return array(null, 'theme.tpl');
115131
}
116-
/* Add in our extra stuff */
117-
$theme =& $template->getVariableByReference('theme');
118-
$theme['debug'] = $gallery->getDebug();
119-
120-
return array(null, 'theme.tpl');
121-
}
122-
123-
/**
124-
* @see GalleryTheme::showAdminPage
125-
*/
126-
function showAdminPage(&$template, $item, $params, $templateFile) {
127-
global $gallery;
128-
$ret = $this->loadCommonTemplateData(
129-
$template, $item, $params, array('parents', 'systemLinks'));
130-
if ($ret) {
131-
return array($ret, null);
132+
133+
/**
134+
* @see GalleryTheme::showAdminPage
135+
*/
136+
function showAdminPage(&$template, $item, $params, $templateFile) {
137+
global $gallery;
138+
$ret = $this->loadCommonTemplateData(
139+
$template, $item, $params, array('parents', 'systemLinks'));
140+
if ($ret) {
141+
return array($ret, null);
142+
}
143+
/* Add in our extra stuff */
144+
$theme =& $template->getVariableByReference('theme');
145+
$theme['debug'] = $gallery->getDebug();
146+
147+
return array(null, 'theme.tpl');
132148
}
133-
/* Add in our extra stuff */
134-
$theme =& $template->getVariableByReference('theme');
135-
$theme['debug'] = $gallery->getDebug();
136-
137-
return array(null, 'theme.tpl');
138-
}
139-
140-
/**
141-
* @see GalleryTheme::showErrorPage
142-
*/
143-
function showErrorPage(&$template) {
144-
global $gallery;
145-
146-
/* Add in our extra stuff */
147-
$theme =& $template->getVariableByReference('theme');
148-
$theme['debug'] = $gallery->getDebug();
149-
150-
return array(null, 'error.tpl');
151-
}
152-
153-
/**
154-
* @see GalleryTheme::showProgressBarPage
155-
*/
156-
function showProgressBarPage(&$template, $item, $params) {
157-
global $gallery;
158-
159-
/* Add in our extra stuff */
160-
$theme =& $template->getVariableByReference('theme');
161-
$theme['debug'] = $gallery->getDebug();
162-
163-
$ret = $this->loadCommonTemplateData(
164-
$template, $item, $params, array('parents', 'systemLinks'));
165-
if ($ret) {
166-
return array($ret, null);
149+
150+
/**
151+
* @see GalleryTheme::showErrorPage
152+
*/
153+
function showErrorPage(&$template) {
154+
global $gallery;
155+
156+
/* Add in our extra stuff */
157+
$theme =& $template->getVariableByReference('theme');
158+
$theme['debug'] = $gallery->getDebug();
159+
160+
return array(null, 'error.tpl');
167161
}
168162

169-
return array(null, 'theme.tpl');
170-
}
171-
172-
/**
173-
* @see GalleryTheme::getSettings
174-
*/
175-
function getSettings($itemId=null) {
176-
list ($ret, $settings, $params) = parent::getSettings($itemId);
177-
if ($ret) {
178-
return array($ret, null, null);
163+
/**
164+
* @see GalleryTheme::showProgressBarPage
165+
*/
166+
function showProgressBarPage(&$template, $item, $params) {
167+
global $gallery;
168+
169+
/* Add in our extra stuff */
170+
$theme =& $template->getVariableByReference('theme');
171+
$theme['debug'] = $gallery->getDebug();
172+
173+
$ret = $this->loadCommonTemplateData(
174+
$template, $item, $params, array('parents', 'systemLinks'));
175+
if ($ret) {
176+
return array($ret, null);
177+
}
178+
179+
return array(null, 'theme.tpl');
179180
}
180-
181-
/* Add in our custom settings */
182-
$settings[] = array(
183-
'key' => 'boxesLayout',
184-
'name' => $this->translate('Block layout'),
185-
'type' => 'single-select',
186-
'choices' => array(
187-
'left' => $this->translate('To the left'),
188-
'bottom' => $this->translate('To the bottom'),
189-
'right' => $this->translate('To the right'),
190-
'disable' => $this->translate('Disable')),
191-
'value' => $params['boxesLayout']);
192-
193-
/* Add in our custom settings */
194-
$settings[] = array(
195-
'key' => 'aboveFoldImages',
196-
'name' => $this->translate('Number of above-the-fold images.
181+
182+
/**
183+
* @see GalleryTheme::getSettings
184+
*/
185+
function getSettings($itemId = null) {
186+
list ($ret, $settings, $params) = parent::getSettings($itemId);
187+
if ($ret) {
188+
return array($ret, null, null);
189+
}
190+
191+
/* Add in our custom settings */
192+
$settings[] = array(
193+
'key' => 'boxesLayout',
194+
'name' => $this->translate('Block layout'),
195+
'type' => 'single-select',
196+
'choices' => array(
197+
'left' => $this->translate('To the left'),
198+
'bottom' => $this->translate('To the bottom'),
199+
'right' => $this->translate('To the right'),
200+
'disable' => $this->translate('Disable'),
201+
),
202+
'value' => $params['boxesLayout'],
203+
);
204+
205+
/* Add in our custom settings */
206+
$settings[] = array(
207+
'key' => 'aboveFoldImages',
208+
'name' => $this->translate('Number of above-the-fold images.
197209
Above-the-fold images will load immediately, while below-the-fold images will be lazy
198210
loaded.'),
199-
'type' => 'text-field',
200-
'typeParams' => array('size' => 2),
201-
'value' => $params['aboveFoldImages']);
202-
203-
return array(null, $settings, $params);
204-
}
205-
211+
'type' => 'text-field',
212+
'typeParams' => array('size' => 2),
213+
'value' => $params['aboveFoldImages'],
214+
);
215+
216+
return array(null, $settings, $params);
217+
}
218+
206219
}
220+
207221
?>

0 commit comments

Comments
 (0)