/functions.php

  1. <?php 
  2. $themename = "Theme Generator"; 
  3. $shortname = "themeshock"; 
  4. require_once dirname( __FILE__ ) . '/functions/activate_plugin.php';// activate pliguin de pinterest y de futuros plugins  
  5. get_template_part('functions/variables_load');//cargas las varriables relacionados con el themegenerator 
  6. include('functions/slider_images.php');///callback para la subida de imagenes (debe usarse include) por efecto del script 
  7. if(file_exists(get_template_directory().'/framework-tool/current_layout/vars_layout.php'))include('framework-tool/current_layout/vars_layout.php'); 
  8. get_template_part('functions/layout_callback');// callback para la seleccion de layouts 
  9. get_template_part('functions/create-pages'); 
  10.  
  11. function wts_reset_get_option($var_get_option, $new_val) { 
  12. if(get_option($var_get_option)) { 
  13. update_option($var_get_option , $new_val); 
  14. }else{ 
  15. return false; 
  16.  
  17. if(is_admin() && $pagenow == 'themes.php' && isset($_GET['activated']) && $_GET['activated'] == 'true') { 
  18. wts_reset_get_option($shortname.'_default_post_boxes', 'true'); 
  19. $GLOBALS['layout_info']['themeshock_default_widget_boxes'] = true; 
  20. (isset($GLOBALS['display_elements']) && $GLOBALS['display_elements'][0] == 'show')?wts_reset_get_option($shortname.'_show_main_menu', 'true'):wts_reset_get_option($shortname.'_show_main_menu', 'false'); 
  21. if(isset($GLOBALS['display_elements']) && $GLOBALS['display_elements'][1] == 'show') { 
  22. $active_socials = array('themeshock_face_follow_option', 'themeshock_tweet_follow_option', 'themeshock_mail_option', 'themeshock_rss_feed_option'); 
  23. foreach($active_socials as $active_social) { 
  24. wts_reset_get_option($active_social, 'true'); 
  25. }else{ 
  26. foreach($GLOBALS['social_network'] as $social_network => $option ) { 
  27. wts_reset_get_option('themeshock'.$option.'_option', 'false'); 
  28. }  
  29. }; 
  30. (isset($GLOBALS['display_elements']) && $GLOBALS['display_elements'][2] == 'show')?wts_reset_get_option($shortname.'_show_search_box', 'true'):wts_reset_get_option($shortname.'_show_search_box', 'false'); 
  31. update_option('themeshock_layout_options', maybe_serialize($layout_info)); 
  32.  
  33. function wts_main_boxes() { 
  34. if(get_option('themeshock_default_post_boxes') == 'true') { 
  35. if(isset($GLOBALS['boxes_css']) && $GLOBALS['boxes_css'][1] != 'boxcss_default') { 
  36. return 'reset_boxcss '.$GLOBALS['boxes_css'][1]; 
  37. }else{ 
  38. return $GLOBALS['boxes_css'][1]; 
  39. }else if(get_option('themeshock_postsbox_style') != 'boxcss_default') { 
  40. return 'reset_boxcss '.get_option('themeshock_postsbox_style'); 
  41. }else{ 
  42. return get_option('themeshock_postsbox_style'); 
  43.  
  44. $font_style_pack = array( 
  45. "Yanone Kaffeesatz", "Wire One", "Ubuntu", "Rokkitt", "Righteous", "Raleway", "Quattrocento Sans", "PT Sans", "Open Sans", "Nixie One", "News Cycle", "Acme", "Coustard",  
  46. "Alfa Slab One", "Abel", "Brawler", "Droid Sans", "Crushed", "Cabin Condensed", "Federo", "Arimo", "Contrail One", "Anton", "Days One", "Droid Serif", "Abril Fatface", "Allan", "Amatic SC",  
  47. "Anonymous Pro", "Bangers", "Baumans", "Boogaloo", "Bree Serif", "Buda", "Cuprum", "Damion", "Dorsa", "Francois One", "Just Another Hand", "Gruppo", "Jockey One", "Maiden Orange", "Josefin Slab",  
  48. "Lobster", "Lobster Two", "Marvel", "Andika", "Arial", "Verdana", "Tahoma", "Trebuchet MS"); 
  49.  
  50. /** Spanish Translations*/ 
  51. load_theme_textdomain( 'tstranslate', TEMPLATEPATH.'/functions/languages' ); 
  52.  
  53. $locale = get_locale(); 
  54. $locale_file = get_template_directory_uri()."/functions/languages/$locale.php"; 
  55. if ( is_readable($locale_file) ) { 
  56. require_once($locale_file); 
  57.  
  58. add_action( 'admin_enqueue_scripts', 'add_slider' ); 
  59. add_action( 'admin_enqueue_scripts', 'light_box' ); 
  60. if ( ! isset( $content_width ) ) $content_width = 960; 
  61.  
  62. /**Header and Background styles*/ 
  63. /** 
  64. add_custom_background(); 
  65. define('HEADER_TEXTCOLOR', 'ffffff'); 
  66. define('HEADER_IMAGE', '%s/img/header_bkg.jpg'); // %s is the template dir uri 
  67. function header_style() { ?> 
  68. <!--<style type="text/css"> #header { background: url(<?php //header_image(); ?>); } </style>--> 
  69. <?php } 
  70. function admin_header_style() {?> 
  71. <style type="text/css"> #headimg { width: 250px; height: 250px; background: no-repeat; } </style><?php 
  72. } 
  73. add_custom_image_header('header_style', 'admin_header_style');*/ 
  74.  
  75. function add_slider() {?> 
  76. <script type='text/javascript'> 
  77. var upload_slider_text='<?php echo __('Upload a slider file', 'tstranslate') ?>'; 
  78. var upload_logo_text='<?php echo __('Upload a logo file', 'tstranslate') ?>'; 
  79. </script> 
  80. <?php 
  81. wp_enqueue_script("ajax_validation", get_template_directory_uri().'/functions/ajax_validation.js', false, "1.0"); 
  82. wp_enqueue_script("fileuploader", get_template_directory_uri().'/functions/fileuploader.js', false, "1.0"); //para upload de archivos  
  83. wp_enqueue_script('postbox'); 
  84. wp_enqueue_script('common'); 
  85. wp_enqueue_script('wp-lists'); 
  86.  
  87. function light_box() { 
  88. wp_enqueue_script("colorbox", get_template_directory_uri().'/js/colorbox.js', false, "1.0"); 
  89.  
  90. /**Menu register*/ 
  91. add_action('init', 'register_shock_menu'); 
  92. function register_shock_menu() { 
  93. register_nav_menus(array('shock_menu'=> 'Shock Menu: place the menu you want as primary navigation.', 'optional_topbar' => 'Top bar Menu')); 
  94. }  
  95.  
  96. $categories = get_categories('hide_empty=0&orderby=name'); 
  97. $wp_cats = array(); 
  98. foreach ($categories as $category_list ) { 
  99. $wp_cats[$category_list->cat_ID] = $category_list->cat_name; 
  100. array_unshift($wp_cats, "Choose a category"); 
  101.  
  102. function themeshock_add_admin() { 
  103. global $themename, $shortname, $wpdb; 
  104. if ( isset($_GET['page']) == basename(__FILE__) ) { 
  105. if ( 'save' == isset($_REQUEST['action']) ) { 
  106. foreach ($_POST as $option_name => $newvalue) { 
  107. switch($option_name) {///parta evitar datos basura del layout generator 
  108. case 'top_1_style': 
  109. case 'top_2_style': 
  110. case 'left_1_style': 
  111. case 'left_2_style':  
  112. case 'right_1_style':  
  113. case 'right_2_style': 
  114. case 'bottom_1_style': 
  115. case 'bottom_2_style': 
  116. case 'slider_blog': 
  117. case 'slider_single': 
  118. case 'slider_search': 
  119. case 'slider_archive': 
  120. case 'slider_category': 
  121. case 'footer_widget_style': 
  122. case 'themeshock_featured': 
  123. case 'ft_size':  
  124. break; 
  125. default: 
  126. update_option( $option_name, $newvalue );  
  127. break; 
  128. add_object_page($themename, $themename, 'administrator', basename(__FILE__), 'themeshock_admin'); 
  129.  
  130. function themeshock_add_init() { 
  131. $file_dir = get_template_directory_uri(); 
  132. wp_enqueue_style("functions", $file_dir."/functions/functions.css", true, "1.0", "all"); 
  133. //wp_enqueue_style("colorbox", $file_dir."/css/colorbox.css", true, "1.0", "all"); 
  134. wp_enqueue_script('comment-reply'); 
  135. add_editor_style(); 
  136.  
  137. /*********************/ 
  138. /** Setup font style */ 
  139. /*******************/ 
  140.  
  141. function get_wptg_font_style() { 
  142. global $themename, $shortname, $font_style_pack; 
  143. $headings = array('H1', 'H2', 'H3', 'H4', 'H5', 'H6'); 
  144. ?> 
  145. <div> 
  146. <b>Body (paragraphs)</b> 
  147. <div class="display-table-cell table-cell-first"> 
  148. <label for="<?php echo $shortname;?>_fontFamilyTagP"><?php echo __('Font Family', 'tstranslate')?></label> 
  149. </div> 
  150. <div class="display-table-cell table-cell-2"> 
  151. <select name="<?php echo $shortname;?>_fontFamilyTagP" id="<?php echo $shortname;?>_fontFamilyTagP"> 
  152. <option value="inherit"> Inherit </option> 
  153. <?php 
  154. $get_font_style = get_option($shortname.'_fontFamilyTagP'); 
  155. foreach($font_style_pack as $font_styles) {?> 
  156. <option <?php echo ($get_font_style === $font_styles)?'selected="selected"':''; ?> ><?php echo $font_styles;?></option><?php 
  157. }?> 
  158. </select> 
  159. </div> 
  160. </div> 
  161. <div> 
  162. <div class="display-table-cell table-cell-first"> 
  163. <label for="<?php echo $shortname; ?>_fontSizeTagP"><?php echo __('Font Size', 'tstranslate')?></label> 
  164. </div> 
  165. <div class="display-table-cell table-cell-2 fontStyle_inputs"> 
  166. <select name="<?php echo $shortname; ?>_fontSizeTagP" id="<?php echo $shortname;?>_fontSizeTagP"> 
  167. <option value="inherit"> Inherit </option> 
  168. <?php 
  169. $get_fontSizeTagP = get_option($shortname.'_fontSizeTagP'); 
  170. $get_fontColorTagP = get_option($shortname.'_fontColorTagP', 'Inherit'); 
  171. foreach(range(10, 30) as $size) {?> 
  172. <option <?php echo ($get_fontSizeTagP == $size)?'selected="selected"':''; ?> value="<?php echo $size?>"><?php echo $size;?>px</option><?php 
  173. }?> 
  174. </select> 
  175. <span>Color</span> 
  176. <input type="text" value="<?php echo($get_fontColorTagP != 'Inherit')?$get_fontColorTagP:"Inherit"?>" name="<?php echo $shortname.'_fontColorTagP';?>" id="<?php echo $shortname.'_fontColorTagP';?>"/> 
  177. </div> 
  178. </div> 
  179. <div class="description-full"></div> 
  180.  
  181. <div> 
  182. <b>Headings (Titles)</b> 
  183. <div class="display-table-cell table-cell-first"> 
  184. <label for="<?php echo $shortname; ?>_fontFamilyTagHeading"><?php echo __('Font Family', 'tstranslate')?></label> 
  185. </div> 
  186. <div class="display-table-cell table-cell-2"> 
  187. <select name="<?php echo $shortname; ?>_fontFamilyTagHeading" id="<?php echo $shortname;?>_fontFamilyTagHeading"> 
  188. <option value="inherit"> Inherit </option> 
  189. <?php 
  190. $get_fontFamilyTagHeading = get_option($shortname.'_fontFamilyTagHeading'); 
  191. foreach($font_style_pack as $font_styles) {?> 
  192. <option <?php echo ($get_fontFamilyTagHeading === $font_styles)?'selected="selected"':''; ?> ><?php echo $font_styles;?></option><?php 
  193. }?> 
  194. </select> 
  195. </div> 
  196. </div> 
  197.  
  198. <?php  
  199. foreach($headings as $heading) {?> 
  200. <div> 
  201. <div class="display-table-cell table-cell-first"> 
  202. <label for="<?php echo $shortname.'_fontSizeTag'.$heading;?>"><?php echo $heading?></label> 
  203. </div> 
  204. <div class="display-table-cell table-cell-2 fontStyle_inputs"> 
  205. <select name="<?php echo $shortname.'_fontSizeTag'.$heading;?>" id="<?php echo $shortname.'_fontSizeTag'.$heading;?>"> 
  206. <option value="inherit"> Inherit </option> 
  207. <?php 
  208. $get_fontSizeTag = get_option($shortname.'_fontSizeTag'.$heading, 'Inherit'); 
  209. $get_fontColorTag = get_option($shortname.'_fontColorTag'.$heading, 'Inherit'); 
  210. foreach(range(16, 50) as $size) {?> 
  211. <option <?php echo ($get_fontSizeTag == $size)?'selected="selected"':'';?> value="<?php echo $size?>" ><?php echo $size;?>px</option><?php 
  212. }?> 
  213. </select> 
  214. <span>Color</span> 
  215. <input type="text" value="<?php echo($get_fontColorTag != 'Inherit')?$get_fontColorTag:"Inherit"?>" 
  216. name="<?php echo $shortname.'_fontColorTag'.$heading;?>" id="<?php echo $shortname.'_fontColorTag'.$heading;?>" /> 
  217. </div> 
  218. </div> 
  219. <?php } ?> 
  220. <div class="inside-row"> 
  221. <span><b>(Inherit)</b> Inherit from downloaded theme</span> 
  222. <div class="clear"></div> 
  223. <span><b>(Color)</b> Use hex, rgb, hsl or color name eg(#333, rgb(200, 200, 200), hsl(0, 0%, 20%) or blue)</span> 
  224. </div> 
  225. <div class="clear"></div> 
  226. <small><?php echo __('Select the font scheme for the header tags', 'tstranslate')?></small> 
  227. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  228. <?php } 
  229.  
  230. /***************/ 
  231. /** Setup Logo */ 
  232. /*************/ 
  233.  
  234. function get_wptg_logo() { 
  235. global $themename, $shortname, $font_style_pack; 
  236. $get_enable_logo_footer= get_option($shortname.'_enable_logo_footer'); 
  237. $get_logo_type = get_option($shortname.'_logo_type'); 
  238. ?> 
  239. <span class="title_type_logo">Image based Logo</span> 
  240. <div class="setup-logo-area setup-image-logo" <?php echo(isset($GLOBALS['error_folder']))?'style="display:none"':''; ?>> 
  241. <div class="header-logo-setup"> 
  242. <label for="logo_type_image">Currently active in your site</label> 
  243. <input type="radio" id="logo_type_image" name="<?php echo $shortname;?>_logo_type" value="image" <?php echo ($get_logo_type === "image")?'checked="checked""':''; ?>/> 
  244. </div><!-- end choose_logo_type --> 
  245. <div class="area_options_logo"> 
  246. <div class="logo-currenty-disabled"> 
  247. <label style="line-height: 152px;">Currently disabled in your website</label> 
  248. </div> 
  249. <div id="TS_logo_uploader"> 
  250. <noscript><p>Please enable JavaScript to use file uploader.</p></noscript> 
  251. </div> 
  252. <ol id="logo_stored"> 
  253. <li><img src="<?php echo $GLOBALS['logo_info']['url'];?>" id="logo_url"/></li> 
  254. </ol> 
  255. <div class="clear"></div> 
  256. </div> 
  257. <div class="footer-logo-setup"> 
  258. <span class="text_info"><?php echo __('Choose your logo to upload', 'tstranslate')?></span> 
  259. </div> 
  260. </div> 
  261.  
  262. <span class="title_type_logo">CSS based logo</span> 
  263. <div class="setup-logo-area setup-text-logo" <?php echo (isset($GLOBALS['error_folder']))?'style="display:none"':''; ?>> 
  264. <div class="header-logo-setup"> 
  265. <label for="logo_type_text">Currently active in your site</label> 
  266. <input type="radio" id="logo_type_text" name="<?php echo $shortname;?>_logo_type" value="text" <?php echo ($get_logo_type === "text")?'checked="checked""':''; ?> /> 
  267. </div><!-- end choose_logo_type --> 
  268. <div class="area_options_logo"> 
  269. <div class="logo-currenty-disabled"> 
  270. <label style="line-height: 152px;">Currently disabled in your website</label> 
  271. </div> 
  272. <div> 
  273. <label for="<?php echo $shortname; ?>_text_logo"><?php echo __('Text Logo', 'tstranslate')?></label> 
  274. <input name="<?php echo $shortname; ?>_text_logo" id="<?php echo $shortname; ?>_text_logo" type="text" value="<?php echo stripslashes(get_option($shortname.'_text_logo', 'My Company')); ?>" /> 
  275. </div> 
  276. <div> 
  277. <label for="<?php echo $shortname; ?>_font_size_logo"><?php echo __('Font Size(e.g. 50px)', 'tstranslate')?></label> 
  278. <input name="<?php echo $shortname; ?>_font_size_logo" id="<?php echo $shortname; ?>_font_size_logo" type="text" value="<?php echo get_option($shortname.'_font_size_logo', '50px'); ?>" /> 
  279. </div> 
  280. <div> 
  281. <label for="<?php echo $shortname; ?>_text_logo_effect"><?php echo __('Effect', 'tstranslate')?></label> 
  282. <select name="<?php echo $shortname; ?>_text_logo_effect" id="<?php echo $shortname; ?>_text_logo_effect"> 
  283. <?php  
  284. $effects_logo_text = array("Normal", "Alpha", "Embossed", "Shadow", "3D", "Neon", "Anaglyphs", "Retro"); 
  285. $get_effect_logo_text = get_option($shortname.'_text_logo_effect', 'Normal'); 
  286. foreach($effects_logo_text as $effect_logo_text ) { ?> 
  287. <option <?php echo ($get_effect_logo_text === $effect_logo_text)?'selected="selected"':''; ?> ><?php echo $effect_logo_text; ?></option><?php 
  288. }?> 
  289. </select> 
  290. </div> 
  291. <div> 
  292. <label for="<?php echo $shortname; ?>_logo_font_family"><?php echo __('Font Family', 'tstranslate')?></label> 
  293. <select name="<?php echo $shortname; ?>_logo_font_family" id="<?php echo $shortname; ?>_logo_font_family"> 
  294. <option>Default</option> 
  295. <?php 
  296. $get_logo_font_family = get_option($shortname.'_logo_font_family'); 
  297. foreach($font_style_pack as $font_styles ) {?> 
  298. <option <?php echo ($get_logo_font_family === $font_styles)?'selected="selected"':''; ?>><?php echo $font_styles; ?></option><?php 
  299. }?> 
  300. </select> 
  301. </div> 
  302. <div class="clear"></div> 
  303. </div> 
  304. <div class="footer-logo-setup"> 
  305. <span class="text_info"><?php echo __('Your text logo settings', 'tstranslate')?></span> 
  306. </div> 
  307. </div> 
  308.  
  309. <div class="logo-footer-area"> 
  310. <label for="<?php echo $shortname; ?>_enable_logo_footer"><?php echo __('Logo footer', 'tstranslate')?></label> 
  311. <input name="<?php echo $shortname; ?>_enable_logo_footer" id="<?php echo $shortname; ?>_enable_logo_footer" type="checkbox" <?php echo($get_enable_logo_footer == 'true')?'checked="checked"':''?> value="true"/>  
  312. <small><?php echo __('Show logo in footer area', 'tstranslate')?></small> 
  313. </div><!-- end inside-cols --> 
  314. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  315. <script> 
  316. jQuery(function() { 
  317. jQuery('#wptg-logo input[name="themeshock_logo_type"]').click(function(e) { 
  318. $themeshockLogoType = jQuery('#wptg-logo input[name="themeshock_logo_type"]:checked').val(); 
  319. jQuery('.logo-currenty-disabled').hide(); 
  320. ($themeshockLogoType == 'image')?jQuery('.setup-text-logo .logo-currenty-disabled').show():jQuery('.setup-image-logo .logo-currenty-disabled').show(); 
  321. }) 
  322. jQuery('#wptg-logo input[name="themeshock_logo_type"]:checked').trigger('click'); 
  323. }) 
  324. </script> 
  325. <?php } 
  326.  
  327. /*****************/ 
  328. /** Setup Search */ 
  329. /** Setup Menu **/ 
  330. /**************/ 
  331.  
  332. function getThemeGenHeaderElements() { 
  333. global $themename, $shortname, $wpdb, $screen_layout_columns;?> 
  334. <div class="inside-row"> 
  335. <label for=""><?php echo __('Menu Customization', 'tstranslate')?></label> 
  336. <a href="nav-menus.php" target="_blank"><?php echo __('Main Menu', 'tstranslate')?></a> 
  337. <small><?php echo __('Use this link to customize the items of your main menu.', 'tstranslate')?></small> 
  338. </div> 
  339. <label for="<?php echo $shortname; ?>_activate_framework_tool"><?php echo __('Show Main Menu', 'tstranslate')?></label> 
  340. <?php $show_main_menu= get_option($shortname.'_show_main_menu', 'true')?> 
  341. <input name="<?php echo $shortname; ?>_show_main_menu" id="<?php echo $shortname; ?>_show_main_menu" type="checkbox" <?php echo ($show_main_menu == 'true')?'checked="checked"':''?> value="true"/> 
  342. <small><?php echo __('Show main menu in header area', 'tstranslate')?></small> 
  343. <div class="clear"></div> 
  344. <label for="<?php echo $shortname; ?>_activate_framework_tool"><?php echo __('Show the search box', 'tstranslate')?></label> 
  345. <?php $show_search_box= get_option($shortname.'_show_search_box', 'true')?> 
  346. <input name="<?php echo $shortname; ?>_show_search_box" id="<?php echo $shortname; ?>_show_search_box" type="checkbox" <?php echo ($show_search_box == 'true')?'checked="checked"':''?> value="true"/> 
  347. <small><?php echo __('Check the options you would like to display on your site', 'tstranslate')?></small> 
  348. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  349. <?php } 
  350.  
  351. /*********************/ 
  352. /** Setup Icon Posts */ 
  353. /*******************/ 
  354.  
  355. function getThemeGenIconPost() { 
  356. global $themename, $shortname; 
  357. $icons = array('Author', 'Date', 'Category', 'Tags', 'Comments', 'Comments2'); 
  358. $i = 0; 
  359. foreach($icons as $icon) { 
  360. $i++; 
  361. $iconPost = get_option($shortname.'_iconPost'.$icon, 'true')?> 
  362. <input type="checkbox" id="<?php echo $shortname.'_iconPost'.$icon;?>" name="<?php echo $shortname.'_iconPost'.$icon;?>" value="true" <?php echo ($iconPost == 'true')?'checked="checked"':''?>/> 
  363. <label for="<?php echo $shortname.'_iconPost'.$icon;?>"><?php echo __($icon, 'tstranslate')?></label> 
  364. <?php echo(count($icons) != $i)?'<span> - </span>':''; 
  365. }?> 
  366. <small class="description-full2"><?php echo __('Show and hide the properties you want to post.', 'tstranslate')?></small> 
  367. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  368. <?php } 
  369.  
  370. /*********************/ 
  371. /** Setup shortcodes */ 
  372. /*******************/ 
  373.  
  374. function getThemeGenShortcodes() { 
  375. global $themename, $shortname, $wpdb, $post;?> 
  376.  
  377. <div class="inside-row"> 
  378. <label for="<?php echo $shortname; ?>_features" class="display-block"><?php echo __('Create custom galleries, portfolios or services pages.', 'tstranslate')?></label> 
  379. </div> 
  380. <div class="inside-row"> 
  381. <?php $wptg_cpt = array('gallery'=>'galleries', 'portfolio'=>'portfolios', 'services'=>'brochures');?> 
  382. <div class="feats wptg-cpt-area"> 
  383. <label>Post Type<br /> 
  384. <select id="<?php echo $shortname; ?>_wptg_ctp_post_type" > 
  385. <?php foreach($wptg_cpt as $value => $postType) {?> 
  386. <option value="<?php echo $value; ?>" data-wptg_ctp="<?php echo $postType;?>"><?php echo $value;?></option> 
  387. <?php }?> 
  388. </select> 
  389. </label> 
  390. <label>Taxonomy<br /> 
  391. <select id="<?php echo $shortname; ?>_wptg_ctp_taxonomy" > 
  392. <option value="" class="wptg-group-allitems" selected="selected">All items</option> 
  393. <?php 
  394. foreach($wptg_cpt as $value => $postType) { 
  395. $get_terms_wptg_cpt = get_terms($postType, 'order=DESC'); 
  396. foreach($get_terms_wptg_cpt as $terms_wptg_cpt) { 
  397. echo '<option value="'.$terms_wptg_cpt->slug.'" class="wptg-group-'.$value.'" >'.$terms_wptg_cpt->name.'</option>'; 
  398. }?> 
  399. </select> 
  400. </label> 
  401. <label>Frame Style<br /> 
  402. <select id="<?php echo $shortname; ?>_wptg_ctp_style" > 
  403. <?php foreach(range(0, 14) as $number) {?> 
  404. <option value="<?php echo $number;?>"><?php echo $number;?></option> 
  405. <?php }?> 
  406. </select> 
  407. </label> 
  408. </div> 
  409. </div><!-- end row --> 
  410. <div class="inside-row"> 
  411. <label>Your shortcode </label> 
  412. <input type="text" name="wptg_ctg_shortcode" class="wptg_ctg_shortcode" value='[wptg-cpt wptg_post_type="gallery" taxonomy="" style="0"]' onclick="copyit(this)"/> 
  413. </div><!-- end row --> 
  414. <small class="description-full2"><?php echo __('Just create the shortcode and paste it in a new page.', 'tstranslate')?></small> 
  415.  
  416. <?php } 
  417.  
  418. /**************************/ 
  419. /** Setup MetaTags Favicon*/ 
  420. /************************/ 
  421.  
  422. function getThemeGenMetaTagsFavicon() { 
  423. global $themename, $shortname;?> 
  424.  
  425. <div class="setup-meta-favicon"> 
  426. <?php $metaDescrip = stripcslashes(get_option($shortname.'_metaDescription'));?> 
  427. <?php $metaKeywords = stripcslashes(get_option($shortname.'_metaKeywords'));?> 
  428.  
  429. <div class="display-table-cell table-cell-first"> 
  430. <label for="<?php echo $shortname; ?>_favicon"><?php echo __('Custom Favicon', 'tstranslate')?></label> 
  431. </div> 
  432. <div class="display-table-cell table-cell-2"> 
  433. <input name="<?php echo $shortname; ?>_favicon" id="<?php echo $shortname; ?>_favicon" type="text" value="<?php echo home_url();?>/favicon.ico" /> 
  434. </div> 
  435. <div class="description-full"> 
  436. <small><?php echo __('A favicon is a 16x16 pixel icon that represents your site; paste the URL to a .ico image that you want to use as the image.', 'tstranslate')?></small> 
  437. </div> 
  438.  
  439. <div class="display-table-cell table-cell-first"> 
  440. <label for="<?php echo $shortname; ?>_metaDescription"><?php echo __('Meta Description', 'tstranslate')?></label> 
  441. </div> 
  442. <div class="display-table-cell table-cell-2"> 
  443. <textarea name="<?php echo $shortname; ?>_metaDescription" type="textarea" cols="" rows="" style="height:100px;"><?php echo($metaDescrip != '')?$metaDescrip:'';?></textarea> 
  444. </div> 
  445. <div class="description-full"> 
  446. <small><?php echo __('How you want your site appears described in search engines.', 'tstranslate')?></small> 
  447. </div> 
  448.  
  449. <div class="display-table-cell table-cell-first"> 
  450. <label for="<?php echo $shortname; ?>_metaKeywords"><?php echo __('Meta Keywords', 'tstranslate')?></label> 
  451. </div> 
  452. <div class="display-table-cell table-cell-2"> 
  453. <textarea name="<?php echo $shortname; ?>_metaKeywords" type="textarea" cols="" rows="" style="height:100px;"><?php echo($metaKeywords != '')?$metaKeywords:'';?></textarea> 
  454. </div> 
  455. <div> 
  456. <small><?php echo __('Website Keywords.', 'tstranslate')?></small> 
  457. </div> 
  458. </div><!-- end setup-meta-favicon -->  
  459. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  460. <?php } 
  461.  
  462. /****************/ 
  463. /** Setup Posts */ 
  464. /**************/ 
  465.  
  466. function getThemeGenPosts() { 
  467. global $themename, $shortname?> 
  468.  
  469. <div class="setup-posts-area">  
  470. <label>View posts as</label> 
  471. <select name="<?php echo $shortname; ?>_grid_post" id="<?php echo $shortname; ?>_grid_post"> 
  472. <?php 
  473. $grid_posts = array("List", "Grid"); 
  474. $get_grid_posts = get_option($shortname.'_grid_post'); 
  475. foreach($grid_posts as $grid_post ) { ?> 
  476. <option <?php echo ($get_grid_posts === $grid_post)?'selected="selected"':''; ?> ><?php echo $grid_post; ?></option><?php 
  477. }?> 
  478. </select> 
  479. <div class="clear"></div> 
  480. <div class="grid_size"> 
  481. <label>Grid Size</label> 
  482. <select name="<?php echo $shortname; ?>_grid_post_size" id="<?php echo $shortname; ?>_grid_post_size"> 
  483. <?php 
  484. $grid_posts_sizes = array("Small", "Normal"); 
  485. $get_grid_posts_size = get_option($shortname.'_grid_post_size'); 
  486. foreach($grid_posts_sizes as $grid_posts_size ) {?> 
  487. <option <?php echo ($get_grid_posts_size === $grid_posts_size)?'selected="selected"':''; ?> ><?php echo $grid_posts_size; ?></option><?php 
  488. }?> 
  489. </select> 
  490. </div><!-- end grid_size --> 
  491. <label>Posts Box Design Style</label> 
  492. <?php 
  493. (isset($GLOBALS['boxes_css']) && $GLOBALS['boxes_css'][1] != 'boxcss_default')? 
  494. $postbox_style = $GLOBALS['boxes_css'][1]: 
  495. $postbox_style = get_option($shortname.'_postsbox_style', 'boxcss_default'); 
  496. $default_post_boxes = get_option($shortname.'_default_post_boxes', 'true')?> 
  497. <select name="<?php echo $shortname; ?>_postsbox_style" class="postsbox_style" <?php echo ($default_post_boxes == 'true')?'disabled="disabled"':'';?> > 
  498. <option value="boxcss_default">Default Box </option> 
  499. <?php foreach (range(0, 14) as $widget_number) {?> 
  500. <option value="<?php echo 'boxcss_'.$widget_number;?>" <?php echo ($postbox_style == 'boxcss_'.$widget_number)?'selected="selected"':'';?>> 
  501. <?php echo ($widget_number != 0)?'Box Style'.$widget_number:'No Box';?> 
  502. </option> 
  503. <?php } ?> 
  504. </select> 
  505. <div class="clear"></div> 
  506.  
  507. <label>Use post box design as in your downloaded theme</label> 
  508. <input name="<?php echo $shortname; ?>_default_post_boxes" id="<?php echo $shortname; ?>_default_post_boxes" class="default_post_boxes" type="checkbox" <?php echo ($default_post_boxes == 'true')?'checked="checked"':''?> value="true"/> 
  509. <div class="clear"></div> 
  510. <small><?php echo __('select the way you view your posts.', 'tstranslate')?></small> 
  511.  
  512. <script> 
  513. jQuery(function() { 
  514. jQuery('.default_post_boxes').change(function() { 
  515. if(jQuery(this).attr('checked')) { 
  516. jQuery('.postsbox_style').attr('disabled', true); 
  517. }else{ 
  518. jQuery('.postsbox_style').removeAttr('disabled'); 
  519. }; 
  520. }); 
  521. jQuery('#themeshock_grid_post').change(function() { 
  522. (jQuery(this).val() == 'List')?jQuery('.grid_size').hide():jQuery('.grid_size').show(); 
  523. }).change(); 
  524.  
  525. jQuery('.default_widget_boxes').change(function() { 
  526. if(jQuery(this).attr('checked')) { 
  527. jQuery('.selected .widget_style, #footer_widget_style .widget_style').attr('disabled', true); 
  528. }else{ 
  529. jQuery('.selected .widget_style, #footer_widget_style .widget_style').removeAttr('disabled'); 
  530. }; 
  531. }).change(); 
  532.  
  533. }); 
  534. </script> 
  535. </div><!-- end setup-posts-area --> 
  536. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  537. <?php } 
  538.  
  539. /***************************/ 
  540. /** Setup Socials Networks */ 
  541. /*************************/ 
  542.  
  543. function getThemeGenSocialNetworks() { 
  544. global $themename, $shortname, $wpdb, $post;?>  
  545. <div class="tg_social_network"> 
  546. <?php foreach($GLOBALS['social_network'] as $social_network =>$option_save) {?> 
  547. <div class="display-table-row"> 
  548. <div class="display-table-cell"> 
  549. <label for="<?php echo $shortname.$option_save; ?>"><?php echo ucfirst(str_replace('_', ' ', $social_network));?></label> 
  550. </div> 
  551. <div class="display-table-cell table-cell-2"> 
  552. <input name="<?php echo $shortname.$option_save; ?>" id="<?php echo $shortname.$option_save;?>" type="text" value="<?php echo get_option($shortname.$option_save, '');?>" /> 
  553. <input name="<?php echo $shortname.$option_save; ?>_option" type="checkbox" id="<?php echo $social_network; ?>" value="true" <?php echo (get_option($shortname.$option_save.'_option')==='true')?'checked="checked"':'';?> /> 
  554. </div> 
  555. </div><!-- end display-table-row --> 
  556. <?php }?> 
  557. </div> 
  558. <small><?php echo __('Enter the links of your social networks', 'tstranslate')?></small> 
  559. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  560. <?php } 
  561.  
  562. /***********************/ 
  563. /** Setup Contact Form */ 
  564. /*********************/ 
  565.  
  566. function getThemeGenContactForm() { 
  567. global $themename, $shortname, $wpdb, $post;?> 
  568. <label for="<?php echo $shortname; ?>_contact_mail"><?php echo __('Contact email', 'tstranslate')?></label> 
  569. <?php $contact_email=(!get_option($shortname.'_contact_mail'))?'email@email.com':get_option($shortname.'_contact_mail');?> 
  570. <input name="<?php echo $shortname; ?>_contact_mail" id="<?php echo $shortname; ?>_contact_mail" type="text" value="<?php echo $contact_email;?>" /> 
  571. <small><?php echo __('Enter the e-mail where you want to receive incoming messages.', 'tstranslate')?></small><div class="clearfix"></div> 
  572. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  573. <?php } 
  574.  
  575. /****************************/ 
  576. /** Setup Custom Post Types */ 
  577. /**************************/ 
  578.  
  579. function getThemeGenCustomPostTypes() { 
  580. global $themename, $shortname; 
  581. $CustomPostTypes = array('Gallery', 'Portfolio', 'Products', 'Services', 'Testimonials'); 
  582. $fontColorPostType = get_option($shortname.'_fontColorPostType'); 
  583. ?> 
  584. <span class="title_option_tg_full">Disable/enable custom post type (Gallery, Portfolio, Products, Services, Testimonials)</span> 
  585. <?php foreach($CustomPostTypes as $CustomPostType) {?> 
  586. <label for="<?php echo $shortname;?>_enablePostType<?php echo $CustomPostType?>"><?php echo __($CustomPostType, 'tstranslate')?></label> 
  587. <?php $enableCustomPostType = get_option($shortname.'_enablePostType'.$CustomPostType, 'true'); ?> 
  588. <input name="<?php echo $shortname.'_enablePostType'.$CustomPostType;?>" id="<?php echo $shortname.'_enablePostType'.$CustomPostType;?>" type="checkbox"  
  589. <?php echo($enableCustomPostType == 'true')?'checked="checked"':'';?> value="true"/> 
  590. <?php } ?> 
  591. <div class="clear"></div> 
  592. <small class="description_full"><?php echo __('Disable/enable custom post type (Gallery, Portfolio, Products, Services, Testimonials) This option will hide these menus in the slider of wp dashboard interface.', 'tstranslate')?></small> 
  593. <span class="title_option_tg_full">Font Color custom post type (Gallery, Portfolio, Products, Services, Testimonials)</span> 
  594. <label for="<?php echo $shortname;?>_fontColorPostType"><?php echo __('Font Color', 'tstranslate')?></label> 
  595. <input name="<?php echo $shortname.'_fontColorPostType';?>" id="<?php echo $shortname.'_fontColorPostType';?>" type="text" value="<?php echo $fontColorPostType;?>" /> 
  596. <br /> 
  597. <span><b>(Font Color)</b> Use hex, rgb, hsl or color name eg(#333, rgb(200, 200, 200), hsl(0, 0%, 20%) or blue)</span> 
  598. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  599. <?php } 
  600.  
  601. /*********************/ 
  602. /** Setup Responsive */ 
  603. /*******************/ 
  604.  
  605. function getThemeGenResponsive() { 
  606. global $themename, $shortname;?> 
  607. <label for="<?php echo $shortname;?>_enableResponsive"><?php echo __('Enable/Disable Responsive', 'tstranslate')?></label> 
  608. <?php $enableResponsive = get_option($shortname.'_enableResponsive', 'true');?> 
  609. <input name="<?php echo $shortname;?>_enableResponsive" id="<?php echo $shortname;?>_enableResponsive" type="checkbox"  
  610. <?php echo($enableResponsive == 'true')?'checked="checked"':'';?> value="true"/> 
  611. <div class="clearfix"></div> 
  612. <small><?php echo __('Disable/Enable responsive mode(Device/Mobile version)', 'tstranslate')?></small> 
  613. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  614. <?php } 
  615.  
  616. /**********************/ 
  617. /** Setup Footer Info */ 
  618. /********************/ 
  619.  
  620. function getThemeGenFooterInfo() { 
  621. global $themename, $shortname;?> 
  622. <div class="display-table-cell table-cell-first"> 
  623. <label for="<?php echo $shortname; ?>_info"><?php echo __('Footer Information', 'tstranslate')?></label> 
  624. </div> 
  625. <div class="display-table-cell table-cell-2"> 
  626. <textarea name="<?php echo $shortname; ?>_info" type="textarea" cols="" rows=""><?php echo (!get_option($shortname.'_info'))?'':stripcslashes(get_option($shortname.'_info'));?></textarea> 
  627. </div> 
  628. <small><?php echo __('You can write your company information in this area. This will be automatically added to the footer. Use <br /> to break lines', 'tstranslate')?></small> 
  629. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  630. <?php } 
  631.  
  632. /***************************/ 
  633. /** Setup Google Analytics */ 
  634. /*************************/ 
  635.  
  636. function getThemeGenGoogleAnalytics() { 
  637. global $themename, $shortname;?> 
  638. <div class="display-table-cell table-cell-first"> 
  639. <label for="<?php echo $shortname; ?>_ga_code"><?php echo __('Google Analytics Code', 'tstranslate')?></label> 
  640. </div> 
  641. <div class="display-table-cell table-cell-2"> 
  642. <textarea name="<?php echo $shortname; ?>_ga_code" type="textarea" cols="" rows="" ><?php echo (!get_option($shortname.'_ga_code'))?'':stripcslashes(get_option($shortname.'_ga_code'));?></textarea> 
  643. </div> 
  644. <small><?php echo __('You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.', 'tstranslate')?></small> 
  645. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  646. <?php } 
  647.  
  648. /************************/ 
  649. /** Setup Shopping Cart */ 
  650. /**********************/ 
  651.  
  652. function getThemeGenShoppingCart() { 
  653. global $themename, $shortname; 
  654. $page_product=array('Products', 'All pages'); 
  655. $GLOBALS['tg_shp_show']=get_option('themeshock_shp_cart_show'); 
  656. $shoppinCartUrl = (!get_option($shortname.'_shopping_cart_url'))?'http://www.yourmerchant.com/ ':get_option($shortname.'_shopping_cart_url'); ?> 
  657. <div class="display-block"> 
  658. <div class="display-table-cell table-cell-first"> 
  659. <label for="<?php echo $shortname; ?>_features">Shopping cart</label> 
  660. </div> 
  661. <div class="display-table-cell table-cell-2"> 
  662. <input type="checkbox" name="ts_shopping_cart" value="true" <?php echo (get_option('ts_shopping_cart')==='true')?'checked="checked"':''; ?> /> 
  663. </div> 
  664. </div> 
  665. <div class="display-block"> 
  666. <div class="display-table-cell table-cell-first"> 
  667. <label for="<?php echo $shortname; ?>_features">Show shopping cart in </label> 
  668. </div> 
  669. <div class="display-table-cell table-cell-2"> 
  670. <select name="<?php echo $shortname; ?>_shp_cart_show[]" multiple="multiple"> 
  671. <?php 
  672. foreach ($page_product as $value) { 
  673. if (is_array($GLOBALS['tg_shp_show'])) { 
  674. $tg_shp_sl=''; 
  675. foreach ($GLOBALS['tg_shp_show'] as $page_verify) { 
  676. if ($page_verify===$value) { 
  677. $tg_shp_sl='selected="selected"'; 
  678. }else{ 
  679. $tg_shp_sl=''; 
  680. }?> 
  681. <option value="<?php echo $value; ?>" <?php echo $tg_shp_sl; ?>><?php echo $value; ?></option><?php 
  682. }?> 
  683. </select> 
  684. </div> 
  685. </div> 
  686. <div class="display-block"> 
  687. <div class="display-table-cell table-cell-first"> 
  688. <label for="<?php echo $shortname; ?>_features">Price url</label> 
  689. </div> 
  690. <div class="display-table-cell table-cell-2"> 
  691. <textarea name="<?php echo $shortname; ?>_shopping_cart_url" type="textarea"><?php echo $shoppinCartUrl;?></textarea> 
  692. </div> 
  693. </div> 
  694. <div class="display-block"> 
  695. <div class="display-table-cell table-cell-first"> 
  696. <label for="<?php echo $shortname; ?>_features">Currency</label> 
  697. </div> 
  698. <div class="display-table-cell table-cell-2"> 
  699. <select name="<?php echo $shortname; ?>_shopping_cart_currency" id="<?php echo $shortname; ?>_imgpack"> 
  700. <?php 
  701. $shoppingcart_currency_pack=array("USD", "BRL", "CAD", "CNY", "COP", "EUR", "GBP", "MXN", "JPY" ); 
  702. $get_shopping_cart=get_option($shortname.'_shopping_cart_currency'); 
  703. foreach($shoppingcart_currency_pack as $shoping_cart_item ) {?> 
  704. <option <?php echo ($shoping_cart_item===$get_shopping_cart)?'selected="selected"':''; ?> ><?php echo $shoping_cart_item; ?></option><?php 
  705. ?>  
  706. </select> 
  707. </div> 
  708. </div> 
  709. <small> 
  710. URL where you will receive payment parameters: Parameters to pass (Post method):<br /> 
  711. $_POST['tg_shp_cart'][idproduct]['title']=Prints product name 
  712. $_POST['tg_shp_cart'][idproduct]['quantity']=Prints product quantity 
  713. $_POST['tg_shp_cart'][idproduct]['price']=Prints the total price for the quantity of such product according to the price defined in Edit product item 
  714. $_POST['tg_shp_cart'][price_total]=Prints total price of all products 
  715. $_POST['tg_shp_cart'][total_items]=Prints total quantity of items of all products 
  716. $_POST['tg_shp_cart'][currrency]=Prints the currency selected at Options for Theme Generator 
  717. </small> 
  718. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  719. <?php } 
  720.  
  721. /************************/ 
  722. /** Setup Tool ThemeGen */ 
  723. /**********************/ 
  724.  
  725. function getThemeGenToolWptg() { 
  726. global $themename, $shortname; 
  727. $get_activate_framework_tool= get_option($shortname.'_activate_framework_tool', 'false'); 
  728. $framework_tool_ckecked = ($get_activate_framework_tool == 'true')?'checked="checked"':'';?> 
  729. <label for="<?php echo $shortname; ?>_activate_framework_tool"><?php echo __('Show the personalize menu', 'tstranslate')?></label> 
  730. <input name="<?php echo $shortname; ?>_activate_framework_tool" id="<?php echo $shortname; ?>_activate_framework_tool" type="checkbox" <?php echo $framework_tool_ckecked?> value="true"/> 
  731. <div class="clear"></div> 
  732. <small><?php echo __('Great Tool to customize your theme. show on the frontpage when active, so that you can change aspect of your theme in real time. (colors, patterns, etc)', 'tstranslate')?></small> 
  733. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  734. <?php } 
  735.  
  736. /*****************************/ 
  737. /** Setup testimonial quotes */ 
  738. /***************************/ 
  739.  
  740. function getThemeGenTestimonialQuotes() { 
  741. global $themename, $shortname;?> 
  742. <div class="inside-row"> 
  743. <div class="display-table-cell table-cell-first"> 
  744. <label><?php echo __('Style type', 'tstranslate')?></label> 
  745. </div> 
  746. <div class="display-table-cell table-cell-2"> 
  747. <select name="<?php echo $shortname; ?>_quote_styles" id="<?php echo $shortname; ?>_quote_styles"> 
  748. <?php 
  749. $get_testimonial_quote_pack = get_option($shortname.'_quote_styles', 1); 
  750. foreach(range(1, 6) as $testimonial_quote_styles ) { ?> 
  751. <option <?php echo ($get_testimonial_quote_pack == $testimonial_quote_styles)?'selected="selected"':''; ?> ><?php echo $testimonial_quote_styles; ?></option><?php 
  752. }?> 
  753. </select> 
  754. </div> 
  755. </div> 
  756. <div class="inside-row"> 
  757. <div class="display-table-cell table-cell-first"> 
  758. <label><?php echo __('Colors', 'tstranslate')?></label> 
  759. </div> 
  760. <div class="display-table-cell table-cell-2"> 
  761. <select name="<?php echo $shortname; ?>_quote_color" id="<?php echo $shortname; ?>_quote_color"> 
  762. <?php 
  763. $testimonial_color_pack = array("gray", "blue", "black", "craft", "white"); 
  764. $get_testimonial_color_pack = get_option($shortname.'_quote_color', 'gray'); 
  765. foreach($testimonial_color_pack as $testimonial_color_styles ) { ?> 
  766. <option <?php echo ($get_testimonial_color_pack == $testimonial_color_styles)?'selected="selected"':''; ?> ><?php echo $testimonial_color_styles?></option><?php 
  767. }?> 
  768. </select> 
  769. </div> 
  770. </div> 
  771.  
  772.  
  773. <small><?php echo __('Select the quotes styles you want to use on your Testimonials page.', 'tstranslate')?></small> 
  774. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  775. <?php } 
  776.  
  777. /*****************/ 
  778. /** Setup slider */ 
  779. /***************/ 
  780.  
  781. function getThemeGenSlider() { 
  782. global $themename, $shortname;?> 
  783.  
  784. <div class="inside-row"> 
  785. <div class="display-table-cell table-cell-first"> 
  786. <label for="<?php echo $shortname; ?>_slider_type"><?php echo __('Slider type', 'tstranslate')?></label> 
  787. </div> 
  788. <div class="display-table-cell table-cell-2"> 
  789. <select name="<?php echo $shortname;?>_slider_type" id="<?php echo $shortname;?>_slider_type"> 
  790. <?php 
  791. $slider_type_pack = array("Nivo-Slider", "Easy-Accordion", "Piecemaker", "Featured-Slider"); 
  792. $get_slider_type = get_option($shortname.'_slider_type'); 
  793. foreach($slider_type_pack as $slider_type ) {?> 
  794. <option <?php echo ($get_slider_type === $slider_type)?'selected="selected"':''; ?> ><?php echo $slider_type; ?></option><?php 
  795. }?> 
  796. </select> 
  797. </div> 
  798. <small><?php echo __('Select the slider you want to use on your site.', 'tstranslate')?></small> 
  799. </div> 
  800. <script> 
  801. jQuery(function() { 
  802. jQuery('#themeshock_slider_type').change(function() { 
  803. $this_val = jQuery(this).val(); 
  804. jQuery('.slider-area-options').hide(); 
  805. jQuery('.slider-area-'+$this_val).show(); 
  806. ($this_val == 'Featured-Slider')?jQuery('#wptg-slider .uploader').hide():jQuery('#wptg-slider .uploader').show(); 
  807. }).change(); 
  808. }) 
  809. </script>  
  810. <div id="slider_type"> 
  811. <?php 
  812. $get_slider_effect = get_option($shortname.'_slider_fx'); 
  813. $slider_effect_pack = array('random', 'sliceDownRight', 'sliceDownLeft', 'sliceUpRight', 'sliceUpLeft', 'sliceUpDown', 'sliceUpDownLeft', 'fold', 'fade', 'boxRandom',  
  814. 'boxRain', 'boxRainReverse', 'boxRainGrow', 'boxRainGrowReverse'); 
  815. $slider_autoplay_pack = array('no', 'yes'); 
  816. $tweentype_pack = array('linear', 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 'easeInCubic', 'easeOutCubic', 'easeInOutCubic', 'easeInQuart', 'easeOutQuart',  
  817. 'easeInOutQuart', 'easeInQuint', 'easeOutQuint', 'easeInOutQuint', 'easeInSine', 'easeOutSine', 'easeInOutSine', 'easeInExpo', 'easeOutExpo', 'easeInOutExpo', 'easeInCirc',  
  818. 'easeOutCirc', 'easeInOutCirc', 'easeInElastic', 'easeOutElastic', 'easeInOutElastic', 'easeInBack', 'easeOutBack', 'easeInOutBack', 'easeInBounce', 'easeOutBounce', 'easeInOutBounce'); 
  819. $get_tweentype = get_option($shortname.'_pm_tweenType'); 
  820. $get_ea_autoplay = get_option($shortname.'_ea_autoplay'); 
  821. $ea_autoplay_pack = array('no', 'yes'); 
  822. $slider_type = get_option($shortname."_slider_type"); 
  823. ?> 
  824. <div class="slider-area-options slider-area-Nivo-Slider"> 
  825. <div class="inside-row"> 
  826. <div class="display-table-cell table-cell-first"> 
  827. <label for="<?php echo $shortname; ?>_anim_speed"><?php echo __('Animation speed', 'tstranslate')?></label> 
  828. </div> 
  829. <div class="display-table-cell table-cell-2"> 
  830. <input name="<?php echo $shortname; ?>_anim_speed" id="<?php echo $shortname; ?>_anim_speed" type="text" value="<?php echo get_option($shortname.'_anim_speed'); ?>" /> 
  831. </div> 
  832. </div><!-- end inside-row --> 
  833. <div class="inside-row"> 
  834. <div class="display-table-cell table-cell-first"> 
  835. <label for="<?php echo $shortname; ?>_slider_fx"><?php echo __('Slider Effect', 'tstranslate');?></label> 
  836. </div> 
  837. <div class="display-table-cell table-cell-2"> 
  838. <select name="<?php echo $shortname; ?>_slider_fx" id="<?php echo $shortname; ?>_slider_fx"> 
  839. <?php foreach($slider_effect_pack as $slider_effect ) { ?> 
  840. <option <?php echo ($get_slider_effect === $slider_effect)?'selected="selected"':''; ?> ><?php echo $slider_effect; ?></option> 
  841. <?php } ?> 
  842. </select> 
  843. </div> 
  844. </div><!-- end inside-row --> 
  845. </div><!-- end slider-area-nivo --> 
  846.  
  847. <div class="slider-area-options slider-area-Piecemaker"> 
  848. <div class="inside-row">  
  849. <div class="display-table-cell table-cell-first"> 
  850. <label for="<?php echo $shortname; ?>_pm_tweenType">TweenType</label> 
  851. </div> 
  852. <div class="display-table-cell table-cell-2"> 
  853. <select name="<?php echo $shortname; ?>_pm_tweenType" id="<?php echo $shortname; ?>_pm_tweenType"> 
  854. <?php foreach($tweentype_pack as $tweentype ) { ?> 
  855. <option <?php echo ($get_tweentype === $tweentype)?'selected="selected"':''; ?>><?php echo $tweentype; ?></option> 
  856. <?php } ?> 
  857. </select> 
  858. </div> 
  859. </div> 
  860. <div class="display-table-cell table-cell-first"> 
  861. <label for="<?php echo $shortname; ?>_pm_autoplay"><?php echo __('Delay in seconds', 'tstranslate')?></label> 
  862. </div> 
  863. <div class="display-table-cell table-cell-2"> 
  864. <input name="<?php echo $shortname; ?>_pm_autoplay" id="<?php echo $shortname; ?>_pm_autoplay" type="text" value="<?php echo get_option($shortname.'_pm_autoplay'); ?>" /> 
  865. </div> 
  866. </div><!-- end slider-area-piecemaker --> 
  867.  
  868. <div class="slider-area-options slider-area-Featured-Slider"> 
  869. <div class="display-table-cell table-cell-first"> 
  870. <label for="<?php echo $shortname; ?>_anim_speed"><?php echo __('Animation speed', 'tstranslate')?></label> 
  871. </div> 
  872. <div class="display-table-cell table-cell-2"> 
  873. <input name="<?php echo $shortname; ?>_feat_speed" id="<?php echo $shortname; ?>_feat_speed" type="text" value="<?php echo get_option($shortname.'_feat_speed', '3000'); ?>" /> 
  874. </div> 
  875. <small><?php echo __('This slider will take data directly from the posts, please go to each post\'s edit page and check the "Featured slider post" option.', 'tstranslate')?></small><div class="clearfix"></div> 
  876. </div><!-- end slider-area-featured --> 
  877.  
  878. </div><!-- end slider_type--> 
  879. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  880.  
  881. <div class="uploader" <?php echo (isset($GLOBALS['error_folder']))?'style="display:none"':''; ?>> 
  882. <span class="uploader-title">Uploader images</span> 
  883. <div id="TS_uploader"> 
  884. <noscript> 
  885. <p>Please enable JavaScript to use file uploader.</p> 
  886. <!-- or put a simple form for upload here --> 
  887. </noscript> 
  888. </div> 
  889. <img src="<?php echo get_template_directory_uri();?>/img/frame_gallery/loading.gif" class="loading_sld" /> 
  890. <ol id="file_stored"> 
  891. <?php  
  892. $last_item=count($GLOBALS['slider_img_info'])-1; 
  893. if ($GLOBALS['slider_img_info']) { 
  894. foreach($GLOBALS['slider_img_info'] as $index => $slider_info) {?> 
  895. <li> 
  896. <div class="display-table-cell table-cell-first"> 
  897. <span class="number"><?php echo $index+1; ?></span> 
  898. <img class="thumb" src="<?php echo $slider_info['thumbnail']?>" /> 
  899. </div> 
  900. <div class="display-table-cell table-cell-2"> 
  901. <input type="text" name="link_<?php echo $index;?>" value="<?php echo $slider_info['link'];?>" /> 
  902. <div class="slider-images-controls"> 
  903. <input type="button" value="save link" data-id="<?php echo $index; ?>" /> 
  904. <?php if ($index!==0) { ?> 
  905. <input type="button" value="▲" data-value="up" data-id="<?php echo $index; ?>" /> 
  906. <?php }?> 
  907. <?php if($last_item!==$index) {?> 
  908. <input type="button" data-value="down" value="▼" data-id="<?php echo $index; ?>" /> 
  909. <?php }?> 
  910. <img class="close" src="<?php echo get_template_directory_uri(); ?>/img/close.png" data-id="<?php echo $index; ?>" /> 
  911. <input type="checkbox" value="true" data-value="sld_image" <?php echo ($slider_info['active'])?'checked="checked"':'';?> data-id="<?php echo $index; ?>" /> 
  912. </div> 
  913. </div> 
  914. </li><?php 
  915. }?> 
  916. </ol> 
  917. </div> 
  918. <?php } 
  919.  
  920. /**********************/ 
  921. /** Setup page layout */ 
  922. /********************/ 
  923.  
  924. function getThemeGenPageLayout() { 
  925. global $themename, $shortname; 
  926. ob_start();?> 
  927. <select name="footer_widget_style" class="widget_style content"> 
  928. <option value="boxcss_default">Default Box </option> 
  929. <?php foreach (range(0, 14) as $widget_number) {?> 
  930. <option value="<?php echo 'boxcss_'.$widget_number;?>"><?php echo ($widget_number != 0)?'Box Style'.$widget_number:'No Box';?></option> 
  931. <?php } ?> 
  932. </select> 
  933. <?php $widget_style_option=ob_get_clean(); 
  934. $name_base='name="footer_widget_style"'; 
  935. $select_position=array(); 
  936. foreach($GLOBALS['layout_info'][0] as $style_widget_name => $value ) { 
  937. if (is_array($value)) { 
  938. $disable=($value["active"]===true)?'style="z-index:2;"':' disabled="disabled" '; 
  939. if($GLOBALS['layout_info']['themeshock_default_widget_boxes'] == true && $disable != ' disabled="disabled" ') { 
  940. $default_widgets_boxes = ' disabled="disabled" '; 
  941. $value_assigned=$value["style"]; 
  942. $array_search=array($name_base, 'value="'.$value_assigned.'"'); 
  943. $array_replace=array('name="'.$style_widget_name.'_style"'.$disable.$default_widgets_boxes, 'value="'.$value_assigned.'" selected="selected"'); 
  944. $select_position[$style_widget_name]=str_replace($array_search, $array_replace, $widget_style_option); 
  945. if ($style_widget_name==='footer_widget_style') { 
  946. $select_position[$style_widget_name]=str_replace('value="'.$value.'"', 'value="'.$value.'" selected="selected"', $widget_style_option); 
  947. ?> 
  948. <ul class="layout_base_info display-block"> 
  949. <li class="lay_disabled"><span></span>Disabled</li> 
  950. <li class="lay_enabled"><span></span>Enabled</li> 
  951. <li class="loading_layout"> <img src="<?php echo get_template_directory_uri();?>/img/frame_gallery/loading.gif" class="loading_layout" /></li> 
  952. </ul> 
  953. <div> 
  954. <div class="display-table-cell table-cell-first"> 
  955. <label>Select the page you want to setup</label> 
  956. </div> 
  957. <div class="display-table-cell table-cell-2"> 
  958. <select id="<?php echo $shortname; ?>_layout_type" > 
  959. <?php foreach($GLOBALS['pages'] as $index => $page) {?> 
  960. <option <?php echo ($index===0)?'selected="selected"':''; ?> value="<?php echo $page->ID; ?>"><?php echo $page->post_title; ?></option> 
  961. <?php }?> 
  962. </select> 
  963. </div> 
  964. </div> 
  965. <script> 
  966. jQuery(function() { 
  967. jQuery('.controls-new-sidebar-show').click(function(e) { 
  968. e.preventDefault(); 
  969. jQuery(this).hide(); 
  970. jQuery('input[name="add_sidebar"], .setup-new-sidebar').show(); 
  971.  
  972. }) 
  973. }) 
  974. </script> 
  975. <div class="option_content_layout"> 
  976. <?php $content_layout = get_option($shortname."_content_layout");?> 
  977. <label>Main Content 700px, Sidebar 220px</label> 
  978. <input type="radio" value="content_layout_small" id="content_layout_small" name="<?php echo $shortname; ?>_content_layout" <?php echo($content_layout == 'content_layout_small')?'checked="checked"':'';?> /> 
  979. <div class="clear"></div> 
  980. <label>Main Content 620px, Sidebar 300px</label> 
  981. <input type="radio" value="content_layout_normal" id="content_layout_normal" name="<?php echo $shortname; ?>_content_layout" <?php echo($content_layout == 'content_layout_normal')?'checked="checked"':'';?> /> 
  982. </div> 
  983. <div class="container-controls-new-sidebar"> 
  984. <input type="button" value="New Sidebar" class="controls-new-sidebar controls-new-sidebar-show" /> 
  985. <input type="button" value="Add Sidebar" name="add_sidebar" class="controls-new-sidebar"/> 
  986. </div> 
  987. <div class="setup-new-sidebar"> 
  988. <div class="inside-row"> 
  989. <div class="display-table-cell table-cell-first"> 
  990. <label>Side</label> 
  991. </div> 
  992. <div class="display-table-cell table-cell-2"> 
  993. <input type="radio" name="sidebar_add" value="Top" checked="checked" />Top 
  994. <input type="radio" name="sidebar_add" value="Bottom" />Bottom 
  995. </div> 
  996. </div> 
  997. <div class="inside-row"> 
  998. <div class="display-table-cell table-cell-first"> 
  999. <label>Name Sidebar</label> 
  1000. </div> 
  1001. <div class="display-table-cell table-cell-2"> 
  1002. <input type="text" value="" name="name_sidebar" /> 
  1003. </div> 
  1004. </div>  
  1005. </div> 
  1006.  
  1007. <ul id="lay_gen" class="noslider"> 
  1008. <li id="slider_page" class="notshow"> 
  1009. <h4>Slider</h4> 
  1010. <div></div> 
  1011. </li> 
  1012. <?php $positions=$GLOBALS['layout_info'][0]; 
  1013. foreach ($positions as $position => $value) { 
  1014. switch ($position) { 
  1015. case 'left_1': 
  1016. case 'left_2': 
  1017. case 'right_1': 
  1018. unset($positions[$position]); 
  1019. continue 2; 
  1020. case 'right_2': 
  1021. unset($positions[$position]); 
  1022. break 2; 
  1023. if (is_array($value)) {?> 
  1024. <li id="<?php echo $position ?>" data-pos="Top" class="<?php echo ($value["active"]===true)?'selected':''; ?>"> 
  1025. <img class="sd_close" src="<?php echo get_template_directory_uri(); ?>/img/close.png" data-delete="<?php echo $position; ?>" /> 
  1026. <?php echo $select_position[$position];?> 
  1027. <div></div> 
  1028. <h4>sidebar <?php echo $position;?></h4> 
  1029. </li><?php 
  1030. } unset($positions[$position]); 
  1031. }?> 
  1032. <li class="nothover"> 
  1033. <ul class="horinzontal"> 
  1034. <li id="left_1" class="<?php echo ($GLOBALS['layout_info'][0]['left_1']["active"]===true)?'selected':''; ?>"> 
  1035. <?php echo $select_position['left_1'];?> 
  1036. <div></div> 
  1037. <h4>sidebar left 1</h4> 
  1038. </li> 
  1039. <li id="left_2" class="<?php echo ($GLOBALS['layout_info'][0]['left_2']["active"]===true)?'selected':''; ?>"> 
  1040. <?php echo $select_position['left_2'];?> 
  1041. <div></div> 
  1042. <h4>sidebar left 2</h4> 
  1043. </li> 
  1044. <li class="content"><h4>content area</h4></li> 
  1045. <li id="right_1" class="<?php echo ($GLOBALS['layout_info'][0]['right_1']["active"]===true)?'selected':''; ?>"> 
  1046. <?php echo $select_position['right_1'];?> 
  1047. <div></div> 
  1048. <h4>sidebar right 1</h4> 
  1049. </li> 
  1050. <li id="right_2" class="last_hor <?php echo ($GLOBALS['layout_info'][0]['right_2']["active"]===true)?'selected':''; ?>"> 
  1051. <?php echo $select_position['right_2'];?> 
  1052. <div></div> 
  1053. <h4>sidebar right 2</h4> 
  1054. </li> 
  1055. </ul> 
  1056. </li> 
  1057. <?php  
  1058. foreach ($positions as $position => $value) {  
  1059. if (is_array($value)) { 
  1060. ?> 
  1061. <li id="<?php echo $position ?>" data-pos="Bottom" class="<?php echo ($value["active"]===true)?'selected':''; ?>"> 
  1062. <img class="sd_close" src="<?php echo get_template_directory_uri(); ?>/img/close.png" data-delete="<?php echo $position; ?>" /> 
  1063. <?php echo $select_position[$position];?> 
  1064. <div></div> 
  1065. <h4>sidebar <?php echo $position;?></h4> 
  1066. </li><?php 
  1067. }?> 
  1068. </ul> 
  1069. <ul class="slider_opt"> 
  1070. <li id="slider_title"> 
  1071. <b>Select where you want top slider to be activated.</b> 
  1072. </li> 
  1073. <?php 
  1074. foreach($GLOBALS['layout_info'][0] as $slider_page_type => $value ) { 
  1075. if (is_array($value)) {break;} 
  1076. if ($slider_page_type==='footer_widget_style') {?> 
  1077. <li id="<?php echo $slider_page_type;?>"> 
  1078. <strong>Footer widget box style  </strong> 
  1079. <?php echo $select_position['footer_widget_style'];?> 
  1080. </li> 
  1081. <li id="default_widget_boxes"> 
  1082. <?php $default_widget_boxes = $GLOBALS['layout_info']['themeshock_default_widget_boxes']?> 
  1083. <label style="width:auto; padding: 0 5px 0 0;">Use widget box designs as in your downloaded theme:</label> 
  1084. <input name="<?php echo $shortname; ?>_default_widget_boxes" id="<?php echo $shortname; ?>_default_widget_boxes" class="default_widget_boxes" type="checkbox" <?php echo ($default_widget_boxes == true)?'checked="checked"':''?> value="true"/> 
  1085. <span class="question_tooltip">? 
  1086. <div class="question_tooltip-desciption"> 
  1087. <img src="<?php echo get_template_directory_uri()?>/img/multi_bkg/preview_options_boxescss.jpg"/> 
  1088. <p>By checking this option your theme will have the content boxes 
  1089. with the design you selected when download your theme from www.wpthemegenerator.com Otherwise it will take 
  1090. one of the designs from the dropdown menu in the layout creator (una imagen mostrando el dropdown).</p> 
  1091. </div> 
  1092. </span> 
  1093. </li><?php  
  1094. }else{?> 
  1095. <li id="<?php echo $slider_page_type; ?>">Activate in <?php echo substr($slider_page_type, strpos($slider_page_type, '_')+1); ?> 
  1096. <input type="checkbox" name="<?php echo $slider_page_type; ?>" value="true" <?php echo ($value===true)?'checked="checked"':''; ?> /> 
  1097. </li><?php 
  1098. }?> 
  1099. </ul> 
  1100.  
  1101. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  1102. <?php } 
  1103.  
  1104. /**********************/ 
  1105. /** Setup getThemeGen */ 
  1106. /********************/ 
  1107.  
  1108. function getThemeGen() { 
  1109. global $themename, $shortname;?> 
  1110. ... 
  1111. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  1112. <?php } 
  1113.  
  1114. function themeshock_admin() { 
  1115. global $themename, $shortname, $wpdb, $screen_layout_columns; 
  1116.  
  1117. if ( isset($_POST['saved'] )) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>'; 
  1118. if ( isset($_POST['reset'] )) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>'; 
  1119.  
  1120. add_meta_box('wptg-font-style', 'Font Style', 'get_wptg_font_style', 'toplevel_page_functions', 'wptg_font_style', 'core'); 
  1121. add_meta_box('wptg-logo', 'Logo', 'get_wptg_logo', 'toplevel_page_functions', 'wptg_logo', 'core'); 
  1122. add_meta_box('wptg-header_elements', 'Menu and Search', 'getThemeGenHeaderElements', 'toplevel_page_functions', 'wptg_header_elements', 'core'); 
  1123. add_meta_box('wptg-shortcodes', 'Custom Post Type Shortcodes', 'getThemeGenShortcodes', 'toplevel_page_functions', 'wptg_shortcodes', 'core'); 
  1124. add_meta_box('wptg-metatags-favicon', 'Meta Tags and Favicon', 'getThemeGenMetaTagsFavicon', 'toplevel_page_functions', 'wptg_metatags_favicon', 'core'); 
  1125. add_meta_box('wptg-posts', 'Posts Display Options', 'getThemeGenPosts', 'toplevel_page_functions', 'wptg_posts', 'core'); 
  1126. add_meta_box('wptg-icon-posts', 'Icon Post', 'getThemeGenIconPost', 'toplevel_page_functions', 'wptg_icon_posts', 'core'); 
  1127. add_meta_box('wptg-socials-networks', 'Social Networks', 'getThemeGenSocialNetworks', 'toplevel_page_functions', 'wptg_social_networks', 'core'); 
  1128. add_meta_box('wptg-contact-form', 'Contact Form', 'getThemeGenContactForm', 'toplevel_page_functions', 'wptg_contact_form', 'core'); 
  1129. add_meta_box('wptg-custom-post-types', 'Options Custom Post Types', 'getThemeGenCustomPostTypes', 'toplevel_page_functions', 'wptg_custom_post_types', 'core'); 
  1130. add_meta_box('wptg-responsive', 'Responsive', 'getThemeGenResponsive', 'toplevel_page_functions', 'wptg_responsive', 'core'); 
  1131. add_meta_box('wptg-footer-info', 'Footer Info', 'getThemeGenFooterInfo', 'toplevel_page_functions', 'wptg_footer_info', 'core'); 
  1132. add_meta_box('wptg-google-analytics', 'Google Analytics', 'getThemeGenGoogleAnalytics', 'toplevel_page_functions', 'wptg_google_analytics', 'core'); 
  1133. add_meta_box('wptg-shopping-cart', 'Shopping Cart', 'getThemeGenShoppingCart', 'toplevel_page_functions', 'wptg_shopping_cart', 'core'); 
  1134. add_meta_box('wptg-tool-wptg', 'Personalize Menu', 'getThemeGenToolWptg', 'toplevel_page_functions', 'wptg_tool_wptg', 'core'); 
  1135. add_meta_box('wptg-testimonial-quotes', 'Testimonial Quotes', 'getThemeGenTestimonialQuotes', 'toplevel_page_functions', 'wptg_testimonial_quotes', 'core'); 
  1136. add_meta_box('wptg-slider', 'Slider', 'getThemeGenSlider', 'toplevel_page_functions', 'wptg_slider', 'core'); 
  1137. add_meta_box('wptg-page-layout', 'Layout Creator', 'getThemeGenPageLayout', 'toplevel_page_functions', 'wptg_page_layout', 'core'); 
  1138. ?> 
  1139. <script type="text/javascript"> 
  1140. jQuery(document).ready( function($) { 
  1141. jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); 
  1142. postboxes.add_postbox_toggles('toplevel_page_functions'); 
  1143. }); 
  1144. </script> 
  1145.  
  1146. <?php if (isset($GLOBALS['error_folder'])) {?> 
  1147. <h2 style="color:#FF0000; font-size:20px;"><?php echo $GLOBALS['error_folder'];?></h2> 
  1148. <?php }?> 
  1149.  
  1150. <!-- new layout options wpthemegenerator --> 
  1151. <div class="wrap" id="wrapper-options-wpthemegenerator"> 
  1152. <form method="post" enctype="multipart/form-data" onsubmit="verify_chk_box();"> 
  1153. <?php 
  1154. wp_nonce_field('wrapper-options-wpthemegenerator'); 
  1155. wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); 
  1156. wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); 
  1157.  
  1158. $metaBoxCols1 = array('wptg_font_style', 'wptg_logo', 'wptg_header_elements', 'wptg_social_networks', 'wptg_metatags_favicon', 'wptg_slider', 'wptg_posts', 'wptg_icon_posts', 'wptg_contact_form'); 
  1159.  
  1160. $metaBoxCols2 = array('wptg_shortcodes', 'wptg_custom_post_types', 'wptg_shopping_cart', 'wptg_responsive', 'wptg_footer_info', 'wptg_google_analytics', 'wptg_testimonial_quotes', 'wptg_page_layout'); 
  1161.  
  1162. ?> 
  1163.  
  1164. <div class="icon32" id="icon-wpthemegenerator"></div> 
  1165. <h2><?php echo __('Options for', 'tstranslate')?> <?php echo $themename; ?></h2> 
  1166.  
  1167. <div class="wptg-cols wptg-col1"> 
  1168. <?php foreach($metaBoxCols1 as $wptgMetabox) { 
  1169. do_meta_boxes('toplevel_page_functions', $wptgMetabox, ''); 
  1170. }?> 
  1171. </div><!-- end wptg-cols --> 
  1172.  
  1173. <div class="wptg-cols wptg-col2"> 
  1174. <?php foreach($metaBoxCols2 as $wptgMetabox) { 
  1175. do_meta_boxes('toplevel_page_functions', $wptgMetabox, ''); 
  1176. }?> 
  1177. </div><!-- end wptg-cols --> 
  1178. <input type="hidden" name="action" value="save" /> 
  1179. </form> 
  1180. </div><!-- end wrap --> 
  1181.  
  1182. <form method="post" enctype="multipart/form-data"> 
  1183. <p class="submit"> 
  1184. <input name="reset" type="submit" value="Reset" /> 
  1185. <input type="hidden" name="action" value="reset" /> 
  1186. </p> 
  1187. </form> 
  1188. <div style="font-size:9px; margin-bottom:10px;"> 
  1189. Icons: <?php $icons = 'http://www.iconshock.com'?> 
  1190. <a href="<?php echo $icons;?>">Iconshock</a> 
  1191. </div> 
  1192.  
  1193. <?php 
  1194.  
  1195. add_action('admin_init', 'themeshock_add_init'); 
  1196. add_action('admin_menu', 'themeshock_add_admin'); 
  1197.  
  1198. //Comments 
  1199. function wts_comment($comment, $args, $depth) { 
  1200. $GLOBALS['comment'] = $comment; ?> 
  1201. <div class="clear"></div> 
  1202. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> 
  1203. <div class="separate_comments"> 
  1204. <div class="commentLeft">  
  1205. <div class="comment-author vcard"> 
  1206. <?php echo get_avatar($comment, $size='40'); ?> 
  1207. </div> 
  1208. </div> 
  1209. <div class="commentRight"> 
  1210. <div class="autorAndDate"> 
  1211. <?php printf('<cite class="fn">%s - </cite>', get_comment_author_link()) ?> 
  1212. <a class="commentInfo" href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf('%1$s', get_comment_date('F j, Y'), NULL) ?></a> 
  1213. </div> 
  1214. <div class="commentTexts"> 
  1215. <?php comment_text() ?>  
  1216. </div> 
  1217. <?php edit_comment_link(__('(Edit)', 'tstranslate'), ' ', '') ?> 
  1218. <div class="reply"> 
  1219. <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> 
  1220. </div>  
  1221. </div> 
  1222. </div><!-- separate comments--> 
  1223. <?php 
  1224.  
  1225. /**/ 
  1226. add_action('admin_init', 'add_post_feat'); 
  1227. add_action('save_post', 'update_feat_post'); 
  1228.  
  1229. function add_post_feat() { 
  1230. add_meta_box("post_details", __("More post options", 'tstranslate'), "post_options", "post", "normal", "low"); 
  1231.  
  1232. function post_options() { 
  1233. global $post; 
  1234. $custom = get_post_custom($post->ID); 
  1235. $feat_post = $custom["feat_post"][0]; 
  1236.  
  1237. ?> 
  1238. <div id="posts-options"> 
  1239. <label><?php echo __('Featured Post:', 'tstranslate');?></label> 
  1240. <input type="checkbox" name="feat_post" id="feat_post" <?php if($feat_post == 'on') {?> checked="checked" <?php }?> /> 
  1241. </div> 
  1242. <?php 
  1243.  
  1244. function update_feat_post() { 
  1245. global $post; 
  1246. if (isset($_POST["feat_post"])) { 
  1247. update_post_meta($post->ID, "feat_post", $_POST["feat_post"]); 
  1248. }else{ 
  1249. update_post_meta($post->ID, "feat_post", 'off'); 
  1250.  
  1251. /**********************/ 
  1252. /** Remove Title Page */ 
  1253. /********************/ 
  1254.  
  1255. add_action('admin_init', 'remove_title_page'); 
  1256. add_action('save_post', 'update_remove_title_page'); 
  1257.  
  1258. function remove_title_page() { 
  1259. add_meta_box("page_details", __("More page options", 'tstranslate'), "page_options", "page", "side", "default"); 
  1260.  
  1261. function page_options() { 
  1262. global $post; 
  1263. $custom = get_post_custom($post->ID); 
  1264. $remove_title = $custom["remove_title_page"][0]; 
  1265. $removeBoxContent = $custom["remove_box_content"][0]; 
  1266. ?> 
  1267. <div id="posts-options"> 
  1268. <label><?php echo __('Remove Title:', 'tstranslate');?></label> 
  1269. <input type="checkbox" name="remove_title_page" id="remove_title_page" <?php echo ($remove_title == 'on')?'checked="checked"':''?> /> 
  1270. <div class="clearfix"></div> 
  1271. <label><?php echo __('Remove Box Content:', 'tstranslate');?></label> 
  1272. <input type="checkbox" name="remove_box_content" id="remove_box_content" <?php echo ($removeBoxContent == 'on')?'checked="checked"':''?> /> 
  1273. </div><?php 
  1274.  
  1275. function update_remove_title_page() { 
  1276. global $post; 
  1277. if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )return; 
  1278. if (isset($_POST["remove_title_page"]) || isset($_POST["remove_box_content"])) { 
  1279. update_post_meta($post->ID, "remove_title_page", $_POST["remove_title_page"]); 
  1280. update_post_meta($post->ID, "remove_box_content", $_POST["remove_box_content"]); 
  1281. }else{ 
  1282. update_post_meta($post->ID, "remove_title_page", 'off'); 
  1283. update_post_meta($post->ID, "remove_box_content", 'off'); 
  1284.  
  1285. function layout_update() { 
  1286. foreach ($GLOBALS['pages'] as $page) { 
  1287. if (!isset($GLOBALS['layout_info'][$page->ID])) { 
  1288. $GLOBALS['layout_info'][$page->ID]['slider_page']=true;/// asigna slider dependiendo el id del pageel blog o home el caso es el 0 
  1289. $GLOBALS['layout_info'][$page->ID]['footer_widget_style']=$GLOBALS['style_widgets_default'];//asignar estilos al footer  
  1290. foreach($GLOBALS['sidebar_info'] as $position_widgets => $description ) {//asignar estilos y posiciones en el layout 
  1291. $GLOBALS['layout_info'][$page->ID][$position_widgets]['active']=($position_widgets==='right_1')?true:false;//define layout habilitado por default en este caso es right_1 
  1292. $GLOBALS['layout_info'][$page->ID][$position_widgets]['style']=$GLOBALS['style_widgets_default']; 
  1293. update_option('themeshock_layout_options', maybe_serialize($GLOBALS['layout_info']));  
  1294. layout_update();///actualiza los pages en los layouts automaticamente  
  1295.  
  1296. /** Esta funcion es para el volver los widgets liquidos segun cuantos estes activos en un sidebar */ 
  1297. function widget_style($position, $id) {// es la funcion que modifica los estilos de los widgets 
  1298. global $wp_registered_sidebars; 
  1299. $default_boxes_widgets = $GLOBALS['layout_info']['themeshock_default_widget_boxes']; 
  1300. if($default_boxes_widgets == true) { 
  1301. $idw= $idw= $GLOBALS['boxes_css'][0]; 
  1302. }else{ 
  1303. if($id != 'boxcss_default') { //$id = ID style box  
  1304. $idw= $idw=($id===NULL)?'boxcss_0':$id; 
  1305. }else{ 
  1306. (isset($GLOBALS['boxes_css']) && $GLOBALS['boxes_css'][0] != 'boxcss_0')?$idw=$GLOBALS['boxes_css'][0]:$idw=($id===NULL)?'boxcss_0':$id; 
  1307. $idw .= ' boxcss'; 
  1308. //$widget_boxescss = (isset($GLOBALS['boxes_css']) && $GLOBALS['boxes_css'][0] != '0')?$GLOBALS['boxes_css'][0]:'noneee'; 
  1309.  
  1310. //////////////////////////////////////////////////////////////////// 
  1311. // $GLOBALS['style_widgets_default'] Borarr importante!!!! 
  1312. ////////////////////////////////////////////////////////////////////  
  1313.  
  1314. $the_sidebars = wp_get_sidebars_widgets(); 
  1315. //echo 'widgets_ss'.$id; 
  1316. foreach ($wp_registered_sidebars as $all_sidebars) { 
  1317. $sidebar_id = $all_sidebars['id']; 
  1318. if($all_sidebars['name'] == $position)break; 
  1319. $reset_boxes = ''; 
  1320. ($default_boxes_widgets != true && $id != "boxcss_default")?$reset_boxes = 'reset_boxes':''; 
  1321. $count_wid = count($the_sidebars[$sidebar_id]); 
  1322. ($count_wid >= 4)?$count_wid = 4:NULL; 
  1323.  
  1324. $class_originals=array('<div class="boxes">',  
  1325. 'container_widgets_pieces',  
  1326. 'widget_corner widget_top_left',  
  1327. 'widget_token_left',  
  1328. 'widget_topbottom widget_top_center',  
  1329. 'widget_corner widget_top_right',  
  1330. 'widget_token_right',  
  1331. 'widget_sides widget_middle_left',  
  1332. 'widget_center widget_content',  
  1333. 'widget_sides widget_middle_right',  
  1334. 'widget_corner widget_bottom_left',  
  1335. 'widget_topbottom widget_bottom_center',  
  1336. 'widget_corner widget_bottom_right',  
  1337. 'widget_token_bottom' 
  1338. ); 
  1339. $new_classes=array('<div class="boxes '.$idw.' width_boxes_'.$count_wid.'">',  
  1340. 'container_widgets_pieces '.$reset_boxes,  
  1341. 'widget_corner widget_top_left '.$reset_boxes,  
  1342. 'widget_token_left '.$reset_boxes,  
  1343. 'widget_topbottom widget_top_center '.$reset_boxes,  
  1344. 'widget_corner widget_top_right '.$reset_boxes,  
  1345. 'widget_token_right '.$reset_boxes,  
  1346. 'widget_sides widget_middle_left '.$reset_boxes,  
  1347. 'widget_center widget_content '.$reset_boxes,  
  1348. 'widget_sides widget_middle_right '.$reset_boxes,  
  1349. 'widget_corner widget_bottom_left '.$reset_boxes,  
  1350. 'widget_topbottom widget_bottom_center '.$reset_boxes,  
  1351. 'widget_corner widget_bottom_right '.$reset_boxes,  
  1352. 'widget_token_bottom '.$reset_boxes 
  1353. );  
  1354. ob_start(); 
  1355. dynamic_sidebar($position); 
  1356. $sidebar_contents = ob_get_clean(); 
  1357. echo str_replace($class_originals, $new_classes, $sidebar_contents); 
  1358.  
  1359. function update_layout() { 
  1360. $layout_pack=array();  
  1361. foreach($GLOBALS['pages'] as $index => $page) {//$GLOBALS['pages'] ver en functions/variables_load.php 
  1362. if ($page->ID===0) {// asignar slider para el single post, search, archive y category 
  1363. $layout_pack[$page->ID]['slider_blog']=true; 
  1364. $layout_pack[$page->ID]['slider_single']=true; 
  1365. $layout_pack[$page->ID]['slider_search']=false;  
  1366. $layout_pack[$page->ID]['slider_archive']=false; 
  1367. $layout_pack[$page->ID]['slider_category']=false; 
  1368. $layout_pack['themeshock_default_widget_boxes'] = true; 
  1369. else{ 
  1370. $layout_pack[$page->ID]['slider_page']=true;/// asigna slider dependiendo el id del pageel blog o home el caso es el 0 
  1371. $layout_pack[$page->ID]['footer_widget_style']=$GLOBALS['style_widgets_default'];//asignar estilos al footer 
  1372.  
  1373. foreach($GLOBALS['sidebar_info'] as $position_widgets=> $description ) {//asignar estilos y posiciones en el layout 
  1374. $layout_pack[$page->ID][$position_widgets]['active']=($position_widgets==='right_1')?true:false;//define layout habilitado por default en este caso es right_1 
  1375. $layout_pack[$page->ID][$position_widgets]['style']=$GLOBALS['style_widgets_default']; 
  1376. update_option('themeshock_layout_options', maybe_serialize($layout_pack));//regitrar layout en los didebar 
  1377. return $layout_pack;//carga todas las posiciones de los layouts;  
  1378.  
  1379. function update_sidebar() { 
  1380. $sidebars=array();  
  1381. foreach($GLOBALS['position_lay_widgets'] as $position_widgets ) { 
  1382. $sidebars[$position_widgets]=$GLOBALS['register_sidebar']; 
  1383. $sidebars[$position_widgets]['name']=$position_widgets;  
  1384. update_option('themeshock_sidebar', maybe_serialize($sidebars));//registra un sidebar en las posisciones 
  1385. return $sidebars; 
  1386. function update_slider_info() { 
  1387. $upload_dir=wp_upload_dir(); 
  1388. if (isset($upload_dir["error"]) && $upload_dir["error"]!==false ) { 
  1389. $GLOBALS['error_folder']= 'The option to change logo and slider is disabled, please create the following folder: /wp-content/uploads/ and allow writing by setting its permissions to 0777'; 
  1390. return false;  
  1391. $directory_slider=$upload_dir['basedir']."/slider/"; 
  1392. mkdir($directory_slider, 0777, true); 
  1393. $directory_slider_base=get_template_directory()."/img/slider/{*.jpg, *.png, *.gif, *.bmp}"; 
  1394. $img_directory_pack=glob($directory_slider_base, GLOB_BRACE); 
  1395. $slider_info= array(); 
  1396. foreach($img_directory_pack as $index => $img_slider_info) { 
  1397. $get_info_img=getimagesize($img_slider_info); 
  1398. $slider_info[$index]['active']=true; 
  1399. $slider_info[$index]['link']='#'; 
  1400. $slider_info[$index]['url']=$upload_dir['baseurl'].'/slider/'.basename($img_slider_info); 
  1401. $slider_info[$index]['path']=$upload_dir['basedir'].'/slider/'.basename($img_slider_info); 
  1402. //file_put_contents($slider_info[$index]['path'], file_get_contents($img_slider_info)); 
  1403. check_filesystem($slider_info[$index]['path'], '', $img_slider_info, 'active-theme'); 
  1404. @chmod($slider_info[$index]['path'], 0777); 
  1405. $slider_info[$index]['thumbnail']=$upload_dir['baseurl'].'/slider/'.basename(image_resize($slider_info[$index]['path'], 200, 200)); 
  1406. @chmod($slider_info[$index]['thumbnail'], 0777); 
  1407. update_option('themeshock_slider_dimensions', maybe_serialize($get_info_img));/// guarda las dimenssiones de la imagen 
  1408. update_option('themeshock_slider_images', maybe_serialize($slider_info));  
  1409. $GLOBALS['slider_img_info']=$slider_info; 
  1410. return $slider_info; 
  1411. function update_logo_info() { 
  1412. $upload_dir=wp_upload_dir(); 
  1413. if (isset($upload_dir["error"]) && $upload_dir["error"]!==false ) { 
  1414. $GLOBALS['error_folder']= 'The option to change logo and slider is disabled, please create the following folder: /wp-content/uploads/ and allow writing by setting its permissions to 0777'; 
  1415. return false;  
  1416. }  
  1417. $directory_logo=$upload_dir['basedir'].'/logo/'; 
  1418. $get_img_logo=get_template_directory_uri().'/img/logo/logo.png'; 
  1419. $get_dimmensions=getimagesize($get_img_logo); 
  1420. $logo_info['path']=$upload_dir['basedir'].'/logo/logo.png'; 
  1421. $logo_info['url']=$upload_dir['baseurl'].'/logo/logo.png'; 
  1422. $logo_info['size']=$get_dimmensions; 
  1423. @mkdir($directory_logo, 0777, true); 
  1424. check_filesystem($logo_info['path'], '', $get_img_logo, 'active-theme'); 
  1425. //file_put_contents($logo_info['path'], file_get_contents($get_img_logo)); 
  1426. chmod($logo_info['path'], 0777);  
  1427. update_option('themeshock_logo', maybe_serialize($logo_info)); 
  1428. return $logo_info; 
  1429.  
  1430. /** 
  1431. Esta funcion es exlusiva para el servidor, es para mostrar y ocultar elementos y recibe el parametro del elemento que se 
  1432. va afectar  
  1433. */  
  1434. function display_elements($element_block) { 
  1435. if(isset($GLOBALS['display_elements']) && $_SERVER['SERVER_NAME'] == 'www.wpthemegenerator.com') { 
  1436. switch($GLOBALS['display_elements'][$element_block]) { 
  1437. case 'show': 
  1438. return 'show_element'; 
  1439. break; 
  1440. case 'hide': 
  1441. return 'hide_element'; 
  1442. break; 
  1443.  
  1444. /** funcion para traer los atributos del logo actual y aplicarlos */ 
  1445. function get_attr_logo() { 
  1446. $eff_logo = $style_logo = $img_logo = NULL; 
  1447. if($GLOBALS['logo_type'] == 'text') { 
  1448. $eff_logo = 'logo_effect_'.strtolower($GLOBALS['logo_text_options']['logo_effect']); 
  1449. $style_logo = 'font-size: '.$GLOBALS['logo_text_options']['logo_text_font_size'].';'; 
  1450. if($GLOBALS['logo_text_options']['logo_font_family'] != 'Default') { 
  1451. $style_logo .= 'font-family: "'.$GLOBALS['logo_text_options']['logo_font_family'].'", sans-serif;'; 
  1452. }; 
  1453. $style_attr = ($style_logo != "")?"style='".$style_logo."'":""; 
  1454. $src_logo = ($GLOBALS['logo_info'])?$GLOBALS['logo_info']['url']:get_template_directory_uri(); 
  1455. if($GLOBALS['logo_type'] == 'image') { 
  1456. $img_logo = '<img src="'.$src_logo.'"><span></span>'; 
  1457. }else{ 
  1458. $img_logo = '<span>'.$GLOBALS['logo_text_options']['logo_text'].'</span>'; 
  1459. return '<a href="'.home_url().'" class="logo '.$eff_logo.'" '.$style_attr.'>'.$img_logo.'</a>'; 
  1460.  
  1461. /** funciton para quitar los puntos suspensivos del excerpt */ 
  1462. function trim_excerpt($text) { 
  1463. return str_replace(" [...]", '...', $text); 
  1464. add_filter('get_the_excerpt', 'trim_excerpt'); 
  1465.  
  1466. function trim_the_content( $the_contents, $read_more_tag = ' READ MORE...', $perma_link_to = '', $all_words = 45 ) { 
  1467. $allowed_tags = array( 'a', 'abbr', 'b', 'blockquote', 'b', 'cite', 'code', 'div', 'em', 'fon', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'label', 'i', 'p', 'pre', 'span', 'strong', 'title', 'ul', 'ol', 'li', 'object', 'embed', 'input' ); 
  1468. if( $the_contents != '' ) { 
  1469. $allowed_tags = '<' . implode( '><', $allowed_tags ) . '>'; 
  1470. $the_contents = str_replace( ']]>', ']]>', $the_contents ); 
  1471. $the_contents = strip_tags( $the_contents, $allowed_tags ); 
  1472. if( $all_words > count( preg_split( '/[\s]+/', strip_tags( $the_contents ), -1 ) ) ) return $the_contents; 
  1473. $all_chunks = preg_split( '/([\s]+)/', $the_contents, -1, PREG_SPLIT_DELIM_CAPTURE ); 
  1474. $the_contents = ''; 
  1475. $count_words = 0; 
  1476. $enclosed_by_tag = false; 
  1477. foreach( $all_chunks as $chunk ) { 
  1478. if( 0 < preg_match( '/<[^>]*$/s', $chunk ) ) $enclosed_by_tag = true; 
  1479. elseif( 0 < preg_match( '/>[^<]*$/s', $chunk ) ) $enclosed_by_tag = false; 
  1480. if( !$enclosed_by_tag && '' != trim( $chunk ) && substr( $chunk, -1, 1 ) != '>' ) $count_words ++; 
  1481. $the_contents .= $chunk; 
  1482. if( $count_words >= $all_words && !$enclosed_by_tag ) break; 
  1483. $the_contents = $the_contents . '<a class="more-link" href="' . $perma_link_to . '">' . $read_more_tag . '</a>'; 
  1484. $the_contents = force_balance_tags( $the_contents ); 
  1485. return $the_contents; 
  1486. /** funcion para actualizar el estado de los post type  
  1487. recibe dos parametros el post name, y el estado nuevo */ 
  1488. function statusCustomPostType($wtsPostName, $wtsStatus) { 
  1489. global $wpdb, $post; 
  1490.  
  1491. (isset($_POST['themeshock_enablePostTypeGallery']) || isset($_POST['themeshock_enablePostTypePortfolio']) || isset($_POST['themeshock_enablePostTypeServices']) || isset($_POST['themeshock_enablePostTypeProducts']) || 
  1492. isset($_POST['themeshock_enablePostTypeTestimonials']))?$redirect_warr = 'true':$redirect_warr = 'false'; 
  1493.  
  1494. if (is_user_logged_in()) { 
  1495. $wpdb->query(" 
  1496. UPDATE $wpdb->posts  
  1497. SET post_status = '".$wtsStatus."' 
  1498. WHERE post_name = '".$wtsPostName."';" 
  1499. ); 
  1500.  
  1501. $menu_current = get_theme_mod('nav_menu_locations'); 
  1502. if($menu_current['shock_menu'] != 0) { 
  1503. $term_shock_menu = get_term_by('term_id', $menu_current['shock_menu'], 'nav_menu'); 
  1504. $idsPostNameWts = $wpdb->get_results("SELECT ID FROM wp_posts w where post_name like '%wts%' and post_status = 'trash'"); 
  1505. $resultMenuItems = $wpdb->get_results($wpdb->prepare("SElECT post_id, meta_value FROM wp_term_relationships rs, wp_postmeta pm where rs.term_taxonomy_id = %s and rs.object_id = pm.post_id and meta_key = '_menu_item_object_id';", $term_shock_menu->term_taxonomy_id)); 
  1506. foreach($idsPostNameWts as $idPostName) { 
  1507. foreach($resultMenuItems as $resultMenuItem) { 
  1508. if($resultMenuItem->meta_value === $idPostName->ID) { 
  1509. $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %s;", $resultMenuItem->post_id)); 
  1510. $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->posts WHERE id = %s;", $resultMenuItem->post_id)); 
  1511. $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id = %s;", $resultMenuItem->post_id)); 
  1512. ($redirect_warr === 'true')?header('Location: '.$_SERVER['REQUEST_URI']):''; 
  1513. }  
  1514. /** funcion para habilitar o desabilitar las taxonomias (portfolio, services, products.. etc)en el dashboard */ 
  1515. function activeCustomPostType($CustomPostType, $wtsPostType, $wtsPostName) { 
  1516. global $wpdb; 
  1517. if(get_option('themeshock_enablePostType'.$CustomPostType) === 'true'): 
  1518. statusCustomPostType($wtsPostName, 'publish'); 
  1519. add_action('init', $wtsPostType); 
  1520. else: 
  1521. statusCustomPostType($wtsPostName, 'trash'); 
  1522. remove_action('init', $wtsPostType); 
  1523. endif; 
  1524.  
  1525.  
  1526. /** funcion que verifica si el dominio es wpthemegenerator */ 
  1527. function is_wpthemegenerator() { 
  1528. if($_SERVER['HTTP_HOST'] == 'www.wpthemegenerator.com') { 
  1529. return true; 
  1530. }else{ 
  1531. return false; 
  1532.  
  1533. /** 
  1534. Esta funcion es la forma correcta para el upload de las imagenes del logo y la de los sliders, adicionalemnte  
  1535. es la que sube las imagenes por primera vez del logo y el slider. 
  1536. Los parametos que soportan son 4 (el directorio del archivo, el nombre, los atributos del archivo y uno opcional que es para especificar si se va usar 
  1537. para crear las imagenes por primera vez o en cada subida de la imagen ya sea logo o slider) 
  1538. */ 
  1539. function check_filesystem($directory_file, $file_name, $file_info, $trigger = 'qq-uploader') { 
  1540. define('FS_METHOD', 'direct'); 
  1541. require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); 
  1542. global $wp_filesystem; 
  1543. //check_admin_referer(); 
  1544. $method = 'direct'; 
  1545.  
  1546. if ( ! $method ) return false; 
  1547. if ( ! class_exists("WP_Filesystem_$method") ) { 
  1548. $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); 
  1549. if ( ! file_exists($abstraction_file) ) return; 
  1550. require_once($abstraction_file); 
  1551. if ( !defined('FS_CHMOD_DIR') ) define('FS_CHMOD_DIR', 0755 ); 
  1552. if ( !defined('FS_CHMOD_FILE') ) define('FS_CHMOD_FILE', 0644 ); 
  1553.  
  1554. $method = "WP_Filesystem_$method"; 
  1555. $wp_filesystem = new $method($args); 
  1556. switch($trigger) { 
  1557. case 'qq-uploader': 
  1558. $filename = trailingslashit($directory_file).$file_name; 
  1559. $wp_filesystem->put_contents($filename, $file_info, 0777); 
  1560. break; 
  1561. case 'active-theme': 
  1562. $wp_filesystem->put_contents($directory_file, $wp_filesystem->get_contents($file_info), 0777); 
  1563. break; 
  1564.  
  1565. return true; 
  1566.  
  1567. include 'functions/framework-tool-panel.php'; 
  1568. get_template_part('functions/sidebars'); 
  1569. get_template_part('functions/taxonomies'); 
  1570. get_template_part('functions/shortcodes'); 
  1571. get_template_part('functions/widgets'); 
  1572. ?> 
.