web_dor_general_settings_page_class

The Business Responsive web dor general settings page class class.

Defined (1)

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

/admin/general_settings_page.php  
  1. class web_dor_general_settings_page_class{ 
  2.  
  3. public $generalsettings; 
  4.  
  5. public $shortgeneralsettings; 
  6.  
  7. public $options_generalsettings; 
  8.  
  9. function __construct() { 
  10.  
  11.  
  12. /// initial params 
  13. $this->generalsettings = "General Settings"; 
  14. $this->shortgeneralsettings = ""; 
  15.  
  16.  
  17. /// get options from data base 
  18.  
  19. $value_of_std[0] = get_theme_mod($this->shortgeneralsettings."_logo_img", ''); 
  20. $value_of_std[1] = get_theme_mod($this->shortgeneralsettings."_body_back", ''); 
  21. $value_of_std[2] = get_theme_mod($this->shortgeneralsettings."_custom_css", ''); 
  22. $value_of_std[3] = get_theme_mod($this->shortgeneralsettings."_favicon_img", ''); 
  23. $value_of_std[4] = get_theme_mod($this->shortgeneralsettings."_show_comments", ''); 
  24. $value_of_std[5] = get_theme_mod($this->shortgeneralsettings."_blog_style", ''); 
  25. $value_of_std[6] = get_theme_mod($this->shortgeneralsettings."_grab_image", ''); 
  26. $value_of_std[7] = get_theme_mod($this->shortgeneralsettings."_show_twitter_icon", ''); 
  27. $value_of_std[8] = get_theme_mod($this->shortgeneralsettings."_show_rss_icon", ''); 
  28. $value_of_std[9] = get_theme_mod($this->shortgeneralsettings."_show_facebook_icon", ''); 
  29. $value_of_std[10] = get_theme_mod($this->shortgeneralsettings."_twitter_url", ''); 
  30. $value_of_std[11] = get_theme_mod($this->shortgeneralsettings."_rss_url", ''); 
  31. $value_of_std[12] = get_theme_mod($this->shortgeneralsettings."_facebook_url", ''); 
  32. $value_of_std[13] = get_theme_mod($this->shortgeneralsettings."_date_format1", ''); 
  33. $value_of_std[14] = get_theme_mod($this->shortgeneralsettings."_date_format2", ''); 
  34. $value_of_std[15] = get_theme_mod($this->shortgeneralsettings."_date_format3", ''); 
  35. $value_of_std[16] = get_theme_mod($this->shortgeneralsettings."_date_format4", ''); 
  36. $value_of_std[17] = get_theme_mod($this->shortgeneralsettings."_our_style", ''); 
  37. $value_of_std[18] = get_theme_mod($this->shortgeneralsettings."_menu_search_form", ''); 
  38. $value_of_std[19] = get_theme_mod($this->shortgeneralsettings."_post_header", ''); 
  39. $value_of_std[20] = get_theme_mod($this->shortgeneralsettings."_favicon_enable", ''); 
  40. $value_of_std[21] = get_theme_mod($this->shortgeneralsettings."_date_enable", ''); 
  41. $value_of_std[22] = get_theme_mod($this->shortgeneralsettings."_footer_text", '<span id="copyright"><a href="http://web-dorado.com/wordpress-themes" target="_blank">WordPress Themes by Web-Dorado</a></span>'); 
  42.  
  43. $this->options_generalsettings = array( 
  44.  
  45. array( 
  46.  
  47. "name" => "Logo",  
  48.  
  49. "id" => "_logo_img",  
  50.  
  51. "std" => $value_of_std[0] 
  52.  
  53. ),  
  54.  
  55. array( 
  56.  
  57. "name" => "General Settings",  
  58.  
  59. "id" => "_body_back",  
  60.  
  61. "std" => $value_of_std[1] 
  62.  
  63. ),  
  64.  
  65. array( 
  66.  
  67. "name" => "General Settings",  
  68.  
  69. "id" => "_custom_css",  
  70.  
  71. "std" => $value_of_std[2] 
  72. ),  
  73.  
  74. array( 
  75.  
  76. "name" => "General Settings",  
  77.  
  78. "id" => "_favicon_img",  
  79.  
  80. "std" => $value_of_std[3] 
  81.  
  82. ),  
  83.  
  84. array( 
  85. "name" => "General Settings",  
  86.  
  87. "id" => "_show_comments",  
  88.  
  89. "std" => $value_of_std[4] 
  90. ),  
  91.  
  92. array( 
  93.  
  94. "name" => "General Settings",  
  95.  
  96. "id" => "_blog_style",  
  97.  
  98. "std" => $value_of_std[5] 
  99. ),  
  100.  
  101. array( 
  102.  
  103. "name" => "General Settings",  
  104.  
  105. "id" => "_grab_image",  
  106.  
  107. "std" => $value_of_std[6] 
  108. ),  
  109.  
  110. array( 
  111.  
  112. "name" => "General Settings",  
  113.  
  114. "id" => "_show_twitter_icon",  
  115.  
  116. "std" => $value_of_std[7] 
  117. ),  
  118.  
  119. array( 
  120.  
  121. "name" => "General Settings",  
  122.  
  123. "id" => "_show_rss_icon",  
  124.  
  125. "std" => $value_of_std[8] 
  126.  
  127. ),  
  128.  
  129. array( 
  130.  
  131. "name" => "General Settings",  
  132.  
  133. "id" => "_show_facebook_icon",  
  134.  
  135. "std" => $value_of_std[9] 
  136.  
  137. ),  
  138.  
  139. array( 
  140.  
  141. "name" => "General Settings",  
  142.  
  143. "id" => "_twitter_url",  
  144.  
  145. "std" => $value_of_std[10] 
  146.  
  147. ),  
  148.  
  149. array( 
  150.  
  151. "name" => "General Settings",  
  152.  
  153. "id" => "_rss_url",  
  154.  
  155. "std" => $value_of_std[11] 
  156.  
  157. ),  
  158.  
  159. array( 
  160.  
  161. "name" => "General Settings",  
  162.  
  163. "id" => "_facebook_url",  
  164.  
  165. "std" => $value_of_std[12] 
  166.  
  167. ),  
  168.  
  169. array( 
  170.  
  171. "name" => "General Settings",  
  172.  
  173. "id" => "_date_format1",  
  174.  
  175. "std" => $value_of_std[13] 
  176.  
  177. ),  
  178.  
  179. array( 
  180.  
  181. "name" => "General Settings",  
  182.  
  183. "id" => "_date_format2",  
  184.  
  185. "std" => $value_of_std[14] 
  186.  
  187. ),  
  188.  
  189. array( 
  190. "name" => "General Settings",  
  191.  
  192. "id" => "_date_format3",  
  193.  
  194. "std" => $value_of_std[15] 
  195.  
  196. ),  
  197.  
  198. array( 
  199.  
  200. "name" => "General Settings",  
  201.  
  202. "id" => "_date_format4",  
  203.  
  204. "std" => $value_of_std[16] 
  205.  
  206. ),  
  207.  
  208. array( 
  209.  
  210. "name" => "General Settings",  
  211.  
  212. "id" => "_our_style",  
  213.  
  214. "std" => $value_of_std[17] 
  215.  
  216. ),  
  217.  
  218. array( 
  219.  
  220. "name" => "General Settings",  
  221.  
  222. "id" => "_menu_search_form",  
  223.  
  224. "std" => $value_of_std[18] 
  225.  
  226. ),  
  227.  
  228. array( 
  229.  
  230. "name" => "General Settings",  
  231.  
  232. "id" => "_post_header",  
  233.  
  234. "std" => $value_of_std[19] 
  235.  
  236. ),  
  237. array( 
  238.  
  239. "name" => "General Settings",  
  240.  
  241. "id" => "_favicon_enable",  
  242.  
  243. "std" => $value_of_std[20] 
  244.  
  245. ),  
  246. array( 
  247.  
  248. "name" => "General Settings",  
  249.  
  250. "id" => "_date_enable",  
  251.  
  252. "std" => $value_of_std[21] 
  253.  
  254. ),  
  255. array( 
  256.  
  257. "name" => "Footer text",  
  258.  
  259. "id" => "_footer_text",  
  260.  
  261. "std" => $value_of_std[22] 
  262.  
  263. ); 
  264.  
  265.  
  266.  
  267.  
  268. public function web_dorado_theme_update_and_get_options_general_settings() {  
  269.  
  270. if ( isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "general_page") { 
  271.  
  272. if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'save') { 
  273.  
  274. foreach ($this->options_generalsettings as $value) { 
  275.  
  276. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  277.  
  278.  
  279. foreach ($this->options_generalsettings as $value) { 
  280.  
  281. if (isset($_REQUEST[$value['id']])) { 
  282.  
  283. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  284.  
  285. } else { 
  286.  
  287. remove_theme_mod($value['id']); 
  288.  
  289.  
  290. header("Location: admin.php?page=web_dorado_theme&controller=general_page&saved=true"); 
  291. die; 
  292.  
  293. }  
  294. else { 
  295.  
  296. if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'reset' ) { 
  297.  
  298. foreach ($this->options_generalsettings as $value) { 
  299. remove_theme_mod($value['id']); 
  300.  
  301. header("Location: admin.php?page=web_dorado_theme&controller=general_page&reset=true"); 
  302. die; 
  303.  
  304. }  
  305. }  
  306.  
  307. public function web_dorado_general_settings_page_admin_scripts() {  
  308.  
  309. wp_enqueue_style('general_settings_page_main_style', get_bloginfo('template_directory').'/admin/css/general_settings_page.css');  
  310. wp_enqueue_script('jquery'); 
  311. wp_enqueue_script('common'); 
  312. wp_enqueue_script('jquery-color'); 
  313. wp_print_scripts('editor'); 
  314. if (function_exists('add_thickbox')) add_thickbox(); 
  315. wp_print_scripts('media-upload'); 
  316. //if (function_exists('wp_tiny_mce')) wp_tiny_mce(); 
  317. wp_admin_css(); 
  318. wp_enqueue_script('utils'); 
  319. do_action("admin_print_styles-post-php"); 
  320. do_action('admin_print_styles'); 
  321.  
  322.  
  323. public function dorado_theme_admin_general_settings() { 
  324. if(isset($_REQUEST['controller']) && $_REQUEST['controller']=='general_page') {  
  325. if (isset($_REQUEST['saved']) && $_REQUEST['saved'] )  
  326.  
  327. echo '<div id="message" class="updated"><p><strong>' . $this->generalsettings . ' settings are saved.</strong></p></div>'; 
  328.  
  329. if (isset($_REQUEST['reset']) && $_REQUEST['reset'] )  
  330.  
  331. echo '<div id="message" class="updated"><p><strong>' . $this->generalsettings . ' settings are reset.</strong></p></div>'; 
  332. ?> 
  333.  
  334. <script type="text/javascript"> 
  335. function open_or_hide_param(cur_element) { 
  336. if(cur_element.checked) { 
  337. jQuery(cur_element).parent().parent().parent().find('.open_hide').show(); 
  338. else 
  339. jQuery(cur_element).parent().parent().parent().find('.open_hide').hide(); 
  340.  
  341. //<![CDATA[ 
  342. jQuery(document).ready(function ($) { 
  343.  
  344.  
  345.  
  346. /*setup the var*/ 
  347.  
  348. jQuery('#main_general_page .upload-button').click(function () { 
  349. window.parent.uploadID = jQuery(this).prev('input'); 
  350. /*grab the specific input*/ 
  351. formfield = jQuery('.upload').attr('name'); 
  352. tb_show('', 'media-upload.php?type=image&TB_iframe=true'); 
  353. return false; 
  354. }); 
  355.  
  356. window.send_to_editor = function (html) { 
  357. imgurl = jQuery('img', html).attr('src'); 
  358. window.parent.uploadID.val(imgurl); 
  359. /*assign the value to the input*/ 
  360. tb_remove(); 
  361. }; 
  362. }); 
  363. //]]> 
  364.  
  365.  
  366.  
  367. </script> 
  368. <div id="main_general_page"> 
  369.  
  370. <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;"> 
  371. <tr>  
  372. <td style="font-size:14px; font-weight:bold"> 
  373. <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 make changes in overall content of the site. 
  374. <a href="http://web-dorado.com/wordpress-theme-options/3-3.html" target="_blank" style="color:#126094; text-decoration:none;">More...</a> 
  375. </td>  
  376. <td align="right" style="font-size:16px;"> 
  377. <a href="http://web-dorado.com/wordpress-themes/business-responsive.html" target="_blank" style="color:red; text-decoration:none;"> 
  378. <img src="<?php echo get_template_directory_uri() ?>/images/header.png" border="0" alt="" width="215"><br> 
  379. Get the full version     
  380. </a> 
  381. </td> 
  382. </tr> 
  383. <tr> 
  384. <td> 
  385. <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">General</h3> 
  386. </td> 
  387. </tr> 
  388. </table>  
  389. <form method="post" action="themes.php?page=web_dorado_theme&controller=general_page"> 
  390.  
  391. <table align="center" width="90%" style=" padding-bottom:0px; padding-top:0px;"> 
  392. <tr> 
  393. <td> 
  394. <div id="wrap-general" class="content-div ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs ui-widget ui-corner-all"> 
  395.  
  396.  
  397. <div> 
  398. <div class="optiontitle first"> 
  399. <h3>Show Comments</h3> 
  400. </div> 
  401. <div class="block margin"> 
  402. <div class="optioninput checkbox"> 
  403. <input type="checkbox" class="checkbox" name="_show_comments" id="_show_comments" <?php checked( get_theme_mod("_show_comments"), "on" ); ?>> 
  404. </div> 
  405.  
  406. <div class="optiondescreption"> 
  407. <p>Comment box will appear below the single posts/pages, allowing the users to provide feedback concerning the post. You can disable the comment box for a particular post/page from the corresponding one.</p> 
  408. </div> 
  409. </div> 
  410.  
  411. </div> 
  412.  
  413. <div> 
  414. <div class="optiontitle"> 
  415. <h3>Custom CSS</h3> 
  416. </div> 
  417. <div class="block"> 
  418. <div class="optiondescreption"> 
  419. <p>Custom CSS will change the visual style of the site. This CSS code will be inserted in the <head> tag of your site. You can provide custom CSS code to be applied to specific elements.</p> 
  420. </div> 
  421. <div class="optioninput"> 
  422. <textarea name="_custom_css" id="_custom_css" style="width:440px; height:200px;"><?php if (get_theme_mod('_custom_css') != "") { echo stripslashes(esc_html(get_theme_mod('_custom_css'))); } else { } ?></textarea> 
  423. </div> 
  424. </div> 
  425. </div> 
  426. <div> 
  427. <div class="optiontitle"> 
  428. <h3>Logo</h3> 
  429. </div>  
  430. <div class="optiondescreption"> 
  431. <p>You can apply a custom logo image by clicking on the Upload Image button and uploading your image.</p> 
  432. </div> 
  433. <div class="optioninput" id="upload_images"> 
  434. <input class="upload" id="_logo_img" type="text" size="36" name="_logo_img" value="<?php if (get_theme_mod("_logo_img") != "") { echo stripslashes(esc_url(get_theme_mod("_logo_img"))); } ?>"/> 
  435. <input class="upload-button" type="button" value="Upload Image"/> 
  436. </div> 
  437. </div> 
  438. <div>  
  439. <div class="optiontitle"> 
  440. <h3>Show Favicon</h3> 
  441. </div> 
  442. <div class="block margin"> 
  443. <div class="optiondescreption"> 
  444. <p>Check the box to show favicon on the site. You can add custom favicon to your homepage. Press *Upload image* button and choosing the corresponding file if the box is checked. By default favicon is a 16 x 16 pixel file saved in favicon.ico format in root directory of the server.</p> 
  445. </div> 
  446. <div class="optioninput checkbox"> 
  447. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" value="on" id="_favicon_enable" type="text" size="36" name="_favicon_enable" <?php checked( get_theme_mod("_favicon_enable"), "on" ); ?>/> 
  448. </div> 
  449. </div> 
  450.  
  451. <div class="open_hide"> 
  452.  
  453. <div class="optiondescreption"> 
  454. <p>You can apply a custom favicon image by clicking on the Upload Image button and uploading your image.</p> 
  455. </div> 
  456. <div class="optioninput open_cheched" id="upload_images"> 
  457. <input class="upload" id="_favicon_img" type="text" size="36" name="_favicon_img" value="<?php if (get_theme_mod("_favicon_img") != "") { echo stripslashes(esc_url(get_theme_mod("_favicon_img"))); } ?>"/> 
  458. <input class="upload-button" type="button" value="Upload Image"/> 
  459. </div> 
  460.  
  461. </div> 
  462. </div>  
  463. <div> 
  464. <div class="optiontitle"> 
  465. <h3>Blog Style post format</h3> 
  466. </div> 
  467. <div class="block margin"> 
  468. <div class="optiondescreption"> 
  469. <p>Here you can choose to change the format of your index/homepage posts and view them as short post 
  470. previews.</p> 
  471. </div> 
  472. <div class="optioninput checkbox"> 
  473. <input type="checkbox" class="checkbox" name="_blog_style" id="_blog_style" <?php checked( get_theme_mod("_blog_style"), "on" ); ?>> 
  474. </div> 
  475. </div> 
  476. </div> 
  477. <div> 
  478. <div class="optiontitle"> 
  479. <h3>Grab the First Post Image</h3> 
  480. </div> 
  481. <div class="block margin"> 
  482. <div class="optiondescreption"> 
  483. <p>Enable this option if you want to use the images that are already in your post to create a thumbnail 
  484. without using custom fields. In this case thumbnail images will be generated automatically using the 
  485. first image of the post. Note that the image needs to be hosted on your own server.</p> 
  486. </div> 
  487. <div class="optioninput checkbox"> 
  488. <input type="checkbox" class="checkbox" name="_grab_image" id="_grab_image" <?php checked( get_theme_mod("_grab_image"), "on" ); ?>> 
  489. </div> 
  490. </div> 
  491. </div> 
  492. <div> 
  493. <div class="optiontitle"> 
  494. <h3>Show Twitter Icon</h3> 
  495. </div> 
  496. <div class="block margin"> 
  497. <div class="optiondescreption"> 
  498. <p>Here you can choose to show the Twitter Icon.</p> 
  499. </div> 
  500. <div class="optioninput checkbox">  
  501. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_show_twitter_icon" id="_show_twitter_icon" <?php checked(( get_theme_mod("_show_twitter_icon") || get_theme_mod("_twitter_url") == ""), true ); ?>> 
  502. </div> 
  503. </div> 
  504. <div class="open_hide"> 
  505. <div class="optiondescreption"> 
  506. <p>Enter your Twitter Profile URL below.</p> 
  507. </div> 
  508.  
  509. <div class="optioninput"> 
  510. <input name="_twitter_url" id="_twitter_url" type="text" value="<?php if (get_theme_mod("_twitter_url") != "") { echo stripslashes(esc_url(get_theme_mod("_twitter_url"))); } else { echo "#"; } ?>"></div> 
  511. </div> 
  512. </div> 
  513. <div> 
  514. <div class="optiontitle"> 
  515. <h3>Show RSS Icon</h3> 
  516. </div> 
  517. <div class="block margin"> 
  518. <div class="optiondescreption"> 
  519. <p>Here you can choose to show the RSS Icon.</p> 
  520. </div>  
  521. <div class="optioninput checkbox"> 
  522. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_show_rss_icon" id="_show_rss_icon" <?php checked(( get_theme_mod("_show_rss_icon") || get_theme_mod("_rss_url") == ""), true ); ?>> 
  523. </div> 
  524. </div> 
  525. <div class="open_hide"> 
  526.  
  527. <div class="optiondescreption"> 
  528. <p>Enter your RSS URL below.</p> 
  529. </div> 
  530.  
  531. <div class="optioninput"> 
  532. <input name="_rss_url" id="_rss_url" type="text" value="<?php if (get_theme_mod("_rss_url") != "") { echo stripslashes(esc_url(get_theme_mod("_rss_url"))); } else { bloginfo('rss2_url'); } ?>"> 
  533. </div> 
  534. </div> 
  535. </div> 
  536. <div> 
  537. <div class="optiontitle"> 
  538. <h3>Show Facebook Icon</h3> 
  539. </div> 
  540. <div class="block margin"> 
  541. <div class="optiondescreption"> 
  542. <p>Here you can choose to show the Facebook Icon.</p> 
  543. </div> 
  544. <div class="optioninput checkbox"> 
  545. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_show_facebook_icon" id="_show_facebook_icon" <?php checked(( get_theme_mod("_show_facebook_icon") || get_theme_mod("_facebook_url") == ""), true ); ?>> 
  546. </div> 
  547. </div> 
  548. <div class="open_hide"> 
  549. <div class="optiondescreption"> 
  550. <p>Enter your Facebook Profile URL below.</p> 
  551. </div> 
  552.  
  553. <div class="optioninput">  
  554. <input name="_facebook_url" id="_facebook_url" type="text" value="<?php if (get_theme_mod("_facebook_url") != "") { echo stripslashes(esc_url(get_theme_mod("_facebook_url"))); } else { echo "#"; } ?>"> 
  555. </div> 
  556. </div> 
  557.  
  558. </div>  
  559.  
  560. <div> 
  561. <div class="optiontitle first"> 
  562. <h3>Display Date to the Posts</h3> 
  563. </div> 
  564. <div class="block margin"> 
  565. <div class="optioninput checkbox"> 
  566. <input type="checkbox" class="checkbox" name="_date_enable" id="_date_enable" <?php checked( get_theme_mod("_date_enable"), "on" ); ?>> 
  567. </div> 
  568.  
  569. <div class="optiondescreption"> 
  570. <p>Choose to display date in posts whether or not.</p> 
  571. </div> 
  572. </div>  
  573. </div> 
  574. <div> 
  575. <div class="optiontitle first"> 
  576. <h3>Information in the Footer</h3> 
  577. </div> 
  578. <div class=""> 
  579. <div class="optiondescreption"> 
  580. <p>Here you can provide the HTML code to be inserted in the footer of your web site.</p> 
  581. </div> 
  582. <div class="optioninput"> 
  583. <textarea name="_footer_text" id="_footer_text" style="width:440px; height:200px;"><?php if ($this->options_generalsettings[22]['std'] != "") { echo stripslashes(esc_html($this->options_generalsettings[22]['std'])); } ?></textarea> 
  584. </div> 
  585.  
  586.  
  587. </div>  
  588. </div> 
  589. </div>  
  590. </td> 
  591. </tr> 
  592. </table> 
  593. <br/> 
  594.  
  595.  
  596. <p class="submit" style="float: left; margin-left: 63px; margin-right: 8px;"> 
  597. <input class="button" name="save" type="submit" value="Save changes"/> 
  598. <input type="hidden" name="action" value="save"/> 
  599. </p> 
  600. </form> 
  601. <form method="post" action="themes.php?page=web_dorado_theme&controller=general_page"> 
  602. <p class="submit"> 
  603. <input class="button" name="reset" type="submit" value="Reset"/> 
  604. <input type="hidden" name="action" value="reset"/> 
  605. </p> 
  606. </form> 
  607. </div> 
  608. <?php 
  609.  
  610.  
  611. }  
  612.