PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/wp-content/themes/simple-catch/functions/panel/theme_options.php

https://github.com/Bochet/festival_lgbt
PHP | 1225 lines | 991 code | 114 blank | 120 comment | 113 complexity | 422004c632a3f388837df38514600c85 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * Simple Catch Theme Options
  4. *
  5. * @package Catch Themes
  6. * @subpackage Simple_Catch
  7. * @since Simple Catch 1.0
  8. */
  9. add_action( 'admin_init', 'simplecatch_register_settings' );
  10. add_action( 'admin_menu', 'simplecatch_options_menu' );
  11. /**
  12. * Enqueue admin script / style
  13. *
  14. * @uses wp_enqueue_script
  15. * @Calling jquery, jquery-ui-tabs,jquery-cookie, jquery-ui-sortable, jquery-ui-draggable
  16. */
  17. function simplecatch_admin_scripts() {
  18. //jquery-cookie registered in functions.php
  19. wp_enqueue_script( 'simplecatch_admin', get_template_directory_uri().'/functions/panel/admin.js', array( 'jquery', 'jquery-ui-tabs', 'jquery-cookie', 'jquery-ui-sortable', 'jquery-ui-draggable', 'farbtastic' ), '1.0', false );
  20. wp_enqueue_script( 'simplecatch_upload', get_template_directory_uri().'/functions/panel/add_image_scripts.js', array( 'jquery','media-upload','thickbox' ) );
  21. wp_enqueue_script( 'simplecatch_color', get_template_directory_uri().'/functions/panel/color_picker.js', array( 'farbtastic' ) );
  22. wp_enqueue_style( 'simplecatch_admin_style',get_template_directory_uri().'/functions/panel/admin.css', array( 'farbtastic', 'thickbox' ), '1.0', 'screen' );
  23. }
  24. add_action('admin_print_styles-appearance_page_theme_options', 'simplecatch_admin_scripts');
  25. add_action('admin_print_styles-appearance_page_slider_options', 'simplecatch_admin_scripts');
  26. add_action('admin_print_styles-appearance_page_social_options', 'simplecatch_admin_scripts');
  27. add_action('admin_print_styles-appearance_page_webmaster_options', 'simplecatch_admin_scripts');
  28. /*
  29. * Create a function for Theme Options Page
  30. *
  31. * @uses add_menu_page
  32. * @add action admin_menu
  33. */
  34. function simplecatch_options_menu() {
  35. add_theme_page(
  36. __( 'Theme Options', 'simplecatch' ), // Name of page
  37. __( 'Theme Options', 'simplecatch' ), // Label in menu
  38. 'edit_theme_options', // Capability required
  39. 'theme_options', // Menu slug, used to uniquely identify the page
  40. 'simplecatch_theme_options_do_page' // Function that renders the options page
  41. );
  42. add_theme_page(
  43. __( 'Slider Options', 'simplecatch' ), // Name of page
  44. __( 'Featured Slider', 'simplecatch' ), // Label in menu
  45. 'edit_theme_options', // Capability required
  46. 'slider_options', // Menu slug, used to uniquely identify the page
  47. 'simplecatch_slider_options_do_page' // Function that renders the options page
  48. );
  49. add_theme_page(
  50. __( 'Social Links', 'simplecatch' ), // Name of page
  51. __( 'Social Links', 'simplecatch' ), // Label in menu
  52. 'edit_theme_options', // Capability required
  53. 'social_options', // Menu slug, used to uniquely identify the page
  54. 'simplecatch_social_options_do_page' // Function that renders the options page
  55. );
  56. add_theme_page(
  57. __( 'Webmaster Tools', 'simplecatch' ), // Name of page
  58. __( 'Webmaster Tools', 'simplecatch' ), // Label in menu
  59. 'edit_theme_options', // Capability required
  60. 'webmaster_options', // Menu slug, used to uniquely identify the page
  61. 'simplecatch_webmaster_options_do_page' // Function that renders the options page
  62. );
  63. }
  64. /*
  65. * Admin Social Links
  66. * use facebook and twitter scripts
  67. */
  68. function simplecatch_admin_social() { ?>
  69. <!-- Start Social scripts -->
  70. <div id="fb-root"></div>
  71. <script>(function(d, s, id) {
  72. var js, fjs = d.getElementsByTagName(s)[0];
  73. if (d.getElementById(id)) return;
  74. js = d.createElement(s); js.id = id;
  75. js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=276203972392824";
  76. fjs.parentNode.insertBefore(js, fjs);
  77. }(document, 'script', 'facebook-jssdk'));</script>
  78. <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>
  79. <!-- End Social scripts -->
  80. <?php
  81. }
  82. add_action('adminmenu','simplecatch_admin_social');
  83. /*
  84. * Register options and validation callbacks
  85. *
  86. * @uses register_setting
  87. * @action admin_init
  88. */
  89. function simplecatch_register_settings(){
  90. register_setting( 'simplecatch_options', 'simplecatch_options', 'simplecatch_theme_options_validate' );
  91. }
  92. /*
  93. * Render Simple Catch Theme Options page
  94. *
  95. * @uses settings_fields, get_option, bloginfo
  96. * @Settings Updated
  97. */
  98. function simplecatch_theme_options_do_page() {
  99. ?>
  100. <div id="catchthemes" class="wrap">
  101. <form method="post" action="options.php">
  102. <?php
  103. settings_fields( 'simplecatch_options' );
  104. global $simplecatch_options_settings;
  105. $options = $simplecatch_options_settings;
  106. ?>
  107. <?php screen_icon(); ?> <h2><?php bloginfo( 'name' ); ?> "<?php _e( 'Theme Options', 'simplecatch' ); ?>" <?php _e( 'By', 'simplecatch' ); ?> <a href="<?php echo esc_url( __( 'http://catchthemes.com/', 'simplecatch' ) ); ?>" title="<?php esc_attr_e( 'Catch Themes', 'simplecatch' ); ?>" target="_blank"><?php _e( 'Catch Themes', 'simplecatch' ); ?></a></h2>
  108. <?php
  109. // Function to show the info bar
  110. if ( function_exists( 'simplecatch_infobar' ) ) :
  111. simplecatch_infobar();
  112. endif;
  113. ?>
  114. <?php if( isset( $_GET [ 'settings-updated' ] ) && $_GET[ 'settings-updated' ] == 'true' ): ?>
  115. <div class="updated" id="message">
  116. <p><strong><?php _e( 'Settings saved.', 'simplecatch' );?></strong></p>
  117. </div>
  118. <?php endif; ?>
  119. <div id="simplecatch_ad_tabs">
  120. <ul class="tabNavigation" id="mainNav">
  121. <li><a href="#designsettings"><?php _e( 'Design Settings', 'simplecatch' );?></a></li>
  122. <li><a href="#themesettings"><?php _e( 'Theme Settings', 'simplecatch' );?></a></li>
  123. </ul><!-- .tabsNavigation #mainNav -->
  124. <!-- Option for Design Settings -->
  125. <div id="designsettings">
  126. <div class="option-container">
  127. <h3 class="option-toggle"><a href="#"><?php _e( 'Logo Options', 'simplecatch' ); ?></a></h3>
  128. <div class="option-content inside">
  129. <table class="form-table">
  130. <tbody>
  131. <tr>
  132. <th scope="row"><?php _e( 'Disable Header Logo:', 'simplecatch' ); ?></th>
  133. <input type='hidden' value='0' name='simplecatch_options[remove_header_logo]'>
  134. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[remove_header_logo]" value="1" <?php checked( '1', $options['remove_header_logo'] ); ?> /></td>
  135. </tr>
  136. <tr>
  137. <th scope="row"><?php _e( 'Header logo url:', 'simplecatch' ); ?></th>
  138. <td>
  139. <?php if ( !empty ( $options[ 'featured_logo_header' ] ) ) { ?>
  140. <input class="upload-url" size="65" type="text" name="simplecatch_options[featured_logo_header]" value="<?php echo esc_url ( $options [ 'featured_logo_header' ]); ?>" class="upload" />
  141. <?php } else { ?>
  142. <input size="65" type="text" name="simplecatch_options[featured_logo_header]" value="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="logo" />
  143. <?php } ?>
  144. <input id="st_upload_button" class="st_upload_button button" name="wsl-image-add" type="button" value="<?php esc_attr_e( 'Change Header Logo','simplecatch' ); ?>" />
  145. </td>
  146. </tr>
  147. <tr>
  148. <th scope="row"><?php _e( 'Preview:', 'simplecatch' ); ?></th>
  149. <td>
  150. <?php
  151. if ( !empty( $options[ 'featured_logo_header' ] ) ) {
  152. echo '<img src="'.esc_url( $options[ 'featured_logo_header' ] ).'" alt="logo"/>';
  153. } else {
  154. echo '<img src="'. get_template_directory_uri().'/images/logo.png" alt="logo" />';
  155. }
  156. ?>
  157. </td>
  158. </tr>
  159. <tr>
  160. <th scope="row"><?php _e( 'Disable Site Title:', 'simplecatch' ); ?></th>
  161. <input type='hidden' value='0' name='simplecatch_options[remove_site_title]'>
  162. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[remove_site_title]" value="1" <?php checked( '1', $options['remove_site_title'] ); ?> /></td>
  163. </tr>
  164. <tr>
  165. <th scope="row"><?php _e( 'Disable Site Description:', 'simplecatch' ); ?></th>
  166. <input type='hidden' value='0' name='simplecatch_options[remove_site_description]'>
  167. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[remove_site_description]" value="1" <?php checked( '1', $options['remove_site_description'] ); ?> /></td>
  168. </tr>
  169. <tr>
  170. <th scope="row"><?php _e( 'Disable Footer Logo:', 'simplecatch' ); ?></th>
  171. <input type='hidden' value='0' name='simplecatch_options[remove_footer_logo]'>
  172. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[remove_footer_logo]" value="1" <?php checked( '1', $options['remove_footer_logo'] ); ?> /></td>
  173. </tr>
  174. <tr>
  175. <th scope="row"><?php _e( 'Footer logo url: ', 'simplecatch' ); ?></th>
  176. <td>
  177. <?php if ( !empty ( $options[ 'featured_logo_footer' ] ) ) { ?>
  178. <input class="upload-url" size="65" type="text" name="simplecatch_options[featured_logo_footer]" value="<?php echo esc_url( $options[ 'featured_logo_footer' ] ); ?>" class="upload" />
  179. <?php } else { ?>
  180. <input size="65" type="text" name="simplecatch_options[featured_logo_footer]" value="<?php echo get_template_directory_uri(); ?>/images/logo-foot.png" alt="logo" />
  181. <?php } ?>
  182. <input id="st_upload_button" class="st_upload_button button" name="wsl-image-add" type="button" value="<?php esc_attr_e( 'Change Footer Logo','simplecatch' );?>" />
  183. </td>
  184. </tr>
  185. <tr>
  186. <th scope="row"><?php _e( 'Preview: ', 'simplecatch' ); ?></th>
  187. <td>
  188. <?php
  189. if ( !empty( $options[ 'featured_logo_footer' ] ) ) {
  190. echo '<img src="'.esc_url( $options[ 'featured_logo_footer' ] ).'" alt="logo"/>';
  191. } else {
  192. echo '<img src="'. get_template_directory_uri().'/images/logo-foot.png" alt="logo" />';
  193. }
  194. ?>
  195. </td>
  196. </tr>
  197. </tbody>
  198. </table>
  199. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  200. </div><!-- .option-content -->
  201. </div><!-- .option-container -->
  202. <div class="option-container">
  203. <h3 class="option-toggle"><a href="#"><?php _e( 'Fav Icon Options', 'simplecatch' ); ?></a></h3>
  204. <div class="option-content inside">
  205. <table class="form-table">
  206. <tbody>
  207. <tr>
  208. <th scope="row"><?php _e( 'Disable Favicon:', 'simplecatch' ); ?></th>
  209. <input type='hidden' value='0' name='simplecatch_options[remove_favicon]'>
  210. <td><input type="checkbox" id="favicon" name="simplecatch_options[remove_favicon]" value="1" <?php checked( '1', $options['remove_favicon'] ); ?> /></td>
  211. </tr>
  212. <tr>
  213. <th scope="row"><?php _e( 'Fav Icon URL:', 'simplecatch' ); ?></th>
  214. <td><?php if ( !empty ( $options[ 'fav_icon' ] ) ) { ?>
  215. <input class="upload-url" size="65" type="text" name="simplecatch_options[fav_icon]" value="<?php echo esc_url( $options [ 'fav_icon' ] ); ?>" class="upload" />
  216. <?php } else { ?>
  217. <input size="65" type="text" name="simplecatch_options[fav_icon]" value="<?php echo get_template_directory_uri(); ?>/images/favicon.ico" alt="fav" />
  218. <?php } ?>
  219. <input id="st_upload_button" class="st_upload_button button" name="wsl-image-add" type="button" value="<?php esc_attr_e( 'Change Fav Icon','simplecatch' );?>" />
  220. </td>
  221. </tr>
  222. <tr>
  223. <th scope="row"><?php _e( 'Preview: ', 'simplecatch' ); ?></th>
  224. <td>
  225. <?php
  226. if ( !empty( $options[ 'fav_icon' ] ) ) {
  227. echo '<img src="'.esc_url( $options[ 'fav_icon' ] ).'" alt="fav" />';
  228. } else {
  229. echo '<img src="'. get_template_directory_uri().'/images/favicon.ico" alt="fav" />';
  230. }
  231. ?>
  232. </td>
  233. </tr>
  234. </tbody>
  235. </table>
  236. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  237. </div><!-- .option-content -->
  238. </div><!-- .option-container -->
  239. <div class="option-container">
  240. <h3 class="option-toggle"><a href="#"><?php _e( 'Content Background', 'simplecatch' ); ?></a></h3>
  241. <div class="option-content inside">
  242. <p><?php printf(__('Need to replace default background?','simplecatch')); ?> <?php printf(__('<a class="button" href="%s">Click here</a>', 'simplecatch'), admin_url('themes.php?page=custom-background')); ?></p>
  243. </div><!-- .option-content -->
  244. </div><!-- .option-container -->
  245. <div class="option-container">
  246. <h3 class="option-toggle"><a href="#"><?php _e( 'Content Color Options', 'simplecatch' ); ?></a></h3>
  247. <div class="option-content inside">
  248. <table class="form-table">
  249. <tbody>
  250. <tr>
  251. <th>
  252. <label for="simplecatch_heading_color">
  253. <?php _e( 'Heading Color:', 'simplecatch' ); ?>
  254. </label>
  255. </th>
  256. <td>
  257. <input type="text" id="simplecatch_heading_color" name="simplecatch_options[heading_color]" size="8" value="<?php echo ( isset( $options[ 'heading_color' ] ) ) ? esc_attr( $options[ 'heading_color' ] ) : '#444444'; ?>" />
  258. <div id="colorpicker_heading_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  259. </td>
  260. </tr>
  261. <tr>
  262. <th>
  263. <label for="simplecatch_meta_color">
  264. <?php _e( 'Meta Description Color:', 'simplecatch' ); ?>
  265. </label>
  266. </th>
  267. <td>
  268. <input type="text" id="simplecatch_meta_color" name="simplecatch_options[meta_color]" size="8" value="<?php echo ( isset( $options[ 'meta_color' ] ) ) ? esc_attr( $options[ 'meta_color' ] ) : '#999999'; ?>" />
  269. <div id="colorpicker_meta_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  270. </td>
  271. </tr>
  272. <tr>
  273. <th>
  274. <label for="simplecatch_text_color">
  275. <?php _e( 'Text Color:', 'simplecatch' ); ?>
  276. </label>
  277. </th>
  278. <td>
  279. <input type="text" id="simplecatch_text_color" name="simplecatch_options[text_color]" size="8" value="<?php echo ( isset( $options[ 'text_color' ] ) ) ? esc_attr( $options[ 'text_color' ] ) : '#555555'; ?>" />
  280. <div id="colorpicker_text_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  281. </td>
  282. </tr>
  283. <tr>
  284. <th>
  285. <label for="simplecatch_link_color">
  286. <?php _e( 'Link Color:', 'simplecatch' ); ?>
  287. </label>
  288. </th>
  289. <td>
  290. <input type="text" id="simplecatch_link_color" name="simplecatch_options[link_color]" size="8" value="<?php echo ( isset( $options[ 'link_color' ] ) ) ? esc_attr( $options[ 'link_color' ] ) : '#000000'; ?>" />
  291. <div id="colorpicker_link_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  292. </td>
  293. </tr>
  294. <tr>
  295. <th>
  296. <label for="simplecatch_widget_heading_color">
  297. <?php _e( 'Sidebar Widget Heading Color:', 'simplecatch' ); ?>
  298. </label>
  299. </th>
  300. <td>
  301. <input type="text" id="simplecatch_widget_heading_color" name="simplecatch_options[widget_heading_color]" size="8" value="<?php echo ( isset( $options[ 'widget_heading_color' ] ) ) ? esc_attr( $options[ 'widget_heading_color' ] ) : '#666666'; ?>" />
  302. <div id="colorpicker_widget_heading_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  303. </td>
  304. </tr>
  305. <tr>
  306. <th>
  307. <label for="simplecatch_widget_text_color">
  308. <?php _e( 'Sidebar Widget Text Color:', 'simplecatch' ); ?>
  309. </label>
  310. </th>
  311. <td>
  312. <input type="text" id="simplecatch_widget_text_color" name="simplecatch_options[widget_text_color]" size="8" value="<?php echo ( isset( $options[ 'widget_text_color' ] ) ) ? esc_attr( $options[ 'widget_text_color' ] ) : '#666666'; ?>" />
  313. <div id="colorpicker_widget_text_color" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
  314. </td>
  315. </tr>
  316. <?php if( $options[ 'reset_color' ] == "1" ) { $options[ 'reset_color' ] = "0"; } ?>
  317. <tr>
  318. <th scope="row"><?php _e( 'Reset Color:', 'simplecatch' ); ?></th>
  319. <input type='hidden' value='0' name='simplecatch_options[reset_color]'>
  320. <td>
  321. <input type="checkbox" id="headerlogo" name="simplecatch_options[reset_color]" value="1" <?php checked( '1', $options['reset_color'] ); ?> />
  322. </td>
  323. </tr>
  324. </tbody>
  325. </table>
  326. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  327. </div><!-- .option-content -->
  328. </div><!-- .option-container -->
  329. <div class="option-container">
  330. <h3 class="option-toggle"><a href="#"><?php _e( 'Custom CSS', 'simplecatch' ); ?></a></h3>
  331. <div class="option-content inside">
  332. <table class="form-table">
  333. <tbody>
  334. <tr>
  335. <th scope="row"><?php _e( 'Enter your custom CSS styles.', 'simplecatch' ); ?></th>
  336. <td>
  337. <textarea name="simplecatch_options[custom_css]" id="custom-css" cols="90" rows="12"><?php echo esc_attr( $options[ 'custom_css' ] ); ?></textarea>
  338. </td>
  339. </tr>
  340. <tr>
  341. <th scope="row"><?php _e( 'CSS Tutorial from W3Schools.', 'simplecatch' ); ?></th>
  342. <td>
  343. <a class="button" href="<?php echo esc_url( __( 'http://www.w3schools.com/css/default.asp','simplecatch' ) ); ?>" title="<?php esc_attr_e( 'CSS Tutorial', 'simplecatch' ); ?>" target="_blank"><?php _e( 'Click Here to Read', 'simplecatch' );?></a>
  344. </td>
  345. </tr>
  346. </tbody>
  347. </table>
  348. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  349. </div><!-- .option-content -->
  350. </div><!-- .option-container -->
  351. <div class="option-container">
  352. <h3 class="option-toggle"><a href="#"><?php _e( 'Default Layout', 'simplecatch' ); ?></a></h3>
  353. <div class="option-content inside">
  354. <table class="form-table">
  355. <tbody>
  356. <tr>
  357. <th scope="row"><label><?php _e( 'Default Layout', 'simplecatch' ); ?></label></th>
  358. <td>
  359. <label title="no-sidebar" class="box"><img src="<?php echo get_template_directory_uri(); ?>/functions/panel/images/no-sidebar.gif" alt="Content-Sidebar" /><br />
  360. <input type="radio" name="simplecatch_options[sidebar_layout]" id="no-sidebar" <?php checked($options['sidebar_layout'], 'no-sidebar') ?> value="no-sidebar" />
  361. <?php _e( 'No Sidebar, One Column', 'simplecatch' ); ?>
  362. </label>
  363. <label title="left-Sidebar" class="box"><img src="<?php echo get_template_directory_uri(); ?>/functions/panel/images/left-sidebar.gif" alt="Content-Sidebar" /><br />
  364. <input type="radio" name="simplecatch_options[sidebar_layout]" id="left-sidebar" <?php checked($options['sidebar_layout'], 'left-sidebar') ?> value="left-sidebar" />
  365. <?php _e( 'Content on Right', 'simplecatch' ); ?>
  366. </label>
  367. <label title="right-sidebar" class="box"><img src="<?php echo get_template_directory_uri(); ?>/functions/panel/images/right-sidebar.gif" alt="Content-Sidebar" /><br />
  368. <input type="radio" name="simplecatch_options[sidebar_layout]" id="right-sidebar" <?php checked($options['sidebar_layout'], 'right-sidebar') ?> value="right-sidebar" />
  369. <?php _e( 'Content on Left', 'simplecatch' ); ?>
  370. </label>
  371. </td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  376. </div><!-- .option-content -->
  377. </div><!-- .option-container -->
  378. </div> <!-- #designsettings -->
  379. <!-- Options for Theme Settings -->
  380. <div id="themesettings">
  381. <div class="option-container">
  382. <h3 class="option-toggle"><a href="#"><?php _e( 'Homepage / Frontpage Category Setting', 'simplecatch' ); ?></a></h3>
  383. <div class="option-content inside">
  384. <table class="form-table">
  385. <tbody>
  386. <tr>
  387. <th scope="row">
  388. <?php _e( 'Front page posts categories:', 'simplecatch' ); ?>
  389. <p>
  390. <small><?php _e( 'Only posts that belong to the categories selected here will be displayed on the front page.', 'simplecatch' ); ?></small>
  391. </p>
  392. </th>
  393. <td>
  394. <select name="simplecatch_options[front_page_category][]" id="frontpage_posts_cats" multiple="multiple" class="select-multiple">
  395. <option value="" <?php if ( empty( $options['front_page_category'] ) ) { echo 'selected="selected"'; } ?>><?php _e( '--Disabled--', 'simplecatch' ); ?></option>
  396. <?php /* Get the list of categories */
  397. if( empty( $options[ 'front_page_category' ] ) ) {
  398. $options[ 'front_page_category' ] = array();
  399. }
  400. $categories = get_categories();
  401. foreach ( $categories as $category) :
  402. ?>
  403. <option value="<?php echo $category->cat_ID; ?>" <?php if ( in_array( $category->cat_ID, $options['front_page_category'] ) ) {echo 'selected="selected"';}?>><?php echo $category->cat_name; ?></option>
  404. <?php endforeach; ?>
  405. </select><br />
  406. <span class="description"><?php _e( 'You may select multiple categories by holding down the CTRL key.', 'simplecatch' ); ?></span>
  407. </td>
  408. </tr>
  409. </tbody>
  410. </table>
  411. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  412. </div><!-- .option-content -->
  413. </div><!-- .option-container -->
  414. <div class="option-container">
  415. <h3 class="option-toggle"><a href="#"><?php _e( 'Search Text Settings', 'simplecatch' ); ?></a></h3>
  416. <div class="option-content inside">
  417. <table class="form-table">
  418. <tbody>
  419. <tr>
  420. <th scope="row"><label><?php _e( 'Default Display Text in Search', 'simplecatch' ); ?></label></th>
  421. <td><input type="text" size="45" name="simplecatch_options[search_display_text]" value="<?php echo esc_attr( $options[ 'search_display_text'] ); ?>" />
  422. </td>
  423. </tr>
  424. <tr>
  425. <th scope="row"><label><?php _e( 'Search Button\'s text', 'simplecatch' ); ?></label></th>
  426. <td><input type="text" size="45" name="simplecatch_options[search_button_text]" value="<?php echo esc_attr( $options[ 'search_button_text' ] ); ?>" />
  427. </td>
  428. </tr>
  429. </tbody>
  430. </table>
  431. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  432. </div><!-- .option-content -->
  433. </div><!-- .option-container -->
  434. <div class="option-container">
  435. <h3 class="option-toggle"><a href="#"><?php _e( 'Excerpt / More Tag Settings', 'simplecatch' ); ?></a></h3>
  436. <div class="option-content inside">
  437. <table class="form-table">
  438. <tbody>
  439. <tr>
  440. <th scope="row"><label><?php _e( 'More Tag Text', 'simplecatch' ); ?></label></th>
  441. <td><input type="text" size="45" name="simplecatch_options[more_tag_text]" value="<?php echo esc_attr( $options[ 'more_tag_text' ] ); ?>" />
  442. </td>
  443. </tr>
  444. <tr>
  445. <th scope="row"><?php _e( 'Excerpt length(words)', 'simplecatch' ); ?></th>
  446. <td><input type="text" size="3" name="simplecatch_options[excerpt_length]" value="<?php echo intval( $options[ 'excerpt_length' ] ); ?>" /></td>
  447. </tr>
  448. </tbody>
  449. </table>
  450. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  451. </div><!-- .option-content -->
  452. </div><!-- .option-container -->
  453. <div class="option-container">
  454. <h3 class="option-toggle"><a href="#"><?php _e( 'Feed Redirect', 'simplecatch' ); ?></a></h3>
  455. <div class="option-content inside">
  456. <table class="form-table">
  457. <tbody>
  458. <tr>
  459. <th scope="row"><label><?php _e( 'Feed Redirect URL', 'simplecatch' ); ?></label></th>
  460. <td><input type="text" size="70" name="simplecatch_options[feed_url]" value="<?php echo esc_attr( $options[ 'feed_url' ] ); ?>" />
  461. </td>
  462. </tr>
  463. </tbody>
  464. </table>
  465. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  466. </div><!-- .option-content -->
  467. </div><!-- .option-container -->
  468. </div> <!-- #themesettings -->
  469. </div><!-- #simplecatch_ad_tabs -->
  470. </form>
  471. </div><!-- .wrap -->
  472. <?php
  473. }
  474. /*
  475. * Render catch options page
  476. * @uses settings_fields, get_option, bloginfo
  477. * @Settings Updated
  478. */
  479. function simplecatch_slider_options_do_page(){
  480. ?>
  481. <div id="catchthemes" class="wrap">
  482. <form method="post" action="options.php">
  483. <?php
  484. settings_fields( 'simplecatch_options' );
  485. global $simplecatch_options_settings;
  486. $options = $simplecatch_options_settings;
  487. ?>
  488. <?php screen_icon(); ?> <h2><?php bloginfo( 'name' ); ?> "<?php _e( 'Featured Slider Options', 'simplecatch' ); ?>" <?php _e( 'By', 'simplecatch' ); ?> <a href="<?php echo esc_url( __( 'http://catchthemes.com/', 'simplecatch' ) ); ?>" title="<?php esc_attr_e( 'Catch Themes', 'simplecatch' ); ?>" target="_blank"><?php _e( 'Catch Themes', 'simplecatch' ); ?></a></h2>
  489. <?php
  490. // Function to show the info bar
  491. if ( function_exists( 'simplecatch_infobar' ) ) :
  492. simplecatch_infobar();
  493. endif;
  494. ?>
  495. <?php if( isset( $_GET [ 'settings-updated' ] ) && $_GET[ 'settings-updated' ] == 'true' ): ?>
  496. <div class="updated" id="message">
  497. <p><strong><?php _e( 'Settings saved.', 'simplecatch' );?></strong></p>
  498. </div>
  499. <?php endif; ?>
  500. <div class="option-container">
  501. <h3 class="option-toggle"><a href="#"><?php _e( 'Add Slider Options', 'simplecatch' ); ?></a></h3>
  502. <div class="option-content inside">
  503. <table class="form-table">
  504. <tr>
  505. <th scope="row"><?php _e( 'Exclude Slider post from Home page posts:', 'simplecatch' ); ?></th>
  506. <input type='hidden' value='0' name='simplecatch_options[exclude_slider_post]'>
  507. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[exclude_slider_post]" value="1" <?php checked( '1', $options['exclude_slider_post'] ); ?> /></td>
  508. </tr>
  509. <tr>
  510. <th scope="row"><?php _e( 'Number of Slides', 'simplecatch' ); ?></th>
  511. <td><input type="text" name="simplecatch_options[slider_qty]" value="<?php echo intval( $options[ 'slider_qty' ] ); ?>" /></td>
  512. </tr>
  513. <tbody class="sortable">
  514. <?php for ( $i = 1; $i <= $options[ 'slider_qty' ]; $i++ ): ?>
  515. <tr>
  516. <th scope="row"><label class="handle"><?php _e( 'Featured Slider Post #', 'simplecatch' ); ?><span class="count"><?php echo absint( $i ); ?></span></label></th>
  517. <td><input type="text" name="simplecatch_options[featured_slider][<?php echo absint( $i ); ?>]" value="<?php if( array_key_exists( 'featured_slider', $options ) && array_key_exists( $i, $options[ 'featured_slider' ] ) ) echo absint( $options[ 'featured_slider' ][ $i ] ); ?>" />
  518. <a href="<?php bloginfo ( 'url' );?>/wp-admin/post.php?post=<?php if( array_key_exists ( 'featured_slider', $options ) && array_key_exists ( $i, $options[ 'featured_slider' ] ) ) echo absint( $options[ 'featured_slider' ][ $i ] ); ?>&action=edit" class="button" title="<?php esc_attr_e('Click Here To Edit'); ?>" target="_blank"><?php _e( 'Click Here To Edit', 'simplecatch' ); ?></a>
  519. </td>
  520. </tr>
  521. <?php endfor; ?>
  522. </tbody>
  523. </table>
  524. <p><?php _e( 'Note: Here You can put your Post IDs which displays on Homepage as slider.', 'simplecatch' ); ?> </p>
  525. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  526. </div><!-- .option-content -->
  527. </div><!-- .option-container -->
  528. <!-- Option for More Slider Options -->
  529. <div class="option-container">
  530. <h3 class="option-toggle"><a href="#"><?php _e( 'Slider Effect Options', 'simplecatch' ); ?></a></h3>
  531. <div class="option-content inside">
  532. <table class="form-table">
  533. <tr>
  534. <th scope="row"><?php _e( 'Disable Slider Background Effect:', 'simplecatch' ); ?></th>
  535. <input type='hidden' value='0' name='simplecatch_options[remove_noise_effect]'>
  536. <td><input type="checkbox" id="headerlogo" name="simplecatch_options[remove_noise_effect]" value="1" <?php checked( '1', $options['remove_noise_effect'] ); ?> /></td>
  537. </tr>
  538. <tr>
  539. <th>
  540. <label for="simplecatch_cycle_style"><?php _e( 'Transition Effect:', 'simplecatch' ); ?></label>
  541. </th>
  542. <td>
  543. <select id="simplecatch_cycle_style" name="simplecatch_options[transition_effect]">
  544. <option value="fade" <?php selected('fade', $options['transition_effect']); ?>><?php _e( 'fade', 'simplecatch' ); ?></option>
  545. <option value="wipe" <?php selected('wipe', $options['transition_effect']); ?>><?php _e( 'wipe', 'simplecatch' ); ?></option>
  546. <option value="scrollUp" <?php selected('scrollUp', $options['transition_effect']); ?>><?php _e( 'scrollUp', 'simplecatch' ); ?></option>
  547. <option value="scrollDown" <?php selected('scrollDown', $options['transition_effect']); ?>><?php _e( 'scrollDown', 'simplecatch' ); ?></option>
  548. <option value="scrollLeft" <?php selected('scrollLeft', $options['transition_effect']); ?>><?php _e( 'scrollLeft', 'simplecatch' ); ?></option>
  549. <option value="scrollRight" <?php selected('scrollRight', $options['transition_effect']); ?>><?php _e( 'scrollRight', 'simplecatch' ); ?></option>
  550. <option value="blindX" <?php selected('blindX', $options['transition_effect']); ?>><?php _e( 'blindX', 'simplecatch' ); ?></option>
  551. <option value="blindY" <?php selected('blindY', $options['transition_effect']); ?>><?php _e( 'blindY', 'simplecatch' ); ?></option>
  552. <option value="blindZ" <?php selected('blindZ', $options['transition_effect']); ?>><?php _e( 'blindZ', 'simplecatch' ); ?></option>
  553. <option value="cover" <?php selected('cover', $options['transition_effect']); ?>><?php _e( 'cover', 'simplecatch' ); ?></option>
  554. <option value="shuffle" <?php selected('shuffle', $options['transition_effect']); ?>><?php _e( 'shuffle', 'simplecatch' ); ?></option>
  555. </select>
  556. </td>
  557. </tr>
  558. <tr>
  559. <th scope="row"><?php _e( 'Transition Delay', 'simplecatch' ); ?></th>
  560. <td>
  561. <input type="text" name="simplecatch_options[transition_delay]" value="<?php echo $options[ 'transition_delay' ]; ?>" size="4" />
  562. <span class="description"><?php _e( 'second(s)', 'simplecatch' ); ?></span>
  563. </td>
  564. </tr>
  565. <tr>
  566. <th scope="row"><?php _e( 'Transition Length', 'simplecatch' ); ?></th>
  567. <td>
  568. <input type="text" name="simplecatch_options[transition_duration]" value="<?php echo $options[ 'transition_duration' ]; ?>" size="4" />
  569. <span class="description"><?php _e( 'second(s)', 'simplecatch' ); ?></span>
  570. </td>
  571. </tr>
  572. </table>
  573. <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save', 'simplecatch' ); ?>" /></p>
  574. </div><!-- .option-content -->
  575. </div><!-- .option-container -->
  576. </form>
  577. </div><!-- .wrap -->
  578. <?php
  579. }
  580. /*
  581. * Render catch options page
  582. * @uses settings_fields, get_option, bloginfo
  583. * @Settings Updated
  584. */
  585. function simplecatch_social_options_do_page(){
  586. ?>
  587. <div id="sociallinks" class="wrap">
  588. <form method="post" action="options.php">
  589. <?php
  590. settings_fields( 'simplecatch_options' );
  591. global $simplecatch_options_settings;
  592. $options = $simplecatch_options_settings;
  593. ?>
  594. <?php screen_icon(); ?><h2><?php bloginfo( 'name' ); ?> "<?php _e( 'Social Links Option', 'simplecatch' ); ?>" <?php _e( 'By', 'simplecatch' ); ?> <a href="<?php echo esc_url( __( 'http://catchthemes.com/', 'simplecatch' ) ); ?>" title="<?php esc_attr_e( 'Catch Themes', 'simplecatch' ); ?>" target="_blank"><?php _e( 'Catch Themes', 'simplecatch' ); ?></a></h2>
  595. <?php
  596. // Function to show the info bar
  597. if ( function_exists( 'simplecatch_infobar' ) ) :
  598. simplecatch_infobar();
  599. endif;
  600. ?>
  601. <?php if( isset( $_GET [ 'settings-updated' ] ) && $_GET[ 'settings-updated' ] == 'true' ): ?>
  602. <div class="updated" id="message">
  603. <p><strong><?php _e( 'Settings saved.', 'simplecatch' );?></strong></p>
  604. </div>
  605. <?php endif; ?>
  606. <table class="form-table">
  607. <tbody>
  608. <tr>
  609. <th scope="row"><h4><?php _e( 'Facebook', 'simplecatch' ); ?></h4></th>
  610. <td><input type="text" size="45" name="simplecatch_options[social_facebook]" value="<?php echo esc_url( $options[ 'social_facebook' ] ); ?>" />
  611. </td>
  612. </tr>
  613. <tr>
  614. <th scope="row"><h4><?php _e( 'Twitter', 'simplecatch' ); ?> </h4></th>
  615. <td><input type="text" size="45" name="simplecatch_options[social_twitter]" value="<?php echo esc_url( $options[ 'social_twitter'] ); ?>" />
  616. </td>
  617. </tr>
  618. <tr>
  619. <th scope="row"><h4><?php _e( 'Google+', 'simplecatch' ); ?> </h4></th>
  620. <td><input type="text" size="45" name="simplecatch_options[social_googleplus]" value="<?php echo esc_url( $options[ 'social_googleplus'] ); ?>" />
  621. </td>
  622. </tr>
  623. <tr>
  624. <th scope="row"><h4><?php _e( 'Pinterest', 'simplecatch' ); ?> </h4></th>
  625. <td><input type="text" size="45" name="simplecatch_options[social_pinterest]" value="<?php echo esc_url( $options[ 'social_pinterest'] ); ?>" />
  626. </td>
  627. </tr>
  628. <tr>
  629. <th scope="row"><h4><?php _e( 'Youtube', 'simplecatch' ); ?></h4></th>
  630. <td><input type="text" size="45" name="simplecatch_options[social_youtube]" value="<?php echo esc_url( $options[ 'social_youtube' ] ); ?>" />
  631. </td>
  632. </tr>
  633. <tr>
  634. <th scope="row"><h4><?php _e( 'Vimeo', 'simplecatch' ); ?></h4></th>
  635. <td><input type="text" size="45" name="simplecatch_options[social_vimeo]" value="<?php echo esc_url( $options[ 'social_vimeo' ] ); ?>" />
  636. </td>
  637. </tr>
  638. <tr>
  639. <th scope="row"><h4><?php _e( 'Linkedin', 'simplecatch' ); ?> </h4></th>
  640. <td><input type="text" size="45" name="simplecatch_options[social_linkedin]" value="<?php echo esc_url( $options[ 'social_linkedin'] ); ?>" />
  641. </td>
  642. </tr>
  643. <tr>
  644. <th scope="row"><h4><?php _e( 'Slideshare', 'simplecatch' ); ?> </h4></th>
  645. <td><input type="text" size="45" name="simplecatch_options[social_slideshare]" value="<?php echo esc_url( $options[ 'social_slideshare'] ); ?>" />
  646. </td>
  647. </tr>
  648. <tr>
  649. <th scope="row"><h4><?php _e( 'Foursquare', 'simplecatch' ); ?></h4></th>
  650. <td><input type="text" size="45" name="simplecatch_options[social_foursquare]" value="<?php echo esc_url( $options[ 'social_foursquare' ] ); ?>" />
  651. </td>
  652. </tr>
  653. <tr>
  654. <th scope="row"><h4><?php _e( 'Flickr', 'simplecatch' ); ?></h4></th>

Large files files are truncated, but you can click here to view the full file