-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththemeoptions.php
executable file
·204 lines (181 loc) · 8.74 KB
/
themeoptions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
/* Plug-in for theme option handling
* The Admin Options page tests for the presence of this file in a theme folder
* If it is present it is linked to with a require_once call.
* If it is not present, no theme options are displayed.
*
*/
require_once(SERVERPATH . "/" . ZENFOLDER . "/admin-functions.php");
class ThemeOptions {
function ThemeOptions() {
setOptionDefault('zpmin_homeoption', '');
setOptionDefault('zpmin_album_thumb_size', 158);
setOptionDefault('zpmin_social', true);
setOptionDefault('zpmin_switch', false);
setOptionDefault('zpmin_menu', '');
setOptionDefault('zpmin_logo', '');
setOptionDefault('zpmin_colorbox', false);
setOptionDefault('zpmin_cbstyle', 'style3');
setOptionDefault('zpmin_zpsearchcount', 2);
setOptionDefault('zpmin_finallink', 'nolink');
}
function getOptionsDisabled() {
return array('image_size','image_use_side','custom_index_page');
}
function getOptionsSupported() {
return array(
gettext('Home Page Image Option') => array('key' => 'zpmin_homeoption', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Choose the option for the single image on the homepage. See Image-Album-Statistics plugin or Random Image functions for more information.')),
gettext('Final Image Link Option') => array('key' => 'zpmin_finallink', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Choose the option for the final image link on image.php. Can either link to full image using standard zenphoto process (with core options), colorbox, or no link (default).')),
gettext('Sidebar Position on the Right?') => array('key' => 'zpmin_switch', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Check to reverse the sidebar and content area positions. Default (unchecked) is the sidebar on the left.')),
gettext('Use colorbox on Album and Search Pages?') => array('key' => 'zpmin_colorbox', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('If checked, 2 links appear when hovering images in album and search pages, one to popup the image in colorbox, and the other to go to the details page.')),
gettext('Colorbox Style') => array('key' => 'zpmin_cbstyle', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Select the Colorbox style you wish to use (examples on the colorbox site).')),
gettext('Disable MetaData Display?') => array('key' => 'zpmin_disablemeta', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Check to disable the metadata (EXIF,IPTC) display on the image page.')),
gettext('Social Networks Sharing Links?') => array('key' => 'zpmin_social', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Check to enable the social sharing buttons on various pages (facebook, twitter, etc).')),
gettext('Album Thumb Size') => array('key' => 'zpmin_album_thumb_size', 'type' => OPTION_TYPE_TEXT, 'desc' => gettext('Select the size of album thumbs. The thumb size above is for image thumbs. Album thumbs will also take on your selection of cropping or not. A good size for albums is 158 (3 per row), and a good size above for image thumbs is 113 (4 per row). Make sure you also set the number of thumbs per row for images and albums above! ')),
gettext('Menu Name of Menu Manager') => array('key' => 'zpmin_menu', 'type' => OPTION_TYPE_TEXT, 'desc' => gettext('If you use the menu manager plugin, enter the name of the menu you would like to use. Make sure you create the menu in the menu manager backend! Or leave blank to use the theme menu.')),
gettext('ZenPage Search Results') => array('key' => 'zpmin_zpsearchcount', 'type' => OPTION_TYPE_TEXT, 'desc' => gettext('If using Zenpage, enter the number of search results to display for each news and pages. Default is 2 (4 total possible).')),
gettext('Logo Image') => array('key' => 'zpmin_logo', 'type' => OPTION_TYPE_TEXT, 'desc' => gettext('Enter an image file located in the themes image directory, including extension, to use as an image logo. Or leave blank to use a text representation of your Gallery name. As an example there is a logo.gif image in the images directory.'))
);
}
function handleOption($option, $currentValue) {
if ($option == 'zpmin_cbstyle') {
echo '<select style="width:200px;" id="' . $option . '" name="' . $option . '"' . ">\n";
echo '<option value="style1"';
if ($currentValue == "style1") {
echo ' selected="selected">style1</option>\n';
} else {
echo '>style1</option>\n';
}
echo '<option value="style2"';
if ($currentValue == "style2") {
echo ' selected="selected">style2</option>\n';
} else {
echo '>style2</option>\n';
}
echo '<option value="style3"';
if ($currentValue == "style3") {
echo ' selected="selected">style3</option>\n';
} else {
echo '>style3</option>\n';
}
echo '<option value="style4"';
if ($currentValue == "style4") {
echo ' selected="selected">style4</option>\n';
} else {
echo '>style4</option>\n';
}
echo '<option value="style5"';
if ($currentValue == "style5") {
echo ' selected="selected">style5</option>\n';
} else {
echo '>style5</option>\n';
}
echo "</select>\n";
}
if ($option == 'zpmin_homeoption') {
echo '<select id="' . $option . '" name="' . $option . '"' . ">\n";
echo '<option value="random"';
if ($currentValue == "random") {
echo ' selected="selected">Random</option>\n';
} else {
echo '>Random</option>\n';
}
echo '<option value="random-daily"';
if ($currentValue == "random-daily") {
echo ' selected="selected">Random Daily</option>\n';
} else {
echo '>Random Daily</option>\n';
}
echo '<option value="image-popular"';
if ($currentValue == "image-popular") {
echo ' selected="selected">Image-Popular</option>\n';
} else {
echo '>Image-Popular</option>\n';
}
echo '<option value="image-latest"';
if ($currentValue == "image-latest") {
echo ' selected="selected">Image-Latest</option>\n';
} else {
echo '>Image-Latest</option>\n';
}
echo '<option value="image-latest-date"';
if ($currentValue == "image-latest-date") {
echo ' selected="selected">Image-Latest-Date</option>\n';
} else {
echo '>Image-Latest-Date</option>\n';
}
echo '<option value="image-latest-mtime"';
if ($currentValue == "image-latest-mtime") {
echo ' selected="selected">Image-Latest-mtime</option>\n';
} else {
echo '>Image-Latest-mtime</option>\n';
}
echo '<option value="image-mostrated"';
if ($currentValue == "image-mostrated") {
echo ' selected="selected">Image-MostRated</option>\n';
} else {
echo '>Image-MostRated</option>\n';
}
echo '<option value="image-toprated"';
if ($currentValue == "image-toprated") {
echo ' selected="selected">Image-TopRated</option>\n';
} else {
echo '>Image-TopRated</option>\n';
}
echo '<option value="album-latest"';
if ($currentValue == "album-latest") {
echo ' selected="selected">Album-Latest</option>\n';
} else {
echo '>Album-Latest</option>\n';
}
echo '<option value="album-latestupdated"';
if ($currentValue == "album-latestupdated") {
echo ' selected="selected">Album-LatestUpdated</option>\n';
} else {
echo '>Album-LatestUpdated</option>\n';
}
echo '<option value="album-mostrated"';
if ($currentValue == "album-mostrated") {
echo ' selected="selected">Album-MostRated</option>\n';
} else {
echo '>Album-MostRated</option>\n';
}
echo '<option value="album-toprated"';
if ($currentValue == "album-toprated") {
echo ' selected="selected">Album-TopRated</option>\n';
} else {
echo '>Album-TopRated</option>\n';
}
echo "</select>\n";
}
if ($option == 'zpmin_finallink') {
echo '<select style="width:200px;" id="' . $option . '" name="' . $option . '"' . ">\n";
echo '<option value="colorbox"';
if ($currentValue == "colorbox") {
echo ' selected="selected">Colorbox</option>\n';
} else {
echo '>Colorbox</option>\n';
}
echo '<option value="nolink"';
if ($currentValue == "nolink") {
echo ' selected="selected">No Link</option>\n';
} else {
echo '>No Link</option>\n';
}
echo '<option value="standard"';
if ($currentValue == "standard") {
echo ' selected="selected">Standard ZenPhoto</option>\n';
} else {
echo '>Standard ZenPhoto</option>\n';
}
echo '<option value="standard-new"';
if ($currentValue == "standard-new") {
echo ' selected="selected">Standard ZenPhoto - New Window</option>\n';
} else {
echo '>Standard ZenPhoto - New Window</option>\n';
}
echo "</select>\n";
}
}
}
?>