PageRenderTime 54ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/ifeature/cyberchimps/options/options-init.php

https://github.com/Bochet/festival_lgbt
PHP | 1078 lines | 783 code | 162 blank | 133 comment | 140 complexity | d8fac04ffc0f5c5ae2e2aad6b570b74f MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * Title: Option initializer
  4. *
  5. * Description: Initializes theme option. Adds all required files for it.
  6. *
  7. * Please do not edit this file. This file is part of the Cyber Chimps Framework and all modifications
  8. * should be made in a child theme.
  9. *
  10. * @category Cyber Chimps Framework
  11. * @package Framework
  12. * @since 1.0
  13. * @author CyberChimps
  14. * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
  15. * @link http://www.cyberchimps.com/
  16. */
  17. /* If the user can't edit theme options, no use running this plugin */
  18. add_action('init', 'cyberchimps_edit_themes_role_check' );
  19. function cyberchimps_edit_themes_role_check() {
  20. if ( current_user_can( 'edit_theme_options' ) ) {
  21. // If the user can edit theme options, let the fun begin!
  22. add_action( 'admin_init', 'cyberchimps_admin_init' );
  23. add_action( 'admin_init', 'cyberchimps_mlu_init' );
  24. add_action( 'admin_menu', 'cyberchimps_admin_add_page');
  25. add_action( 'wp_before_admin_bar_render', 'cyberchimps_admin_bar' );
  26. }
  27. }
  28. // create the admin menu for the theme options page
  29. function cyberchimps_admin_add_page() {
  30. $cyberchimps_page = add_theme_page(
  31. __('Theme Options Page', 'cyberchimps'),
  32. __('Theme Options', 'cyberchimps'),
  33. 'edit_theme_options',
  34. 'cyberchimps-theme-options',
  35. 'cyberchimps_options_page'
  36. );
  37. add_action( "admin_print_styles-$cyberchimps_page", 'cyberchimps_load_styles');
  38. add_action( "admin_print_scripts-$cyberchimps_page", 'cyberchimps_load_scripts');
  39. }
  40. function cyberchimps_load_styles() {
  41. // Set template directory uri
  42. $directory_uri = get_template_directory_uri();
  43. wp_enqueue_style( 'bootstrap', $directory_uri . '/cyberchimps/lib/bootstrap/css/bootstrap.css' );
  44. wp_enqueue_style( 'bootstrap-responsive', $directory_uri . '/cyberchimps/lib/bootstrap/css/bootstrap-responsive.css', 'bootstrap' );
  45. wp_enqueue_style( 'cyberchimps-responsive', $directory_uri . '/cyberchimps/lib/bootstrap/css/cyberchimps-responsive.css', array( 'bootstrap', 'bootstrap-responsive' ) );
  46. wp_enqueue_style( 'plugin_option_styles', $directory_uri . '/cyberchimps/options/lib/css/options-style.css', array( 'bootstrap', 'bootstrap-responsive' ) );
  47. wp_enqueue_style('color-picker', $directory_uri . '/cyberchimps/options/lib/css/colorpicker.css');
  48. wp_enqueue_style('thickbox');
  49. }
  50. function cyberchimps_load_scripts() {
  51. // Set template directory uri
  52. $directory_uri = get_template_directory_uri();
  53. // Enqueued scripts
  54. wp_enqueue_script('jquery-ui-core');
  55. wp_enqueue_script('jquery-ui-sortable');
  56. // Adding JS to support drag and drop in theme options
  57. wp_enqueue_script('jquery-touch-punch-min', $directory_uri . '/cyberchimps/lib/js/touch-punch-min.js', array('jquery') );
  58. wp_enqueue_script('jquery-touch-sense', $directory_uri . '/cyberchimps/lib/js/touch-sensitive.js', array('jquery') );
  59. wp_enqueue_script('thickbox');
  60. wp_enqueue_script('color-picker', $directory_uri . '/cyberchimps/options/lib/js/colorpicker.js', array('jquery'));
  61. wp_enqueue_script('media-uploader', $directory_uri . '/cyberchimps/options/lib/js/options-medialibrary-uploader.js', array('jquery'));
  62. wp_enqueue_script('options-custom', $directory_uri . '/cyberchimps/options/lib/js/options-custom.js', array('jquery'));
  63. wp_enqueue_script('bootstrap-js', $directory_uri . '/cyberchimps/lib/bootstrap/js/bootstrap.min.js', array('jquery'));
  64. wp_enqueue_script('google-fonts', $directory_uri . '/cyberchimps/options/lib/js/font_inline_plugin.js', array('jquery'));
  65. }
  66. // Load options customizer file
  67. add_action('init', 'cyberchimps_load_customizer' );
  68. function cyberchimps_load_customizer() {
  69. require_once dirname( __FILE__ ) . '/options-customizer.php';
  70. }
  71. // add core and theme settings to options page
  72. add_action('admin_init', 'cyberchimps_admin_init');
  73. function cyberchimps_admin_init(){
  74. // Load options media uploader
  75. require_once dirname( __FILE__ ) . '/options-medialibrary-uploader.php';
  76. // register theme options settings
  77. register_setting( 'cyberchimps_options', 'cyberchimps_options', 'cyberchimps_options_validate' );
  78. // add all core settings
  79. // Create sections
  80. $sections_list = cyberchimps_get_sections();
  81. cyberchimps_create_sections( $sections_list );
  82. // Create fields
  83. $fields_list = cyberchimps_get_fields();
  84. cyberchimps_create_fields( $fields_list );
  85. }
  86. // create and display theme options page
  87. function cyberchimps_options_page() {
  88. settings_errors();
  89. ?>
  90. <div class="wrap">
  91. <?php do_action( 'cyberchimps_options_before_container' ); ?>
  92. <div class="container-fluid cc-options">
  93. <form action="options.php" method="post" id="cyberchimps_options_page">
  94. <?php
  95. settings_fields('cyberchimps_options');
  96. $headings_list = cyberchimps_get_headings();
  97. $sections_list = cyberchimps_get_sections();
  98. do_action( 'cyberchimps_options_form_start' )
  99. ?>
  100. <!-- header -->
  101. <div class="row-fluid cc-header">
  102. <div class="span4">
  103. <div class="cc-title">
  104. <div class="icon32" id="icon-tools"> <br /> </div>
  105. <h2><?php printf( '%1s ' . __( 'Options', 'cyberchimps' ), apply_filters( 'cyberchimps_current_theme_name', 'CyberChimps' ) ); ?></h2>
  106. </div><!-- cc-title -->
  107. </div><!-- span4 -->
  108. <div class="span8">
  109. <ul class="cc-header-links">
  110. <li><a href="<?php echo apply_filters( 'cyberchimps_support_forum', 'http://cyberchimps.com/support/' ); ?>" target="_blank"><?php _e( 'Support', 'cyberchimps' ); ?></a></li>
  111. <li><a href="<?php echo apply_filters( 'cyberchimps_documentation', 'http://cyberchimps.com/docs/' ); ?>" target="_blank"><?php _e( 'Instructions', 'cyberchimps' ); ?></a></li>
  112. <li><a href="<?php echo apply_filters('cyberchimps_options_buy_link', 'http://cyberchimps.com/store/' ); ?>" target="_blank"><?php _e( 'Buy Themes', 'cyberchimps' ); ?></a></li>
  113. <?php if( has_filter( 'cyberchimps_upgrade_pro_title', 'cyberchimps_upgrade_bar_pro_title' ) ): ?>
  114. <li><a href="<?php echo apply_filters('cyberchimps_upgrade_link', '' ); ?>" target="_blank"><?php echo apply_filters( 'cyberchimps_upgrade_pro_title', '' ); ?></a></li>
  115. <?php endif; ?>
  116. </ul>
  117. </div><!-- span8 -->
  118. </div><!-- row-fluid -->
  119. <!-- end header -->
  120. <!-- start sub menu -->
  121. <div class="row-fluid">
  122. <div class="span12">
  123. <div class="cc-submenu">
  124. <div class="cc-collapse">
  125. <!-- mobile menu button -->
  126. <div class="cc-mobile-menu">
  127. <a class="btn" data-toggle="modal" href="#cc-mobile-modal" >
  128. <i class="icon-th-list"></i>
  129. </a>
  130. </div><!-- cc-mobil-menu -->
  131. <div class="cc-social-container-subheader hidden-phone">
  132. <div class="cc-social twitter">
  133. <a href="https://twitter.com/cyberchimps" class="twitter-follow-button" data-show-count="false" data-size="small">Follow @cyberchimps</a>
  134. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  135. </div><!-- cc-scoial -->
  136. <div class="cc-social facebook">
  137. <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcyberchimps.com%2F&amp;send=false&amp;layout=button_count&amp;width=200&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:21px;" allowTransparency="true"></iframe>
  138. </div><!-- cc-scoial -->
  139. </div><!-- cc-social-container -->
  140. <!--
  141. <div class="btn-group">
  142. <button class="btn" id="open-all-tabs"><?php _e('Open All', 'cyberchimps'); ?></button>
  143. <button class="btn" id="close-all-tabs"><?php _e('Collapse All', 'cyberchimps'); ?></button>
  144. </div>
  145. -->
  146. </div><!-- cc-collapse -->
  147. <div class="cc-submenu-links">
  148. <input type="submit" class="reset-button btn" name="reset" value="<?php esc_attr_e( 'Restore Defaults', 'cyberchimps' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!', 'cyberchimps' ) ); ?>' );" />
  149. <input type="submit" id="cyberchimps_options_submit" class="btn btn-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'cyberchimps' ); ?>" />
  150. </div><!-- cc-submenu-links -->
  151. <div class="clear"></div>
  152. </div><!-- cc-submenu -->
  153. <!-- hidden mobile menu -->
  154. <div class="modal hide" id="cc-mobile-modal">
  155. <div class="modal-header">
  156. <button type="button" class="close" data-dismiss="modal">&#215;</button>
  157. <div class="cc-mobile-title"></div>
  158. <h3>Navigation</h3>
  159. </div>
  160. <div class="modal-body">
  161. <ul class="cc-parent nav-tab-wrapper">
  162. <?php
  163. foreach ( $headings_list as $heading ) {
  164. $jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($heading['id']) );
  165. echo '<li class="cc-has-children">';
  166. echo '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" title="' . esc_attr( $heading['title'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $heading['title'] ) . '</a>';
  167. echo '</li>';
  168. } ?>
  169. </ul>
  170. </div>
  171. <div class="modal-footer">
  172. <a href="#" class="btn" data-dismiss="modal">Close</a>
  173. </div>
  174. </div>
  175. <!-- end mobile menu -->
  176. </div><!-- span12 -->
  177. </div><!-- row fluid -->
  178. <!-- end sub menu -->
  179. <!-- start left menu -->
  180. <div class="row-fluid cc-content">
  181. <div class="span3">
  182. <div class="cc-left-menu">
  183. <ul class="cc-parent nav-tab-wrapper">
  184. <?php
  185. foreach ( $headings_list as $heading ) {
  186. $jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($heading['id']) );
  187. echo '<li class="cc-has-children">';
  188. echo '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" title="' . esc_attr( $heading['title'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $heading['title'] ) . '<i class="icon-chevron-down"></i></a><div class="cc-menu-arrow"><div></div></div>';
  189. echo '<ul class="cc-child">';
  190. foreach( $sections_list as $section ) {
  191. if ( in_array( $heading['id'], $section) ) {
  192. $jquery_click_section_hook = '';
  193. $jquery_click_section_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($section['id']) );
  194. echo '<li><a id="'. esc_attr( $jquery_click_section_hook ) . '-tab" title="' . esc_attr( $section['label'] ) . '" href="' . esc_attr( '#'. $jquery_click_section_hook ) . '">' . esc_html( $section['label'] ) . '</a></li>';
  195. }
  196. }
  197. echo '</ul>';
  198. echo '</li>';
  199. } ?>
  200. <li id="left-menu-save">
  201. <input type="submit" id="cyberchimps_options_submit" class="btn btn-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'cyberchimps' ); ?>" />
  202. </li>
  203. </ul>
  204. </div><!-- cc-left-menu -->
  205. </div><!-- span3 -->
  206. <!-- end left menu -->
  207. <!-- start main content -->
  208. <div class="span9">
  209. <div class="cc-main-content">
  210. <?php foreach( $headings_list as $heading ) {
  211. $jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($heading['id']) );
  212. echo '<div class="group cc-content-section" id="' . esc_attr( $jquery_click_hook ) . '">';
  213. echo '<h2>' . esc_html( $heading['title'] ) . '</h2>';
  214. if ( isset( $heading['description'] ) ) {
  215. echo '<p>' . esc_html( $heading['description'] ) . '</p>';
  216. }
  217. cyberchimps_do_settings_sections( $heading['id'] );
  218. echo '</div>';
  219. } ?>
  220. </div><!-- cc-main-content -->
  221. </div><!-- span9 -->
  222. </div><!-- row fluid -->
  223. <!-- end main content -->
  224. <!-- start footer -->
  225. <div class="row-fluid">
  226. <div class="cc-footer">
  227. <div class="span3">
  228. <div class="cc-logo">
  229. <a href="http://cyberchimps.com" title="<?php esc_attr_e( 'CyberChimps Wordpress Themes', 'cyberchimps' ); ?>"><img src="<?php echo get_template_directory_uri(); ?>/cyberchimps/options/lib/images/options/cc-logo.png" alt="<?php esc_attr_e( 'CyberChimps Wordpress Themes', 'cyberchimps' ); ?>" /></a>
  230. </div><!-- cc-logo -->
  231. </div><!-- span3 -->
  232. <div class="span9">
  233. <div class="cc-social-container">
  234. <div class="cc-social twitter">
  235. <a href="https://twitter.com/cyberchimps" class="twitter-follow-button" data-show-count="false" data-size="small">Follow @cyberchimps</a>
  236. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
  237. </div><!-- cc-scoial -->
  238. <div class="cc-social facebook">
  239. <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcyberchimps.com%2F&amp;send=false&amp;layout=button_count&amp;width=200&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:21px;" allowTransparency="true"></iframe>
  240. </div><!-- cc-scoial -->
  241. </div><!-- cc-social-container -->
  242. <div class="footer-links">
  243. <input type="submit" class="reset-button btn" name="reset" value="<?php esc_attr_e( 'Restore Defaults', 'cyberchimps' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!', 'cyberchimps' ) ); ?>' );" />
  244. <input type="submit" id="cyberchimps_options_submit" class="btn btn-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'cyberchimps' ); ?>" />
  245. </div><!-- footer-links -->
  246. </div><!-- span 9 -->
  247. <div class="clear"></div>
  248. </div><!-- cc-footer -->
  249. </div><!-- row fluid -->
  250. <!-- end footer -->
  251. </form>
  252. </div><!-- container-fluid -->
  253. </div><!-- wrap -->
  254. <?php
  255. }
  256. /**
  257. * forked version of core function do_settings_sections()
  258. * modified core code call cyberchimps_do_settings_fields() and apply markup for section title and description
  259. * returns mixed data
  260. */
  261. function cyberchimps_do_settings_sections( $page ) {
  262. global $wp_settings_sections, $wp_settings_fields;
  263. if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
  264. return;
  265. foreach ( (array) $wp_settings_sections[$page] as $section ) {
  266. $jquery_click_section_hook = '';
  267. $jquery_click_section_hook = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($section['id']) );
  268. echo '<div class="section-group" id="' . esc_attr( $jquery_click_section_hook ) . '">';
  269. if ( $section['title'] ) {
  270. echo "<h3>{$section['title']}<span></span></h3>\n";
  271. }
  272. // wrapper div of all field-container divs
  273. echo '<div class="field-container-wrapper">';
  274. call_user_func($section['callback'], $section);
  275. if ( isset($wp_settings_fields) && isset($wp_settings_fields[$page]) && isset($wp_settings_fields[$page][$section['id']]) ) {
  276. cyberchimps_do_settings_fields($page, $section['id']);
  277. }
  278. echo '</div>'; // .field-container ends
  279. echo '<div class="clear"></div></div>';
  280. }
  281. }
  282. /**
  283. * forked version of core function do_settings_fields()
  284. * modified core code to remove table cell markup and apply custom markup
  285. * returns mixed data
  286. */
  287. function cyberchimps_do_settings_fields($page, $section) {
  288. global $wp_settings_fields;
  289. if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
  290. return;
  291. foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
  292. call_user_func($field['callback'], $field['args']);
  293. }
  294. }
  295. function cyberchimps_get_headings() {
  296. $headings_list = array();
  297. // pull in both default sections and users custom sections
  298. return apply_filters('cyberchimps_heading_list', $headings_list);
  299. }
  300. function cyberchimps_get_sections() {
  301. $sections_list = array();
  302. // pull in both default sections and users custom sections
  303. return apply_filters('cyberchimps_section_list', $sections_list);
  304. }
  305. function cyberchimps_get_fields() {
  306. $fields_list = array();
  307. // pull in both default fields and users custom fields
  308. return apply_filters('cyberchimps_field_list', $fields_list);
  309. }
  310. function cyberchimps_create_sections( $sections ) {
  311. if ( empty($sections) )
  312. return false;
  313. // add in error checking and proper validation, escaping, and translation calls
  314. foreach($sections as $section ) {
  315. if ( cyberchimps_section_exists( $section['heading'], $section['id']) ){
  316. continue;
  317. } else {
  318. add_settings_section(
  319. $section['id'],
  320. $section['label'],
  321. 'cyberchimps_sections_callback',
  322. $section['heading']
  323. );
  324. }
  325. }
  326. }
  327. function cyberchimps_custom_events_callback( $value ) {
  328. $output = '';
  329. $events_installed = false;
  330. if ( $events_installed ) {
  331. $output .= __('Link to Events plugin settings', 'cyberchimps');
  332. } else {
  333. $output .= __('Insert custom events info and insert install link', 'cyberchimps');
  334. }
  335. echo $output;
  336. }
  337. function cyberchimps_drag_drop_field( $value ) {
  338. // Set directory uri
  339. $directory_uri = get_template_directory_uri();
  340. $option_name = 'cyberchimps_options';
  341. $settings = get_option($option_name);
  342. $val = '';
  343. $output = '';
  344. // If the option is already saved, ovveride $val
  345. if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') ) {
  346. if ( isset( $settings[($value['id'])]) ) {
  347. // Assign empty array if the array returns null
  348. if( $settings[($value['id'])] != "" ) {
  349. $val = $settings[($value['id'])];
  350. }
  351. else {
  352. $val = NULL;
  353. }
  354. // Striping slashes of non-array options
  355. if ( !is_array($val) ) {
  356. $val = stripslashes( $val );
  357. }
  358. }
  359. }
  360. // Set default value to $val
  361. if( empty( $val ) ){
  362. if ( isset( $value['std'] ) ) {
  363. if (is_array($value['std'])) {
  364. $val = array_keys( $value['std'] );
  365. } else {
  366. $val = array_keys( explode( $value['std'] ) );
  367. }
  368. }
  369. }
  370. $output .= "<div class='section_order' id=" . esc_attr($value['id']) . ">";
  371. $output .= "<div class='left_list span6'>";
  372. $output .= "<div class='inactive'>Inactive Elements</div>";
  373. $output .= "<div class='list_items'>";
  374. if ( is_array( $val ) ) {
  375. foreach ($value['options'] as $key => $option) {
  376. if ( in_array( $key, $val ) ) continue;
  377. $output .= "<div class='list_item'>";
  378. $output .= '<img src="'. $directory_uri . '/cyberchimps/lib/images/minus.png" class="action" title="Remove"/>';
  379. $output .= "<span data-key='{$key}'>{$option}</span>";
  380. $output .= "</div>";
  381. }
  382. }
  383. $output .= "</div>";
  384. $output .= "</div>";
  385. $output .= '<div class="arrow span1 hidden-phone"><img src="'. $directory_uri . '/cyberchimps/lib/images/arrowdrag.png" /></div>';
  386. $output .= "<div class='right_list span5'>";
  387. $output .= "<div class='active'>Active Elements</div>";
  388. $output .= "<div class='drag'>Drag & Drop Elements</div>";
  389. $output .= "<div class='list_items'>";
  390. if ( is_array( $val ) ) {
  391. foreach ($val as $key) {
  392. if( !array_key_exists( $key, $value['options'] ) ) continue;
  393. $output .= "<div class='list_item'>";
  394. $output .= '<img src="'. $directory_uri . '/cyberchimps/lib/images/minus.png" class="action" title="Remove"/>';
  395. $output .= "<span data-key='{$key}'>{$value['options'][$key]}</span>";
  396. $output .= "</div>";
  397. }
  398. }
  399. $output .= "</div>";
  400. $output .= "<input class='blog-section-order-tracker' type='hidden' name='cyberchimps_options[blog_section_order_tracker]' />";
  401. $output .= "</div>";
  402. $output .= '<div id="values" data-key="'.$option_name.'"></div>';
  403. $output .= '<div class="clear"></div>';
  404. $output .= "</div>";
  405. echo $output;
  406. }
  407. function cyberchimps_sections_callback( $section_passed ) {
  408. $sections = cyberchimps_get_sections();
  409. if ( empty($sections) && empty($section_passed ) )
  410. return false;
  411. foreach ( $sections as $section ) {
  412. if ( $section_passed['id'] == $section['id'] ) {
  413. echo '<p>';
  414. if( isset( $section['description'] ) ) {
  415. echo $section['description'];
  416. }
  417. echo '</p>';
  418. }
  419. }
  420. }
  421. /**
  422. * custom function that checks if the section has been run through add_settings_section() function
  423. * returns bool value true if section exists and false if it does not
  424. */
  425. function cyberchimps_section_exists( $heading, $section ) {
  426. global $wp_settings_sections;
  427. if ( isset( $wp_settings_sections[$heading][$section] ) ) {
  428. return true;
  429. }
  430. return false;
  431. }
  432. function cyberchimps_create_fields( $fields ) {
  433. if ( empty($fields) )
  434. return false;
  435. // loop through and create each field
  436. foreach ($fields as $field_args) {
  437. $field_defaults = array(
  438. 'id' => false,
  439. 'name' => __('Default Field', 'cyberchimps'),
  440. 'callback' => 'cyberchimps_fields_callback',
  441. 'section' => 'cyberchimps_default_section',
  442. 'heading' => 'cyberchimps_default_heading',
  443. );
  444. $field_args = wp_parse_args( $field_args, $field_defaults );
  445. if ( empty($field_args['id']) ) {
  446. continue;
  447. } elseif ( !cyberchimps_section_exists( $field_args['heading'], $field_args['section']) ){
  448. continue;
  449. } else {
  450. add_settings_field(
  451. $field_args['id'],
  452. $field_args['name'],
  453. $field_args['callback'],
  454. $field_args['heading'],
  455. $field_args['section'],
  456. $field_args
  457. );
  458. }
  459. }
  460. }
  461. function cyberchimps_fields_callback( $value ) {
  462. global $allowedtags;
  463. $option_name = 'cyberchimps_options';
  464. $settings = get_option($option_name);
  465. $val = '';
  466. $select_value = '';
  467. $checked = '';
  468. $output = '';
  469. // Set default value to $val
  470. if ( isset( $value['std'] ) ) {
  471. $val = $value['std'];
  472. }
  473. // If the option is already saved, ovveride $val
  474. if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') ) {
  475. if ( isset( $settings[($value['id'])]) ) {
  476. $val = $settings[($value['id'])];
  477. // Striping slashes of non-array options
  478. if ( !is_array($val) ) {
  479. $val = stripslashes( $val );
  480. }
  481. }
  482. }
  483. // If there is no class set make it blank
  484. if( !isset( $value['class'] ) ) {
  485. $value['class'] = '';
  486. }
  487. // If there is a description save it for labels
  488. $explain_value = '';
  489. if ( isset( $value['desc'] ) ) {
  490. $explain_value = $value['desc'];
  491. }
  492. // field wrapper
  493. $output .= '<div class="field-container">';
  494. // Output field name
  495. if ($value['name'] && $value['type'] != 'info' && $value['type'] != 'welcome' && $value['type'] != 'toggle' ) {
  496. $output .= '<label for="' . esc_attr( $value['id'] ) . '">'. $value['name'] . '</label>';
  497. }
  498. switch ( $value['type'] ) {
  499. // Basic text input
  500. case 'text':
  501. $output .= '<input id="' . esc_attr( $value['id'] ) . '" class="of-input ' . esc_attr( $value['class'] ) . '" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" type="text" value="' . esc_attr( $val ) . '" />';
  502. break;
  503. // Textarea
  504. case 'textarea':
  505. $rows = '8';
  506. if ( isset( $value['settings']['rows'] ) ) {
  507. $custom_rows = $value['settings']['rows'];
  508. if ( is_numeric( $custom_rows ) ) {
  509. $rows = $custom_rows;
  510. }
  511. }
  512. $val = stripslashes( $val );
  513. $output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" rows="' . $rows . '">' . esc_textarea( $val ) . '</textarea>';
  514. break;
  515. // Unfiltered Textarea
  516. case 'unfiltered_textarea':
  517. $rows = '8';
  518. if ( isset( $value['settings']['rows'] ) ) {
  519. $custom_rows = $value['settings']['rows'];
  520. if ( is_numeric( $custom_rows ) ) {
  521. $rows = $custom_rows;
  522. }
  523. }
  524. $val = stripslashes( $val );
  525. $output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" rows="' . $rows . '">' . esc_textarea( $val ) . '</textarea>';
  526. break;
  527. // css Textarea
  528. case 'csstextarea':
  529. $rows = '8';
  530. if ( isset( $value['settings']['rows'] ) ) {
  531. $custom_rows = $value['settings']['rows'];
  532. if ( is_numeric( $custom_rows ) ) {
  533. $rows = $custom_rows;
  534. }
  535. }
  536. $val = stripslashes( $val );
  537. $output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" rows="' . $rows . '">' . strip_tags( $val ) . '</textarea>';
  538. $output .= '<div id="custom-css-msg"></div>';
  539. break;
  540. // Select Box
  541. case 'select':
  542. $output .= '<select class="of-input ' . esc_attr( $value['class'] ) . '" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '">';
  543. foreach ($value['options'] as $key => $option ) {
  544. $selected = '';
  545. if ( $val != '' ) {
  546. $selected = selected( $val, $key, false);
  547. }
  548. $output .= '<option value="' . esc_attr( $key ) . '" '.$selected.'>' . esc_html( $option ) . '</option>';
  549. }
  550. $output .= '</select>';
  551. break;
  552. // Radio Box
  553. case "radio":
  554. $name = $option_name .'['. $value['id'] .']';
  555. $val = ( $val != '' ) ? $val : $value['std'];
  556. foreach ($value['options'] as $key => $option) {
  557. $id = $option_name . '-' . $value['id'] .'-'. $key;
  558. $output .= '<div class="radio-container ' . esc_attr( $value['class'] ) . '"><input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '" class="of-radio">' . esc_html( $option ) . '</label></div>';
  559. }
  560. break;
  561. // Image Selectors
  562. case "images":
  563. $name = $option_name .'['. $value['id'] .']';
  564. $output .= '<div class="images-radio-container">';
  565. foreach ( $value['options'] as $key => $option ) {
  566. $selected = '';
  567. $checked = '';
  568. if ( $val != '' ) {
  569. if ( $val == $key ) {
  570. $selected = ' of-radio-img-selected';
  571. $checked = ' checked="checked"';
  572. }
  573. }
  574. $output .= '<div class="images-radio-subcontainer"><input type="radio" id="' . esc_attr( $value['id'] .'_'. $key) . '" class="of-radio-img-radio" value="' . esc_attr( $key ) . '" name="' . esc_attr( $name ) . '" '. $checked .' />';
  575. $output .= '<div class="of-radio-img-label">' . esc_html( $key ) . '</div>';
  576. $output .= '<img src="' . esc_url( $option ) . '" alt="' . $option .'" class="of-radio-img-img' . $selected .'" onclick="document.getElementById(\''. esc_attr($value['id'] .'_'. $key) .'\').checked=true;" /></div>';
  577. }
  578. $output .= '</div>';
  579. break;
  580. // Checkbox
  581. case "checkbox":
  582. $output .= '<div class="checkbox-container"><input id="' . esc_attr( $value['id'] ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" '. checked( $val, 1, false) .' />';
  583. $output .= '<label class="right-label" for="' . esc_attr( $value['id'] ) . '">' . wp_kses( $explain_value, $allowedtags) . '</label></div>';
  584. break;
  585. // Multicheck
  586. case "multicheck":
  587. foreach ($value['options'] as $key => $option) {
  588. $checked = '';
  589. $label = $option;
  590. $option = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($key));
  591. $id = $option_name . '-' . $value['id'] . '-'. $option;
  592. $name = $option_name . '[' . $value['id'] . '][' . $option .']';
  593. if ( isset($val[$option]) ) {
  594. $checked = checked($val[$option], 1, false);
  595. }
  596. $output .= '<div class="checkbox-container"><input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '" class="right-label">' . esc_html( $label ) . '</label></div>';
  597. }
  598. break;
  599. // Toggle Switch
  600. case "toggle":
  601. $checked = "";
  602. if( $val )
  603. $checked = 'checked="checked"';
  604. $output .= '<div class="toggle-container" id="' . esc_attr( $value['id'] ) . '_container"><label for="' . esc_attr( $value['id'] ) . '">'. $value['name'] . '</label><input id="' . esc_attr( $value['id'] ) . '"' . $checked . 'class="checkbox-toggle of-input" type="checkbox" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" '. checked( $val, 1, false) .' /></div>';
  605. break;
  606. // Color picker
  607. case "color":
  608. $output .= '<div class="input-prepend '.$value['class'].'"><div id="' . esc_attr( $value['id'] . '_picker' ) . '" class="add-on colorSelector"><div style="' . esc_attr( 'background-color:' . $val ) . '"></div></div>';
  609. $output .= '<input class="of-color" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '" type="text" value="' . esc_attr( $val ) . '" /></div>';
  610. break;
  611. // Uploader
  612. case "upload":
  613. $output .= cyberchimps_medialibrary_uploader( $value['class'], $value['id'], $val, null, $explain_value );
  614. break;
  615. // Typography
  616. case 'typography':
  617. unset( $font_size, $font_style, $font_face, $font_color );
  618. $typography_defaults = array(
  619. 'size' => '',
  620. 'face' => '',
  621. 'style' => '',
  622. 'color' => ''
  623. );
  624. $typography_stored = wp_parse_args( $val, $typography_defaults );
  625. $typography_options = array(
  626. 'sizes' => cyberchimps_recognized_font_sizes(),
  627. 'faces' => cyberchimps_recognized_font_faces(),
  628. 'styles' => cyberchimps_recognized_font_styles(),
  629. 'color' => true
  630. );
  631. if ( isset( $value['options'] ) ) {
  632. $typography_options = wp_parse_args( $value['options'], $typography_options );
  633. }
  634. // Font Size
  635. if ( $typography_options['sizes'] ) {
  636. $font_size = '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
  637. $sizes = $typography_options['sizes'];
  638. foreach ( $sizes as $i ) {
  639. $size = $i . 'px';
  640. $font_size .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
  641. }
  642. $font_size .= '</select>';
  643. }
  644. // Font Face
  645. if ( $typography_options['faces'] ) {
  646. $font_face = '<select class="of-typography of-typography-face" name="' . esc_attr( $option_name . '[' . $value['id'] . '][face]' ) . '" id="' . esc_attr( $value['id'] . '_face' ) . '">';
  647. $faces = $typography_options['faces'];
  648. foreach ( $faces as $key => $face ) {
  649. $font_face .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['face'], $key, false ) . '>' . esc_html( $face ) . '</option>';
  650. }
  651. $font_face .= '</select>';
  652. }
  653. // Font Styles
  654. if ( $typography_options['styles'] ) {
  655. $font_style = '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
  656. $styles = $typography_options['styles'];
  657. foreach ( $styles as $key => $style ) {
  658. $font_style .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
  659. }
  660. $font_style .= '</select>';
  661. }
  662. // Font Color
  663. if ( $typography_options['color'] ) {
  664. $font_color = '<div class="input-prepend of-typography"><div id="' . esc_attr( $value['id'] ) . '_color_picker" class="add-on colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
  665. $font_color .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" /></div>';
  666. }
  667. // Allow modification/injection of typography fields
  668. $typography_fields = compact( 'font_size', 'font_face', 'font_style', 'font_color' );
  669. $typography_fields = apply_filters( 'cyberchimps_typography_fields', $typography_fields, $typography_stored, $option_name, $value );
  670. $output .= implode( '', $typography_fields );
  671. break;
  672. // Background
  673. case 'background':
  674. $background = $val;
  675. // Background Color
  676. $output .= '<div class="input-prepend"><div id="' . esc_attr( $value['id'] ) . '_color_picker" class="add-on colorSelector"><div style="' . esc_attr( 'background-color:' . $background['color'] ) . '"></div></div>';
  677. $output .= '<input class="of-color of-background of-background-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $background['color'] ) . '" /></div>';
  678. // Background Image - New AJAX Uploader using Media Library
  679. if (!isset($background['image'])) {
  680. $background['image'] = '';
  681. }
  682. $output .= cyberchimps_medialibrary_uploader( $value['class'], $value['id'], $background['image'], null, '',0,'image');
  683. $class = 'of-background-properties';
  684. if ( '' == $background['image'] ) {
  685. $class .= ' hide';
  686. }
  687. $output .= '<div class="' . esc_attr( $class ) . '">';
  688. // Background Repeat
  689. $output .= '<select class="of-background of-background-repeat" name="' . esc_attr( $option_name . '[' . $value['id'] . '][repeat]' ) . '" id="' . esc_attr( $value['id'] . '_repeat' ) . '">';
  690. $repeats = cyberchimps_recognized_background_repeat();
  691. foreach ($repeats as $key => $repeat) {
  692. $output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['repeat'], $key, false ) . '>'. esc_html( $repeat ) . '</option>';
  693. }
  694. $output .= '</select>';
  695. // Background Position
  696. $output .= '<select class="of-background of-background-position" name="' . esc_attr( $option_name . '[' . $value['id'] . '][position]' ) . '" id="' . esc_attr( $value['id'] . '_position' ) . '">';
  697. $positions = cyberchimps_recognized_background_position();
  698. foreach ($positions as $key=>$position) {
  699. $output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['position'], $key, false ) . '>'. esc_html( $position ) . '</option>';
  700. }
  701. $output .= '</select>';
  702. // Background Attachment
  703. $output .= '<select class="of-background of-background-attachment" name="' . esc_attr( $option_name . '[' . $value['id'] . '][attachment]' ) . '" id="' . esc_attr( $value['id'] . '_attachment' ) . '">';
  704. $attachments = cyberchimps_recognized_background_attachment();
  705. foreach ($attachments as $key => $attachment) {
  706. $output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $background['attachment'], $key, false ) . '>' . esc_html( $attachment ) . '</option>';
  707. }
  708. $output .= '</select>';
  709. $output .= '</div>';
  710. break;
  711. // Editor
  712. case 'editor':
  713. $output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
  714. echo $output;
  715. $textarea_name = esc_attr( $option_name . '[' . $value['id'] . ']' );
  716. $default_editor_settings = array(
  717. 'textarea_name' => $textarea_name,
  718. 'media_buttons' => false,
  719. 'tinymce' => array( 'plugins' => 'wordpress' )
  720. );
  721. $editor_settings = array();
  722. if ( isset( $value['settings'] ) ) {
  723. $editor_settings = $value['settings'];
  724. }
  725. $editor_settings = array_merge($editor_settings, $default_editor_settings);
  726. wp_editor( $val, $value['id'], $editor_settings );
  727. $output = '';
  728. break;
  729. // Info
  730. case "info":
  731. $id = '';
  732. $class = 'section';
  733. if ( isset( $value['id'] ) ) {
  734. $id = 'id="' . esc_attr( $value['id'] ) . '" ';
  735. }
  736. if ( isset( $value['type'] ) ) {
  737. $class .= ' section-' . $value['type'];
  738. }
  739. if ( isset( $value['class'] ) ) {
  740. $class .= ' ' . $value['class'];
  741. }
  742. $output .= '<div ' . $id . 'class="' . esc_attr( $class ) . '">' . "\n";
  743. if ( isset($value['name']) ) {
  744. $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
  745. }
  746. if ( $value['desc'] ) {
  747. $output .= apply_filters('cyberchimps_sanitize_info', $value['desc'] ) . "\n";
  748. }
  749. $output .= '</div>' . "\n";
  750. break;
  751. // Welcome
  752. case "welcome":
  753. $id = '';
  754. $class = 'section';
  755. if ( isset( $value['id'] ) ) {
  756. $id = 'id="' . esc_attr( $value['id'] ) . '" ';
  757. }
  758. if ( isset( $value['type'] ) ) {
  759. $class .= ' section-' . $value['type'];
  760. }
  761. if ( isset( $value['class'] ) ) {
  762. $class .= ' ' . $value['class'];
  763. }
  764. $output .= '<div ' . $id . 'class="' . esc_attr( $class ) . '">' . "\n";
  765. if ( isset($value['name']) ) {
  766. $output .= '<h4 class="heading">' . esc_html( apply_filters('cyberchimps_help_sub_heading', $value['name']) ) . '</h4>' . "\n";
  767. }
  768. $output .= apply_filters('cyberchimps_sanitize_info', apply_filters( 'cyberchimps_help_description', '' ) ) . "\n";
  769. $output .= '</div>' . "\n";
  770. break;
  771. case "export":
  772. $output .= "<textarea rows='10'>" . esc_html(serialize($settings)) . "</textarea>";
  773. break;
  774. case "import":
  775. $output .= "<textarea name='import' rows='10'></textarea>";
  776. break;
  777. }
  778. if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) && ( $value['type'] != "welcome" ) && ( $value['type'] != "upload" ) ) {
  779. if ( ( $value['type'] != "checkbox" ) && ( $value['type'] != "editor" ) ) {
  780. $output .= '<div class="desc">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
  781. }
  782. }
  783. // end field wrapper
  784. $output .= '</div>';
  785. echo $output;
  786. }
  787. /**
  788. * Validate options
  789. *
  790. * Validate theme options before updating to database.
  791. */
  792. function cyberchimps_options_validate( $input ) {
  793. // Theme option import functionality
  794. if( isset( $_POST['import' ] ) ) {
  795. if( trim( $_POST['import' ] ) ) {
  796. $string = stripslashes( trim( $_POST['import'] ) );
  797. $try = unserialize( $string );
  798. if($try) {
  799. add_settings_error( 'cyberchimps_options', 'imported_success', __( 'Options Imported', 'cyberchimps' ), 'updated fade' );
  800. return $try;
  801. } else {
  802. add_settings_error( 'cyberchimps_options', 'imported_failed', __( 'Invalid Data for Import', 'cyberchimps' ), 'error fade' );
  803. }
  804. }
  805. }
  806. /*
  807. * Restore Defaults.
  808. *
  809. * In the event that the user clicked the "Restore Defaults"
  810. * button, the options defined in the theme's options.php
  811. * file will be added to the option for the active theme.
  812. */
  813. if ( isset( $_POST['reset'] ) ) {
  814. add_settings_error( 'cyberchimps_options', 'restore_defaults', __( 'Default options restored.', 'cyberchimps' ), 'updated fade' );
  815. return cyberchimps_get_default_values();
  816. }
  817. /*
  818. * Update Settings
  819. *
  820. * This used to check for $_POST['update'], but has been updated
  821. * to be compatible with the theme customizer introduced in WordPress 3.4
  822. */
  823. else {
  824. $clean = array();
  825. $options = cyberchimps_get_fields();
  826. foreach ( $options as $option ) {
  827. if ( ! isset( $option['id'] ) ) {
  828. continue;
  829. }
  830. if ( ! isset( $option['type'] ) ) {
  831. continue;
  832. }
  833. $id = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower( $option['id'] ) );
  834. // Set upload to false if it wasn't sent in the $_POST
  835. if ( 'info' == $option['type'] && ! isset( $input[$id] ) ) {
  836. $input[$id] = false;
  837. }
  838. // Set upload to false if it wasn't sent in the $_POST
  839. if ( 'upload' == $option['type'] && ! isset( $input[$id] ) ) {
  840. $input[$id] = false;
  841. }
  842. // Set radio to false if it wasn't sent in the $_POST
  843. if ( 'radio' == $option['type'] && ! isset( $input[$id] ) ) {
  844. $input[$id] = false;
  845. }
  846. // Set toggle to false if it wasn't sent in the $_POST
  847. if ( 'toggle' == $option['type'] && ! isset( $input[$id] ) ) {
  848. $input[$id] = false;
  849. }
  850. // Set checkbox to false if it wasn't sent in the $_POST
  851. if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
  852. $input[$id] = false;
  853. }
  854. // Set checkbox to false if it wasn't sent in the $_POST
  855. if ( 'images' == $option['type'] && ! isset( $input[$id] ) ) {
  856. $input[$id] = false;
  857. }
  858. // Set each item in the multicheck to false if it wasn't sent in the $_POST
  859. if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
  860. foreach ( $option['options'] as $key => $value ) {
  861. $input[$id][$key] = false;
  862. }
  863. }
  864. // For a value to be submitted to database it must pass through a sanitization filter
  865. if ( has_filter( 'cyberchimps_sanitize_' . $option['type'] ) ) {
  866. $clean[$id] = apply_filters( 'cyberchimps_sanitize_' . $option['type'], $input[$id], $option );
  867. }
  868. }
  869. add_settings_error( 'cyberchimps_options', 'save_options', __( 'Options saved.', 'cyberchimps' ), 'updated fade' );
  870. return $clean;
  871. }
  872. }
  873. /**
  874. * Format Configuration Array.
  875. *
  876. * Get an array of all default values as set in
  877. * options.php. The 'id','std' and 'type' keys need
  878. * to be defined in the configuration array. In the
  879. * event that these keys are not present the option
  880. * will not be included in this function's output.
  881. *
  882. * @return array Rey-keyed options configuration array.
  883. *
  884. * @access private
  885. */
  886. function cyberchimps_get_default_values() {
  887. $output = array();
  888. $config = cyberchimps_get_fields();
  889. foreach ( (array) $config as $option ) {
  890. if ( ! isset( $option['id'] ) ) {
  891. continue;
  892. }
  893. if ( ! isset( $option['std'] ) ) {
  894. continue;
  895. }
  896. if ( ! isset( $option['type'] ) ) {
  897. continue;
  898. }
  899. if ( has_filter( 'cyberchimps_sanitize_' . $option['type'] ) ) {
  900. $output[$option['id']] = apply_filters( 'cyberchimps_sanitize_' . $option['type'], $option['std'], $option );
  901. }
  902. }
  903. return $output;
  904. }
  905. /**
  906. * Add Theme Options menu item to Admin Bar.
  907. */
  908. function cyberchimps_admin_bar() {
  909. global $wp_admin_bar;
  910. $wp_admin_bar->add_menu( array(
  911. 'parent' => 'appearance',
  912. 'id' => 'cyberchimps_options_page',
  913. 'title' => __( 'Theme Options', 'cyberchimps' ),
  914. 'href' => admin_url( 'themes.php?page=cyberchimps-theme-options' )
  915. ));
  916. }