PageRenderTime 33ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/paradise/Paradise/functions/options.php

https://gitlab.com/billyprice1/website
PHP | 415 lines | 371 code | 35 blank | 9 comment | 2 complexity | d1a44579b4d2c77211123bc0e7e64b0c MD5 | raw file
  1. <?php
  2. require_once(dirname(__FILE__) . '/admin_options/AdminPageFactory.php');
  3. function theme_options_pages() {
  4. /*-------------------- Appearance Options Subpage --------------------*/
  5. ap_add_sub_page('Appearance', __('Theme Options', TEMPLATENAME), __('Theme Options', TEMPLATENAME), 'administrator', 'custom_theme_options');
  6. ap_page_title(__('Theme Options', TEMPLATENAME));
  7. ap_page_icon('index');
  8. /*-------------------- General Options --------------------*/
  9. ap_add_section('general', __('General', TEMPLATENAME));
  10. ap_add_checkbox(array(
  11. 'name' => 'show_switcher',
  12. 'title' => __('Display color switcher?', TEMPLATENAME),
  13. 'default' => true,
  14. 'desc' => __('Check this to display color switcher on the frontend.', TEMPLATENAME),
  15. ));
  16. $_theme_colors = theme_get_color_styles();
  17. reset($_theme_colors);
  18. ap_add_select(array(
  19. 'name' => 'default_theme_color',
  20. 'title' => __('Choose color scheme', TEMPLATENAME),
  21. 'default' => key($_theme_colors),
  22. 'options' => $_theme_colors,
  23. ));
  24. ap_add_upload(array(
  25. 'name' => 'logo',
  26. 'title' => __('Upload logo', TEMPLATENAME),
  27. 'class' => 'large-text',
  28. ));
  29. ap_add_upload(array(
  30. 'name' => 'favicon',
  31. 'title' => __('Upload favicon', TEMPLATENAME),
  32. 'class' => 'large-text',
  33. 'desc' => __('File type: .ico or .png File dimensions: 16x16, 32x32.', TEMPLATENAME),
  34. ));
  35. ap_add_checkbox(array(
  36. 'name' => 'use_breadcrumbs',
  37. 'title' => __('Display breadcrumbs?', TEMPLATENAME),
  38. 'default' => true,
  39. 'desc' => __('Check this to display breadcrumbs.', TEMPLATENAME),
  40. ));
  41. ap_add_select(array(
  42. 'name' => 'default_side_sidebar',
  43. 'title' => __('Default side sidebar', TEMPLATENAME),
  44. 'default' => 'disable',
  45. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  46. 'options_func' => 'get_registered_sidebars',
  47. 'desc' => __('Choose sidebar for side of page.', TEMPLATENAME),
  48. ));
  49. ap_add_select(array(
  50. 'name' => 'default_bottom_sidebar',
  51. 'title' => __('Default bottom sidebar', TEMPLATENAME),
  52. 'default' => 'disable',
  53. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  54. 'options_func' => 'get_registered_sidebars',
  55. 'desc' => __('Choose sidebar for bottom of page.', TEMPLATENAME),
  56. ));
  57. ap_add_input(array(
  58. 'name' => 'copyright',
  59. 'title' => __('Footer copyright text', TEMPLATENAME),
  60. 'default' => 'Copyright &copy; 2010 '.get_bloginfo('name').' company. All rights reserved.',
  61. 'desc' => __('Type a copyright text.', TEMPLATENAME),
  62. 'class' => 'large-text code',
  63. ));
  64. ap_add_textarea(array(
  65. 'name' => 'custom_css',
  66. 'title' => __('Custom CSS', TEMPLATENAME),
  67. 'class' => 'large-text code',
  68. ));
  69. /*-------------------- Theme Fonts Options --------------------*/
  70. ap_add_section('fonts', __('Fonts', TEMPLATENAME));
  71. ap_add_radio(array(
  72. 'name' => 'font_family',
  73. 'title' => __('Base theme font', TEMPLATENAME),
  74. 'default' => 'Arial,Helvetica,Garuda,sans-serif',
  75. 'options' => theme_base_font_options(),
  76. ));
  77. ap_add_checkbox(array(
  78. 'name' => 'use_cufon_font',
  79. 'title' => __('Enable Cufon', TEMPLATENAME),
  80. 'default' => true,
  81. 'desc' => __('Check this to use cufon font.', TEMPLATENAME),
  82. ));
  83. ap_add_radio(array(
  84. 'name' => 'cufon_font',
  85. 'title' => __('Choose cufon fonts', TEMPLATENAME),
  86. 'default' => 'MgOpen Modata',
  87. 'options_func' => 'theme_cufon_font_options',
  88. ));
  89. /*-------------------- Home Page Options --------------------*/
  90. ap_add_section('home', __('Home & Slider', TEMPLATENAME));
  91. ap_add_radio(array(
  92. 'name' => 'show_on_front',
  93. 'title' => __('Home page displays', TEMPLATENAME),
  94. 'options' => array(
  95. 'posts' => __('Your latest posts', TEMPLATENAME),
  96. 'page' => sprintf(__('A %sstatic page%s (select bellow)', TEMPLATENAME), '<a href="edit.php?post_type=page">', '</a>'),
  97. ),
  98. 'default' => 'posts',
  99. ));
  100. ap_add_select(array(
  101. 'name' => 'page_on_front',
  102. 'title' => __('Static home page', TEMPLATENAME),
  103. 'options' => array(
  104. 0 => __('- Select -', TEMPLATENAME),
  105. ) + get_registered_pages(),
  106. 'default' => '0',
  107. ));
  108. ap_add_checkbox(array(
  109. 'name' => 'use_feature_home_box',
  110. 'title' => __('Show Special box?', TEMPLATENAME),
  111. 'default' => false,
  112. 'desc' => __('Check this to show special box.', TEMPLATENAME),
  113. ));
  114. ap_add_textarea(array(
  115. 'name' => 'feature_home_box',
  116. 'title' => __('Home page Special box', TEMPLATENAME),
  117. 'default' => '',
  118. 'desc' => __('Content area for special gray box, which is under slider.', TEMPLATENAME),
  119. 'class' => 'large-text code',
  120. ));
  121. global $_theme_sliders_list;
  122. ap_add_select(array(
  123. 'name' => 'slider_type',
  124. 'title' => __('Choose a slider type', TEMPLATENAME),
  125. 'default' => '',
  126. 'options' => array('disable' => __('Disable', TEMPLATENAME)) + $_theme_sliders_list,
  127. 'desc' => __('Slider to be Displayed in Header.', TEMPLATENAME),
  128. 'onchange' => 'this.form.submit();',
  129. ));
  130. ap_add_input(array(
  131. 'name' => 'slider_count_items',
  132. 'title' => __('Number of slides', TEMPLATENAME),
  133. 'default' => '',
  134. 'desc' => __('Number of slides to be displayed. (Empty to show all the slides)', TEMPLATENAME),
  135. 'class' => 'small-text',
  136. ));
  137. ap_add_select(array(
  138. 'name' => 'slider_post_order',
  139. 'title' => __('Order by', TEMPLATENAME),
  140. 'default' => 'rand',
  141. 'options' => array(
  142. 'none' => __('No order', TEMPLATENAME),
  143. 'rand' => __('Randomly', TEMPLATENAME),
  144. 'date' => __('Date', TEMPLATENAME),
  145. ),
  146. 'desc' => __('Choose an option to order slides.', TEMPLATENAME),
  147. ));
  148. ap_add_select(array(
  149. 'name' => 'slider_sort_order',
  150. 'title' => __('Sort type', TEMPLATENAME),
  151. 'default' => 'ASC',
  152. 'options' => array(
  153. 'ASC' => __('Ascendent', TEMPLATENAME),
  154. 'DESC' => __('Descendent', TEMPLATENAME),
  155. ),
  156. 'desc' => __('Disabled if "Order By" option is "Randomly"', TEMPLATENAME),
  157. ));
  158. ap_add_checkbox(array(
  159. 'name' => 'slider_caption',
  160. 'title' => __('Captions', TEMPLATENAME),
  161. 'default' => true,
  162. 'desc' => __('Check this to display captions over the slides. (If choosen slider supports this option)', TEMPLATENAME),
  163. ));
  164. ap_add_checkbox(array(
  165. 'name' => 'slider_caption_title',
  166. 'title' => __('Captions titles', TEMPLATENAME),
  167. 'default' => true,
  168. 'desc' => __('Check this to display slide title in captions.', TEMPLATENAME),
  169. ));
  170. ap_add_checkbox(array(
  171. 'name' => 'slider_caption_content',
  172. 'title' => __('Captions content', TEMPLATENAME),
  173. 'default' => true,
  174. 'desc' => __('Check this to display slide content in captions.', TEMPLATENAME),
  175. ));
  176. ap_add_checkbox(array(
  177. 'name' => 'slider_caption_more',
  178. 'title' => __('Captions "more" button?', TEMPLATENAME),
  179. 'default' => true,
  180. 'desc' => __('Check this to display "more" button.', TEMPLATENAME),
  181. ));
  182. ap_add_input(array(
  183. 'name' => 'slider_caption_more_text',
  184. 'title' => __('"More" button text', TEMPLATENAME),
  185. 'default' => __('Read more', TEMPLATENAME),
  186. 'desc' => __('"More" buttons text for slides captions.', TEMPLATENAME)
  187. ));
  188. ap_add_checkbox(array(
  189. 'name' => 'slider_link',
  190. 'title' => __('Use linked slides?', TEMPLATENAME),
  191. 'default' => true,
  192. 'desc' => __('Check this to make slider images linked. (If choosen slider supports this option)', TEMPLATENAME),
  193. ));
  194. /*-------------------- Sliders Options Pages --------------------*/
  195. theme_slider_options();
  196. /*-------------------- Portfolio Page Options --------------------*/
  197. ap_add_section('portfolio', __('Portfolio & Gallery', TEMPLATENAME));
  198. ap_add_select(array(
  199. 'name' => 'portfolio_layout',
  200. 'title' => __('Portfolio page layout', TEMPLATENAME),
  201. 'default' => 'portfolio2',
  202. 'options' => array(
  203. 'portfolio2' => __('1 columns', TEMPLATENAME),
  204. 'portfolio3' => __('2 columns', TEMPLATENAME),
  205. 'portfolio4' => __('3 columns', TEMPLATENAME),
  206. ),
  207. 'desc' => __('Choose layout type for Portfolio Page.', TEMPLATENAME),
  208. ));
  209. ap_add_input(array(
  210. 'name' => 'portfolio_rows',
  211. 'title' => __('Number of lines (portfolio page)', TEMPLATENAME),
  212. 'default' => '4',
  213. 'desc' => __('Only regards for portfolio page', TEMPLATENAME),
  214. 'class' => 'small-text',
  215. ));
  216. ap_add_select(array(
  217. 'name' => 'portfolio_bottom_sidebar',
  218. 'title' => __('Portfolio bottom sidebar', TEMPLATENAME),
  219. 'default' => 'disable',
  220. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  221. 'options_func' => 'get_registered_sidebars',
  222. 'desc' => __('Choose your bottom sidebar for portfolio page.', TEMPLATENAME),
  223. ));
  224. ap_add_input(array(
  225. 'name' => 'portfolio_more_text',
  226. 'title' => __('More button text', TEMPLATENAME),
  227. 'default' => __('Read more', TEMPLATENAME),
  228. 'desc' => __('Leave it blank if you do not want to display this button.', TEMPLATENAME),
  229. ));
  230. ap_add_input(array(
  231. 'name' => 'portfolio_target_text',
  232. 'title' => __('Target button text', TEMPLATENAME),
  233. 'default' => __('Visit website', TEMPLATENAME),
  234. ));
  235. ap_add_checkbox(array(
  236. 'name' => 'portfolio_show_date',
  237. 'title' => __('Display a meta date information?', TEMPLATENAME),
  238. 'default' => true,
  239. 'desc' => __('Check this to display meta date information for portfolio single page.', TEMPLATENAME),
  240. ));
  241. ap_add_checkbox(array(
  242. 'name' => 'portfolio_show_clients',
  243. 'title' => __('Display a clients meta information?', TEMPLATENAME),
  244. 'default' => true,
  245. 'desc' => __('Check this to display a post clients for portfolio single page.', TEMPLATENAME),
  246. ));
  247. ap_add_checkbox(array(
  248. 'name' => 'portfolio_show_division',
  249. 'title' => __('Display a divisions meta information?', TEMPLATENAME),
  250. 'default' => true,
  251. 'desc' => __('Check this to display a post divisions for portfolio single page.', TEMPLATENAME),
  252. ));
  253. ap_add_checkbox(array(
  254. 'name' => 'portfolio_show_comments',
  255. 'title' => __('Enable comments?', TEMPLATENAME),
  256. 'default' => true,
  257. 'desc' => __('Check this to enable a post comments for portfolio posts.', TEMPLATENAME),
  258. ));
  259. ap_add_select(array(
  260. 'name' => 'gallery_bottom_sidebar',
  261. 'title' => __('Gallery bottom sidebar', TEMPLATENAME),
  262. 'default' => 'disable',
  263. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  264. 'options_func' => 'get_registered_sidebars',
  265. 'desc' => __('Choose bottom sidebar for gallery pages.', TEMPLATENAME),
  266. ));
  267. ap_add_input(array(
  268. 'name' => 'gallery_limit',
  269. 'title' => __('Number of thumbnails for gallery page', TEMPLATENAME),
  270. 'default' => '18',
  271. 'desc' => __('Number of thumbtails to be displayed on the gallery page', TEMPLATENAME),
  272. 'class' => 'small-text',
  273. ));
  274. ap_add_select(array(
  275. 'name' => 'lightbox_skin',
  276. 'title' => __('LightBox skin', TEMPLATENAME),
  277. 'default' => 'light_square',
  278. 'options' => array(
  279. 'dark_rounded' => __('Dark Rounded', TEMPLATENAME),
  280. 'dark_square' => __('Dark Square', TEMPLATENAME),
  281. 'facebook' => __('Facebook', TEMPLATENAME),
  282. 'light_rounded' => __('Light Rounded', TEMPLATENAME),
  283. 'light_square' => __('Light Square', TEMPLATENAME),
  284. ),
  285. 'desc' => __('Choose a skin for LightBox.', TEMPLATENAME),
  286. ));
  287. /*-------------------- Blog Options --------------------*/
  288. ap_add_section('blog', __('Blog posts & Pages', TEMPLATENAME));
  289. ap_add_select(array(
  290. 'name' => 'blog_side_sidebar',
  291. 'title' => __('Blog side sidebar', TEMPLATENAME),
  292. 'default' => 'disable',
  293. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  294. 'options_func' => 'get_registered_sidebars',
  295. 'desc' => __('Choose side sidebar for blog pages.', TEMPLATENAME),
  296. ));
  297. ap_add_select(array(
  298. 'name' => 'blog_bottom_sidebar',
  299. 'title' => __('Blog bottom sidebar', TEMPLATENAME),
  300. 'default' => 'disable',
  301. 'options' => array('disable' => __('Disable', TEMPLATENAME)),
  302. 'options_func' => 'get_registered_sidebars',
  303. 'desc' => __('Choose bottom sidebar for blog pages.', TEMPLATENAME),
  304. ));
  305. ap_add_input(array(
  306. 'name' => 'blog_more_text',
  307. 'title' => __('More button text', TEMPLATENAME),
  308. 'default' => __('Read more', TEMPLATENAME),
  309. 'desc' => __('Leave it blank if you do not want to display this button.', TEMPLATENAME),
  310. ));
  311. ap_add_input(array(
  312. 'name' => 'searches_limit',
  313. 'title' => __('Search posts limit', TEMPLATENAME),
  314. 'default' => '10',
  315. 'desc' => __('Type a number of posts to be displayed on search results page', TEMPLATENAME),
  316. 'class' => 'small-text',
  317. ));
  318. global $_theme_layouts;
  319. ap_add_select(array(
  320. 'name' => 'default_blog_layout',
  321. 'title' => __('Default layout for blog', TEMPLATENAME),
  322. 'default' => 1,
  323. 'options' => $_theme_layouts,
  324. 'desc' => __('Select default layout for blog.', TEMPLATENAME),
  325. ));
  326. ap_add_select(array(
  327. 'name' => 'default_pages_layout',
  328. 'title' => __('Default layout for pages', TEMPLATENAME),
  329. 'default' => 3,
  330. 'options' => $_theme_layouts,
  331. 'desc' => __('Select default layout for pages.', TEMPLATENAME),
  332. ));
  333. ap_add_checkbox(array(
  334. 'name' => 'show_about_autor',
  335. 'title' => __('Show about autor box?', TEMPLATENAME),
  336. 'default' => true,
  337. ));
  338. ap_add_select(array(
  339. 'name' => 'page_404',
  340. 'title' => __('Page of error 404', TEMPLATENAME),
  341. 'default' => '',
  342. 'options' => array('default' => __('Embedded 404 page', TEMPLATENAME)) + get_registered_pages(),
  343. 'desc' => __('Select your 404 page.', TEMPLATENAME),
  344. ));
  345. /*-------------------- SEO Options --------------------*/
  346. ap_add_section('google', __('Google Analytics', TEMPLATENAME));
  347. ap_add_checkbox(array(
  348. 'name' => 'ga_use',
  349. 'title' => __('Use Google Analytics', TEMPLATENAME),
  350. 'default' => false,
  351. 'desc' => __('Check this if you want to enable Google Analytics Service', TEMPLATENAME),
  352. ));
  353. ap_add_textarea(array(
  354. 'name' => 'ga_code',
  355. 'title' => __('Google Analytics Code', TEMPLATENAME),
  356. 'default' => "<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'XX-XXXXXXXX-X']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>",
  357. 'desc' => sprintf(__('Paste your %sGoogle Analytics%s code here, it will get applied to each page.', TEMPLATENAME), '<a href="http://www.google.com/analytics/" target="_blank">', '</a>'),
  358. 'class' => 'large-text code',
  359. ));
  360. /*-------------------- Social Options --------------------*/
  361. ap_add_section('social', __('Social', TEMPLATENAME));
  362. global $_theme_social_links;
  363. foreach ($_theme_social_links as $key => $link) {
  364. ap_add_input(array(
  365. 'name' => $key.'_social_link',
  366. 'title' => '<b>'.ucfirst($link).'</b><img src="'.get_bloginfo('template_url')."/images/social/{$key}.png" .'">',
  367. 'default' => '',
  368. 'class' => 'large-text',
  369. ));
  370. }
  371. }
  372. add_action('init', 'theme_options_pages');
  373. function get_registered_pages() {
  374. $pages = get_pages();
  375. $out = array();
  376. foreach ($pages as $page)
  377. $out[$page->ID] = $page->post_title;
  378. return $out;
  379. }
  380. ?>