web_dor_sample_date

The Business Responsive web dor sample date class.

Defined (1)

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

/admin/install_sampl_date.php  
  1. class web_dor_sample_date{ 
  2.  
  3. public function web_dorado_sample_data_admin_scripts() { 
  4.  
  5. wp_enqueue_script('jquery');  
  6.  
  7.  
  8.  
  9. public function web_buisnes_install_posts() { 
  10.  
  11. if(isset($_GET['install_element']) && $_GET['install_element']=='inst') 
  12. $this->install_post_menu_pages(); 
  13. //$this->install_widgets();  
  14. if(isset($_GET['remove_element']) && $_GET['remove_element']=='rem') {  
  15. $this->remove_post_menu_pages(); 
  16. $this->remove_widgets();  
  17. ?> 
  18. <script> 
  19. count_of_installed=1; 
  20. installeation=new Array(); 
  21. installeation[1]='Adding Page About Us'; 
  22. installeation[2]='Adding Page Services'; 
  23. installeation[3]='Adding Page News'; 
  24. installeation[4]='Adding Page Blog'; 
  25. installeation[5]='Adding Page Gallery'; 
  26. installeation[6]='Adding Page Log In'; 
  27. installeation[7]='Adding Page Search'; 
  28. installeation[8]='Adding Page Parent'; 
  29. installeation[9]='Adding Page SubPage1'; 
  30. installeation[10]='Adding Page SubPage2'; 
  31. installeation[11]='Adding Page Contact Us'; 
  32. installeation[12]='Adding Gallery Posts Category'; 
  33. installeation[13]='Adding Blog Posts Category'; 
  34. installeation[14]='Adding News Posts Category'; 
  35. installeation[15]='Adding Top Posts Category'; 
  36. installeation[16]='Adding Content Posts Category'; 
  37. installeation[17]='Adding Post ADALAH SATU'; 
  38. installeation[18]='Adding Post PELBAGAI TELAH!!!'; 
  39. installeation[19]='Adding Post Ipsum Presents!!'; 
  40. installeation[20]='Adding Post About Us'; 
  41. installeation[21]='Adding Post Service'; 
  42. installeation[22]='Adding Post Products'; 
  43. installeation[23]='Adding Post Morbi in sem quis dui placerat ornare.1'; 
  44. installeation[24]='Adding Post Morbi in sem quis dui placerat ornare.2'; 
  45. installeation[25]='Adding Post Lorem ipsum dolor sit amet'; 
  46. installeation[26]='Adding Post Lorem ipsum dolor sit amet2'; 
  47. installeation[27]='Adding Post Lorem ipsum dolor sit amet3'; 
  48. installeation[28]='Adding Post Lorem ipsum dolor sit amet4'; 
  49. installeation[29]='Adding Post Gallery Post1'; 
  50. installeation[30]='Adding Post Gallery Post2'; 
  51. installeation[31]='Adding Post Gallery Post3'; 
  52. installeation[32]='Adding Post Gallery Post4'; 
  53. installeation[33]='Adding Post Gallery Post5'; 
  54. installeation[34]='Adding Post Gallery Post6'; 
  55. installeation[35]='Adding Post Gallery Post7'; 
  56. installeation[36]='Adding Post Gallery Post8'; 
  57. installeation[37]='Adding Post Gallery Post9'; 
  58. installeation[38]='Adding Post Gallery Post10'; 
  59. installeation[39]='Connecting Thumbnails to Gallery Post1'; 
  60. installeation[40]='Connecting Thumbnails to Gallery Post2'; 
  61. installeation[41]='Connecting Thumbnails to Gallery Post3'; 
  62. installeation[42]='Connecting Thumbnails to Gallery Post4'; 
  63. installeation[43]='Connecting Thumbnails to Gallery Post5'; 
  64. installeation[44]='Connecting Thumbnails to Gallery Post6'; 
  65. installeation[45]='Connecting Thumbnails to Gallery Post7'; 
  66. installeation[46]='Connecting Thumbnails to Gallery Post8'; 
  67. installeation[47]='Connecting Thumbnails to Gallery Post9'; 
  68. installeation[48]='Connecting Thumbnails to Gallery Post10'; 
  69. installeation[49]='Connecting Thumbnails to Products '; 
  70. installeation[50]='Connecting Thumbnails to blog post 1'; 
  71. installeation[51]='Connecting Thumbnails to blog post 2'; 
  72. installeation[52]='Connecting Thumbnails to news post 1'; 
  73. installeation[53]='Connecting Thumbnails to news post 2'; 
  74. installeation[54]='Connecting Thumbnails to news post 3'; 
  75. installeation[55]='Connecting Thumbnails to news post 4'; 
  76. installeation[56]='Adding Metadata for About Us, Gallery and Service Pages'; 
  77. installeation[57]='Adding Menu Web Business'; 
  78. installeation[58]='Adding Menu Item Home'; 
  79. installeation[59]='Adding Menu Item About Us'; 
  80. installeation[60]='Adding Menu Item Service'; 
  81. installeation[61]='Adding Menu Item News'; 
  82. installeation[62]='Adding Menu Item Blog'; 
  83. installeation[63]='Adding Menu Item Gallery'; 
  84. installeation[64]='Adding Menu Item Log In'; 
  85. installeation[65]='Adding Menu Item Search'; 
  86. installeation[66]='Adding Menu Item Parent'; 
  87. installeation[67]='Adding Menu Item Sub Page1'; 
  88. installeation[68]='Adding Menu Item Sub Page2'; 
  89. installeation[69]='Adding Menu Item Contact Us'; 
  90. installeation[70]='Adding Slider Options'; 
  91. installeation[71]='Adding Widget'; 
  92. installeation[72]='Connecting Thumbnails to ADALAH MENJADI SATU!!'; 
  93. installeation[73]='Connecting Thumbnails to PELBAGAI VERSI TELAH!!!'; 
  94. installeation[74]='Connecting Thumbnails to Ipsum Presents!!!'; 
  95. installeation[75]='The Data is Installed'; 
  96.  
  97.  
  98. count_of_remov=1;  
  99. removing=new Array(); 
  100. removing[1]='Remove Page About Us'; 
  101. removing[2]='Remove Page Services'; 
  102. removing[3]='Remove Page News'; 
  103. removing[4]='Remove Page Blog'; 
  104. removing[5]='Remove Page Gallery'; 
  105. removing[6]='Remove Page Log In'; 
  106. removing[7]='Remove Page Search'; 
  107. removing[8]='Remove Page Parent'; 
  108. removing[9]='Remove Page SubPage1'; 
  109. removing[10]='Remove Page SubPage2'; 
  110. removing[11]='Remove Page Contact Us'; 
  111. removing[12]='Remove Gallery Posts Category'; 
  112. removing[13]='Remove Blog Posts Category'; 
  113. removing[14]='Remove News Posts Category'; 
  114. removing[15]='Remove Top Posts Category'; 
  115. removing[16]='Remove Content Posts Category'; 
  116. removing[17]='Remove Post ADALAH SATU'; 
  117. removing[18]='Remove Post PELBAGAI TELAH!!!'; 
  118. removing[19]='Remove Post Ipsum Presents!!'; 
  119. removing[20]='Remove Post About Us'; 
  120. removing[21]='Remove Post Service'; 
  121. removing[22]='Remove Post Products'; 
  122. removing[23]='Remove Post Morbi in sem quis dui placerat ornare.1'; 
  123. removing[24]='Remove Post Morbi in sem quis dui placerat ornare.2'; 
  124. removing[25]='Remove Post Lorem ipsum dolor sit amet'; 
  125. removing[26]='Remove Post Lorem ipsum dolor sit amet2'; 
  126. removing[27]='Remove Post Lorem ipsum dolor sit amet3'; 
  127. removing[28]='Remove post Lorem ipsum dolor sit amet4'; 
  128. removing[29]='Remove Post Gallery Post1'; 
  129. removing[30]='Remove Post Gallery Post2'; 
  130. removing[31]='Remove Post Gallery Post3'; 
  131. removing[32]='Remove Post Gallery Post4'; 
  132. removing[33]='Remove Post Gallery Post5'; 
  133. removing[34]='Remove Post Gallery Post6'; 
  134. removing[35]='Remove Post Gallery Post7'; 
  135. removing[36]='Remove Post Gallery Post8'; 
  136. removing[37]='Remove Post Gallery Post9'; 
  137. removing[38]='Remove Post Gallery Post10'; 
  138. removing[39]='Remove Menu'; 
  139. removing[40]='Remove Widgets'; 
  140. removing[41]='Remove Slider'; 
  141. removing[42]='The Data is Removed'; 
  142.  
  143.  
  144. function add_install_text(install_text) { 
  145. var kent_or_zuyk=count_of_installed%2+1; 
  146. new_element=jQuery('<div class="install_date'+kent_or_zuyk+'"><div class="install_text">'+install_text+'     </div><div class="result_div"><img class="image_load" src="<?php echo get_template_directory_uri(); ?>/images/loading.gif" /></div></div>'); 
  147. jQuery('#installed_date_list').append(new_element); 
  148. return new_element; 
  149. function add_remov_text(remov_text) { 
  150. var kent_or_zuyk=count_of_remov%2+1; 
  151. new_element=jQuery('<div class="remove_date'+kent_or_zuyk+'"><div class="remove_text">'+remov_text+'     </div><div class="result_div"><img class="image_load" src="<?php echo get_template_directory_uri(); ?>/images/loading.gif" /></div></div>'); 
  152. jQuery('#installed_date_list').append(new_element); 
  153. return new_element; 
  154. function submit(remov_or_install, number_action) { 
  155. if(number_action==1) { 
  156. jQuery('#installed_date_list').html(''); 
  157. if(remov_or_install=='install') { 
  158. if(number_action==1) { 
  159. count_of_installed=1; 
  160. if(!confirm("This action will install sample data for your theme.Are you sure to proceed?")) 
  161. return; 
  162. element=add_install_text(installeation[count_of_installed]); 
  163. image_complete=jQuery(element).find('img'); 
  164. result_div=jQuery(element).find('.result_div'); 
  165. jQuery.ajax({ 
  166. url: "<?php echo admin_url('admin-ajax.php'); ?>?action=install_sample_date&number_of_actoion="+number_action,  
  167. success: function(data) { 
  168. if(data=='1') { 
  169. image_complete.attr('src', '<?php echo get_template_directory_uri(); ?>/images/sucsess.png'); 
  170. else 
  171. result_div.html(data); 
  172. }  
  173. count_of_installed++; 
  174. if(count_of_installed!=installeation.length) { 
  175.  
  176. submit('install', count_of_installed) 
  177.  
  178. }); 
  179. return; 
  180.  
  181. if(remov_or_install=='remove') { 
  182. if(number_action==1) { 
  183. count_of_remov=1;  
  184. if(!confirm("This action will remove sample data. Are you sure to proceed?")) 
  185. return; 
  186. element=add_remov_text(removing[count_of_remov]); 
  187. image_complete=jQuery(element).find('img'); 
  188. result_div=jQuery(element).find('.result_div'); 
  189. jQuery.ajax({ 
  190. url: "<?php echo admin_url('admin-ajax.php'); ?>?action=remove_sample_date&number_of_actoion="+number_action,  
  191. success: function(data) { 
  192. if(data=='1') { 
  193. image_complete.attr('src', '<?php echo get_template_directory_uri(); ?>/images/sucsess.png'); 
  194. else 
  195. result_div.html(data); 
  196. }  
  197.  
  198. count_of_remov++; 
  199. if(count_of_remov!=removing.length) { 
  200.  
  201. submit('remove', count_of_remov) 
  202. }); 
  203. return; 
  204.  
  205.  
  206.  
  207.  
  208.  
  209. </script> 
  210. <style> 
  211. .headin_class{ 
  212. -webkit-margin-before: 0px; 
  213. -webkit-margin-after: 10px; 
  214. margin-left:59px; 
  215. font-family:Segoe UI; 
  216. width:90%;padding-bottom: 15px; 
  217. border-bottom: rgb(111, 111, 111) solid 2px; 
  218. color: rgb(111, 111, 111); 
  219. font-size:18pt; 
  220.  
  221. #installed_date_list{ 
  222. margin-left:59px; 
  223. width:90%; 
  224. #install_remove{ 
  225. background-color:#F1F1F1 ; 
  226. margin:10px; 
  227. width:90%; 
  228. margin-left:59px; 
  229.  
  230. #doaction{ 
  231. margin: 10px; 
  232. margin-right:0px; 
  233. .install_text{ 
  234. color:rgb(111, 111, 111); 
  235. font-family:Segoe UI; 
  236. font-size:15pt; 
  237. float:left; 
  238. .remove_text{ 
  239. color:rgb(111, 111, 111); 
  240. font-family:Segoe UI; 
  241. font-size:15pt; 
  242. float:left; 
  243. .list_title{ 
  244. font-size:24px; 
  245. .image_load{ 
  246. width:16px; 
  247. height:16px;  
  248. .error_text{ 
  249. color: #991111; 
  250. font-size: 15pt; 
  251. .notification_text{ 
  252. color: #115A8F; 
  253. font-size: 15pt; 
  254. .install_date2{ 
  255. padding-top:10px; 
  256. padding-bottom:10px; 
  257. background-color:#FFFFFF; 
  258. .install_date1{ 
  259. padding-top:10px; 
  260. padding-bottom:10px; 
  261. background-color:#F8F8F8; 
  262. .remove_date2{ 
  263. padding-top:10px; 
  264. padding-bottom:10px; 
  265. background-color:#FFFFFF; 
  266. .remove_date1{ 
  267. padding-top:10px; 
  268. padding-bottom:10px; 
  269. background-color:#F8F8F8; 
  270. .result_div{ 
  271.  
  272. </style> 
  273. <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;"> 
  274. <tr>  
  275. <td style="font-size:14px; font-weight:bold"> 
  276. <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 to add sample data. 
  277. <a href="http://web-dorado.com/wordpress-theme-options/3-9.html" target="_blank" style="color:#126094; text-decoration:none;">More...</a> 
  278. </td>  
  279. <td align="right" style="font-size:16px;"> 
  280. <a href="http://web-dorado.com/wordpress-themes/business-responsive.html" target="_blank" style="color:red; text-decoration:none;"> 
  281. <img src="<?php echo get_template_directory_uri() ?>/images/header.png" border="0" alt="" width="215"><br> 
  282. Get the full version     
  283. </a> 
  284. </td> 
  285. </tr> 
  286. <tr> 
  287. <td> 
  288. <h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Install Sample Data</h3> 
  289. </td> 
  290. </tr> 
  291. </table>  
  292.  
  293.  
  294.  
  295.  
  296. <div id="install_remove"> 
  297. <input type="button" onclick="submit('install', 1)" name="" id="doaction" class="button action" value="Install Sample Data"> 
  298. <input type="button" onclick="submit('remove', 1)" name="" id="doaction" class="button action" value="Remove Sample Data"> 
  299. </div> 
  300. <div id="installed_date_list"> 
  301.  
  302. </div> 
  303. <?php  
  304.  
  305.  
  306.  
  307. public function install_ajax() { 
  308. $action_number=$_GET['number_of_actoion']; 
  309. switch($action_number) { 
  310. case 1:{ 
  311.  
  312. $insert_page['spec_id']='1'; 
  313.  
  314. $insert_page['title']='About Us'; 
  315.  
  316. $insert_page['content']=" 
  317. <div class=\"about_us_img\"><img alt=\"\" src=\"".get_template_directory_uri()."/images/sidebarItem3.png\" /> 
  318. <div class=\"pnt\"></div> 
  319. </div> 
  320. <p style=\"font-size: 16px;\">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, .</p> 
  321.   
  322. <p style=\"font-size: 16px;\">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>"; 
  323.  
  324.  
  325. echo $this->install_page($insert_page); 
  326. break; 
  327. }  
  328. case 2:{  
  329.  
  330. $insert_page['spec_id']='2';  
  331. $insert_page['title']='Services';  
  332. $insert_page['content']="<p style='font-size: 17px;line-height: 25px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi.</p> 
  333. <ul class='service_page' style='line-height: 32px;font-size: 17px;display: inline-table;width: 100%;'> 
  334. <li style='float:left;list-style: none;padding:5px;width: 43%;'> 
  335. <ul style='list-style-image:url(\"".get_template_directory_uri()."/images/content.list.icon.gif\");list-style-position: inside;padding: 0;'> 
  336. <li>Lorem ipsum dolor sit amet.</li> 
  337. <li>Aliquam tincidunt mauris eu .</li> 
  338. <li>Vestibulum auctor dapibus.</li> 
  339. <li>Lorem ipsum dolor sit amet.</li> 
  340. <li>Aliquam tincidunt mauris eu.</li> 
  341. <li>Vestibulum auctor dapibus.</li> 
  342. <li>Vestibulum auctor dapibus neque.</li> 
  343. <li>Lorem ipsum dolor sit amet.</li> 
  344. </ul> 
  345. </li> 
  346. <li style='float:left;list-style: none;padding:5px;width: 43%;'> 
  347. <ul style='list-style-image:url(\"".get_template_directory_uri()."/images/content.list.icon.gif\");list-style-position: inside;padding: 0;'> 
  348. <li>Lorem ipsum dolor sit amet.</li> 
  349. <li>Aliquam tincidunt mauris eu.</li> 
  350. <li>Vestibulum auctor dapibus neque.</li> 
  351. <li>Lorem ipsum dolor sit amet.</li> 
  352. <li>Aliquam tincidunt mauris eu.</li> 
  353. <li>Vestibulum auctor dapibus.</li> 
  354. <li>Vestibulum auctor dapibus neque.</li> 
  355. <li>Lorem ipsum dolor sit amet.</li> 
  356. </ul> 
  357. </li> 
  358. </ul> 
  359. <p style='font-size: 17px;line-height: 25px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante.</p> 
  360. <div class='tag_for_service'></div>";  
  361.  
  362.  
  363.  
  364. echo $this->install_page($insert_page); 
  365. break; 
  366. }  
  367. case 3:{  
  368.  
  369. $insert_page['spec_id']='3';  
  370. $insert_page['title']='News';  
  371. $insert_page['content']="<p style='font-size: 16px;'>Quisque sit amet est et sapien ullamcorper pharetra.</p>";  
  372.  
  373. $insert_page['meta']['meta_key']='_wp_page_template'; 
  374. $insert_page['meta']['meta_value']='page-news.php';  
  375.  
  376. echo $this->install_page($insert_page); 
  377. break; 
  378. }  
  379.  
  380. case 4:{  
  381.  
  382. $insert_page['spec_id']='4';  
  383. $insert_page['title']='Blog';  
  384. $insert_page['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>";  
  385.  
  386. $insert_page['meta']['meta_key']='_wp_page_template'; 
  387. $insert_page['meta']['meta_value']='page-blog.php';  
  388.  
  389. echo $this->install_page($insert_page); 
  390. break; 
  391. }  
  392. case 5:{  
  393.  
  394. $insert_page['spec_id']='5';  
  395. $insert_page['title']='Gallery';  
  396. $insert_page['content']="<p style='font-size: 16px;'>Donec eu libero sit amet quam egestas semper.</p>"; 
  397.  
  398. $insert_page['meta']['meta_key']='_wp_page_template'; 
  399. $insert_page['meta']['meta_value']='page-gallery.php';  
  400.  
  401. $insert_page['custom_meta']['blog_perpage']='9'; 
  402. echo $this->install_page($insert_page); 
  403. break; 
  404. }  
  405. case 6:{  
  406.  
  407. $insert_page['spec_id']='6';  
  408. $insert_page['title']='Log In';  
  409. $insert_page['content']="<p style='font-size: 16px;'>Quisque sit amet est et sapien ullamcorper pharetra.</p>";  
  410.  
  411. $insert_page['meta']['meta_key']='_wp_page_template'; 
  412. $insert_page['meta']['meta_value']='page-login.php';  
  413.  
  414.  
  415. echo $this->install_page($insert_page); 
  416. break; 
  417. }  
  418. case 7:{  
  419.  
  420. $insert_page['spec_id']='7';  
  421. $insert_page['title']='Search';  
  422. $insert_page['content']="<p style='font-size: 16px;'>Quisque sit amet est et sapien ullamcorper pharetra.</p>";;  
  423.  
  424. $insert_page['meta']['meta_key']='_wp_page_template'; 
  425. $insert_page['meta']['meta_value']='search.php';  
  426.  
  427. echo $this->install_page($insert_page); 
  428. break; 
  429. }  
  430. case 8:{  
  431.  
  432. $insert_page['spec_id']='8';  
  433. $insert_page['title']='Parent';  
  434. $insert_page['content']="";  
  435. echo $this->install_page($insert_page); 
  436. break; 
  437. }  
  438. case 9:{  
  439.  
  440. $insert_page['spec_id']='9';  
  441. $insert_page['title']='Sub Page1';  
  442. $insert_page['content']="";  
  443.  
  444. $insert_page['parent_of']=8;  
  445. echo $this->install_page($insert_page); 
  446. break; 
  447. }  
  448. case 10:{  
  449.  
  450. $insert_page['spec_id']='10';  
  451. $insert_page['title']='Sub Page2';  
  452. $insert_page['content']="";  
  453.  
  454. $insert_page['parent_of']=8; 
  455. echo $this->install_page($insert_page); 
  456. break; 
  457. }  
  458. case 11:{  
  459.  
  460. $insert_page['spec_id']='11';  
  461. $insert_page['title']='Contact Us';  
  462. $insert_page['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>"; 
  463.  
  464. $insert_page['meta']['meta_key']='_wp_page_template'; 
  465. $insert_page['meta']['meta_value']='page-contact.php';  
  466.  
  467. echo $this->install_page($insert_page); 
  468. break; 
  469. }  
  470. case 12:{  
  471. $category_params['spec_id']=$action_number; 
  472. $category_params['param'] = array( 
  473. 'cat_name' => 'Gallery posts',  
  474. 'category_description' => 'Category for Gallery Posts',  
  475. 'category_nicename' => '',  
  476. 'category_parent' => '' 
  477. ); 
  478. echo $this->install_category($category_params); 
  479. break; 
  480. }  
  481. case 13:{  
  482. $category_params['spec_id']=$action_number; 
  483. $category_params['param'] = array( 
  484. 'cat_name' => 'Blog posts',  
  485. 'category_description' => 'Category for Blog Posts',  
  486. 'category_nicename' => '',  
  487. 'category_parent' => '' 
  488. ); 
  489. echo $this->install_category($category_params); 
  490. break; 
  491. }  
  492. case 14:{  
  493. $category_params['spec_id']=$action_number; 
  494. $category_params['param'] =array( 
  495. 'cat_name' => 'News posts',  
  496. 'category_description' => 'Category for News Posts',  
  497. 'category_nicename' => '',  
  498. 'category_parent' => '' 
  499. ); 
  500. echo $this->install_category($category_params); 
  501. break; 
  502. }  
  503. case 15:{  
  504. $category_params['spec_id']=$action_number; 
  505. $category_params['param'] =array( 
  506. 'cat_name' => 'Top posts',  
  507. 'category_description' => 'Category for Top Posts',  
  508. 'category_nicename' => '',  
  509. 'category_parent' => '' 
  510. ); 
  511. echo $this->install_category($category_params); 
  512. break; 
  513. }  
  514. case 16:{  
  515. $category_params['spec_id']=$action_number; 
  516. $category_params['param'] =array( 
  517. 'cat_name' => 'Content posts',  
  518. 'category_description' => 'Category for Content Posts',  
  519. 'category_nicename' => '',  
  520. 'category_parent' => '' 
  521. ); 
  522. echo $this->install_category($category_params); 
  523. break; 
  524.  
  525. case 17:{  
  526.  
  527. $insert_post['spec_id']=$action_number;  
  528. $insert_post['title']='ADALAH SATU!!!';  
  529. $insert_post['content']="<p>bahawa pembaca akan teranggu oleh text yang bolah difahami apabila melihat susunan mukasurat. Kengunaan Lorem...</p>";  
  530.  
  531. $insert_post['category']=15;  
  532. echo $this->install_post($insert_post); 
  533. break; 
  534. case 18:{  
  535.  
  536. $insert_post['spec_id']=$action_number;  
  537. $insert_post['title']='PELBAGAI TELAH!!!';  
  538. $insert_post['content']="<p>bahawa pembaca akan teranggu oleh text yang bolah difahami apabila melihat susunan mukasurat. Kengunaan Lorem...</p>"; 
  539.  
  540.  
  541. $insert_post['category']=15;  
  542. echo $this->install_post($insert_post); 
  543. break; 
  544.  
  545. case 19:{  
  546.  
  547. $insert_post['spec_id']=$action_number;  
  548. $insert_post['title']='Ipsum Presents!!';  
  549. $insert_post['content']=" <p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p>"; 
  550.  
  551.  
  552.  
  553. $insert_post['category']=15;  
  554. echo $this->install_post($insert_post); 
  555. break; 
  556. case 20:{  
  557.  
  558. ///content post 1 
  559. $insert_post['spec_id']=$action_number;  
  560. $insert_post['title']='About Us';  
  561. $insert_post['content']="<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue.</p>"; 
  562.  
  563.  
  564. $insert_post['category']=16;  
  565. echo $this->install_post($insert_post); 
  566. break; 
  567. case 21:{  
  568. ///content post 2 
  569. $insert_post['spec_id']=$action_number;  
  570. $insert_post['title']='Service';  
  571. $insert_post['content']="<p style='font-size: 17px;line-height: 25px;margin-bottom:0;'>Pellentesque habitant morbi tristique senectus. </p> 
  572. <ul style='list-style-image:url(\"".get_template_directory_uri()."/images/content.list.icon.gif\");font-size: 16px;line-height: 26px;'> 
  573. <li>Lorem ipsum dolor, elit amet.</li> 
  574. <li>Aliquam tincidunt mauris sit.</li> 
  575. <li>Aliquam tincidunt mauris sit.</li> 
  576. <li>Vestibulum auctor neque mauris.</li> 
  577. <li>Lorem ipsum dolor, elit sit.</li> 
  578. <li>Aliquam tincidunt mauris sit.</li> 
  579. <li>Vestibulum auctor dapibus elit.</li> 
  580. <li>Vestibulum auctor dapibus risus.</li> 
  581. <li>Lorem ipsum dolor, dapibus.</li> 
  582. <li style='margin-bottom: 20px;'>Lorem ipsum dolor, dapibus.</li> 
  583. </ul>";  
  584.  
  585. $insert_post['category']=16;  
  586. echo $this->install_post($insert_post); 
  587. break; 
  588. case 22:{  
  589. ///content post 3 
  590. $insert_post['spec_id']=$action_number;  
  591. $insert_post['title']='Products';  
  592. $insert_post['content']="<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis.</p>"; 
  593.  
  594. $insert_post['category']=16;  
  595. echo $this->install_post($insert_post); 
  596. break; 
  597. case 23:{  
  598. /// blog post 1 
  599. $insert_post['spec_id']=$action_number;  
  600. $insert_post['title']='Morbi in sem quis dui placerat ornare.';  
  601. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  602.  
  603.  
  604. $insert_post['category']=13;  
  605. echo $this->install_post($insert_post); 
  606. break; 
  607. case 24:{  
  608. /// blog post 2 
  609. $insert_post['spec_id']=$action_number;  
  610. $insert_post['title']='Morbi in sem quis dui placerat ornare.';  
  611. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  612.  
  613.  
  614. $insert_post['category']=13;  
  615. echo $this->install_post($insert_post); 
  616. break; 
  617. case 25:{  
  618. /// neews post 1 
  619. $insert_post['spec_id']=$action_number;  
  620. $insert_post['title']='Lorem ipsum dolor sit amet';  
  621. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  622.  
  623.  
  624. $insert_post['category']=14;  
  625. echo $this->install_post($insert_post); 
  626. break; 
  627. case 26:{  
  628. /// neews post 2 
  629. $insert_post['spec_id']=$action_number;  
  630. $insert_post['title']='Lorem ipsum dolor sit amet';  
  631. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  632.  
  633.  
  634. $insert_post['category']=14;  
  635. echo $this->install_post($insert_post); 
  636. break; 
  637. case 27:{  
  638. /// neews post 3 
  639. $insert_post['spec_id']=$action_number;  
  640. $insert_post['title']='Lorem ipsum dolor sit amet';  
  641. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  642.  
  643.  
  644. $insert_post['category']=14;  
  645. echo $this->install_post($insert_post); 
  646. break; 
  647. case 28:{  
  648. /// neews post 4 
  649. $insert_post['spec_id']=$action_number;  
  650. $insert_post['title']='Lorem ipsum dolor sit amet';  
  651. $insert_post['content']="<p style='font-size: 16px;'>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.</p>"; 
  652.  
  653.  
  654. $insert_post['category']=14;  
  655. echo $this->install_post($insert_post); 
  656. break; 
  657. case 29: 
  658. case 30: 
  659. case 31: 
  660. case 32: 
  661. case 33: 
  662. case 34: 
  663. case 35: 
  664. case 36: 
  665. case 37: 
  666. case 38: 
  667. {  
  668.  
  669.  
  670.  
  671. $insert_post['spec_id']=$action_number;  
  672. $insert_post['title']='Gallery Post'.($action_number-28);  
  673. $insert_post['content']=""; 
  674.  
  675. $insert_post['category']=12;  
  676. echo $this->install_post($insert_post); 
  677. break; 
  678. case 39: 
  679. case 40: 
  680. case 41: 
  681. case 42: 
  682. case 43: 
  683. case 44: 
  684. case 45: 
  685. case 46: 
  686. case 47: 
  687. case 48: 
  688. {  
  689. // insert gallery post thumbnails 
  690.  
  691. $params['spec_id']=$action_number; 
  692. $params['image_name']='0'.(int)($action_number%3+1).'.jpg'; 
  693. $params['post_id']=$action_number-10;  
  694. echo $this->conect_post_thumbnail($params); 
  695. break; 
  696. case 49:{  
  697. // insert  
  698. $params['spec_id']=$action_number; 
  699. $params['image_name']='bottomPost.png'; 
  700. $params['post_id']=22;  
  701. echo $this->conect_post_thumbnail($params); 
  702. break; 
  703. case 50:{  
  704. $params['spec_id']=$action_number; 
  705. $params['image_name']='03.jpg'; 
  706. $params['post_id']=23;  
  707. echo $this->conect_post_thumbnail($params); 
  708. break; 
  709. case 51:{  
  710. $params['spec_id']=$action_number; 
  711. $params['image_name']='03.jpg'; 
  712. $params['post_id']=24;  
  713. echo $this->conect_post_thumbnail($params); 
  714. break; 
  715. case 52:{  
  716. $params['spec_id']=$action_number; 
  717. $params['image_name']='03.jpg'; 
  718. $params['post_id']=25;  
  719. echo $this->conect_post_thumbnail($params); 
  720. break; 
  721. case 53:{  
  722. $params['spec_id']=$action_number; 
  723. $params['image_name']='03.jpg'; 
  724. $params['post_id']=26;  
  725. echo $this->conect_post_thumbnail($params); 
  726. break; 
  727. case 54:{  
  728. $params['spec_id']=$action_number; 
  729. $params['image_name']='03.jpg'; 
  730. $params['post_id']=27;  
  731. echo $this->conect_post_thumbnail($params); 
  732. break; 
  733. case 55:{  
  734. $params['spec_id']=$action_number; 
  735. $params['image_name']='03.jpg'; 
  736. $params['post_id']=28;  
  737. echo $this->conect_post_thumbnail($params); 
  738. break; 
  739. case 56:{  
  740. //////// update some meta values 
  741. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  742.  
  743. $met_for_cat_select_gall['categor-'.$inserted_install[12]]='on'; 
  744. $met_for_cat_select_gall['gallery_perpage']='9'; 
  745. add_post_meta($inserted_install[5], '_web_business_meta', $met_for_cat_select_gall, true) or update_post_meta($inserted_install[5], '_web_business_meta', $met_for_cat_select_gall); 
  746.  
  747. $met_for_cat_select['categor-'.$inserted_install[13]]='on'; 
  748. $met_for_cat_select['blog_perpage']='3'; 
  749. add_post_meta($inserted_install[4], '_web_business_meta', $met_for_cat_select, true) or update_post_meta($inserted_install[4], '_web_business_meta', $met_for_cat_select); 
  750.  
  751. $met_for_cat_select_news['categor-'.$inserted_install[14]]='on'; 
  752. $met_for_cat_select_news['blog_perpage']='4'; 
  753. add_post_meta($inserted_install[3], '_web_business_meta', $met_for_cat_select_news, true) or update_post_meta($inserted_install[3], '_web_business_meta', $met_for_cat_select_news); 
  754.  
  755. echo '1'; 
  756. break; 
  757. case 57:{  
  758. $menu_pamas['spec_id']=57; 
  759. $menu_pamas['name']='Web Business'; 
  760. $menu_pamas['description']='Menu for Custom Pages'; 
  761.  
  762. echo $this->install_menu($menu_pamas); 
  763. break; 
  764. case 58:{  
  765. $params['spec_id']=58; 
  766. $params['menu_title']='Home'; 
  767. $params['menu_id']='57'; 
  768. $params['menu_url']=get_home_url();  
  769. echo $this->install_menu_item($params); 
  770. break; 
  771. case 59:{  
  772. $params['spec_id']=59; 
  773. $params['page_id']='1'; 
  774. $params['menu_id']='57'; 
  775. $params['menu_title']='About Us'; 
  776. //$params['parent_of']  
  777. echo $this->install_menu_item($params); 
  778. break; 
  779. case 60:{  
  780. $params['spec_id']=60; 
  781. $params['page_id']='2'; 
  782. $params['menu_id']='57'; 
  783. $params['menu_title']='Service'; 
  784. //$params['parent_of']  
  785. echo $this->install_menu_item($params); 
  786. break; 
  787. case 61:{  
  788. $params['spec_id']=61; 
  789. $params['page_id']='3'; 
  790. $params['menu_id']='57'; 
  791. $params['menu_title']='News'; 
  792. //$params['parent_of']  
  793. echo $this->install_menu_item($params); 
  794. break; 
  795. case 62:{  
  796. $params['spec_id']=62; 
  797. $params['page_id']='4'; 
  798. $params['menu_id']='57'; 
  799. $params['menu_title']='Blog'; 
  800. //$params['parent_of']  
  801. echo $this->install_menu_item($params); 
  802. break; 
  803. case 63:{  
  804. $params['spec_id']=63; 
  805. $params['page_id']='5'; 
  806. $params['menu_id']='57'; 
  807. $params['menu_title']='Gallery'; 
  808. //$params['parent_of']  
  809. echo $this->install_menu_item($params); 
  810. break; 
  811. case 64:{  
  812. $params['spec_id']=64; 
  813. $params['page_id']='6'; 
  814. $params['menu_id']='57'; 
  815. $params['menu_title']='Log In'; 
  816. //$params['parent_of']  
  817. echo $this->install_menu_item($params); 
  818. break; 
  819. case 65:{  
  820. $params['spec_id']=65; 
  821. $params['page_id']='7'; 
  822. $params['menu_id']='57'; 
  823. $params['menu_title']='Search'; 
  824. //$params['parent_of']  
  825. echo $this->install_menu_item($params); 
  826. break; 
  827. case 66:{  
  828. $params['spec_id']=66; 
  829. $params['page_id']='8'; 
  830. $params['menu_id']='57'; 
  831. $params['menu_title']='Parent'; 
  832. //$params['parent_of']  
  833. echo $this->install_menu_item($params); 
  834. break; 
  835. case 67:{  
  836. $params['spec_id']=67; 
  837. $params['page_id']='9'; 
  838. $params['menu_id']='57'; 
  839. $params['parent_of']=66; 
  840. $params['menu_title']='Sub Page1'; 
  841. //$params['parent_of']  
  842. echo $this->install_menu_item($params); 
  843. break; 
  844. case 68:{  
  845. $params['spec_id']=68; 
  846. $params['page_id']='10'; 
  847. $params['menu_id']='57'; 
  848. $params['parent_of']=66;  
  849. $params['menu_title']='Sub Page2';  
  850. echo $this->install_menu_item($params); 
  851. break; 
  852. case 69:{  
  853. $params['spec_id']=69; 
  854. $params['page_id']='11'; 
  855. $params['menu_id']='57'; 
  856. $params['menu_title']='Contact Us';  
  857. echo $this->install_menu_item($params); 
  858. break; 
  859. }  
  860. case 70:{ 
  861. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  862. set_theme_mod( 'top_cat' . $inserted_install['15'], 'on', '', 'yes' ); 
  863. set_theme_mod( 'content_cat' .$inserted_install['16'] , 'on', '', 'yes' ); 
  864. set_theme_mod( '_grab_image', '' ); 
  865. set_theme_mod( '_n_of_home_post', '3' ); 
  866.  
  867. /// insert slider params 
  868.  
  869. $image_link=get_template_directory_uri().'/images/slder_1.jpg'.';;;;'.get_template_directory_uri().'/images/slder_2.jpg'.';;;;'.get_template_directory_uri().'/images/slder_3.jpg'; 
  870. set_theme_mod('web_busines_image_link', $image_link); 
  871. $image_textarea='Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.;;;;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.;;;;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna  
  872. aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea  
  873. commodo consequat.'; 
  874. set_theme_mod('web_busines_image_textarea', $image_textarea); 
  875. echo 1; 
  876. break; 
  877.  
  878.  
  879. case 71:{  
  880. echo $this->install_widgets();  
  881. break;  
  882. case 72:{  
  883. $params['spec_id']=$action_number; 
  884. $params['image_name']='thumb1.png'; 
  885. $params['post_id']=17;  
  886. echo $this->conect_post_thumbnail($params); 
  887. break; 
  888. case 73:{  
  889. $params['spec_id']=$action_number; 
  890. $params['image_name']='thumb2.png'; 
  891. $params['post_id']=18;  
  892. echo $this->conect_post_thumbnail($params); 
  893. break; 
  894. case 74:{  
  895. $params['spec_id']=$action_number; 
  896. $params['image_name']='thumb3.png'; 
  897. $params['post_id']=19;  
  898. echo $this->conect_post_thumbnail($params); 
  899. break; 
  900.  
  901.  
  902.  
  903. die(); 
  904.  
  905.  
  906. public function remove_ajax() { 
  907. $action_number=$_GET['number_of_actoion']; 
  908. switch($action_number) { 
  909. case 1:{ 
  910. $params['spec_id']=1; 
  911. echo $this->remove_page_post($params); 
  912. break; 
  913.  
  914. case 2:{ 
  915. $params['spec_id']=2; 
  916. echo $this->remove_page_post($params); 
  917. break; 
  918.  
  919. case 3:{ 
  920. $params['spec_id']=3; 
  921. echo $this->remove_page_post($params); 
  922. break; 
  923.  
  924. case 4:{ 
  925. $params['spec_id']=4; 
  926. echo $this->remove_page_post($params); 
  927. break; 
  928.  
  929. case 5:{ 
  930. $params['spec_id']=5; 
  931. echo $this->remove_page_post($params); 
  932. break; 
  933.  
  934. case 6:{ 
  935. $params['spec_id']=6; 
  936. echo $this->remove_page_post($params); 
  937. break; 
  938.  
  939. case 7:{ 
  940. $params['spec_id']=7; 
  941. echo $this->remove_page_post($params); 
  942. break; 
  943.  
  944. case 8:{ 
  945. $params['spec_id']=8; 
  946. echo $this->remove_page_post($params); 
  947. break; 
  948.  
  949. case 9:{ 
  950. $params['spec_id']=9; 
  951. echo $this->remove_page_post($params); 
  952. break; 
  953. case 10:{ 
  954. $params['spec_id']=10; 
  955. echo $this->remove_page_post($params); 
  956. break; 
  957. case 11:{ 
  958. $params['spec_id']=11; 
  959. echo $this->remove_page_post($params); 
  960. break; 
  961. case 12:{ 
  962. $params['spec_id']=12; 
  963. echo $this->remove_category($params); 
  964. break; 
  965. case 13:{ 
  966. $params['spec_id']=13; 
  967. echo $this->remove_category($params); 
  968. break; 
  969. case 14:{ 
  970. $params['spec_id']=14; 
  971. echo $this->remove_category($params); 
  972. break; 
  973. case 15:{ 
  974. $params['spec_id']=15; 
  975. echo $this->remove_category($params); 
  976. break; 
  977. case 16:{ 
  978. $params['spec_id']=16; 
  979. echo $this->remove_category($params); 
  980. break; 
  981. case 17:{ 
  982. $params['spec_id']=17; 
  983. echo $this->remove_page_post($params); 
  984. break; 
  985. case 18:{ 
  986. $params['spec_id']=18; 
  987. echo $this->remove_page_post($params); 
  988. break; 
  989. case 19:{ 
  990. $params['spec_id']=19; 
  991. echo $this->remove_page_post($params); 
  992. break; 
  993. case 20:{ 
  994. $params['spec_id']=20; 
  995. echo $this->remove_page_post($params); 
  996. break; 
  997. case 21:{ 
  998. $params['spec_id']=21; 
  999. echo $this->remove_page_post($params); 
  1000. break; 
  1001. case 22:{ 
  1002. $params['spec_id']=22; 
  1003. echo $this->remove_page_post($params); 
  1004. break; 
  1005. case 23:{ 
  1006. $params['spec_id']=23; 
  1007. echo $this->remove_page_post($params); 
  1008. break; 
  1009. case 24:{ 
  1010. $params['spec_id']=24; 
  1011. echo $this->remove_page_post($params); 
  1012. break; 
  1013. case 25:{ 
  1014. $params['spec_id']=25; 
  1015. echo $this->remove_page_post($params); 
  1016. break; 
  1017. case 26:{ 
  1018. $params['spec_id']=26; 
  1019. echo $this->remove_page_post($params); 
  1020. break; 
  1021. case 27:{ 
  1022. $params['spec_id']=27; 
  1023. echo $this->remove_page_post($params); 
  1024. break; 
  1025. case 28:{ 
  1026. $params['spec_id']=28; 
  1027. echo $this->remove_page_post($params); 
  1028. break; 
  1029. case 29: 
  1030. case 30: 
  1031. case 31: 
  1032. case 32: 
  1033. case 33: 
  1034. case 34: 
  1035. case 35: 
  1036. case 36: 
  1037. case 37: 
  1038. case 38:{ 
  1039. $params['spec_id']=$action_number; 
  1040. echo $this->remove_page_post($params); 
  1041. break; 
  1042. case 39: 
  1043. {  
  1044.  
  1045. $params['spec_id']=57; 
  1046. $params['menu_item'][0]=58; 
  1047. $params['menu_item'][1]=59; 
  1048. $params['menu_item'][2]=60; 
  1049. $params['menu_item'][3]=61; 
  1050. $params['menu_item'][4]=62; 
  1051. $params['menu_item'][5]=63; 
  1052. $params['menu_item'][6]=64; 
  1053. $params['menu_item'][7]=65; 
  1054. $params['menu_item'][8]=66; 
  1055. $params['menu_item'][9]=67; 
  1056. $params['menu_item'][10]=68; 
  1057. $params['menu_item'][11]=69; 
  1058. $params['menu_item'][12]=74; 
  1059. echo $this->remove_menu($params); 
  1060. break; 
  1061. case 40:{  
  1062. echo $this->remove_widgets();  
  1063. break;  
  1064. case 41:{ 
  1065. $xxx=0; 
  1066. $image_link=get_template_directory_uri().'/images/slder_1.jpg'.';;;;'.get_template_directory_uri().'/images/slder_2.jpg'.';;;;'.get_template_directory_uri().'/images/slder_3.jpg'; 
  1067. if(get_theme_mod('web_busines_image_link')==$image_link) { 
  1068. set_theme_mod('web_busines_image_link', ''); 
  1069. $xxx=1; 
  1070. $image_textarea='Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.;;;;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.;;;;Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna  
  1071. aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea  
  1072. commodo consequat.'; 
  1073. if(get_theme_mod('web_busines_image_link')==$image_textarea) { 
  1074. set_theme_mod('web_busines_image_textarea', ''); 
  1075. $xxx=1; 
  1076. if($xxx) { 
  1077. echo 1;  
  1078. else 
  1079. echo '<div class="notification_text">Not Found</div>'; 
  1080. }  
  1081. die(); 
  1082.  
  1083. private function remove_page_post($params) { 
  1084. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1085. if(isset($inserted_install[$params['spec_id']])) { 
  1086. $sucsses=wp_delete_post( $inserted_install[$params['spec_id']], true ); 
  1087. if($sucsses) { 
  1088.  
  1089. unset($inserted_install[$params['spec_id']]); 
  1090. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1091. return 1;  
  1092. else 
  1093. if(get_post($inserted_install[$params['spec_id']])) 
  1094. return '<div class="error_text">Error Remove</div>'; 
  1095. else{ 
  1096. // if(isset) 
  1097. // wp_delete_attachment(); 
  1098. unset($inserted_install[$params['spec_id']]); 
  1099. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1100. return '<div class="notification_text">Not Found</div>';  
  1101. else 
  1102. return '<div class="notification_text">Not Found</div>'; 
  1103.  
  1104.  
  1105. private function remove_category($params) { 
  1106. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1107. if(isset($inserted_install[$params['spec_id']])) { 
  1108. $sucsses=wp_delete_category( $inserted_install[$params['spec_id']]); 
  1109. if($sucsses) { 
  1110. unset($inserted_install[$params['spec_id']]); 
  1111. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1112. return 1;  
  1113. else 
  1114. if(get_category($inserted_install[$params['spec_id']])) 
  1115. return '<div class="error_text">Error Remove</div>'; 
  1116. else{ 
  1117. unset($inserted_install[$params['spec_id']]); 
  1118. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1119. return '<div class="notification_text">Not Found</div>';  
  1120. else 
  1121. return '<div class="notification_text">Not Found</div>'; 
  1122.  
  1123.  
  1124. private function remove_menu($params) { 
  1125.  
  1126. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1127. if(isset($inserted_install[$params['spec_id']])) { 
  1128. $sucsses=wp_delete_nav_menu( $inserted_install[$params['spec_id']]); 
  1129. if($sucsses) { 
  1130.  
  1131. foreach($params['menu_item'] as $menu_item) { 
  1132. if(isset( $inserted_install[$menu_item])) 
  1133. unset($inserted_install[$menu_item]); 
  1134.  
  1135. unset($inserted_install[$params['spec_id']]); 
  1136. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1137. return 1;  
  1138. else 
  1139. {  
  1140. if(wp_get_nav_menu_items($inserted_install[$params['spec_id']])) 
  1141. return '<div class="error_text">Error Remove</div>'; 
  1142. else{ 
  1143. unset($inserted_install[$params['spec_id']]); 
  1144. foreach($params['menu_item'] as $menu_item) { 
  1145. if(isset( $inserted_install[$menu_item])) 
  1146. unset($inserted_install[$menu_item]); 
  1147. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1148. return '<div class="notification_text">Not Found</div>';  
  1149. else{ 
  1150. return '<div class="notification_text">Not Found</div>'; 
  1151.  
  1152.  
  1153.  
  1154. private function exsist_in_base($list, $spec_id) { 
  1155. $exsist=0; 
  1156. if($list!='') 
  1157. foreach($list as $key=>$value) 
  1158. if($key==$spec_id) 
  1159. $exsist=1; 
  1160. if($exsist) 
  1161. return true; 
  1162. return false; 
  1163.  
  1164.  
  1165.  
  1166. private function install_category($category_params) { 
  1167.  
  1168. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1169. $exsist=$this->exsist_in_base($inserted_install, $category_params['spec_id']); 
  1170. if($exsist) { 
  1171. $catt=get_category((int)$inserted_install[$category_params['spec_id']]); 
  1172. if($catt) 
  1173. return '<div class="notification_text">Already exists.</div>'; 
  1174. $cat_id=wp_insert_category($category_params['param']); 
  1175.  
  1176. if($cat_id) {  
  1177. $inserted_install[$category_params['spec_id']]=$cat_id; 
  1178. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1179. return 1; 
  1180. else { 
  1181. $category_params['param']['cat_name']=$category_params['param']['cat_name'].date("H:i:s");  
  1182. $cat_id=wp_insert_category($category_params['param']);  
  1183. if($cat_id) {  
  1184. $inserted_install[$category_params['spec_id']]=$cat_id; 
  1185. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1186. return 1; 
  1187. }  
  1188. else 
  1189. return '<div class="error_text">Error inserting category.</div>'; 
  1190.  
  1191.  
  1192. private function conect_post_thumbnail($params) { 
  1193.  
  1194.  
  1195. $inserted_post_pages=get_theme_mod('web_buisnes_install_posts', ''); 
  1196. $exsist=$this->exsist_in_base($inserted_post_pages, $params['spec_id']); 
  1197. if($exsist) 
  1198. if(wp_get_attachment_image($inserted_post_pages[$params['spec_id']])) 
  1199. if(get_post( $inserted_post_pages[$params['post_id']])) 
  1200. if(get_post_thumbnail_id($inserted_post_pages[$params['post_id']])) 
  1201. return '<div class="notification_text">Already exists.</div>'; 
  1202. else{ 
  1203. set_post_thumbnail( $inserted_post_pages[$params['post_id']], $inserted_post_pages[$params['spec_id']] ); 
  1204. return 1; 
  1205.  
  1206. else 
  1207. return '<div class="notification_text">Post does not exist.</div>'; 
  1208.  
  1209.  
  1210. $upload_dir = wp_upload_dir();  
  1211. $image_url=get_template_directory_uri().'/images/'.$params['image_name']; 
  1212. $image_data = wp_remote_get($image_url); 
  1213. $image_data=$image_data['body']; 
  1214. $filename = basename($image_url); 
  1215.  
  1216. if(wp_mkdir_p($upload_dir['path'])) 
  1217. $file = $upload_dir['path'] . '/' . $filename; 
  1218. else 
  1219. $file = $upload_dir['basedir'] . '/' . $filename; 
  1220.  
  1221. if ( ! WP_Filesystem() ) { 
  1222. request_filesystem_credentials($url, '', true, false, null); 
  1223. return; 
  1224. global $wp_filesystem; 
  1225. $wp_filesystem->put_contents($file, $image_data); 
  1226. $wp_filetype = wp_check_filetype($filename, null ); 
  1227. $attachment = array( 
  1228. 'post_mime_type' => $wp_filetype['type'],  
  1229. 'post_title' => sanitize_file_name($filename),  
  1230. 'post_content' => '',  
  1231. 'post_status' => 'inherit' 
  1232. ); 
  1233.  
  1234. $attach_id = wp_insert_attachment( $attachment, $file, $params['post_id']); 
  1235. $attach_data = wp_generate_attachment_metadata( $attach_id, $file); 
  1236.  
  1237. wp_update_attachment_metadata( $attach_id, $attach_data );  
  1238. if(isset($inserted_post_pages[$params['post_id']])) { 
  1239.  
  1240. set_post_thumbnail( $inserted_post_pages[$params['post_id']], $attach_id ); 
  1241. $inserted_post_pages[$params['spec_id']]=$attach_id; 
  1242. set_theme_mod('web_buisnes_install_posts', $inserted_post_pages); 
  1243.  
  1244. else 
  1245. return '<div class="notification_text">postdoes not exist.</div>'; 
  1246. return 1; 
  1247.  
  1248.  
  1249.  
  1250. private function install_menu($params) { 
  1251.  
  1252. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1253. $exsist=$this->exsist_in_base($inserted_install, $params['spec_id']); 
  1254. if($exsist) { 
  1255.  
  1256.  
  1257. return '<div class="notification_text">Already exists.</div>'; 
  1258.  
  1259. $web_business_menu = array( 
  1260. 'cat_name' => $params['name'],  
  1261. 'category_description' => $params['description'],  
  1262. 'category_nicename' => '',  
  1263. 'category_parent' => '',  
  1264. 'taxonomy' => 'nav_menu',  
  1265. 'count' => '8' 
  1266. ); 
  1267.  
  1268. // Create the menu for custom pages 
  1269. $web_business_menu_id = wp_insert_category($web_business_menu); 
  1270. if($web_business_menu_id) 
  1271. $inserted_install[$params['spec_id']]=$web_business_menu_id; 
  1272. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1273.  
  1274. $change_selected_dur_menu=get_option('theme_mods_business-responsive'); 
  1275. $change_selected_dur_menu['nav_menu_locations']['primary-menu']=$web_business_menu_id; 
  1276. update_option('theme_mods_business-responsive', $change_selected_dur_menu); 
  1277. return 1; 
  1278.  
  1279. else 
  1280. return '<div class="error_text">error install. menu cannot be created</div>'; 
  1281.  
  1282.  
  1283.  
  1284. private function install_menu_item($params) { 
  1285. $inserted_install=get_theme_mod('web_buisnes_install_posts', ''); 
  1286. if(isset($inserted_install[$params['menu_id']])) 
  1287. $menu_id=$inserted_install[$params['menu_id']]; 
  1288. else 
  1289. return '<div class="error_text">Menu not found</div>'; 
  1290.  
  1291. $parent=0; 
  1292.  
  1293. //element isset in base? 
  1294. $exsist=$this->exsist_in_base($inserted_install, $params['spec_id']); 
  1295. if($exsist) {  
  1296. return '<div class="notification_text">Already exists.</div>'; 
  1297.  
  1298.  
  1299. /// if element is children 
  1300. if(isset($params['parent_of'])) { 
  1301.  
  1302. $parent=$inserted_install[$params['parent_of']]; 
  1303.  
  1304. $page_id=0; 
  1305.  
  1306. $menu_item_url=''; 
  1307. if(isset($params['menu_url'])) 
  1308. $menu_item_url=$params['menu_url']; 
  1309. if(isset($inserted_install[$params['page_id']])) 
  1310. $page_id=$inserted_install[$params['page_id']]; 
  1311. $type='page'; 
  1312. $type=''; 
  1313. $item_type=''; 
  1314. if($page_id) { 
  1315.  
  1316.  
  1317. $menu_item_id=wp_update_nav_menu_item($menu_id, 0, array('menu-item-title' => $params['menu_title'],  
  1318. 'menu-item-object' =>'page',  
  1319. 'menu-item-object-id' =>$page_id ,  
  1320. 'menu-item-type' => 'post_type',  
  1321. 'menu-item-parent-id' =>$parent,  
  1322. 'menu-item-status' => 'publish')); 
  1323. if($menu_item_url) { 
  1324.  
  1325. $menu_item_id=wp_update_nav_menu_item($menu_id, 0, array( 
  1326. 'menu-item-title' => __('Home', 'sp_webBusiness'),  
  1327. 'menu-item-classes' => 'home',  
  1328. 'menu-item-url' => home_url( '/' ),  
  1329. 'menu-item-status' => 'publish')); 
  1330.  
  1331.  
  1332.  
  1333. if($menu_item_id) {  
  1334. $inserted_install[$params['spec_id']]=$menu_item_id; 
  1335. set_theme_mod('web_buisnes_install_posts', $inserted_install); 
  1336. return 1; 
  1337. else 
  1338. return '<div class="error_text">Error adding menu item </div>'; 
  1339.  
  1340. ////////////////////// install page 
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347. private function install_page($insert_page) { 
  1348.  
  1349. global $wpdb; 
  1350. $inserted_post_pages=get_theme_mod('web_buisnes_install_posts', ''); 
  1351. if($inserted_post_pages!='' && !is_array($inserted_post_pages)) { 
  1352. $inserted_post_pages=''; 
  1353. set_theme_mod('web_buisnes_install_posts', ''); 
  1354. $page_exsist=0; // if this page alredy instaled 
  1355.  
  1356. // chech if page in alredy indtalled 
  1357. if($inserted_post_pages!='') 
  1358. foreach($inserted_post_pages as $key=>$inserted_post_page) 
  1359. if($key==$insert_page['spec_id']) 
  1360. $page_exsist=1; 
  1361.  
  1362. // return if instaled 
  1363. if($page_exsist) 
  1364. if(get_post( $inserted_post_pages[$insert_page['spec_id']])) { 
  1365. return '<div class="notification_text">Already exists.</div>'; 
  1366. $page_parent=0; 
  1367. // page  
  1368. if(isset($insert_page['parent_of'])) { 
  1369. if(!isset($inserted_post_pages[$insert_page['parent_of']])) { 
  1370. return '<div class="error_text">Parent page does not exist.</div>';  
  1371. else 
  1372. $page_parent=$inserted_post_pages[$insert_page['parent_of']]; 
  1373. if(!isset($insert_page['parent_of'])) 
  1374. $insert_page['parent_of']=0; 
  1375. // set page 
  1376. $page=array( 
  1377. 'ID' => NULL, //Are you updating an existing post? 
  1378. 'menu_order' =>$insert_page['parent_of'], //If new post is a page, it sets the order in which it should appear in the tabs. 
  1379. 'comment_status' => 'open', // 'closed' means no comments. 
  1380. 'ping_status' => 'open', // 'closed' means pingbacks or trackbacks turned off 
  1381. 'pinged' => '', //? 
  1382. 'post_author' => get_current_user_id( ),  
  1383. 'post_category' => array('category-slug'),  
  1384. 'post_content' => $insert_page['content'],  
  1385. 'post_date' => date('Y-m-d H:i:s'),  
  1386. 'post_date_gmt' => date('Y-m-d H:i:s'),  
  1387. 'post_excerpt' => '',  
  1388. 'post_name' => $insert_page['title'] ,  
  1389. 'post_parent' => $page_parent,  
  1390. 'post_password' => '',  
  1391. 'post_status' => 'publish',  
  1392. 'post_title' => $insert_page['title'],  
  1393. 'post_type' => 'page', //You may want to insert a regular post, page, link, a menu item or some custom post type 
  1394. 'to_ping' => '',  
  1395. ); 
  1396.  
  1397.  
  1398. // create page 
  1399. $page_id=wp_insert_post($page); 
  1400.  
  1401. // when page sucssesfuly instaled 
  1402. if(is_numeric($page_id)) { 
  1403. $value_inserted=1; 
  1404.  
  1405. /// set page type meta parmaters 
  1406. if(isset($insert_page['meta'])) { 
  1407.  
  1408. $value_inserted=$wpdb->insert($wpdb->prefix.'postmeta', array( 
  1409. 'post_id' => $page_id,  
  1410. 'meta_key' => $insert_page['meta']['meta_key'],  
  1411. 'meta_value' => $insert_page['meta']['meta_value'],  
  1412. ),  
  1413. array( 
  1414. '%d',  
  1415. '%s',  
  1416. '%s',  
  1417. )); 
  1418.  
  1419.  
  1420.  
  1421. // set custom meta params in page 
  1422. if(isset($insert_page['custom_meta'])) { 
  1423.  
  1424. foreach($insert_page['custom_meta'] as $key=>$value) 
  1425. $met[$key]=$value; 
  1426.  
  1427. add_post_meta($page_id, '_web_business_meta', $met, TRUE);  
  1428.  
  1429.  
  1430. /// set in base page alredy createt 
  1431. $inserted_post_pages[$insert_page['spec_id']]=$page_id; 
  1432. set_theme_mod('web_buisnes_install_posts', $inserted_post_pages); 
  1433.  
  1434. if($value_inserted) 
  1435. return 1; 
  1436. else 
  1437. return '<div class="error_text">Error adding page metadata.</div>';  
  1438. else 
  1439. return '<div class="error_text">Error creating page.</div>'; 
  1440.  
  1441.  
  1442.  
  1443.  
  1444. private function install_post($insert_post) { 
  1445.  
  1446. global $wpdb; 
  1447. $inserted_post_pages=get_theme_mod('web_buisnes_install_posts', '');  
  1448. $category=''; 
  1449.  
  1450. // chech if page in alredy indtalled 
  1451.  
  1452. if($this->exsist_in_base($inserted_post_pages, $insert_post['spec_id'])) 
  1453. if(get_post( $inserted_post_pages[$insert_post['spec_id']])) 
  1454. return '<div class="notification_text">Already exists.</div>'; 
  1455.  
  1456. if(isset($insert_post['category'])) { 
  1457. if(isset($inserted_post_pages[$insert_post['category']])) 
  1458. $category=$inserted_post_pages[$insert_post['category']]; 
  1459. else 
  1460. $category=0; 
  1461. if(!$category) { 
  1462. return '<div class="error_text">post category not found</div>'; 
  1463.  
  1464. $post_parent=0; 
  1465. // page  
  1466. if(isset($insert_post['parent_of'])) { 
  1467. if(!isset($inserted_post_pages[$insert_post['parent_of']])) { 
  1468. return '<div class="error_text">Post category not found.</div>';  
  1469. else 
  1470. $post_parent=$inserted_post_pages[$insert_post['parent_of']]; 
  1471.  
  1472. // set page 
  1473. $post=array( 
  1474. 'ID' => NULL, //Are you updating an existing post? 
  1475. 'menu_order' => $insert_post['spec_id'], //If new post is a page, it sets the order in which it should appear in the tabs. 
  1476. 'comment_status' => 'open', // 'closed' means no comments. 
  1477. 'ping_status' => 'open', // 'closed' means pingbacks or trackbacks turned off 
  1478. 'pinged' => '', //? 
  1479. 'post_author' => get_current_user_id( ),  
  1480. 'post_category' => array($category),  
  1481. 'post_content' => $insert_post['content'],  
  1482. 'post_date' => date('Y-m-d H:i:s'),  
  1483. 'post_date_gmt' => date('Y-m-d H:i:s'),  
  1484. 'post_excerpt' => '',  
  1485. 'post_name' => $insert_post['title'] ,  
  1486. 'post_parent' => $post_parent,  
  1487. 'post_password' => '',  
  1488. 'post_status' => 'publish',  
  1489. 'post_title' => $insert_post['title'],  
  1490. 'post_type' => 'post', //You may want to insert a regular post, page, link, a menu item or some custom post type 
  1491. 'to_ping' => '',  
  1492. ); 
  1493.  
  1494.  
  1495. // create page 
  1496. $post_id=wp_insert_post($post); 
  1497.  
  1498. // when page sucssesfuly instaled 
  1499. if(is_numeric($post_id)) { 
  1500. $value_inserted=1; 
  1501.  
  1502. /// set page type meta parmaters 
  1503. if(isset($insert_page['meta'])) { 
  1504.  
  1505. $value_inserted=$wpdb->insert($wpdb->prefix.'postmeta', array( 
  1506. 'post_id' => $post_id,  
  1507. 'meta_key' => $insert_post['meta']['meta_key'],  
  1508. 'meta_value' => $insert_post['meta']['meta_value'],  
  1509. ),  
  1510. array( 
  1511. '%d',  
  1512. '%s',  
  1513. '%s',  
  1514. )); 
  1515.  
  1516.  
  1517.  
  1518. // set custom meta params in page 
  1519. if(isset($insert_post['custom_meta'])) { 
  1520.  
  1521. foreach($insert_post['custom_meta'] as $key=>$value) 
  1522. $met[$key]=$value; 
  1523.  
  1524. add_post_meta($page_id, '_web_business_meta', $met, TRUE);  
  1525.  
  1526.  
  1527. /// set in base page alredy createt 
  1528. $inserted_post_pages[$insert_post['spec_id']]=$post_id; 
  1529. set_theme_mod('web_buisnes_install_posts', $inserted_post_pages); 
  1530.  
  1531. if($value_inserted) 
  1532. return 1; 
  1533. else 
  1534. return '<div class="error_text"Error adding post metadata.</div>';  
  1535. else 
  1536. return '<div class="error_text">Error creating post.</div>'; 
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542. public function install_widgets() { 
  1543. $term = get_term_by('name', 'News posts', 'category'); 
  1544. $categ_id_by_name = $term->term_id; 
  1545. $widget_text=get_option('widget_text'); 
  1546. $widget_web_buis_categ=get_option('widget_web_buis_categ'); 
  1547. /** if(isset($widget_web_buis_categ[2000])) 
  1548. return '<div class="notification_text">Already exists.</div>';*/ 
  1549.  
  1550. $widget_web_buis_categ[2000]['title']='News'; 
  1551. $widget_web_buis_categ[2000]['categ_id']= $categ_id_by_name; 
  1552. $widget_web_buis_categ[2000]['post_count']='3'; 
  1553.  
  1554. $widget_text[1501]['title']=''; 
  1555. $widget_text[1501]['text']=' <div class="widget-container demo"> 
  1556. <img src="'.get_template_directory_uri().'/images/footer.partner.1.png" alt="" width="" /> 
  1557. </div>'; 
  1558. $widget_text[1501]['filter']=false; 
  1559.  
  1560. $widget_text[1502]['title']=''; 
  1561. $widget_text[1502]['text']=' <div class="widget-container demo"> 
  1562. <img src="'.get_template_directory_uri().'/images/footer.partner.2.png" alt="" width="" /> 
  1563. </div>'; 
  1564. $widget_text[1502]['filter']=false; 
  1565.  
  1566. $widget_text[1503]['title']=''; 
  1567. $widget_text[1503]['text']=' <div class="widget-container demo"> 
  1568. <img src="'.get_template_directory_uri().'/images/footer.partner.3.png" alt="" width="" /> 
  1569. </div>'; 
  1570. $widget_text[1503]['filter']=false; 
  1571.  
  1572. $widget_text[1504]['title']=''; 
  1573. $widget_text[1504]['text']=' <div class="widget-container demo"> 
  1574. <img src="'.get_template_directory_uri().'/images/footer.partner.4.png" alt="" width="" /> 
  1575. </div>'; 
  1576. $widget_text[1504]['filter']=false; 
  1577.  
  1578. $widget_text[1505]['title']=''; 
  1579. $widget_text[1505]['text']=' <div class="widget-container demo"> 
  1580. <img src="'.get_template_directory_uri().'/images/footer.partner.5.png" alt="" width="" /> 
  1581. </div>'; 
  1582. $widget_text[1505]['filter']=false; 
  1583. $widget_text[1506]['title']=''; 
  1584. $widget_text[1506]['text']=' <div class="widget-container demo"> 
  1585. <img src="'.get_template_directory_uri().'/images/footer.partner.5.png" alt="" width="" /> 
  1586. </div>'; 
  1587. $widget_text[1506]['filter']=false;  
  1588.  
  1589. update_option('widget_text', $widget_text); 
  1590. update_option('widget_web_buis_categ', $widget_web_buis_categ); 
  1591.  
  1592.  
  1593. $sidbar_text_add=wp_get_sidebars_widgets();  
  1594.  
  1595. $sidbar_text_add['primary-widget-area'][2000]='web_buis_categ-2000'; 
  1596. $sidbar_text_add['footer-sidebar'][1501]='text-1501'; 
  1597. $sidbar_text_add['footer-sidebar'][1502]='text-1502'; 
  1598. $sidbar_text_add['footer-sidebar'][1503]='text-1503'; 
  1599. $sidbar_text_add['footer-sidebar'][1504]='text-1504'; 
  1600. $sidbar_text_add['footer-sidebar'][1505]='text-1505'; 
  1601. $sidbar_text_add['footer-sidebar'][1506]='text-1506'; 
  1602.  
  1603. update_option( 'sidebars_widgets', $sidbar_text_add ); 
  1604. $sidbar_text_add=get_option('sidebars_widgets'); 
  1605. return 1; 
  1606.  
  1607.  
  1608.  
  1609. function remove_widgets() { 
  1610. ///// remove widgets 
  1611. $widget_text=get_option('widget_text'); 
  1612. $widget_web_buis_categ=get_option('widget_web_buis_categ'); 
  1613. if(!isset($widget_web_buis_categ[2000])) 
  1614. return '<div class="notification_text">Not Found</div>'; 
  1615. unset($widget_web_buis_categ[2000]); 
  1616. unset($widget_text[1501]); 
  1617. unset($widget_text[1502]); 
  1618. unset($widget_text[1503]); 
  1619. unset($widget_text[1504]); 
  1620. unset($widget_text[1505]); 
  1621. unset($widget_text[1506]); 
  1622. update_option('widget_text', $widget_text); 
  1623. update_option('widget_web_buis_categ', $widget_web_buis_categ); 
  1624.  
  1625. $sidbar_text_add=wp_get_sidebars_widgets();  
  1626. unset($sidbar_text_add['primary-widget-area'][2000]); 
  1627. unset($sidbar_text_add['footer-sidebar'][1501]); 
  1628. unset($sidbar_text_add['footer-sidebar'][1502]); 
  1629. unset($sidbar_text_add['footer-sidebar'][1503]); 
  1630. unset($sidbar_text_add['footer-sidebar'][1504]); 
  1631. unset($sidbar_text_add['footer-sidebar'][1505]); 
  1632. unset($sidbar_text_add['footer-sidebar'][1506]); 
  1633.  
  1634.  
  1635. update_option( 'sidebars_widgets', $sidbar_text_add ); 
  1636. return 1; 
  1637.  
  1638.  
  1639.  
  1640.  
  1641.