web_dor_slider_page_class

The Business Responsive web dor slider page class class.

Defined (1)

The class is defined in the following location(s).

/admin/slider_page.php  
  1. class web_dor_slider_page_class{ 
  2.  
  3. function __construct() {} 
  4.  
  5.  
  6. /// save changes or reset options 
  7. private function web_dorado_theme_update_slider() { 
  8.  
  9. $image_list=''; 
  10. $image_href=''; 
  11. $image_textarea=''; 
  12. $image_link=''; 
  13. if ( isset($_GET['saved']) && $_GET['saved']=='saved' ) {  
  14.  
  15.  
  16. for($i=0;$i<200;$i++) { 
  17. if(isset($_POST['ct_image_link_'.$i])) { 
  18. $image_link .=$_POST['ct_image_link_'.$i].';;;;'; 
  19.  
  20. if(isset($_POST['ct_image_href_'.$i])) { 
  21. $image_href .=$_POST['ct_image_href_'.$i].';;;;'; 
  22.  
  23. if(isset($_POST['ct_image_textarea_'.$i])) { 
  24. $image_textarea .=$_POST['ct_image_textarea_'.$i].';;;;'; 
  25. set_theme_mod('web_busines_image_link', $image_link); 
  26. set_theme_mod('web_busines_image_href', $image_href); 
  27. set_theme_mod('web_busines_image_textarea', $image_textarea); 
  28. set_theme_mod('ct_slider_height', $_POST['ct_slider_height']); 
  29. set_theme_mod('ct_pause_time', $_POST['ct_pause_time']); 
  30. set_theme_mod('ct_anim_speed', $_POST['ct_anim_speed']); 
  31. set_theme_mod('ct_effect', $_POST['ct_effect']); 
  32. set_theme_mod('ct_pause_on_hover', $_POST['ct_pause_on_hover']); 
  33.  
  34. if(isset($_GET['reset']) && $_GET['reset']=='reset') { 
  35.  
  36. remove_theme_mod('web_busines_image_link'); 
  37. remove_theme_mod('web_busines_image_href'); 
  38. remove_theme_mod('web_busines_image_textarea'); 
  39. remove_theme_mod('ct_slider_height'); 
  40. remove_theme_mod('ct_pause_time'); 
  41. remove_theme_mod('ct_anim_speed');  
  42. remove_theme_mod('ct_effect'); 
  43. remove_theme_mod('ct_pause_on_hover'); 
  44.  
  45. }  
  46.  
  47. /// print massage after save 
  48. private function web_dor_print_massage() { 
  49.  
  50. if (isset($_GET['saved']) && $_GET['saved'] =='saved' )  
  51.  
  52. echo '<div id="message" class="updated"><p><strong>Slider settings are saved.</strong></p></div>'; 
  53.  
  54. if (isset($_GET['reset']) && $_GET['reset'] == 'reset' )  
  55.  
  56. echo '<div id="message" class="updated"><p><strong>Slider settings are reset.</strong></p></div>'; 
  57.  
  58.  
  59. /// include style and scripts for slider page 
  60. public function web_dorado_slider_page_admin_scripts() { 
  61.  
  62. wp_enqueue_style('slider_page_main_style', get_bloginfo('template_directory').'/admin/css/slider_page.css');  
  63. wp_enqueue_script('jquery'); 
  64. wp_enqueue_script( 'common' ); 
  65. wp_enqueue_script( 'jquery-color' ); 
  66. wp_print_scripts('editor'); 
  67. if (function_exists('add_thickbox')) add_thickbox(); 
  68. wp_print_scripts('media-upload'); 
  69. wp_admin_css(); 
  70. wp_enqueue_script('utils'); 
  71. do_action("admin_print_styles-post-php"); 
  72. do_action('admin_print_styles'); 
  73.  
  74.  
  75. private function get_slider_parametrs() { 
  76.  
  77. $image_link=get_theme_mod('web_busines_image_link', ''); 
  78. if($image_link) { 
  79. $link_array=explode(';;;;', $image_link); 
  80. array_pop($link_array); 
  81. else {$link_array=array();}  
  82. $param['link_array']=$link_array; 
  83.  
  84.  
  85. $image_href=get_theme_mod('web_busines_image_href', ''); 
  86. if($image_href) { 
  87. $href_array=explode(';;;;', $image_href); 
  88. array_pop($href_array); 
  89. else {$href_array=array();}  
  90. $param['href_array']=$href_array; 
  91.  
  92. $image_textarea=get_theme_mod('web_busines_image_textarea', ''); 
  93. if($image_textarea) { 
  94. $textarea_array=explode(';;;;', $image_textarea); 
  95. array_pop($textarea_array); 
  96. else {$textarea_array=array();}  
  97. $param['textarea_array']=$textarea_array; 
  98. return $param; 
  99.  
  100. //// back end style 
  101. public function dorado_theme_admin_slider() { 
  102.  
  103. $LIST=''; 
  104. $this->web_dorado_theme_update_slider(); 
  105. $this->web_dor_print_massage(); 
  106. $param=$this->get_slider_parametrs(); 
  107. $link_array=$param['link_array']; 
  108. $href_array=$param['href_array']; 
  109. $textarea_array=$param['textarea_array']; 
  110. ?>  
  111. <div id="main_slider_page"> 
  112. <div class="wrap" style="margin-right:76px; margin-left: 82px;"> 
  113.  
  114. <table align="center" width="100%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;"> 
  115. <tbody> 
  116. <tr>  
  117. <td style="font-size:14px; font-weight:bold;color: #333;"> 
  118. <a href="http://web-dorado.com/wordpress-themes-guide-step-1.html" target="_blank" style="color:#126094; text-decoration:none;">User Manual</a><br />This section allows you customize the slider. 
  119. <a href="http://web-dorado.com/wordpress-theme-options/3-8.html" target="_blank" style="color:#126094; text-decoration:none;">More...</a> 
  120. </td>  
  121. <td align="right" style="font-size:16px;"> 
  122. <a href="http://web-dorado.com/wordpress-themes/business-responsive.html" target="_blank" style="color:red; text-decoration:none;"> 
  123. <img src="<?php echo get_template_directory_uri() ?>/images/header.png" border="0" alt="" width="215"><br> 
  124. Get the full version     
  125. </a> 
  126. </td> 
  127. </tr> 
  128. <tr> 
  129. <td> 
  130. <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;font-weight: bold;">Slider</h3> 
  131. </td> 
  132. </tr> 
  133. </tbody> 
  134. </table> 
  135.  
  136. <?php  
  137. //Style and js included in $template html file 
  138. $template=wp_remote_retrieve_body(wp_remote_get(get_template_directory_uri().'/nivo_files/templates/settings.slides.htm')); 
  139. $list=wp_remote_retrieve_body(wp_remote_get(get_template_directory_uri().'/nivo_files/templates/slides.image.add.list.htm')); 
  140.  
  141. for($i=0;$i<count($link_array);$i++) { 
  142. $str=$list; 
  143. $str=str_replace("{LINK}", stripslashes(esc_url($link_array[$i])), $str); 
  144. if(!isset($href_array[$i])) 
  145. $href_array[$i]=''; 
  146. $str=str_replace("{HREF}", stripslashes(esc_url($href_array[$i])), $str); 
  147. $str=str_replace("{TEXTAREA}", stripslashes(esc_html($textarea_array[$i])), $str); 
  148. $str=str_replace("{ID}", $i, $str); 
  149. $LIST.=$str; 
  150.  
  151. $template=str_replace("{LIST}", $LIST, $template);  
  152. $template=str_replace("{HEIGHT}", get_theme_mod('ct_slider_height', '500'), $template); 
  153. $template=str_replace("{SPEED}", get_theme_mod('ct_anim_speed', '500'), $template); 
  154. $template=str_replace("{PAUSE}", get_theme_mod('ct_pause_time', '4000'), $template); 
  155. $template=str_replace("{THEME_URL}", get_template_directory_uri(), $template); 
  156.  
  157. if(get_theme_mod('ct_pause_on_hover')) {$template=str_replace("{CHECKED}", 'checked="checked"', $template);} 
  158. if(get_theme_mod('ct_effect')) {$template=str_replace('value="'.get_theme_mod('ct_effect').'"', 'value="'.get_theme_mod('ct_effect').'"'.' selected="selected"', $template);} 
  159. else{$template=str_replace("{CHECKED}", '', $template);} 
  160.  
  161. echo $template; 
  162. ?> <div style="clear:both; width:100%"></div></div> <?php  
  163.  
  164.  
  165.  
  166.