-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.php
395 lines (322 loc) · 14.7 KB
/
options.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*
*/
if ( !function_exists( 'of_get_option' ) ) {
function of_get_option($name, $default = false) {
$optionsframework_settings = get_option('optionsframework');
// Gets the unique option id
$option_name = $optionsframework_settings['id'];
if ( get_option($option_name) ) {
$options = get_option($option_name);
}
if ( isset($options[$name]) ) {
return $options[$name];
} else {
return $default;
}
}
}
function optionsframework_option_name() {
// This gets the theme name from the stylesheet (lowercase and without spaces)
$themename = get_theme_data(STYLESHEETPATH . '/style.css');
$themename = $themename['Name'];
$themename = preg_replace("/\W/", "", strtolower($themename) );
$optionsframework_settings = get_option('optionsframework');
$optionsframework_settings['id'] = $themename;
update_option('optionsframework', $optionsframework_settings);
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the "id" fields, make sure to use all lowercase and no spaces.
*
*/
include "includes/googlefonts.php";
function optionsframework_options() {
$able = array(1=>"Enabled", 2=>"Disabled");
$imagepath = get_template_directory_uri() ."/images/";
global $fontname;
$options[] = array( "name" => "General Settings",
"type" => "heading");
$options[] = array( "name" => "Favicon",
"desc" => "This option sets the favicon image, while it is suggested that it be an icon file, in most cases with modern browsers a png will also work. This icon shown in tabs and history areas to quickly identify the site to your visitors.",
"id" => "favicon",
"type" => "upload");
$options[] = array( "name" => "Enable Ajax Loading",
"desc" => "This option turns off and on the Ajax Content loader pervasive through out the site. It can sometimes interfere with specific javascript plugins that require an on ready hook. This can be solved usually with Livequery, included with the theme.",
"id" => "ajax",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Demo Mode",
"desc" => "Displays some css changing options on the front end of the site. Do not enable for live sites.",
"id" => "demo",
"std" => 0,
"type" =>"checkbox");
$options[] = array( "name" => "Footer Text",
"desc" => "This is text that will appear in the bottom left of the static footer. Feel free to change it. It is intended for copyright information.",
"id" => "footer-text",
"std" => "",
"class" => "",
"type" => "text");
$options[] = array( "name" => "Styling",
"type" => "heading");
$options[] = array( "name" => "Enable Shadow on Glass",
"desc" => "This option puts a dark shadow/halo around the trim of the site when enabled. It adds an element of realism.",
"id" => "shadow",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Enable Header Screen",
"desc" => "This creates a screen on the top half of the website for artistic reasons when enabled.",
"id" => "screen",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Enable Chrome on the Glass Trim",
"desc" => "This creates an overlay on the glass trim, giving it a rounded feel. This affects the color of the element significantly so use with care.",
"id" => "chrome",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Glass Link Color",
"desc" => "This is the color of the links in the bottom and top of the site in the trim area along with the text.This color should contrast the Glass Link color. ",
"id" => "link_color_trim",
"std" => "#ffffff",
"type" => "color");
$options[] = array( "name" => "Glass Color",
"desc" => "This is the background color of the header navigation and footer that form the trim of the theme.",
"id" => "glass",
"std" => "#000000",
"type" => "color");
$options[] = array( "name" => "Glass Color border",
"desc" => "This is the color of various one pixel borders associated with the site trim, but not the ones within main content area. Those will stay a gray tone unless changed in the custom.css",
"id" => "glassborder",
"std" => "#000000",
"type" => "color");
$options[] = array( "name" => "Opacity Level",
"desc" => "This changes the opacity level of the background of the trim and only the background it does not change the opacity of the text of those elements (thus not affecting the color). The value must be between 0-100, and must have a placeholder zero preceding if less than 10. The following are valid values; 01, 05, 10, 50, 99, 98.5, 20.52, 100, 60, 20.",
"id" => "opacity",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Link Color",
"desc" => "This changes the color of the normal links in the body of the site, they will always be on a white background unless changed in the custom css so keep that in mind.",
"id" => "link_color",
"std" => "#0000ff",
"type" => "color");
$options[] = array( "name" => "Background Color",
"desc" => "This is the chief background color that any background images will appear against.",
"id" => "backgroundcolor",
"std" => "#0000",
"type" => "color");
$options[] = array( "name" => "Logo",
"desc" => "You can set this value using WordPress media library, or upload your own using this option. Any image that you set using this option can be recalled from the library as long as the media is not deleted. This image replaces the header text in the top half of the screen that is wrapped in trim. Removing the image returns the header text.",
"id" => "logo",
"type" => "upload");
$options[] = array( "name" => "Background Image",
"desc" => "This option sets the background image.You can set this value using WordPress media library, or upload your own using this option. Any image that you set using this option can be recalled from the library as long as the media is not deleted. ",
"id" => "backgroundimage",
"type" => "upload");
$options[] = array( "name" => "Background Attachment",
"desc" => "Sets if the image is Fixed to the browser window not scrolling with the screen, or if it scrolls with the screen.",
"id" => "backgroundattachment",
"std" => "fixed",
"type" => "select",
"options" => array(
'fixed' => 'Fixed',
'scroll' => 'Scroll')
);
$options[] = array( "name" => "Background Repeat",
"desc" => "This option sets in what way you would like to set the background repeating if it is repeated.",
"id" => "backgroundrepeat",
"std" => "no-repeat",
"type" => "select",
"options" => array(
'no-repeat' => 'No Repeating',
'repeat' => 'Repeating',
'repeat-x' => 'Repeat Horizonally',
'repeat-y' => 'Repeat Vertically')
);
$options[] = array( "name" => "Background Placement Horizonally",
"desc" => "Sets the origin of the background rendering horizontally. If the background repeats this option moves it around.",
"id" => "backgroundx",
"std" => "center",
"type" => "select",
"options" => array(
'left' => 'Left',
'right' => 'Right',
'center' => 'Center')
);
$options[] = array( "name" => "Background Placement Vertically",
"desc" => "Sets the origin of the background rendering Vertically. If the background repeats this option moves it around.",
"id" => "backgroundy",
"std" => "center",
"type" => "select",
"options" => array(
'top' => 'Top',
'bottom' => 'Bottom',
'center' => 'Center')
);
$options[] = array( "name" => "Typography",
"type" => "heading");
$options[] = array( "name" => "Typography",
"desc" => "While the theme has defaults for Typography you can freely change theme here. The google font resporitory can be found here at the <a href='http://www.google.com/webfonts' target='blank_'> google fonts repository</a>. You can change the font of the body area or the headers.",
"type" => "info");
$options[] = array( "name" => "Header Google Font",
"desc" => "Select from a list of 320 fonts to use as the header font.",
"id" => "googlefont",
"std" => "45",
"type" => "select",
"options" => $fontname);
$options[] = array( "name" => "Body Google Font URL",
"desc" => "Select from a list of 320 fonts to use as the body text",
"id" => "bgooglefont",
"std" => "45",
"type" => "select",
"options" => $fontname);
$options[] = array( "name" => "Layout",
"type" => "heading");
$options[] = array( "name" => "Header Height",
"id" => "height",
"std" => "100",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Header Height Measurement",
"desc" => "Images for layout.",
"id" => "hhmeasure",
"class"=>"mini",
"std" => "%",
"options" => array(
"%"=>'Percentage %',
"px"=>'Pixel [px]',
'em'=>'Letter M Widths [em]'),
"type"=>"select",
);
$options[] = array( "name" => "Enable Fixed Header",
"desc" => "Fixes the Header to the top of the screen",
"id" => "fixheader",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Enable Fixed ",
"desc" => "Fixes the footer to the bottom of the screen",
"id" => "fixfooter",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Expanded Content Slate ",
"desc" => "Expands the whitespace in the content zone to cover the background.",
"id" => "contentwidth",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "Blog Page Layout",
"desc" => "",
"id" => "layout",
"std" => "2c-l-fixed",
"type" => "images",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "Single Page Layout",
"desc" => "",
"id" => "single_layout",
"std" => "2c-l-fixed",
"type" => "images",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "Number of columns in Blog",
"desc" => "Enable two columns for the main blog post list.",
"id" => "postcols",
"std" => "Enabled",
"type" =>"checkbox");
$options[] = array( "name" => "2col_footer Template Page Layout",
"desc" => "Images for layout.",
"id" => "2col_footer_layout",
"std" => "2col_footer",
"type" => "images",
"class"=>"hidden",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "1col Template Page Layout",
"desc" => "Images for layout.",
"id" => "1col_layout",
"std" => "1col",
"type" => "images",
"class"=>"hidden",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "1col_footer Template Page Layout",
"desc" => "Images for layout.",
"id" => "1col_footer_layout",
"std" => "1col_footer",
"type" => "images",
"class"=>"hidden",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "2col Template Page Layout",
"desc" => "Images for layout.",
"id" => "2col_layout",
"class"=>"hidden",
"std" => "2col",
"type" => "images",
"options" => array(
'1col' => $imagepath . '1col.png',
'1col_footer' => $imagepath . '1col_footer.png',
'2col' => $imagepath . '2col.png',
'2col_footer' => $imagepath . '2col_footer.png')
);
$options[] = array( "name" => "Social",
"type" => "heading");
$options[] = array( "name" => "Facebook ID number",
"desc" => "Your facebook ID number, it can usually be found in the URL of your profile/fan page/group",
"id" => "facebook",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Twitter Name",
"desc" => "Your Twitter name, please exclude the @ sign at the begining.",
"id" => "twitter",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Google+ ID",
"desc" => "Number found in the url of your Google+ profile page",
"id" => "gplus",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "LinkedIn ID",
"desc" => "Number found in the url of your LinkedIn profile page",
"id" => "linkedin",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Dribbble Username",
"desc" => "Your Dribbble profile name",
"id" => "dribbble",
"std" => "",
"class" => "mini",
"type" => "text");
$options[] = array( "name" => "Enable RSS",
"desc" => "Enable the the RSS icon.",
"id" => "rss",
"std" => "Enabled",
"type" =>"checkbox");
return $options;}?>