-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoptions.php
389 lines (333 loc) · 15.1 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
<?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.
*/
function optionsframework_option_name() {
// This gets the theme name from the stylesheet
$themename = wp_get_theme();
$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.
*
* If you are making your theme translatable, you should replace 'options_framework_theme'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
// Departments
$profile_depts = array(
'' => __('Select a Department', 'ufclaspeople2'),
'Anthropology' => 'Anthropology',
'Astronomy' => 'Astronomy',
'Biology' => 'Biology',
'Chemistry' => 'Chemistry',
'Classics' => 'Classics',
'Economics' => 'Economics',
'English' => 'English',
'Geography' => 'Geography',
'Geological Sciences' => 'Geological Sciences',
'History' => 'History',
'Languages, Literatures, & Cultures' => 'Languages, Literatures, & Cultures',
'Linguistics' => 'Linguistics',
'Mathematics' => 'Mathematics',
'Philosophy' => 'Philosophy',
'Physics' => 'Physics',
'Political Science' => 'Political Science',
'Psychology' => 'Psychology',
'Religion' => 'Religion',
'Sociology and Criminology & Law' => 'Sociology and Criminology & Law',
'Spanish and Portuguese Studies' => 'Spanish and Portuguese Studies',
'Statistics' => 'Statistics',
'Other' => 'Other',
);
// Locations
$profile_locations = array(
'' => __('Select a Location', 'ufclaspeople2'),
'Academic Advising Center Gainesville FL' => 'Academic Advising Center',
'Anderson Hall Gainesville FL' => 'Anderson Hall',
'Bartram Hall Gainesville FL' => 'Bartram Hall',
'Broward Hall Gainesville FL' => 'Broward Hall',
'Bryant Space Science Center Gainesville FL' => 'Bryant Space Science Center',
'Carr Hall Gainesville FL' => 'Carr Hall',
'Dauer Hall Gainesville FL' => 'Dauer Hall',
'Griffin-Floyd Hall Gainesville FL' => 'Griffin-Floyd Hall',
'Grinter Hall Gainesville FL' => 'Grinter Hall',
'Keene-Flint Hall Gainesville FL' => 'Keene-Flint Hall',
'Little Hall Gainesville FL' => 'Little Hall',
'Matherly Hall Gainesville FL' => 'Matherly Hall',
'McCarty Hall A Gainesville FL' => 'McCarty Hall A',
'McCarty Hall C Gainesville FL' => 'McCarty Hall C',
'29.648068, -82.346436' => 'Microkelvin Lab',
'Norman Hall Gainesville FL' => 'Norman Hall',
'Physics Department Gainesville FL' => 'Physics Building',
'Psychology Bldg Gainesville FL' => 'Psychology Building',
'Pugh Hall Gainesville FL' => 'Pugh Hall',
'Rolfs Hall Gainesville FL' => 'Rolfs Hall',
'Tigert Hall Gainesville FL' => 'Tigert Hall',
'Turlington Hall Gainesville FL' => 'Turlington Hall',
'Ustler Hall Gainesville FL' => 'Ustler Hall',
'Walker Hall Gainesville FL' => 'Walker Hall',
'Williamson Hall Gainesville FL' => 'Williamson Hall',
'Yon Hall Gainesville FL' => 'Yon Hall',
);
$profile_affiliations = array(
'' => __('Select an affiliation', 'ufclaspeople2'),
'Faculty' => 'Faculty',
'Graduate Student' => 'Graduate Student',
'Staff' => 'Staff',
);
$parent_colleges_institutes = array(
"College of Liberal Arts and Sciences" => "College of Liberal Arts and Sciences",
/*"University of Florida" => "University of Florida",
"UF Academic Health Center" => "UF Academic Health Center",
"Shands HealthCare" => "Shands HealthCare",
"" => "None"*/
);
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all tags into an array
$options_tags = array();
$options_tags_obj = get_tags();
foreach ( $options_tags_obj as $tag ) {
$options_tags[$tag->term_id] = $tag->name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// If using image radio buttons, define a directory path
$imagepath = get_template_directory_uri() . '/images/';
$options = array();
// Profile
$options[] = array(
'name' => __('Profile Information', 'ufclaspeople2'),
'type' => 'heading');
$options[] = array(
'name' => __('', 'ufclaspeople2'),
'desc' => __('Profile information for this site. Email, phone, and location also appears in the mobile navigation menu. Leave blank to disable mobile menu buttons.', 'ufclaspeople2'),
'type' => 'info');
$options[] = array(
'name' => __('Email', 'ufclaspeople2'),
'desc' => __('Enter your email address. (e.g. [email protected])', 'ufclaspeople2'),
'id' => 'opt_profile_email',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Phone', 'ufclaspeople2'),
'desc' => __('Enter your phone number in the following format: ###-###-####. (e.g. 352-555-5555)', 'ufclaspeople2'),
'id' => 'opt_profile_phone',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Office Location', 'ufclaspeople2'),
'desc' => __('Select a location. Links will take users to Google Maps (https://www.google.com/maps)', 'ufclaspeople2'),
'id' => 'opt_profile_location',
'std' => '',
'type' => 'select',
'options' => $profile_locations);
$options[] = array(
'name' => __('Affilation', 'ufclaspeople2'),
'desc' => __('', 'ufclaspeople2'),
'id' => 'opt_profile_affiliation',
'std' => '',
'type' => 'select',
'options' => $profile_affiliations);
$options[] = array(
'name' => __('Department', 'ufclaspeople2'),
'desc' => __('Select a department', 'ufclaspeople2'),
'id' => 'opt_profile_dept',
'std' => '',
'type' => 'select',
'options' => $profile_depts);
// Settings from the original template
$options[] = array( "name" => "General",
"type" => "heading");
$options[] = array( "name" => "Parent College / Institute",
"desc" => "Select your parent organization.",
"id" => "opt_parent_colleges_institutes",
"std" => "one",
"type" => "select",
"options" => $parent_colleges_institutes);
/* $options[] = array( "name" => "Webmaster Email",
"desc" => "Enter the email address for webmaster contact requests (e.g. [email protected])",
"id" => "opt_webmaster_email",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Google Analytics Account Number",
"desc" => "Enter your account number for Google Analytics (e.g. 'UA-xxxxxxx-x') Default is 'UA-1145687-25'. ",
"id" => "opt_analytics_acct",
"std" => "UA-1145687-25",
"type" => "text");
$options[] = array( "name" => "Intranet URL",
"desc" => "Enter the URL to your unit's intranet. This will place a link at the bottom of the footer titled 'Intranet'",
"id" => "opt_intranet_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Make a Gift URL",
"desc" => "Enter the URL to your unit's specific fund/giving page at the UF Foundation. Find available online funds at the <a href='https://www.uff.ufl.edu/OnlineGiving/Advanced.asp'>UF Foundation</a>",
"id" => "opt_makeagift_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Enable Mega Drop Down Menu",
"desc" => "Enable mega drop down menus for your main menu",
"id" => "opt_mega_menu",
"std" => "0",
"type" => "checkbox");
$options[] = array( "name" => "Collapse Sidebar Navigation",
"desc" => "Useful for larger sites - keeps the sidebar navigation a manageable height",
"id" => "opt_collapse_sidebar_nav",
"std" => "0",
"type" => "checkbox");
$options[] = array( "name" => "Site Title",
"type" => "heading");
$options[] = array( "name" => "Title Font Size",
"desc" => "Enter a number that corresponds to the size of the font you would like for the title of your site (Default 2.6).",
"id" => "opt_title_size",
"class" => "mini",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Title Padding",
"desc" => "Enter the amount of padding the title should have (Default 6).",
"id" => "opt_title_pad",
"class" => "mini",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Tagline Font Size",
"desc" => "Enter a number that corresponds to the size of the font you would like for the tagline of your site (Default values 1.4).",
"id" => "opt_tagline_size",
"class" => "mini",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Header Call to Action",
"type" => "heading");
$options[] = array( "name" => "Call to Action Text",
"desc" => "The Call to Action text is the orange box above your main menu. Enter what you would like it to say here. Leave it blank to remove it.",
"id" => "opt_actionitem_text",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Call to Action URL",
"desc" => "Where visitors are taken when they click on your Header Action Item",
"id" => "opt_actionitem_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Homepage Layout",
"type" => "heading");
$options[] = array( "name" => "Homepage Layout for Widgets",
"desc" => "Select which layout you want to use for your widgets on the homepage",
"id" => "opt_homepage_layout",
"std" => "3c-default",
"type" => "images",
"options" => array(
'3c-default' => $imagepath . '3c-default.png',
'3c-thirds' => $imagepath . '3c-thirds.png',
'2c-bias' => $imagepath . '2c-bias.png',
'2c-half' => $imagepath . '2c-half.png',
'1c-100' => $imagepath . '1c-100.png')
);
$options[] = array( "name" => "Color Scheme (white background)",
"desc" => "Use a white background for the homepage widget zone",
"id" => "opt_homepage_layout_color",
"std" => "0",
"type" => "checkbox");
$options[] = array( "name" => "Featured Content",
"type" => "heading");
$options[] = array( "name" => "Select a Category",
"desc" => "Choose a category from which featured posts are drawn. To remove the featured content area, simply set this dropdown to 'Choose a Category'",
"id" => "opt_featured_category",
"type" => "select",
"std" => array("Choose a Category" => "Choose a Category"),
"options" => $options_categories);
$options[] = array( "name" => "Number of Posts to Display in Slider",
"desc" => "How many posts do you want to display in your slider (Story Stacker is fixed at 3)",
"id" => "opt_number_of_posts_to_show",
"std" => "3",
"type" => "select",
"class" => "mini",
"options" => array("1" => "1", "2" => "2", "3" => "3","4" => "4","5" => "5","6" => "6",));
$options[] = array( "name" => "Slider Speed",
"desc" => "Time in milliseconds to display each slide (e.g. 5000 means five seconds)",
"id" => "opt_featured_speed",
"std" => "7000",
"type" => "text");
$options[] = array( "name" => "Disable Timeline Scrubber",
"desc" => "Disable the long bar with dots underneath the images",
"id" => "opt_featured_content_disable_timeline",
"std" => "0",
"type" => "checkbox");
$options[] = array( "name" => "Story Stacker",
"desc" => "Check to enable the Featured Content Story Stacker for your home page.",
"id" => "opt_story_stacker",
"std" => "0",
"type" => "checkbox");
$options[] = array( "name" => "Story Stacker - Disable Dates",
"desc" => "Disable dates from appearing underneath your post titles",
"id" => "opt_story_stacker_disable_dates",
"std" => "0",
"type" => "checkbox");
*/
$options[] = array( "name" => "Advanced",
"type" => "heading");
/*$options[] = array( "name" => "Facebook",
"super-admin-only" => "0",
"desc" => "Enter the url of your organization's Facebook page (e.g. http://facebook.com/uflorida)",
"id" => "opt_facebook_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Twitter",
"super-admin-only" => "0",
"desc" => "Enter the url of your organization's Twitter page (e.g. http://www.twitter.com/uflorida)",
"id" => "opt_twitter_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Youtube",
"super-admin-only" => "0",
"desc" => "Enter the url of your organization's Youtube page (e.g. http://www.youtube.com/universityofflorida)",
"id" => "opt_youtube_url",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Facebook Insights ID",
"super-admin-only" => "1",
"desc" => "Enter the unique number ID for fb:admins, e.g., <meta property=\"fb:admins\" content=\"1138099648\", would be \"1138099648\" />",
"id" => "opt_facebook_insights",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Custom Logo",
"super-admin-only" => "1",
"desc" => "For advanced use only.",
"id" => "opt_alternative_site_logo",
"type" => "upload");
$options[] = array( "name" => "Custom Logo Height",
"super-admin-only" => "1",
"desc" => "For advanced use only. Enter height in pixels (i.e. 70)",
"id" => "opt_alternative_site_logo_height",
"class" => "mini",
"std" => "",
"type" => "text");
$options[] = array( "name" => "Custom Logo Width",
"super-admin-only" => "1",
"desc" => "For advanced use only. Enter width in pixels (i.e. 70)",
"id" => "opt_alternative_site_logo_width",
"class" => "mini",
"std" => "",
"type" => "text"); */
$options[] = array( "name" => "Custom CSS",
"desc" => "Enter custom CSS to be inserted in the header.",
"id" => "opt_custom_css",
"std" => "",
"type" => "textarea");
return $options;
}