web_dor_home_page_class

The Business Responsive web dor home page class class.

Defined (1)

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

/admin/home_page.php  
  1. class web_dor_home_page_class{ 
  2.  
  3. public $homepage; 
  4. public $shorthomepage; 
  5. public $options_homepage; 
  6.  
  7. function __construct() { 
  8. $this->homepage = "Homepage"; 
  9. $this->shorthomepage = ""; 
  10.  
  11. $this->options_homepage = array( 
  12.  
  13. array( 
  14. "name" => "Homepage",  
  15.  
  16. "type" => "title" 
  17. ),  
  18.  
  19. array( 
  20.  
  21. "name" => "numbers of home page",  
  22.  
  23. "id" => "_n_of_home_post",  
  24.  
  25. "std" => "" 
  26.  
  27. ),  
  28.  
  29. array( 
  30.  
  31. "name" => "hide top posts",  
  32.  
  33. "id" => "_hide_top_posts",  
  34.  
  35. "std" => "" 
  36.  
  37. ),  
  38.  
  39. array( 
  40.  
  41. "name" => "hide slider",  
  42.  
  43. "id" => "_hide_slider",  
  44.  
  45. "std" => "" 
  46.  
  47. ); 
  48. $cats = get_categories('hide_empty=0'); 
  49. $site_cats = array(); 
  50. foreach ($cats as $cat) { 
  51.  
  52. array_push($this->options_homepage, array( 
  53. "name" => "top_cat" . $cat->cat_ID,  
  54. "id" => "top_cat" . $cat->cat_ID,  
  55. "std" => "") 
  56. ); 
  57.  
  58. array_push($this->options_homepage, array( 
  59. "name" => "content_cat" . $cat->cat_ID,  
  60. "id" => "content_cat" . $cat->cat_ID,  
  61. "std" => "") 
  62. ); 
  63.  
  64.  
  65.  
  66.  
  67. /// save changes or reset options 
  68. public function web_dorado_theme_update_and_get_options_home() { 
  69.  
  70.  
  71. if (isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "home_page") { 
  72. if (isset($_REQUEST['action']) && $_REQUEST['action']=='save' ) { 
  73. foreach ($this->options_homepage as $value) { 
  74. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  75. foreach ($this->options_homepage as $value) { 
  76. if (isset($_REQUEST[$value['id']])) { 
  77. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  78. } else { 
  79. remove_theme_mod($value['id']); 
  80. header("Location: themes.php?page=web_dorado_theme&controller=home_page&saved=true"); 
  81. die; 
  82. }  
  83. else { 
  84.  
  85. if (isset($_REQUEST['action']) && $_REQUEST['action']=='reset') { 
  86.  
  87. foreach ($this->options_homepage as $value) { 
  88. remove_theme_mod($value['id']); 
  89.  
  90. header("Location: themes.php?page=web_dorado_theme&controller=home_page&reset=true"); 
  91. die; 
  92.  
  93.  
  94.  
  95.  
  96. public function web_dorado_home_page_admin_scripts() { 
  97.  
  98. wp_enqueue_style('home_page_main_style', get_bloginfo('template_directory').'/admin/css/home_page.css');  
  99.  
  100.  
  101.  
  102. public function dorado_theme_admin_home() { 
  103.  
  104. if(isset($_REQUEST['controller']) && $_REQUEST['controller']=='home_page') {  
  105. if (isset($_REQUEST['saved']) && $_REQUEST['saved'] )  
  106.  
  107. echo '<div id="message" class="updated"><p><strong>Home settings are saved.</strong></p></div>'; 
  108.  
  109. if (isset($_REQUEST['reset']) && $_REQUEST['reset'] )  
  110.  
  111. echo '<div id="message" class="updated"><p><strong>Home settings are reset.</strong></p></div>'; 
  112. ?> 
  113.  
  114.  
  115. <div> 
  116. <script> 
  117.  
  118. function open_or_hide_param_top(cur_element) { 
  119. if(cur_element.checked) { 
  120. jQuery(cur_element).parent().parent().parent().find('.open_hide_top').hide(); 
  121. else 
  122. jQuery(cur_element).parent().parent().parent().find('.open_hide_top').show(); 
  123.  
  124. jQuery(document).ready(function ($) { 
  125. jQuery('.with_input').each(function() {open_or_hide_param_top(this)}) 
  126.  
  127. }); 
  128.  
  129. </script> 
  130. <table align="center" width="90%" style="margin-top: 0px; margin-bottom: 20px;border-bottom: rgb(111, 111, 111) solid 2px;"> 
  131. <tr>  
  132. <td style="font-size:14px; font-weight:bold"> 
  133. <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 to customize the homepage.  
  134. <a href="http://web-dorado.com/wordpress-theme-options/3-4.html" target="_blank" style="color:#126094; text-decoration:none;">More...</a> 
  135. </td>  
  136. <td align="right" style="font-size:16px;"> 
  137. <a href="http://web-dorado.com/wordpress-themes/business-responsive.html" target="_blank" style="color:red; text-decoration:none;"> 
  138. <img src="<?php echo get_template_directory_uri() ?>/images/header.png" border="0" alt="" width="215"><br> 
  139. Get the full version     
  140. </a> 
  141. </td> 
  142. </tr> 
  143. <tr> 
  144. <td colspan="2"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Home</h3> 
  145. </td> 
  146. </tr> 
  147. </table> 
  148. <form method="post" action="themes.php?page=web_dorado_theme&controller=home_page"> 
  149. <table align="center" width="90%" style=" padding-bottom:0px; padding-top:0px;"> 
  150. <tr> 
  151. <td> 
  152. <div> 
  153. <div class="optiontitle first"> 
  154. <h3>Number of Posts</h3> 
  155. </div> 
  156. <div class="block"> 
  157. <div class="optiondescreption"> 
  158. <p>Specify the number of content posts to be displayed on the homepage.</p> 
  159. </div> 
  160. <div class="optioninput"> 
  161. <input style="width: 30px;text-align: center;" name="_n_of_home_post" id="_n_of_home_post" type="text" value="<?php if (get_theme_mod("_n_of_home_post") != "") { echo get_theme_mod("_n_of_home_post"); } else echo "3"; ?>"> 
  162. </div> 
  163. </div> 
  164. </div>  
  165. <div> 
  166. <div class="optiontitle"> 
  167. <h3>Hide Slider</h3> 
  168. </div> 
  169. <div class="block margin"> 
  170. <div class="optiondescreption"> 
  171. <p>Using this option, you can hide the homepage slider.</p> 
  172. </div> 
  173. <div class="optioninput checkbox"> 
  174. <input type="checkbox" name="_hide_slider" id="_hide_slider" <?php checked( get_theme_mod("_hide_slider"), "on" ); ?> /> 
  175. </div> 
  176. </div> 
  177. </div>  
  178. <div> 
  179. <div class="optiontitle"> 
  180. <h3>Hide Top Posts</h3> 
  181. </div> 
  182. <div class="block margin"> 
  183. <div class="optiondescreption"> 
  184. <p>Using this option, you can hide the top posts from the homepage.</p> 
  185. </div>  
  186. <div class="optioninput checkbox"> 
  187. <input type="checkbox" onclick="open_or_hide_param_top(this)" class="checkbox with_input" name="_hide_top_posts" id="_hide_top_posts" <?php checked( get_theme_mod("_hide_top_posts"), "on" ); ?> /> 
  188. </div> 
  189. </div> 
  190. <div class="open_hide_top"> 
  191.  
  192. <div class="optiondescreption"> 
  193. <p>Select the categories from which you want the homepage top posts to be selected (the 
  194. posts are selected automatically).</p> 
  195. </div> 
  196. <div class="block"> 
  197.  
  198. <?php $cats = get_categories('hide_empty=0'); 
  199. foreach ($cats as $categs) { 
  200. ?> <div class="optioninput checkbox_for_posts">  
  201. <input type="checkbox" name="<?php echo "top_cat" . $categs->cat_ID; ?>" class="checkbox" id="<?php echo "top_cat" . $categs->cat_ID; ?>" <?php checked( get_theme_mod("top_cat" . $categs->cat_ID), "on" ); ?> /></div><label for="<?php echo "top_cat" . $categs->cat_ID; ?>"> <?php echo $categs->cat_name; ?></label> 
  202.  
  203. <br><br> 
  204. <?php } ?> 
  205.  
  206. </div> 
  207. </div> 
  208.  
  209. </div> 
  210.  
  211. <div class="optiontitle"> 
  212. <h3>Select Categories for Content Posts</h3> 
  213. </div> 
  214. <div class="optiondescreption" style="width:99% !important"> 
  215. <p>Select the categories from which you want the homepage content posts to be selected (the 
  216. posts are selected automatically).</p> 
  217. </div> 
  218.  
  219. <?php $cats = get_categories('hide_empty=0'); 
  220. foreach ($cats as $categs) { 
  221. ?> 
  222. <div class="optioninput checkbox_for_posts"> 
  223. <input type="checkbox" name="<?php echo "content_cat" . $categs->cat_ID; ?>" id="<?php echo "content_cat" . $categs->cat_ID; ?>" <?php checked( get_theme_mod("content_cat" . $categs->cat_ID), "on" ); ?> /></div><label for="<?php echo "content_cat" . $categs->cat_ID; ?>"> <?php echo $categs->cat_name; ?> </label> 
  224. <br><br> 
  225. <?php } ?> 
  226.  
  227. </td> 
  228. </tr> 
  229. </table><br/> 
  230. <p class="submit" style="float: left; margin-left: 63px; margin-right: 8px;"> 
  231. <input class="button" name="save" type="submit" value="Save changes"/> 
  232. <input type="hidden" name="action" value="save"/> 
  233. </p> 
  234. </form> 
  235. <form method="post" action="themes.php?page=web_dorado_theme&controller=home_page"> 
  236. <p class="submit"> 
  237. <input class="button" name="reset" type="submit" value="Reset"/> 
  238. <input type="hidden" name="action" value="reset"/> 
  239. </p> 
  240. </form> 
  241. </div> 
  242. <?php 
  243.  
  244.  
  245.  
  246. }  
  247.