Advertisement
Guest User

Untitled

a guest
Apr 6th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. <div class="block ui-tabs-panel deactive" id="option-ui-id-2" >
  2. <?php $current_options = wp_parse_args( get_option( 'appointment_options', array() ), theme_data_setup() );
  3. if(isset($_POST['webriti_settings_save_2']))
  4. {
  5. if($_POST['webriti_settings_save_2'] == 1)
  6. {
  7. if ( empty($_POST) || !wp_verify_nonce($_POST['webriti_gernalsetting_nonce_customization'],'webriti_customization_nonce_gernalsetting') )
  8. { printf (__('Sorry, your nonce did not verify.','appointment')); exit; }
  9. else
  10. {
  11. $current_options['slider_radio']=sanitize_text_field($_POST['slider_radio']);
  12. $current_options['slider_options']=sanitize_text_field($_POST['slider_options']);
  13. $current_options['slider_transition_delay']=sanitize_text_field($_POST['slider_transition_delay']);
  14. $current_options['featured_slider_post']=sanitize_text_field($_POST['featured_slider_post']);
  15.  
  16.  
  17.  
  18. $all_cats=$_POST['slider_select_category'];
  19. if($all_cats)
  20. {
  21. $arr=' ';
  22. foreach($all_cats as $val)
  23. {
  24. $arr.=$val.',';
  25. }
  26. $current_options['slider_select_category']=$arr;
  27. }
  28. // slider section enabled yes ya on
  29. if(isset($_POST['home_banner_enabled']))
  30. { echo $current_options['home_banner_enabled']= sanitize_text_field($_POST['home_banner_enabled']); }
  31. else { echo $current_options['home_banner_enabled']="off"; }
  32.  
  33. // slider section enabled yes ya on
  34. if(isset($_POST['home_post_enabled']))
  35. { echo $current_options['home_post_enabled']= sanitize_text_field($_POST['home_post_enabled']); }
  36. else { echo $current_options['home_post_enabled']="off"; }
  37.  
  38.  
  39. echo '<pre>';print_r($current_options);
  40.  
  41. update_option('appointment_options', $current_options);
  42. }
  43. }
  44. if($_POST['webriti_settings_save_2'] == 2)
  45. {
  46.  
  47. $current_options['home_banner_enabled']="on";
  48. $current_options['home_post_enabled']='on';
  49. $current_options['slider_btn_link_target']= 'on';
  50. $current_options['slider_radio']= 'demo';
  51. $current_options['slider_options']= 'slide';
  52. $current_options['slider_transition_delay']= '2000';
  53. $current_options['slider_select_category']= ' Uncategorized ';
  54. $current_options['featured_slider_post']= '';
  55.  
  56. update_option('appointment_options',$current_options);
  57. }
  58. } ?>
  59. <form method="post" id="webriti_theme_options_2">
  60. <div id="heading">
  61. <table style="width:100%;"><tr>
  62. <td><h2><?php _e('Home Feature Image Setting','appointment');?></h2></td>
  63. <td><div class="webriti_settings_loding" id="webriti_loding_2_image"></div>
  64. <div class="webriti_settings_massage" id="webriti_settings_save_2_success" ><?php _e('Options data successfully Saved','appointment');?></div>
  65. <div class="webriti_settings_massage" id="webriti_settings_save_2_reset" ><?php _e('Options data successfully reset','appointment');?></div>
  66. </td>
  67. <td style="text-align:right;">
  68. <input class="reset-button btn" type="button" name="reset" value="Restore Defaults" onclick="webriti_option_data_reset('2');">
  69. <input class="button button-primary button-large" type="button" value="Save Options" onclick="webriti_option_data_save('2')" >
  70. </td>
  71. </tr>
  72. </table>
  73. </div>
  74. <?php wp_nonce_field('webriti_customization_nonce_gernalsetting','webriti_gernalsetting_nonce_customization'); ?>
  75. <div class="section">
  76. <h3><?php _e('Enable Home Banner','appointment'); ?> </h3>
  77. <input type="checkbox" <?php if($current_options['home_banner_enabled']=='on') echo "checked='checked'"; ?> id="home_banner_enabled" name="home_banner_enabled" >
  78. <span class="explain"><?php _e('Enable Home Banner on front page.','appointment'); ?></span>
  79. </div>
  80. <div class="section">
  81. <h3><?php _e('Select Slider Type','appointment'); ?> </h3>
  82. <input type="radio" name="slider_radio" id="slider_radio_demo" value="demo" <?php if($current_options['slider_radio']=='demo'){echo 'checked';} ?>><?php _e('Demo slider','appointment'); ?>
  83. <input type="radio" name="slider_radio" id="slider_radio_post" value="post" <?php if($current_options['slider_radio']=='post'){echo 'checked';} ?>><?php _e('Post slider','appointment'); ?>
  84. <input type="radio" name="slider_radio" id="slider_radio_category" value="category" <?php if($current_options['slider_radio']=='category'){echo 'checked';} ?>> <?php _e('Category slider','appointment'); ?>
  85. </div>
  86.  
  87. <div id="main_section" class="section" <?php if ($current_options['slider_radio']=='demo'){echo 'style="display:none;"';}?>>
  88. <h3><?php _e('Transition Effect :','appointment'); ?>
  89. <select id="slider_style" name="slider_options">
  90. <option value="carousel-fade" <?php if($current_options['slider_options']=='carousel-fade'){echo 'selected';} ?>><?php _e('fade','appointment'); ?></option>
  91. <option value="slide" <?php if($current_options['slider_options']=='slide'){echo 'selected';} ?>><?php _e('slide','appointment'); ?></option>
  92. </select>
  93. <h3><?php _e('Transition Delay : ','appointment'); ?><input type="text" name="slider_transition_delay" id="slider_transition_delay" value="<?php echo $current_options['slider_transition_delay'] ?>"></h3><h5><?php _e('If you choose Transction Delay 2000 that means 2 second.','appointment'); ?></h5></h3>
  94. </div>
  95.  
  96. <div id="post_slider" <?php if($current_options['slider_radio']!='post'){echo 'style="display:none;"';}?>>
  97. <input type="checkbox" <?php if($current_options['home_post_enabled']=='on') echo "checked='checked'"; ?> id="home_post_enabled" name="home_post_enabled" value="on">
  98. <span class="explain"><?php _e('Enable Home Post on front page.','appointment'); ?></span>
  99.  
  100. <h3><?php _e('Featured post slider section','appointment'); ?> </h3>
  101. <div id="all_slider_content">
  102. <div class="repeat-content-wrap">
  103. <div class="row">
  104. <div class="col col-1"> <?php _e('Featured Post Slider','appointment'); ?>
  105. </div>
  106. <div class="col col-2">
  107. <input type="text" name="featured_slider_post" value="<?php echo $current_options['featured_slider_post'];?>">
  108. <a href="<?php bloginfo ( 'url' );?>/wp-admin/post.php?post=<?php if( array_key_exists ( 'featured_slider_post', $current_options ) && array_key_exists ( $i, $current_options[ 'featured_slider_post' ] ) ) echo absint( $current_options[ 'featured_slider_post' ][ $i ] ); ?>&action=edit" class="button" title="<?php esc_attr_e('Click Here To Edit'); ?>" target="_blank"><?php _e( 'Click Here To Edit', 'appointment' ); ?></a>
  109. <p><span> <h5><?php _e("You can use multiple ID's seprated by Commma[ , ]",'appointment');?></span></h5></p> </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div id="category_slider" <?php if($current_options['slider_radio']!='category'){echo 'style="display:none;"';}?>>
  115. <h3><?php _e('Featured Category slider section','appointment'); ?> </h3>
  116.  
  117. <div>
  118. <select class="slider_select_cat" name="slider_select_category[]" multiple >
  119.  
  120. <?php
  121. $args = array(
  122. 'orderby' => 'name',
  123. 'parent' => 0
  124. );
  125. $categories = get_categories( $args );
  126. foreach ( $categories as $category ) {
  127. ?>
  128. <option <?php if(!strpos($current_options['slider_select_category'],$category->name)===false){echo 'selected';}?> > <?php echo $category->name;?> </option><?php
  129. }
  130. ?>
  131. </select>
  132. </div>
  133. </div>
  134.  
  135. <div id="demo_slider" <?php if ($current_options['slider_radio']!='demo'){echo 'style="display:none;"';}?>>
  136. </div>
  137. <div class="section">
  138. </div>
  139.  
  140. <div id="button_section">
  141. <input type="hidden" value="1" id="webriti_settings_save_2" name="webriti_settings_save_2" />
  142. <input class="reset-button btn" type="button" name="reset" value="Restore Defaults" onclick="webriti_option_data_reset('2');">
  143. <input class="button button-primary button-large" type="button" value="Save Options" onclick="webriti_option_data_save('2')" >
  144. </div>
  145. </form>
  146. </div>
  147. <script>
  148.  
  149.  
  150. jQuery('input[name=slider_radio]').on('click',function(){
  151. if(this.value=='category')
  152. {
  153. jQuery("#category_slider").attr('style','display:block');
  154. jQuery("#post_slider").attr('style','display:none');
  155. jQuery("#demo_slider").attr('style','display:none');
  156. jQuery("#main_section").attr('style','display:block');
  157. }
  158. else if(this.value=='post')
  159. {
  160. jQuery("#category_slider").attr('style','display:none');
  161. jQuery("#post_slider").attr('style','display:block');
  162. jQuery("#demo_slider").attr('style','display:none');
  163. jQuery("#main_section").attr('style','display:block');
  164. }
  165. else
  166. {
  167. jQuery("#category_slider").attr('style','display:none');
  168. jQuery("#post_slider").attr('style','display:none');
  169. jQuery("#demo_slider").attr('style','display:block');
  170. jQuery("#main_section").attr('style','display:none');
  171. }
  172. });
  173. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement