web_dor_integration_page_class

The Business Responsive web dor integration page class class.

Defined (1)

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

/admin/integration_page.php  
  1. class web_dor_integration_page_class{ 
  2.  
  3. public $integration; 
  4.  
  5. public $shortintegration; 
  6.  
  7. public $options_integration; 
  8.  
  9.  
  10. function __construct() { 
  11.  
  12. $this->integration = "Integration"; 
  13. $this->shortintegration = "int"; 
  14.  
  15. $this->options_integration = array(  
  16.  
  17. array( 
  18.  
  19. "name" => "Integration",  
  20.  
  21. "id" => "_integrate_header_enable",  
  22.  
  23. "std" => "" 
  24.  
  25. ),  
  26.  
  27. array( 
  28.  
  29. "name" => "Integration",  
  30.  
  31. "id" => "_integrate_body_enable",  
  32.  
  33. "std" => "" 
  34.  
  35. ),  
  36.  
  37. array( 
  38.  
  39. "name" => "Integration",  
  40.  
  41. "id" => "_integrate_singletop_enable",  
  42.  
  43. "std" => "" 
  44.  
  45. ),  
  46.  
  47. array( 
  48.  
  49. "name" => "Integration",  
  50.  
  51. "id" => "_integrate_singlebottom_enable",  
  52.  
  53. "std" => "" 
  54.  
  55. ),  
  56.  
  57. array( 
  58.  
  59. "name" => "Integration",  
  60.  
  61. "id" => "_integration_head",  
  62.  
  63. "std" => "" 
  64.  
  65. ),  
  66.  
  67. array( 
  68.  
  69. "name" => "Integration",  
  70.  
  71. "id" => "_integration_body",  
  72.  
  73. "std" => "" 
  74. ),  
  75.  
  76. array( 
  77. "name" => "Integration",  
  78.  
  79. "id" => "_integration_single_top",  
  80.  
  81. "std" => "" 
  82. ),  
  83.  
  84. array( 
  85.  
  86. "name" => "Integration",  
  87.  
  88. "id" => "_integration_single_bottom",  
  89.  
  90. "std" => "" 
  91. ),  
  92.  
  93. array( 
  94. "name" => "Integration",  
  95.  
  96. "id" => "_integration_single_top",  
  97.  
  98. "std" => "" 
  99. ),  
  100.  
  101. array( 
  102. "name" => "Integration",  
  103.  
  104. "id" => "_integrate_is_baner_enable",  
  105.  
  106. "std" => "" 
  107. ),  
  108.  
  109. array( 
  110. "name" => "Integration",  
  111.  
  112. "id" => "_integrate_baner_image_url",  
  113.  
  114. "std" => "" 
  115. ),  
  116.  
  117. array( 
  118. "name" => "Integration",  
  119.  
  120. "id" => "_integrate_baner_click_destination",  
  121.  
  122. "std" => "" 
  123. ),  
  124.  
  125. array( 
  126. "name" => "Integration",  
  127.  
  128. "id" => "_integrate_baner_adsens_code",  
  129.  
  130. "std" => "" 
  131. ),  
  132.  
  133.  
  134. ); 
  135.  
  136.  
  137.  
  138.  
  139. /// save changes or reset options 
  140. public function web_dorado_theme_update_and_get_options_integration() { 
  141.  
  142. if ( isset($_GET['page']) && $_GET['page'] == "web_dorado_theme" && isset($_GET['controller']) && $_GET['controller'] == "integration_page") { 
  143. if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'save') { 
  144. foreach ($this->options_integration as $value) { 
  145. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  146. foreach ($this->options_integration as $value) { 
  147. if (isset($_REQUEST[$value['id']])) { 
  148. set_theme_mod($value['id'], $_REQUEST[$value['id']]); 
  149. } else { 
  150. remove_theme_mod($value['id']); 
  151. header("Location: themes.php?page=web_dorado_theme&controller=integration_page&saved=true"); 
  152. die; 
  153. } else if (isset($_REQUEST['action']) && $_REQUEST['action'] =='reset') { 
  154. foreach ($this->options_integration as $value) { 
  155. remove_theme_mod($value['id']); 
  156. header("Location: themes.php?page=web_dorado_theme&controller=integration_page&reset=true"); 
  157. die; 
  158.  
  159.  
  160. public function web_dorado_integration_page_admin_scripts() { 
  161.  
  162. wp_enqueue_style('integration_page_main_style', get_bloginfo('template_directory').'/admin/css/integration_page.css');  
  163. if (function_exists('add_thickbox')) add_thickbox(); 
  164. wp_print_scripts('media-upload'); 
  165.  
  166.  
  167.  
  168. public function dorado_theme_admin_integration() { 
  169.  
  170. if(isset($_REQUEST['controller']) && $_REQUEST['controller']=='integration_page') { 
  171. if (isset($_REQUEST['saved']) && $_REQUEST['saved'] )  
  172.  
  173. echo '<div id="message" class="updated"><p><strong>Integration settings are saved.</strong></p></div>'; 
  174.  
  175. if (isset($_REQUEST['reset']) && $_REQUEST['reset'] )  
  176.  
  177. echo '<div id="message" class="updated"><p><strong>Integration settings are reset.</strong></p></div>'; 
  178. ?> 
  179. <script> 
  180. function open_or_hide_param(cur_element) { 
  181. if(cur_element.checked) { 
  182. jQuery(cur_element).parent().parent().parent().find('.open_hide').show(); 
  183. else 
  184. jQuery(cur_element).parent().parent().parent().find('.open_hide').hide(); 
  185.  
  186. jQuery(document).ready(function() { 
  187. jQuery('.with_input').each(function() {open_or_hide_param(this)}) 
  188.  
  189. jQuery("#change-integration-1").click(function() { 
  190. jQuery("#integration_2").hide(100); 
  191. jQuery("#integration_1").show(100); 
  192. jQuery("#button-1").addClass("active_button"); 
  193. jQuery("#button-2").removeClass("active_button"); 
  194.  
  195.  
  196. }); 
  197.  
  198. jQuery("#change-integration-2").click(function() { 
  199.  
  200. jQuery("#integration_1").hide(100); 
  201. jQuery("#integration_2").show(100); 
  202. jQuery("#button-2").addClass("active_button"); 
  203. jQuery("#button-1").removeClass("active_button"); 
  204.  
  205. }); 
  206.  
  207. /*setup the var*/ 
  208.  
  209. jQuery('#main_integration_page .upload-button').click(function () { 
  210. window.parent.uploadID = jQuery(this).prev('input'); 
  211. /*grab the specific input*/ 
  212. formfield = jQuery('.upload').attr('name'); 
  213. tb_show('', 'media-upload.php?type=image&TB_iframe=true'); 
  214. return false; 
  215. }); 
  216.  
  217. window.send_to_editor = function (html) { 
  218. imgurl = jQuery('img', html).attr('src'); 
  219. window.parent.uploadID.val(imgurl); 
  220. /*assign the value to the input*/ 
  221. tb_remove(); 
  222. }; 
  223.  
  224. }); 
  225.  
  226. </script> 
  227. <div id="main_integration_page"> 
  228. <table align="center" width="90%" style="margin-top: 0px; margin-bottom: 20px;border-bottom: rgb(111, 111, 111) solid 2px;"> 
  229. <tr>  
  230. <td style="font-size:14px; font-weight:bold"> 
  231. <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 integrate the website with social media and analytical tools. 
  232. <a href="http://web-dorado.com/wordpress-theme-options/3-5.html" target="_blank" style="color:#126094; text-decoration:none;">More...</a> 
  233. </td>  
  234. <td align="right" style="font-size:16px;"> 
  235. <a href="http://web-dorado.com/wordpress-themes/business-responsive.html" target="_blank" style="color:red; text-decoration:none;"> 
  236. <img src="<?php echo get_template_directory_uri() ?>/images/header.png" border="0" alt="" width="215"><br> 
  237. Get the full version     
  238. </a> 
  239. </td> 
  240. </tr> 
  241. <tr> 
  242. <td> 
  243. <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;"><?php echo $this->integration; ?></h3> 
  244. </td> 
  245. </tr> 
  246. </table> 
  247. <form method="post" action="themes.php?page=web_dorado_theme&controller=integration_page"> 
  248. <table align="center" width="90%" style=" padding-bottom:0px; padding-top:0px;"> 
  249. <tr> 
  250. <td> 
  251. <a href="javascript:;" id="change-integration-1" style="text-decoration:none; color:black; font-family:Segoe UI;color: rgb(111, 111, 111); font-size:10p;"><span class="button active_button" id="button-1" style="background: url(<?php echo get_template_directory_uri(); ?>/images/button.png) center; background-size: 100% 100%;">Main Integration</span></a> 
  252. <a href="javascript:;" id="change-integration-2" style="text-decoration:none; background-color:silver; color:black; font-family:Segoe UI;color: rgb(111, 111, 111); font-size:10p;"><span class="button" id="button-2" style="background: url(<?php echo get_template_directory_uri(); ?>/images/button.png) center; background-size: 100% 100%;">AdSense and Advertisement Integration</span></a> 
  253. <br /> 
  254. <br /> 
  255.  
  256. <div id="integration_1"> 
  257. <div> 
  258. <div class="optiontitle first"> 
  259. <h3>Enable header code</h3> 
  260. </div> 
  261.  
  262. <div class="block margin"> 
  263. <div class="optiondescreption"> 
  264. <p>Enable this option to add the header code specified below. Disabling this option removes the 
  265. header code from your blog (the code is saved and can be used later on).</p> 
  266. </div> 
  267. <div class="optioninput checkbox"> 
  268. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_integrate_header_enable" id="_integrate_header_enable" <?php checked( get_theme_mod("_integrate_header_enable"), "on" ); ?>> 
  269. </div> 
  270. </div> 
  271. <div class="open_hide">  
  272. <div class="optiondescreption"> 
  273. <p>Here you can add code to appear in the head section of every page of your blog (useful adding 
  274. javascript or css to all pages).</p> 
  275. </div> 
  276.  
  277. <div class="optioninput"> 
  278. <textarea name="_integration_head" id="_integration_head" style="width:440px; height:200px;"><?php if (get_theme_mod('_integration_head') != "") { echo stripslashes(esc_html(get_theme_mod('_integration_head'))); } ?></textarea> 
  279.  
  280. </div> 
  281. </div> 
  282. </div>  
  283. <div> 
  284. <div class="optiontitle"> 
  285. <h3>Enable body code</h3> 
  286. </div> 
  287. <div class="block margin"> 
  288. <div class="optiondescreption"> 
  289. <p>Enable this option to add the body code specified below. Disabling this option removes the 
  290. body code from your blog (the code is saved and can be used later on).</p> 
  291. </div> 
  292. <div class="optioninput checkbox"> 
  293. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_integrate_body_enable" id="_integrate_body_enable" <?php checked( get_theme_mod("_integrate_body_enable"), "on" ); ?>> 
  294. </div> 
  295. </div> 
  296. <div class="open_hide"> 
  297. <div class="optiondescreption"> 
  298. <p>Here you can add code to appear in body section of all pages of your blog. Can be used 
  299. toenter a tracking pixel for a state counter such as Google Analytics.</p> 
  300. </div> 
  301.  
  302. <div class="optioninput"> 
  303. <textarea name="_integration_body" id="_integration_body" style="width:440px; height:200px;"><?php if (get_theme_mod('_integration_body') != "") { echo stripslashes(esc_html(get_theme_mod('_integration_body'))); } ?></textarea>  
  304. </div>  
  305. </div> 
  306. </div> 
  307. <div>  
  308. <div class="optiontitle"> 
  309. <h3>Enable single top code</h3> 
  310. </div> 
  311. <div class="block margin"> 
  312. <div class="optiondescreption"> 
  313. <p>Enable this option to add the single top code specified below. Disabling this option removes 
  314. the single top code from your blog (the code is saved and can be used later on).</p> 
  315. </div> 
  316. <div class="optioninput checkbox"> 
  317. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_integrate_singletop_enable" id="_integrate_singletop_enable" <?php checked( get_theme_mod("_integrate_singletop_enable"), "on" ); ?>> 
  318. </div> 
  319. </div> 
  320. <div class="open_hide"> 
  321. <div class="optiondescreption"> 
  322. <p>Here you can add code to be palcedat the top of all single posts (useful for integrating social bookmarking 
  323. links for instance).</p> 
  324. </div> 
  325.  
  326. <div class="optioninput"> 
  327. <textarea name="_integration_single_top" id="_integration_single_top" style="width:440px; height:200px;"><?php if (get_theme_mod('_integration_single_top') != "") { echo stripslashes(esc_html(get_theme_mod('_integration_single_top'))); }?></textarea> 
  328. </div> 
  329. </div> 
  330. </div> 
  331. <div> 
  332. <div class="optiontitle"> 
  333. <h3>Enable single bottom code</h3> 
  334. </div> 
  335. <div class="block margin"> 
  336. <div class="optiondescreption"> 
  337. <p>Enable this option to add the single bottom code specified below. Disabling this option 
  338. removes the single bottom code from your blog (the code is saved and can be used later 
  339. on).</p> 
  340. </div> 
  341. <div class="optioninput checkbox"> 
  342. <input type="checkbox" onclick="open_or_hide_param(this)" class="checkbox with_input" name="_integrate_singlebottom_enable" id="_integrate_singlebottom_enable" <?php checked( get_theme_mod("_integrate_singlebottom_enable"), "on" ); ?>> 
  343. </div> 
  344. </div> 
  345. <div class="open_hide"> 
  346. <div class="optiondescreption"> 
  347. <p>Here you can add code to be placed at the bottom of all single posts. </p> 
  348. </div> 
  349. <div class="optioninput"> 
  350. <textarea name="_integration_single_bottom" id="_integration_single_bottom" style="width:440px; height:200px;"><?php if (get_theme_mod('_integration_single_bottom') != "") { echo stripslashes(esc_html(get_theme_mod('_integration_single_bottom' ))); }?></textarea> 
  351. </div> 
  352. </div>  
  353. </div> 
  354.  
  355.  
  356.  
  357.  
  358. </div> 
  359. <div id="integration_2" style="display:none;"> 
  360. <div class="optiontitle"> 
  361. <h3>Enable advertisement banner</h3> 
  362. </div>  
  363. <div class="block margin">  
  364. <div class="optiondescreption"> 
  365. <p>Enabling this option will display the banner (size 468x60) add on the bottom of your post pages below the single post content. If enabled you must fill in the banner image and destination URL below.</p> 
  366. </div>  
  367. <div class="optioninput checkbox"> 
  368. <input type="checkbox" class="checkbox" name="_integrate_is_baner_enable" id="_integrate_is_baner_enable" <?php checked( get_theme_mod("_integrate_is_baner_enable"), "on" ); ?>> 
  369. </div> 
  370. </div> 
  371.  
  372. <div class="optiontitle"> 
  373. <h3>Upload advertisement banner image</h3> 
  374. </div> 
  375. <div class="optiondescreption"> 
  376. <p>You can upload the advertisement banner (size 468*60) by clicking the Upload banner button.</p> 
  377. </div> 
  378. <div class="optioninput"> 
  379.  
  380. <input class="upload" id="_integrate_baner_image_url" type="text" size="85" name="_integrate_baner_image_url" value="<?php if (get_theme_mod("_integrate_baner_image_url") != "") { echo stripslashes(esc_url(get_theme_mod("_integrate_baner_image_url"))); } ?>"/> 
  381. <input class="upload-button" type="button" value="Upload Image"/> 
  382. </div> 
  383.  
  384. <div class="optiontitle"> 
  385. <h3>The URL of advertisement banner when clicked</h3> 
  386. </div> 
  387. <div class="optiondescreption"> 
  388. <p>You can provide the value of the destination URL when advertisement banner is clicked.</p> 
  389. </div> 
  390. <div class="optioninput"> 
  391. <input type="text" size="100" class="text" name="_integrate_baner_click_destination" id="_integrate_baner_click_destination" value="<?php echo stripslashes(esc_url(get_theme_mod("_integrate_baner_click_destination", ''))); ?>"> 
  392. </div> 
  393.  
  394. <div class="optiontitle"> 
  395. <h3>AdSense Code</h3> 
  396. </div> 
  397. <div class="optiondescreption"> 
  398. <p>Please insert the AdSense code provided by Google. </p> 
  399. </div> 
  400. <div class="optioninput"> 
  401. <input type="text" size="100" class="text" name="_integrate_baner_adsens_code" id="_integrate_baner_adsens_code" value="<?php echo stripslashes(esc_attr(get_theme_mod("_integrate_baner_adsens_code", ''))); ?>"> 
  402. </div> 
  403.  
  404. </div> 
  405. </td> 
  406. </tr> 
  407. </table> 
  408. <br/> 
  409. <p class="submit" style="float: left; margin-left: 63px; margin-right: 8px;"> 
  410. <input class="button" name="save" type="submit" value="Save changes"/> 
  411. <input type="hidden" name="action" value="save"/> 
  412. </p> 
  413. </form> 
  414. <form method="post" action="themes.php?page=web_dorado_theme&controller=integration_page"> 
  415. <p class="submit"> 
  416. <input class="button" name="reset" type="submit" value="Reset"/> 
  417. <input type="hidden" name="action" value="reset"/> 
  418. </p> 
  419. </form> 
  420. </div> 
  421. <?php  
  422. }  
  423.