Child Theme Configurator - Version 1.7.4

Version Description

  • Restored multisite admin menu link under Tools by popular demand
  • Automatically Network enables new child theme on creation
  • Fix for FTP notice - now uses PHP_OS constant to detect win vs nix
  • Added duplicate child theme feature
Download this release

Release Info

Developer lilaeamedia
Plugin Icon 128x128 Child Theme Configurator
Version 1.7.4
Comparing to
See all releases

Code changes from version 1.7.3.1 to 1.7.4

child-theme-configurator.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: Create a child theme that follows WP best practice to enqueue stylesheets. Easy to use CSS editor lets you find, preview and customize any style.
9
- Version: 1.7.3.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: chld_thm_cfg
@@ -22,7 +22,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
22
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
23
  defined( 'CHLD_THM_CFG_OPTIONS' ) or
24
  define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
25
- define( 'CHLD_THM_CFG_VERSION', '1.7.3.1' );
26
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
27
  defined( 'CHLD_THM_CFG_BPSEL' ) or
28
  define( 'CHLD_THM_CFG_BPSEL', '2500' );
@@ -49,7 +49,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
49
  // setup admin hooks
50
  if ( is_multisite() )
51
  add_action( 'network_admin_menu', 'ChildThemeConfigurator::network_admin' );
52
- else
53
  add_action( 'admin_menu', 'ChildThemeConfigurator::admin' );
54
  // setup ajax actions
55
  add_action( 'wp_ajax_ctc_update', 'ChildThemeConfigurator::save' );
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: Create a child theme that follows WP best practice to enqueue stylesheets. Easy to use CSS editor lets you find, preview and customize any style.
9
+ Version: 1.7.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: chld_thm_cfg
22
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
23
  defined( 'CHLD_THM_CFG_OPTIONS' ) or
24
  define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
25
+ define( 'CHLD_THM_CFG_VERSION', '1.7.4' );
26
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
27
  defined( 'CHLD_THM_CFG_BPSEL' ) or
28
  define( 'CHLD_THM_CFG_BPSEL', '2500' );
49
  // setup admin hooks
50
  if ( is_multisite() )
51
  add_action( 'network_admin_menu', 'ChildThemeConfigurator::network_admin' );
52
+ //else
53
  add_action( 'admin_menu', 'ChildThemeConfigurator::admin' );
54
  // setup ajax actions
55
  add_action( 'wp_ajax_ctc_update', 'ChildThemeConfigurator::save' );
includes/class-ctc-css.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS output, parsing, normalization
9
- Version: 1.7.3.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -138,16 +138,15 @@ class ChildThemeConfiguratorCSS {
138
  function load_config() {
139
  $option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
140
  //echo 'loading option: ' . $option . LF;
141
- if ( ( $configarray = get_option( $option . '_configvars' ) ) && count( $configarray ) ):
142
  foreach ( $this->configvars as $configkey ):
143
  if ( isset( $configarray[ $configkey ] ) )
144
  $this->{$configkey} = $configarray[ $configkey ];
145
  endforeach;
146
  $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
147
  foreach ( $this->dicts as $configkey ):
148
- if ( ( $configarray = get_option( $option . '_' . $configkey ) ) && count( $configarray ) )
149
  $this->{$configkey} = $configarray;
150
- else return FALSE;
151
  endforeach;
152
  else:
153
  return FALSE;
@@ -162,10 +161,10 @@ class ChildThemeConfiguratorCSS {
162
  $configarray = array();
163
  foreach ( $this->configvars as $configkey )
164
  $configarray[ $configkey ] = $this->{$configkey};
165
- update_option( $option . '_configvars', $configarray );
166
  $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
167
  foreach ( $this->dicts as $configkey )
168
- update_option( $option . '_' . $configkey, $this->{$configkey} );
169
  }
170
 
171
  /**
@@ -226,16 +225,17 @@ class ChildThemeConfiguratorCSS {
226
  $this->read_stylesheet( 'child' );
227
  else:
228
  if ( isset( $this->addl_css ) ):
229
- foreach ( $this->addl_css as $template ):
230
- $this->styles .= '/*** BEGIN ' . $template . ' ***/' . LF;
231
- $this->read_stylesheet( 'parnt', $template );
232
- $this->styles .= '/*** END ' . $template . ' ***/' . LF;
233
  endforeach;
234
  endif;
 
235
  if ( $this->ctc()->is_theme() || $this->ctc()->is_legacy() ):
236
- $this->styles .= '/*** BEGIN style.css ***/' . LF;
237
- $this->read_stylesheet( 'parnt' );
238
- $this->styles .= '/*** END style.css ***/' . LF;
239
  endif;
240
  endif;
241
  $this->normalize_css();
@@ -258,11 +258,11 @@ class ChildThemeConfiguratorCSS {
258
  }
259
  // formats css string for accurate parsing
260
  function normalize_css() {
261
- if ( preg_match( "/(\}[\w\#\.]|; *\})/", $this->styles ) ): // prettify compressed CSS
262
- $this->styles = preg_replace( "/\*\/\s*/s", "*/\n", $this->styles ); // end comment
263
- $this->styles = preg_replace( "/\{\s*/s", " {\n ", $this->styles ); // open brace
264
- $this->styles = preg_replace( "/;\s*/s", ";\n ", $this->styles ); // semicolon
265
- $this->styles = preg_replace( "/\s*\}\s*/s", "\n}\n", $this->styles ); // close brace
266
  endif;
267
  }
268
  // creates header comments for stylesheet
@@ -558,7 +558,7 @@ class ChildThemeConfiguratorCSS {
558
  * parse_css_file
559
  * reads stylesheet to get WordPress meta data and passes rest to parse_css
560
  */
561
- function parse_css_file( $template, $file = 'style.css' ) {
562
  if ( '' == $file ) $file = 'style.css';
563
  // have we run out of memory?
564
  if ( $this->max_sel ):
@@ -574,7 +574,7 @@ class ChildThemeConfiguratorCSS {
574
  preg_match( $regex, $this->styles, $matches );
575
  $child_name = $this->get_prop( 'child_name' );
576
  if ( !empty( $matches[ 1 ] ) && 'child' == $template && empty( $child_name ) ) $this->set_prop( 'child_name', $matches[ 1 ] );
577
- $this->parse_css( $template, NULL, TRUE, $this->ctc()->normalize_path( dirname( $file ) ) );
578
  }
579
 
580
  // loads raw css file into local memory
@@ -757,17 +757,6 @@ class ChildThemeConfiguratorCSS {
757
  function write_css( $backup = FALSE ) {
758
  // write new stylesheet
759
  $output = apply_filters( 'chld_thm_cfg_css_header', $this->get_css_header(), $this );
760
- // 1.7.3 -- use read-only version of insert with markers to check if @imports need to be written to stylesheet
761
- // eventually all will be migrated to link tags, but we need to account for user not updating import config
762
- /*
763
- $imports = $this->get_prop( 'imports' );
764
- if ( !empty( $imports ) ):
765
- foreach ( $imports as $import ):
766
- $output .= $import . ';' . LF;
767
- endforeach;
768
- endif;
769
- $output .= LF;
770
- */
771
  // turn the dictionaries into indexes (value => id into id => value):
772
  $rulearr = array_flip( $this->dict_rule );
773
  $valarr = array_flip( $this->dict_val );
@@ -832,16 +821,17 @@ class ChildThemeConfiguratorCSS {
832
  // write new stylesheet:
833
  // try direct write first, then wp_filesystem write
834
  // stylesheet must already exist and be writable by web server
835
- if ( FALSE !== @file_put_contents( $stylesheet_verified, $output ) ): //is_writable( $stylesheet_verified ) &&
836
- //echo 'stylesheet write successful: ' . $stylesheet_verified . LF;
837
- return TRUE;
838
- elseif ( FALSE !== $wp_filesystem->put_contents( $this->ctc()->fspath( $stylesheet_verified ), $output ) ):
839
- //echo 'filesystem stylesheet write successful: ' . $stylesheet_verified . LF;
840
- return TRUE;
 
 
841
  endif;
842
- //echo 'stylesheet write failed: ' . $stylesheet_verified . LF;
843
  endif;
844
- //echo 'file not ok! ' . $stylesheet . LF;
845
  return FALSE;
846
  }
847
 
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS output, parsing, normalization
9
+ Version: 1.7.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
138
  function load_config() {
139
  $option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
140
  //echo 'loading option: ' . $option . LF;
141
+ if ( ( $configarray = get_site_option( $option . '_configvars' ) ) && count( $configarray ) ):
142
  foreach ( $this->configvars as $configkey ):
143
  if ( isset( $configarray[ $configkey ] ) )
144
  $this->{$configkey} = $configarray[ $configkey ];
145
  endforeach;
146
  $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
147
  foreach ( $this->dicts as $configkey ):
148
+ if ( ( $configarray = get_site_option( $option . '_' . $configkey ) ) && count( $configarray ) )
149
  $this->{$configkey} = $configarray;
 
150
  endforeach;
151
  else:
152
  return FALSE;
161
  $configarray = array();
162
  foreach ( $this->configvars as $configkey )
163
  $configarray[ $configkey ] = $this->{$configkey};
164
+ update_site_option( $option . '_configvars', $configarray );
165
  $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
166
  foreach ( $this->dicts as $configkey )
167
+ update_site_option( $option . '_' . $configkey, $this->{$configkey} );
168
  }
169
 
170
  /**
225
  $this->read_stylesheet( 'child' );
226
  else:
227
  if ( isset( $this->addl_css ) ):
228
+ foreach ( $this->addl_css as $file ):
229
+ $this->styles .= '/*** BEGIN ' . $file . ' ***/' . LF;
230
+ $this->read_stylesheet( 'parnt', $file );
231
+ $this->styles .= '/*** END ' . $file . ' ***/' . LF;
232
  endforeach;
233
  endif;
234
+ list ( $template, $file ) = apply_filters( 'chld_thm_cfg_parent_preview_args', array( 'parnt', 'style.css' ) );
235
  if ( $this->ctc()->is_theme() || $this->ctc()->is_legacy() ):
236
+ $this->styles .= '/*** BEGIN ' . $file . ' ***/' . LF;
237
+ $this->read_stylesheet( $template, $file );
238
+ $this->styles .= '/*** END ' . $file . ' ***/' . LF;
239
  endif;
240
  endif;
241
  $this->normalize_css();
258
  }
259
  // formats css string for accurate parsing
260
  function normalize_css() {
261
+ if ( preg_match( "/(\}[\w\#\.]|; *\})/", $this->styles ) ): // prettify compressed CSS
262
+ $this->styles = preg_replace( "/\*\/\s*/s", "*/\n", $this->styles ); // end comment
263
+ $this->styles = preg_replace( "/\{\s*/s", " {\n ", $this->styles ); // open brace
264
+ $this->styles = preg_replace( "/;\s*/s", ";\n ", $this->styles ); // semicolon
265
+ $this->styles = preg_replace( "/\s*\}\s*/s", "\n}\n", $this->styles ); // close brace
266
  endif;
267
  }
268
  // creates header comments for stylesheet
558
  * parse_css_file
559
  * reads stylesheet to get WordPress meta data and passes rest to parse_css
560
  */
561
+ function parse_css_file( $template, $file = 'style.css', $cfgtemplate = FALSE ) {
562
  if ( '' == $file ) $file = 'style.css';
563
  // have we run out of memory?
564
  if ( $this->max_sel ):
574
  preg_match( $regex, $this->styles, $matches );
575
  $child_name = $this->get_prop( 'child_name' );
576
  if ( !empty( $matches[ 1 ] ) && 'child' == $template && empty( $child_name ) ) $this->set_prop( 'child_name', $matches[ 1 ] );
577
+ $this->parse_css( $cfgtemplate ? $cfgtemplate : $template, NULL, TRUE, $this->ctc()->normalize_path( dirname( $file ) ) );
578
  }
579
 
580
  // loads raw css file into local memory
757
  function write_css( $backup = FALSE ) {
758
  // write new stylesheet
759
  $output = apply_filters( 'chld_thm_cfg_css_header', $this->get_css_header(), $this );
 
 
 
 
 
 
 
 
 
 
 
760
  // turn the dictionaries into indexes (value => id into id => value):
761
  $rulearr = array_flip( $this->dict_rule );
762
  $valarr = array_flip( $this->dict_val );
821
  // write new stylesheet:
822
  // try direct write first, then wp_filesystem write
823
  // stylesheet must already exist and be writable by web server
824
+ if ( $this->ctc()->is_ajax && is_writable( $stylesheet_verified ) ):
825
+ if ( FALSE === @file_put_contents( $stylesheet_verified, $output ) ):
826
+ $this->debug( 'Ajax write failed.', __FUNCTION__ );
827
+ return FALSE;
828
+ endif;
829
+ elseif ( FALSE === $wp_filesystem->put_contents( $this->ctc()->fspath( $stylesheet_verified ), $output ) ):
830
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
831
+ return FALSE;
832
  endif;
833
+ return TRUE;
834
  endif;
 
835
  return FALSE;
836
  }
837
 
includes/class-ctc-ui.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
- Version: 1.7.3.1
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -28,6 +28,7 @@ class ChildThemeConfiguratorUI {
28
  $child = $css->get_prop( 'child' );
29
  $hidechild = ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' );
30
  $enqueueset = ( isset( $css->enqueue ) && $child );
 
31
  if ( empty( $css->nowarn ) ) $this->parent_theme_check();
32
  $imports = $css->get_prop( 'imports' );
33
  $id = 0;
@@ -70,6 +71,7 @@ class ChildThemeConfiguratorUI {
70
  }
71
 
72
  function render_theme_menu( $template = 'child', $selected = NULL ) {
 
73
  ?>
74
  <select class="ctc-select" id="ctc_theme_<?php echo $template; ?>" name="ctc_theme_<?php echo $template; ?>" style="visibility:hidden" <?php echo $this->ctc()->is_theme() ? '' : ' disabled '; ?> ><?php
75
  foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
+ Version: 1.7.4
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
28
  $child = $css->get_prop( 'child' );
29
  $hidechild = ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' );
30
  $enqueueset = ( isset( $css->enqueue ) && $child );
31
+ $this->ctc()->debug( 'Enqueue set: ' . ( $enqueueset ? 'TRUE' : 'FALSE' ), __FUNCTION__ );
32
  if ( empty( $css->nowarn ) ) $this->parent_theme_check();
33
  $imports = $css->get_prop( 'imports' );
34
  $id = 0;
71
  }
72
 
73
  function render_theme_menu( $template = 'child', $selected = NULL ) {
74
+
75
  ?>
76
  <select class="ctc-select" id="ctc_theme_<?php echo $template; ?>" name="ctc_theme_<?php echo $template; ?>" style="visibility:hidden" <?php echo $this->ctc()->is_theme() ? '' : ' disabled '; ?> ><?php
77
  foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
includes/class-ctc.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
- Version: 1.7.3.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -62,7 +62,6 @@ class ChildThemeConfiguratorAdmin {
62
  'child_tags',
63
  'child_version',
64
  'configtype', // backward compatability
65
- 'revert',
66
  'nowarn',
67
  );
68
  var $actionfields = array(
@@ -99,17 +98,17 @@ class ChildThemeConfiguratorAdmin {
99
  $this->is_post = ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] );
100
  $this->is_get = ( 'GET' == $_SERVER[ 'REQUEST_METHOD' ] );
101
  $this->is_debug = get_option( CHLD_THM_CFG_OPTIONS . '_debug' );
 
 
102
  // sel_limit is now calculated based on free memory to prevent out of memory on serialization
103
  $bytes_free = $this->get_free_memory();
104
  $this->sel_limit = ( int ) ( $bytes_free / CHLD_THM_CFG_BPSEL );
105
  $this->debug( 'Free memory: ' . $bytes_free . ' max selectors: ' . $this->sel_limit, __FUNCTION__ );
106
  //$this->set_benchmark( 'before', 'execute', 'program' );
107
  }
108
- function render() {
109
- $this->ui->render();
110
- }
111
  function enqueue_scripts() {
112
- wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chld-thm-cfg.css', array(), '1.7.3.1' );
113
 
114
  // we need to use local jQuery UI Widget/Menu/Selectmenu 1.11.2 because selectmenu is not included in < 1.11.2
115
  // this will be updated in a later release to use WP Core scripts when it is widely adopted
@@ -198,11 +197,15 @@ class ChildThemeConfiguratorAdmin {
198
  // initialize help
199
  $this->ui->render_help_content();
200
  // load styles and scripts
201
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 999 );
202
  // load web fonts for this theme
203
  $this->load_imports();
204
  }
205
 
 
 
 
 
206
  function get_themes() {
207
  // create cache of theme info
208
  $this->themes = array( 'child' => array(), 'parnt' => array() );
@@ -217,6 +220,7 @@ class ChildThemeConfiguratorAdmin {
217
  if ( 'child' == $group ) $version = preg_replace("/\.\d{6}\d+$/", '', $version );
218
  // add theme to themes array
219
  $this->themes[ $group ][ $slug ] = array(
 
220
  'Name' => $theme->get( 'Name' ),
221
  'ThemeURI' => $theme->get( 'ThemeURI' ),
222
  'Author' => $theme->get( 'Author' ),
@@ -241,18 +245,19 @@ class ChildThemeConfiguratorAdmin {
241
  function load_config() {
242
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-css.php' );
243
  $this->css = new ChildThemeConfiguratorCSS();
244
- $is_rebuild = $this->css->load_config();
245
- if ( FALSE !== $is_rebuild ):
246
  // if themes do not exist reinitialize
247
  if ( ! $this->check_theme_exists( $this->css->get_prop( 'child' ) )
248
- || ! $this->check_theme_exists( $this->css->get_prop( 'parnt' ) ) ):
249
  add_action( 'admin_notices', array( $this, 'config_notice' ) );
250
  $this->css = new ChildThemeConfiguratorCSS();
251
  $this->css->enqueue = 'enqueue';
252
  endif;
253
  else:
 
254
  $this->css->enqueue = 'enqueue';
255
  endif;
 
256
  if ( $this->is_get ):
257
  if ( $this->css->get_prop( 'child' ) ):
258
  // get filesystem credentials if available
@@ -262,7 +267,7 @@ class ChildThemeConfiguratorAdmin {
262
  if ( !is_writable( $stylesheet ) && !$this->fs ):
263
  add_action( 'admin_notices', array( $this, 'writable_notice' ) );
264
  endif;
265
- // enqueue flag will be null for anyone coming from < 1.6.0
266
  if ( !isset( $this->css->enqueue ) ):
267
  add_action( 'admin_notices', array( $this, 'enqueue_notice' ) );
268
  endif;
@@ -279,7 +284,6 @@ class ChildThemeConfiguratorAdmin {
279
  add_action( 'admin_notices', array( $this, 'owner_notice' ) );
280
  endif;
281
  endif;
282
- return $is_rebuild;
283
  }
284
 
285
  function cache_debug() {
@@ -294,6 +298,7 @@ class ChildThemeConfiguratorAdmin {
294
  */
295
  function ajax_save_postdata( $action = 'ctc_update' ) {
296
  $this->is_ajax = TRUE;
 
297
  // security check
298
  if ( $this->validate_post( $action ) ):
299
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
@@ -326,12 +331,10 @@ class ChildThemeConfiguratorAdmin {
326
  $this->css->save_config();
327
  endif;
328
  endif;
329
- $result = $this->css->obj_to_utf8( $this->updates );
330
- // send all updates back to browser to update cache
331
- die( json_encode( $result ) );
332
- else:
333
- die( 0 );
334
  endif;
 
 
 
335
  }
336
 
337
  /**
@@ -455,8 +458,9 @@ class ChildThemeConfiguratorAdmin {
455
  break;
456
 
457
  case 'set_writable':
458
- // make child theme writable ( systems not running suExec )
459
- $this->set_writable();
 
460
  $msg = '8&tab=file_options';
461
  break;
462
 
@@ -574,6 +578,27 @@ class ChildThemeConfiguratorAdmin {
574
  endif;
575
  endif;
576
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
577
  if ( FALSE === $this->verify_child_dir( $child ) ):
578
  $this->errors[] = __( 'Your theme directories are not writable.', 'chld_thm_cfg' );
579
  add_action( 'admin_notices', array( $this, 'writable_notice' ) );
@@ -589,15 +614,23 @@ class ChildThemeConfiguratorAdmin {
589
  // restore imports if this is a rebuild
590
  $this->css->imports = $imports;
591
  $this->css->nowarn = $nowarn;
592
- // check if we have additional files from legacy plugin extension. if so, we have to override
 
 
 
 
 
 
 
 
 
593
  // function to support wp_filesystem requirements
594
  if ( $this->is_theme( $configtype ) ):
595
  // is theme means this is not a plugin stylesheet config
596
- add_action( 'chld_thm_cfg_addl_files', array( &$this, 'add_base_files' ), 10, 2 );
597
- add_action( 'chld_thm_cfg_addl_files', array( &$this, 'copy_screenshot' ), 10, 2 );
598
- add_action( 'chld_thm_cfg_addl_files', array( &$this, 'enqueue_parent_css' ), 15, 2 );
599
- elseif( $this->is_legacy()
600
- && has_action( 'chld_thm_cfg_addl_files' ) ):
601
  // backwards compatability for plugins extension < 2.0.0 (before pro)
602
  // action exists so we have to hijack it to use new filesystem checks
603
  remove_all_actions( 'chld_thm_cfg_addl_files' );
@@ -623,23 +656,17 @@ class ChildThemeConfiguratorAdmin {
623
  elseif ( !$this->is_theme( $configtype ) )
624
  $this->css->set_prop( 'enqueue', 'enqueue' );
625
 
626
- // parse parent stylesheet if theme or legacy plugin extension
627
- if ( $this->is_theme( $configtype ) || $this->is_legacy() )
628
- $this->css->parse_css_file( 'parnt' );
629
-
630
- // parse child stylesheet, backup or skip ( to reset )
631
- $this->css->parse_css_file( 'child', $revert );
632
-
633
- // parse additional stylesheets
634
- if ( isset( $_POST[ 'ctc_additional_css' ] ) && is_array( $_POST[ 'ctc_additional_css' ] ) ):
635
- $this->css->addl_css = array();
636
- foreach ( $_POST[ 'ctc_additional_css' ] as $file ):
637
- $this->css->parse_css_file( 'parnt', $file );
638
- $this->css->addl_css[] = $file;
639
- endforeach;
640
- endif;
641
-
642
- // runs code generation function in read-only mode to add existing external stylesheet links to config data
643
  $this->enqueue_parent_css( $this->css, TRUE );
644
  // hook for add'l plugin files and subdirectories. Must run after stylesheets are parsed to apply latest options
645
  do_action( 'chld_thm_cfg_addl_files', $this );
@@ -654,46 +681,14 @@ class ChildThemeConfiguratorAdmin {
654
  return FALSE;
655
  endif;
656
 
657
- // copy parent theme mods option set
658
- if ( isset( $_POST[ 'ctc_parent_mods' ] ) ):
659
- // we can copy settings from parent to child even if neither is currently active
660
- // so we need cases for active parent, active child or neither
661
-
662
- // get active theme
663
- $active_theme = get_stylesheet();
664
- // create temp array from parent settings
665
- $child_mods = get_option( 'theme_mods_' . $parnt );
666
- if ( $active_theme == $parnt ):
667
- // if parent theme is active, get widgets from active sidebars_widgets array
668
- $child_widgets = retrieve_widgets();
669
- else:
670
- // otherwise get widgets from parent theme mods
671
- $child_widgets = $child_mods[ 'sidebars_widgets' ][ 'data' ];
672
- endif;
673
- if ( $active_theme == $child ):
674
- // if child theme is active, remove widgets from temp array
675
- unset( $child_mods[ 'sidebars_widgets' ] );
676
- // copy temp array to child mods
677
- update_option( 'theme_mods_' . $child, $child_mods );
678
- // copy widgets to active sidebars_widgets array
679
- wp_set_sidebars_widgets( $child_widgets );
680
- else:
681
- // otherwise copy widgets to temp array with time stamp
682
- $child_mods[ 'sidebars_widgets' ][ 'data' ] = $child_widgets;
683
- $child_mods[ 'sidebars_widgets' ][ 'time' ] = time();
684
- // copy temp array to child theme mods
685
- update_option( 'theme_mods_' . $child, $child_mods );
686
- endif;
687
- endif;
688
-
689
  // save new object to WP options table
690
  $this->css->save_config();
691
 
692
- // hook for add'l plugin options
693
- do_action( 'chld_thm_cfg_addl_options', $this ); // hook for add'l plugin options
694
 
695
- // return message id 1, which says new child theme created successfull;
696
- return 1; //isset( $_POST[ 'ctc_scan_subdirs' ] ) ? '9&tab=import_options' : 1;
697
  endif;
698
  return FALSE;
699
  }
@@ -717,13 +712,14 @@ class ChildThemeConfiguratorAdmin {
717
  }
718
 
719
  function update_redirect( $msg = 1 ) {
720
- if ( empty( $this->is_ajax ) && !$this->is_debug ):
 
 
721
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
 
722
  wp_safe_redirect(
723
- ( is_multisite() ?
724
- network_admin_url( 'themes.php' ) :
725
- admin_url( 'tools.php' ) ) . '?page=' . $ctcpage . ( $msg ? '&updated=' . $msg : '' )
726
- );
727
  die();
728
  endif;
729
  }
@@ -848,7 +844,7 @@ endif;
848
  add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
849
  ";
850
  endif;
851
- return explode( "\n", $code );
852
  }
853
 
854
  // updates function file with wp_enqueue_script code block. If getexternals flag is passed function is run in read-only mode
@@ -870,18 +866,24 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
870
  $this->debug( 'Errors detected, returning', __FUNCTION__ );
871
  return FALSE;
872
  endif;
873
- if ( !$this->fs ):
 
 
 
 
 
874
  $this->debug( 'No filesystem access.', __FUNCTION__ );
875
  return FALSE; // return if no filesystem access
876
- endif;
877
- global $wp_filesystem;
878
- if( !$wp_filesystem->exists( $this->fspath( $filename ) ) ):
879
- // make sure file exists with php header
880
- $this->debug( 'No functions file, creating...', __FUNCTION__ );
881
- $this->add_base_files( $this );
882
- endif;
883
  // get_contents_array returns extra linefeeds so just split it ourself
884
- $markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
 
885
  $newfile = '';
886
  $externals = array();
887
  $phpopen = 0;
@@ -955,8 +957,15 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
955
  // only write file when getexternals is false
956
  if ( ! $getexternals ):
957
  $this->debug( 'Writing new functions file...', __FUNCTION__ );
958
- if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $filename ), $newfile ) )
 
 
 
 
 
 
959
  return FALSE;
 
960
  $this->css->converted = 1;
961
  endif;
962
  }
@@ -969,16 +978,16 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
969
  endif;
970
  global $wp_filesystem;
971
  if ( $file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
972
- if ( !$wp_filesystem->exists( $this->fspath( $file ) ) ):
973
- $this->debug( 'Writing to filesystem: ' . $file, __FUNCTION__ );
974
- if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $file ), $contents ) ):
975
- $this->debug( 'Filesystem write failed.', __FUNCTION__ );
976
- return FALSE;
 
 
 
 
977
  endif;
978
- else:
979
- $this->debug( 'File exists.', __FUNCTION__ );
980
- return FALSE;
981
- endif;
982
  else:
983
  $this->debug( 'No directory.', __FUNCTION__ );
984
  return FALSE;
@@ -1117,6 +1126,31 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
1117
  return FALSE;
1118
  }
1119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1120
  function unset_writable() {
1121
  if ( !$this->fs ) return FALSE; // return if no filesystem access
1122
  global $wp_filesystem;
@@ -1310,21 +1344,22 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
1310
  }
1311
 
1312
  function writable_notice() {
1313
- ?> <div class="update-nag">
1314
- <p><?php _e( 'Child Theme Configurator is unable to write to the stylesheet. This can be resolved using one of the following options:<ol>', 'chld_thm_cfg' );
1315
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
1316
- if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%unix%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) ):
1317
- _e( '<li>Temporarily make the stylesheet writable by clicking the button below. You should change this back when you are finished editing for security by clicking "Make read-only" under the "Files" tab.</li>', 'chld_thm_cfg' );
1318
  ?><form action="?page=<?php echo $ctcpage; ?>" method="post">
1319
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
1320
- <input name="ctc_set_writable" class="button" type="submit" value="<?php _e( 'Temporarily make stylesheet writable', 'chld_thm_cfg' ); ?>"/></form><?php endif;
1321
  _e( '<li><a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editin wp-config.php">Add your FTP/SSH credentials to the WordPress config file</a>.</li>', 'chld_thm_cfg' );
1322
  if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%iis%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) )
1323
  _e( '<li><a target="_blank" href="http://technet.microsoft.com/en-us/library/cc771170" title="Setting Application Pool Identity">Assign WordPress to an application pool that has write permissions</a> (Windows IIS systems).</li>', 'chld_thm_cfg' );
1324
- _e( '<li><a target="_blank" href="http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions">Set the stylesheet write permissions on the server manually</a> (not recommended).</li>', 'chld_thm_cfg' );
1325
- if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%unix%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) )
1326
- _e( '<li>Run PHP under Apache with suEXEC (contact your web host).</li>', 'chld_thm_cfg' ) ?>
1327
- </ol></p>
 
1328
  </div>
1329
  <?php
1330
  }
@@ -1437,6 +1472,14 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
1437
  else return get_template();
1438
  }
1439
 
 
 
 
 
 
 
 
 
1440
  /* debug backtrace with extraneous steps (missing class, function or line) removed */
1441
  function backtrace_summary() {
1442
  $bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
@@ -1489,4 +1532,71 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
1489
  echo $debug;
1490
  }
1491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1492
  }
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
+ Version: 1.7.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
62
  'child_tags',
63
  'child_version',
64
  'configtype', // backward compatability
 
65
  'nowarn',
66
  );
67
  var $actionfields = array(
98
  $this->is_post = ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] );
99
  $this->is_get = ( 'GET' == $_SERVER[ 'REQUEST_METHOD' ] );
100
  $this->is_debug = get_option( CHLD_THM_CFG_OPTIONS . '_debug' );
101
+ if ( $this->is_debug && ( $this->debug = get_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' ) ) )
102
+ delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
103
  // sel_limit is now calculated based on free memory to prevent out of memory on serialization
104
  $bytes_free = $this->get_free_memory();
105
  $this->sel_limit = ( int ) ( $bytes_free / CHLD_THM_CFG_BPSEL );
106
  $this->debug( 'Free memory: ' . $bytes_free . ' max selectors: ' . $this->sel_limit, __FUNCTION__ );
107
  //$this->set_benchmark( 'before', 'execute', 'program' );
108
  }
109
+
 
 
110
  function enqueue_scripts() {
111
+ wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chld-thm-cfg.css', array(), '1.7.4' );
112
 
113
  // we need to use local jQuery UI Widget/Menu/Selectmenu 1.11.2 because selectmenu is not included in < 1.11.2
114
  // this will be updated in a later release to use WP Core scripts when it is widely adopted
197
  // initialize help
198
  $this->ui->render_help_content();
199
  // load styles and scripts
200
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
201
  // load web fonts for this theme
202
  $this->load_imports();
203
  }
204
 
205
+ function render() {
206
+ $this->ui->render();
207
+ }
208
+
209
  function get_themes() {
210
  // create cache of theme info
211
  $this->themes = array( 'child' => array(), 'parnt' => array() );
220
  if ( 'child' == $group ) $version = preg_replace("/\.\d{6}\d+$/", '', $version );
221
  // add theme to themes array
222
  $this->themes[ $group ][ $slug ] = array(
223
+ 'Template' => $theme->get( 'Template' ),
224
  'Name' => $theme->get( 'Name' ),
225
  'ThemeURI' => $theme->get( 'ThemeURI' ),
226
  'Author' => $theme->get( 'Author' ),
245
  function load_config() {
246
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-css.php' );
247
  $this->css = new ChildThemeConfiguratorCSS();
248
+ if ( FALSE !== $this->css->load_config() ):
 
249
  // if themes do not exist reinitialize
250
  if ( ! $this->check_theme_exists( $this->css->get_prop( 'child' ) )
251
+ || ! $this->check_theme_exists( $this->css->get_prop( 'parnt' ) ) ):
252
  add_action( 'admin_notices', array( $this, 'config_notice' ) );
253
  $this->css = new ChildThemeConfiguratorCSS();
254
  $this->css->enqueue = 'enqueue';
255
  endif;
256
  else:
257
+ // this is a fresh install
258
  $this->css->enqueue = 'enqueue';
259
  endif;
260
+ do_action( 'chld_thm_cfg_load' );
261
  if ( $this->is_get ):
262
  if ( $this->css->get_prop( 'child' ) ):
263
  // get filesystem credentials if available
267
  if ( !is_writable( $stylesheet ) && !$this->fs ):
268
  add_action( 'admin_notices', array( $this, 'writable_notice' ) );
269
  endif;
270
+ // enqueue flag will be null for existing install < 1.6.0
271
  if ( !isset( $this->css->enqueue ) ):
272
  add_action( 'admin_notices', array( $this, 'enqueue_notice' ) );
273
  endif;
284
  add_action( 'admin_notices', array( $this, 'owner_notice' ) );
285
  endif;
286
  endif;
 
287
  }
288
 
289
  function cache_debug() {
298
  */
299
  function ajax_save_postdata( $action = 'ctc_update' ) {
300
  $this->is_ajax = TRUE;
301
+
302
  // security check
303
  if ( $this->validate_post( $action ) ):
304
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
331
  $this->css->save_config();
332
  endif;
333
  endif;
 
 
 
 
 
334
  endif;
335
+ $result = $this->css->obj_to_utf8( $this->updates );
336
+ // send all updates back to browser to update cache
337
+ die( json_encode( $result ) );
338
  }
339
 
340
  /**
458
  break;
459
 
460
  case 'set_writable':
461
+ // make child theme style.css and functions.php writable ( systems not running suExec )
462
+ $this->set_writable(); // no argument defaults to style.css
463
+ $this->set_writable( 'functions' );
464
  $msg = '8&tab=file_options';
465
  break;
466
 
578
  endif;
579
  endif;
580
  endif;
581
+
582
+ // clone existing child theme
583
+ if ( 'existing' == $type && isset( $_POST[ 'ctc_duplicate_theme' ] ) ):
584
+ $clone = strtolower( preg_replace( "%[^\w\-]%", '', sanitize_text_field( $_POST[ 'ctc_duplicate_theme_slug' ] ) ) );
585
+ if ( empty( $clone ) ):
586
+ $this->errors[] = __( 'Please enter a valid Child Theme template name.', 'chld_thm_cfg' );
587
+ else:
588
+ if ( $this->check_theme_exists( $clone ) ):
589
+ $this->errors[] = sprintf(
590
+ __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.',
591
+ 'chld_thm_cfg' ), $clone );
592
+ else:
593
+ $this->clone_child_theme( $clone );
594
+ if ( empty( $this->errors ) ):
595
+ $this->copy_theme_mods( $child, $clone );
596
+ $child = $clone;
597
+ endif;
598
+ endif;
599
+ endif;
600
+ endif;
601
+
602
  if ( FALSE === $this->verify_child_dir( $child ) ):
603
  $this->errors[] = __( 'Your theme directories are not writable.', 'chld_thm_cfg' );
604
  add_action( 'admin_notices', array( $this, 'writable_notice' ) );
614
  // restore imports if this is a rebuild
615
  $this->css->imports = $imports;
616
  $this->css->nowarn = $nowarn;
617
+ // parse parent stylesheet if theme or legacy plugin extension
618
+ if ( $this->is_theme( $configtype ) || $this->is_legacy() ):
619
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_parent_stylesheet' ) );
620
+ if ( is_multisite() )
621
+ add_action( 'chld_thm_cfg_addl_options', array( &$this, 'network_enable' ) );
622
+ endif;
623
+
624
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_additional_stylesheets' ) );
625
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_child_stylesheet' ) );
626
+
627
  // function to support wp_filesystem requirements
628
  if ( $this->is_theme( $configtype ) ):
629
  // is theme means this is not a plugin stylesheet config
630
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'add_base_files' ), 10, 2 );
631
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'copy_screenshot' ), 10, 2 );
632
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'enqueue_parent_css' ), 15, 2 );
633
+ elseif( $this->is_legacy() && has_action( 'chld_thm_cfg_addl_files' ) ):
 
634
  // backwards compatability for plugins extension < 2.0.0 (before pro)
635
  // action exists so we have to hijack it to use new filesystem checks
636
  remove_all_actions( 'chld_thm_cfg_addl_files' );
656
  elseif ( !$this->is_theme( $configtype ) )
657
  $this->css->set_prop( 'enqueue', 'enqueue' );
658
 
659
+ // plugin hooks for additional stylesheet handling options
660
+ do_action( 'chld_thm_cfg_stylesheet_handling' );
661
+ do_action( 'chld_thm_cfg_existing_theme' );
662
+ // plugin hook to parse additional or non-standard files
663
+ do_action( 'chld_thm_cfg_parse_stylesheets' );
664
+
665
+ // copy menus, widgets and other customizer options from parent to child if selected
666
+ if ( isset( $_POST[ 'ctc_parent_mods' ] ) ) // && empty( $_POST[ 'ctc_duplicate_theme' ] ) )
667
+ $this->copy_theme_mods( $parnt, $child );
668
+
669
+ // run code generation function in read-only mode to add existing external stylesheet links to config data
 
 
 
 
 
 
670
  $this->enqueue_parent_css( $this->css, TRUE );
671
  // hook for add'l plugin files and subdirectories. Must run after stylesheets are parsed to apply latest options
672
  do_action( 'chld_thm_cfg_addl_files', $this );
681
  return FALSE;
682
  endif;
683
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  // save new object to WP options table
685
  $this->css->save_config();
686
 
687
+ // plugin hook for additional child theme setup functions
688
+ do_action( 'chld_thm_cfg_addl_options', $this );
689
 
690
+ // return message id 1, which says new child theme created successfully;
691
+ return 1;
692
  endif;
693
  return FALSE;
694
  }
712
  }
713
 
714
  function update_redirect( $msg = 1 ) {
715
+ if ( empty( $this->is_ajax ) ):
716
+ if ( $this->is_debug )
717
+ set_site_transient( CHLD_THM_CFG_OPTIONS . '_debug', $this->debug, 3600 );
718
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
719
+ $screen = get_current_screen()->id;
720
  wp_safe_redirect(
721
+ ( strstr( $screen, '-network' ) ? network_admin_url( 'themes.php' ) : admin_url( 'tools.php' ) )
722
+ . '?page=' . $ctcpage . ( $msg ? '&updated=' . $msg : '' ) );
 
 
723
  die();
724
  endif;
725
  }
844
  add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
845
  ";
846
  endif;
847
+ return explode( "\n", apply_filters( 'chld_thm_cfg_enqueue_code_filter', $code ) );
848
  }
849
 
850
  // updates function file with wp_enqueue_script code block. If getexternals flag is passed function is run in read-only mode
866
  $this->debug( 'Errors detected, returning', __FUNCTION__ );
867
  return FALSE;
868
  endif;
869
+ // first check if this is an ajax update
870
+ if ( $this->is_ajax && is_readable( $filename ) && is_writable( $filename ) ):
871
+ // ok to proceed
872
+ $this->debug( 'Ajax update, bypassing wp filesystem.', __FUNCTION__ );
873
+ $markerdata = explode( "\n", @file_get_contents( $filename ) );
874
+ elseif ( !$this->fs ):
875
  $this->debug( 'No filesystem access.', __FUNCTION__ );
876
  return FALSE; // return if no filesystem access
877
+ else:
878
+ global $wp_filesystem;
879
+ if( !$wp_filesystem->exists( $this->fspath( $filename ) ) ):
880
+ // make sure file exists with php header
881
+ $this->debug( 'No functions file, creating...', __FUNCTION__ );
882
+ $this->add_base_files( $this );
883
+ endif;
884
  // get_contents_array returns extra linefeeds so just split it ourself
885
+ $markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
886
+ endif;
887
  $newfile = '';
888
  $externals = array();
889
  $phpopen = 0;
957
  // only write file when getexternals is false
958
  if ( ! $getexternals ):
959
  $this->debug( 'Writing new functions file...', __FUNCTION__ );
960
+ if ( $this->is_ajax && is_writable( $filename ) ):
961
+ if ( FALSE === @file_put_contents( $filename, $newfile ) ):
962
+ $this->debug( 'Ajax write failed.', __FUNCTION__ );
963
+ return FALSE;
964
+ endif;
965
+ elseif ( FALSE === $wp_filesystem->put_contents( $this->fspath( $filename ), $newfile ) ):
966
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
967
  return FALSE;
968
+ endif;
969
  $this->css->converted = 1;
970
  endif;
971
  }
978
  endif;
979
  global $wp_filesystem;
980
  if ( $file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
981
+ if ( !$wp_filesystem->exists( $this->fspath( $file ) ) ):
982
+ $this->debug( 'Writing to filesystem: ' . $file, __FUNCTION__ );
983
+ if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $file ), $contents ) ):
984
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
985
+ return FALSE;
986
+ endif;
987
+ else:
988
+ $this->debug( 'File exists.', __FUNCTION__ );
989
+ return FALSE;
990
  endif;
 
 
 
 
991
  else:
992
  $this->debug( 'No directory.', __FUNCTION__ );
993
  return FALSE;
1126
  return FALSE;
1127
  }
1128
 
1129
+ function clone_child_theme( $newchild ) {
1130
+ if ( !$this->fs ) return FALSE; // return if no filesystem access
1131
+ global $wp_filesystem;
1132
+ $dir = untrailingslashit( $this->css->get_child_target( '' ) );
1133
+ $child = $this->theme_basename( '', $dir );
1134
+ $themedir = trailingslashit( get_theme_root() );
1135
+ $fsthemedir = $this->fspath( $themedir );
1136
+ $files = $this->css->recurse_directory( $dir, NULL, TRUE );
1137
+ $errors = array();
1138
+ foreach ( $files as $file ):
1139
+ $childfile = $this->theme_basename( $child, $this->normalize_path( $file ) );
1140
+ $newfile = trailingslashit( $newchild ) . $childfile;
1141
+ $childpath = $fsthemedir . trailingslashit( $child ) . $childfile;
1142
+ $newpath = $fsthemedir . $newfile;
1143
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1144
+ if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1145
+ if ( is_file( $file ) && !$wp_filesystem->copy( $childpath, $newpath ) ):
1146
+ $errors[] = 'could not copy ' . $newpath;
1147
+ endif;
1148
+ else:
1149
+ $errors[] = 'invalid dir: ' . $newfile;
1150
+ endif;
1151
+ endforeach;
1152
+ }
1153
+
1154
  function unset_writable() {
1155
  if ( !$this->fs ) return FALSE; // return if no filesystem access
1156
  global $wp_filesystem;
1344
  }
1345
 
1346
  function writable_notice() {
1347
+ ?> <div class="update-nag" style="display:block">
1348
+ <div class="ctc-section-toggle" id="ctc_perm_options"><?php _e( 'The child theme is in read-only mode and Child Theme Configurator cannot apply changes. Click to see options', 'chld_thm_cfg' ); ?></div><div class="ctc-section-toggle-content" id="ctc_perm_options_content"><p><ol><?php
1349
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
1350
+ if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
1351
+ _e( '<li>Temporarily set write permissions by clicking the button below. When you are finished editing, revert to read-only by clicking "Make read-only" under the "Files" tab.</li>', 'chld_thm_cfg' );
1352
  ?><form action="?page=<?php echo $ctcpage; ?>" method="post">
1353
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
1354
+ <input name="ctc_set_writable" class="button" type="submit" value="<?php _e( 'Make files writable', 'chld_thm_cfg' ); ?>"/></form><?php endif;
1355
  _e( '<li><a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editin wp-config.php">Add your FTP/SSH credentials to the WordPress config file</a>.</li>', 'chld_thm_cfg' );
1356
  if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%iis%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) )
1357
  _e( '<li><a target="_blank" href="http://technet.microsoft.com/en-us/library/cc771170" title="Setting Application Pool Identity">Assign WordPress to an application pool that has write permissions</a> (Windows IIS systems).</li>', 'chld_thm_cfg' );
1358
+ _e( '<li><a target="_blank" href="http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions">Set write permissions on the server manually</a> (not recommended).</li>', 'chld_thm_cfg' );
1359
+ if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
1360
+ _e( '<li>Run PHP under Apache with suEXEC (contact your web host).</li>', 'chld_thm_cfg' );
1361
+ endif; ?>
1362
+ </ol></p></div>
1363
  </div>
1364
  <?php
1365
  }
1472
  else return get_template();
1473
  }
1474
 
1475
+ /* returns child theme either from existing config or passed as post var */
1476
+ function get_current_child() {
1477
+ if ( isset( $_GET[ 'ctc_child' ] ) && ( $child = sanitize_text_field( $_GET[ 'ctc_child' ] ) ) )
1478
+ return $child;
1479
+ elseif ( $child = $this->css->get_prop( 'child' ) )
1480
+ return $child;
1481
+ else return get_stylesheet();
1482
+ }
1483
  /* debug backtrace with extraneous steps (missing class, function or line) removed */
1484
  function backtrace_summary() {
1485
  $bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
1532
  echo $debug;
1533
  }
1534
 
1535
+ function parse_parent_stylesheet() {
1536
+ $this->css->parse_css_file( 'parnt' );
1537
+ }
1538
+
1539
+ function parse_child_stylesheet() {
1540
+ // get revert/backup
1541
+ $revert = isset( $_POST[ 'ctc_revert' ] ) ? sanitize_text_field( $_POST[ 'ctc_revert' ] ) : '';
1542
+ // parse child stylesheet, backup or skip ( to reset )
1543
+ $this->css->parse_css_file( 'child', $revert );
1544
+ }
1545
+
1546
+ function parse_additional_stylesheets() {
1547
+ // parse additional stylesheets
1548
+ if ( isset( $_POST[ 'ctc_additional_css' ] ) && is_array( $_POST[ 'ctc_additional_css' ] ) ):
1549
+ $this->css->addl_css = array();
1550
+ foreach ( $_POST[ 'ctc_additional_css' ] as $file ):
1551
+ $file = sanitize_text_field( $file );
1552
+ $this->css->parse_css_file( 'parnt', $file );
1553
+ $this->css->addl_css[] = $file;
1554
+ endforeach;
1555
+ endif;
1556
+ }
1557
+
1558
+ function copy_theme_mods( $from, $to ) {
1559
+
1560
+ // we can copy settings from parent to child even if neither is currently active
1561
+ // so we need cases for active parent, active child or neither
1562
+
1563
+ // get active theme
1564
+ $active_theme = get_stylesheet();
1565
+ $this->debug( 'from: ' . $from . ' to: ' . $to . ' active: ' . $active_theme, __FUNCTION__ );
1566
+ // create temp array from parent settings
1567
+ $child_mods = get_option( 'theme_mods_' . $from );
1568
+ if ( $active_theme == $from ):
1569
+ $this->debug( 'from is active, using active widgets', __FUNCTION__ );
1570
+ // if parent theme is active, get widgets from active sidebars_widgets array
1571
+ $child_widgets = retrieve_widgets();
1572
+ else:
1573
+ $this->debug( 'from not active, using theme mods widgets', __FUNCTION__ );
1574
+ // otherwise get widgets from parent theme mods
1575
+ $child_widgets = $child_mods[ 'sidebars_widgets' ][ 'data' ];
1576
+ endif;
1577
+ if ( $active_theme == $to ):
1578
+ $this->debug( 'to active, setting active widgets', __FUNCTION__ );
1579
+ // if child theme is active, remove widgets from temp array
1580
+ unset( $child_mods[ 'sidebars_widgets' ] );
1581
+ // copy widgets to active sidebars_widgets array
1582
+ wp_set_sidebars_widgets( $child_widgets );
1583
+ else:
1584
+ $this->debug( 'child not active, saving widgets in theme mods', __FUNCTION__ );
1585
+ // otherwise copy widgets to temp array with time stamp
1586
+ $child_mods[ 'sidebars_widgets' ][ 'data' ] = $child_widgets;
1587
+ $child_mods[ 'sidebars_widgets' ][ 'time' ] = time();
1588
+ endif;
1589
+ $this->debug( 'saving child theme mods:' . LF . print_r( $child_mods, TRUE ), __FUNCTION__ );
1590
+ // copy temp array to child mods
1591
+ update_option( 'theme_mods_' . $to, $child_mods );
1592
+ }
1593
+
1594
+ function network_enable() {
1595
+ if ( $child = $this->css->get_prop( 'child' ) ):
1596
+ $allowed_themes = get_site_option( 'allowedthemes' );
1597
+ $allowed_themes[ $child ] = true;
1598
+ update_site_option( 'allowedthemes', $allowed_themes );
1599
+ endif;
1600
+ }
1601
+
1602
  }
includes/forms/addl_panels.php CHANGED
@@ -25,13 +25,12 @@ if ( !defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) ):
25
  <li><h3><?php _e( 'Find related styles', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Use the "All Styles" panel to edit groups of selectors from a single combined list.', 'chld_thm_cfg' ); ?></p></li>
26
  <li><h3><?php _e( 'Find styles by Nav Menu', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Tweak menus quickly and easily.', 'chld_thm_cfg' ); ?></p></li>
27
  <li><h3><?php _e( 'Most recent edits', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Return to recently edited selectors from a toggleable sidebar.', 'chld_thm_cfg' ); ?></p></li>
28
- <li><h3><?php _e( 'Free Upgrades', 'chld_thm_cfg' ); ?></h3>
29
- <p><?php _e( 'Your Update Key gives you access to new Pro features as soon as they are released.', 'chld_thm_cfg' ); ?></p></li>
30
  <li><h3><?php _e( 'Top-rated Online Support', 'chld_thm_cfg' ); ?></h3></li>
31
  <li><h3><?php _e( 'Online Documentation', 'chld_thm_cfg' ); ?></h3></li>
32
  <li><h3><?php _e( 'Tutorial Videos', 'chld_thm_cfg' ); ?></h3></li>
33
  </ul>
34
- <p><?php _e( 'For a limited time save over 15% off Child Theme Configurator Pro.', 'chld_thm_cfg' ); ?></p>
35
- <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=1710" title="<?php _e( 'Upgrade Now', 'chld_thm_cfg' ); ?>"><?php _e( 'Buy Now - Only $14.95 USD*', 'chld_thm_cfg' ); ?></a></h3><small><?php _e( '*Prices subject to change.', 'chld_thm_cfg' ); ?></small></div>
36
  </div></div><?php
37
  endif;
25
  <li><h3><?php _e( 'Find related styles', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Use the "All Styles" panel to edit groups of selectors from a single combined list.', 'chld_thm_cfg' ); ?></p></li>
26
  <li><h3><?php _e( 'Find styles by Nav Menu', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Tweak menus quickly and easily.', 'chld_thm_cfg' ); ?></p></li>
27
  <li><h3><?php _e( 'Most recent edits', 'chld_thm_cfg' ); ?></h3><p><?php _e( 'Return to recently edited selectors from a toggleable sidebar.', 'chld_thm_cfg' ); ?></p></li>
28
+ <li><h3><?php _e( 'Genesis Framework Support', 'chld_thm_cfg' ); ?></h3>
29
+ <p><?php _e( 'Automatically detects and configures Genesis Child Themes with more frameworks on the way.', 'chld_thm_cfg' ); ?></p></li>
30
  <li><h3><?php _e( 'Top-rated Online Support', 'chld_thm_cfg' ); ?></h3></li>
31
  <li><h3><?php _e( 'Online Documentation', 'chld_thm_cfg' ); ?></h3></li>
32
  <li><h3><?php _e( 'Tutorial Videos', 'chld_thm_cfg' ); ?></h3></li>
33
  </ul>
34
+ <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=1710" title="<?php _e( 'Upgrade Now', 'chld_thm_cfg' ); ?>"><?php _e( 'Buy Now - Only $17.95 USD*', 'chld_thm_cfg' ); ?></a></h3><small><?php _e( '*Prices subject to change.', 'chld_thm_cfg' ); ?></small></div>
 
35
  </div></div><?php
36
  endif;
includes/forms/files.php CHANGED
@@ -106,6 +106,5 @@ if ( !defined( 'ABSPATH' ) ) exit;
106
  <input class="ctc_checkbox" id="ctc_is_debug" name="ctc_is_debug" type="checkbox"
107
  value="1" <?php echo checked( $this->ctc()->is_debug, 1 ); ?> autocomplete="off" />
108
  </div>
109
- <div id="ctc_debug_container"><?php do_action( 'chld_thm_cfg_print_debug' ); ?></div>
110
  </div>
111
  </div>
106
  <input class="ctc_checkbox" id="ctc_is_debug" name="ctc_is_debug" type="checkbox"
107
  value="1" <?php echo checked( $this->ctc()->is_debug, 1 ); ?> autocomplete="off" />
108
  </div>
 
109
  </div>
110
  </div>
includes/forms/parent-child.php CHANGED
@@ -45,11 +45,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
45
  </div>
46
  <div class="ctc-input-cell" style="clear:both"> <strong>&nbsp;</strong> </div>
47
  <div class="ctc-input-cell" >
48
- <input class="ctc_text ctc-themeonly" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e( 'Theme Slug', 'chld_thm_cfg' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
49
  </div>
50
  <?php if ( '' == $hidechild ): ?>
51
  <div class="ctc-input-cell">
52
- <?php $this->render_theme_menu( 'child', $child ); ?>
53
  </div>
54
  <?php endif; ?>
55
  </div>
@@ -103,7 +103,24 @@ if ( !defined( 'ABSPATH' ) ) exit;
103
  <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
104
  value="<?php echo esc_attr( $css->get_prop( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'chld_thm_cfg' ); ?>" autocomplete="off" />
105
  </div>
106
- </div></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  <?php $parent_handling = ( isset( $css->enqueue ) ? $css->enqueue : 'enqueue' ); ?>
108
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
109
  <div class="ctc-input-cell ctc-section-toggle" id="ctc_stylesheet_handling">
@@ -157,7 +174,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
157
  </label>
158
  </strong> </div>
159
  <div class="ctc-input-cell howto sep"><?php _e( 'Select this option if stylesheet link tags are hard-coded into the header template (common in older themes). This enables the child stylesheet to override the parent stylesheet without using <code>@import</code>.', 'chld_thm_cfg' ); ?>
160
- </div>
161
  <div class="ctc-input-cell clear">&nbsp;</div>
162
  <div class="ctc-input-cell">
163
  <label>
@@ -168,11 +185,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
168
  </strong> </div>
169
  <div class="ctc-input-cell howto"><?php _e( "This option imports the parent stylesheet from the child stylesheet. This enables the child stylesheet to override the parent stylesheet, but using <code>@import</code> is no longer recommended.", 'chld_thm_cfg' ); ?>
170
  </div>
171
- </div></div>
172
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
173
- <div class="ctc-input-cell"> <strong>
174
- <?php _e( 'Copy Parent Theme Menus, Widgets and other Options', 'chld_thm_cfg' ); ?>
175
- </strong> </div>
176
  <div class="ctc-input-cell">
177
  <input class="ctc_checkbox ctc-themeonly" id="ctc_parent_mods" name="ctc_parent_mods" type="checkbox"
178
  value="1" <?php echo $disabled; ?> />
@@ -182,12 +199,12 @@ if ( !defined( 'ABSPATH' ) ) exit;
182
  </strong>
183
  <?php _e( 'This will overwrite child theme options you may have already set.', 'chld_thm_cfg' ); ?>
184
  </div>
185
- </div>
186
  <?php if ( '' == $hidechild ): ?>
187
  <div class="ctc-input-row clearfix">
188
- <div class="ctc-input-cell"> <strong>
189
  <?php _e( 'Backup current stylesheet', 'chld_thm_cfg' ); ?>
190
- </strong> </div>
191
  <div class="ctc-input-cell">
192
  <input class="ctc_checkbox" id="ctc_backup" name="ctc_backup" type="checkbox"
193
  value="1" />
@@ -259,4 +276,5 @@ endif; ?>
259
  </div>
260
  </div>
261
  </form>
 
262
  </div>
45
  </div>
46
  <div class="ctc-input-cell" style="clear:both"> <strong>&nbsp;</strong> </div>
47
  <div class="ctc-input-cell" >
48
+ <input class="ctc_text ctc-themeonly" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e( 'New Child Theme Slug', 'chld_thm_cfg' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
49
  </div>
50
  <?php if ( '' == $hidechild ): ?>
51
  <div class="ctc-input-cell">
52
+ <?php $this->render_theme_menu( 'child', $this->ctc()->get_current_child() ); ?>
53
  </div>
54
  <?php endif; ?>
55
  </div>
103
  <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
104
  value="<?php echo esc_attr( $css->get_prop( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'chld_thm_cfg' ); ?>" autocomplete="off" />
105
  </div>
106
+ </div>
107
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_duplicate_theme" <?php echo $hidechild;?>>
108
+ <div class="ctc-input-cell"> <strong>
109
+ <?php _e( 'Duplicate Existing Child Theme', 'chld_thm_cfg' ); ?>
110
+ </strong> </div>
111
+ <div class="ctc-input-cell">
112
+ <input class="ctc_checkbox ctc-themeonly" id="ctc_duplicate_theme" name="ctc_duplicate_theme" type="checkbox"
113
+ value="1" <?php echo $disabled; ?> />
114
+ <input class="ctc_text" id="ctc_duplicate_theme_slug" name="ctc_duplicate_theme_slug" type="text"
115
+ value="" placeholder="<?php _e( 'Duplicate Theme Slug', 'chld_thm_cfg' ); ?>" autocomplete="off" />
116
+ </div>
117
+ <div class="ctc-input-cell howto"> <strong>
118
+ <?php _e( 'NOTE:', 'chld_thm_cfg' ); ?>
119
+ </strong>
120
+ <?php _e( 'This will copy all child theme files and apply changes to new version.', 'chld_thm_cfg' ); ?>
121
+ </div>
122
+ </div>
123
+ </div>
124
  <?php $parent_handling = ( isset( $css->enqueue ) ? $css->enqueue : 'enqueue' ); ?>
125
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
126
  <div class="ctc-input-cell ctc-section-toggle" id="ctc_stylesheet_handling">
174
  </label>
175
  </strong> </div>
176
  <div class="ctc-input-cell howto sep"><?php _e( 'Select this option if stylesheet link tags are hard-coded into the header template (common in older themes). This enables the child stylesheet to override the parent stylesheet without using <code>@import</code>.', 'chld_thm_cfg' ); ?>
177
+ </div><?php do_action( 'chld_thm_cfg_enqueue_options' ); ?>
178
  <div class="ctc-input-cell clear">&nbsp;</div>
179
  <div class="ctc-input-cell">
180
  <label>
185
  </strong> </div>
186
  <div class="ctc-input-cell howto"><?php _e( "This option imports the parent stylesheet from the child stylesheet. This enables the child stylesheet to override the parent stylesheet, but using <code>@import</code> is no longer recommended.", 'chld_thm_cfg' ); ?>
187
  </div>
188
+ </div></div><?php if ( ! is_multisite() || ! empty( $this->ctc()->themes[ 'parnt' ][ $this->ctc()->get_current_parent() ][ 'allowed' ] ) ): ?>
189
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
190
+ <div class="ctc-input-cell"> <strong><label for="ctc_parent_mods">
191
+ <?php _e( 'Copy Parent Theme Menus, Widgets and other Customizer Options', 'chld_thm_cfg' ); ?>
192
+ </label></strong> </div>
193
  <div class="ctc-input-cell">
194
  <input class="ctc_checkbox ctc-themeonly" id="ctc_parent_mods" name="ctc_parent_mods" type="checkbox"
195
  value="1" <?php echo $disabled; ?> />
199
  </strong>
200
  <?php _e( 'This will overwrite child theme options you may have already set.', 'chld_thm_cfg' ); ?>
201
  </div>
202
+ </div><?php endif; ?>
203
  <?php if ( '' == $hidechild ): ?>
204
  <div class="ctc-input-row clearfix">
205
+ <div class="ctc-input-cell"> <strong><label for="ctc_backup">
206
  <?php _e( 'Backup current stylesheet', 'chld_thm_cfg' ); ?>
207
+ </label></strong> </div>
208
  <div class="ctc-input-cell">
209
  <input class="ctc_checkbox" id="ctc_backup" name="ctc_backup" type="checkbox"
210
  value="1" />
276
  </div>
277
  </div>
278
  </form>
279
+ <div id="ctc_debug_container"><?php do_action( 'chld_thm_cfg_print_debug' ); ?></div>
280
  </div>
js/chld-thm-cfg.js CHANGED
@@ -2,14 +2,13 @@
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 1.7.3.1
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
9
  * Copyright (C) 2014-2015 Lilaea Media
10
  */
11
  ;
12
- // jQuery plugin template for plugin that does not work on element
13
  ( function( $ ) {
14
  $.chldthmcfg = {
15
  //console.log( 'executing main function' );
@@ -662,6 +661,9 @@
662
  $( '#ctc_child_themeuri' ).val( ctcAjax.themes[ 'child' ][ child ].ThemeURI );
663
  $( '#ctc_child_descr' ).val( ctcAjax.themes[ 'child' ][ child ].Descr );
664
  $( '#ctc_child_tags' ).val( ctcAjax.themes[ 'child' ][ child ].Tags );
 
 
 
665
  }
666
  }
667
  },
@@ -683,18 +685,30 @@
683
  },
684
 
685
  set_parent_menu: function( obj ) {
686
- $( '#ctc_theme_parent' ).parents( '.ctc-input-row' ).first()
687
  .append( '<span class="ctc-status-icon spinner"></span>' );
688
  $( '.spinner' ).show();
689
  document.location='?page=' + ctcAjax.page + '&ctc_parent=' + obj.value;
690
  },
691
 
692
  set_child_menu: function( obj ) {
693
- var self = this;
 
 
694
  if ( !self.is_empty( ctcAjax.themes.child[ obj.value ] ) ) {
695
- $( '#ctc_child_name' ).val( ctcAjax.themes.child[ obj.value ].Name );
696
- $( '#ctc_child_author' ).val( ctcAjax.themes.child[ obj.value ].Author );
697
- $( '#ctc_child_version' ).val( ctcAjax.themes.child[ obj.value ].Version );
 
 
 
 
 
 
 
 
 
 
698
  }
699
  },
700
 
@@ -1247,7 +1261,7 @@
1247
  } );
1248
  $( '.ctc-section-toggle' ).on( 'click', function( e ) {
1249
  e.preventDefault();
1250
- $( this ).parents( '.ctc-input-row' ).first().find( '.ctc-section-toggle' )
1251
  .each( function() {
1252
  $( this ).toggleClass( 'open' );
1253
  } );
@@ -1279,10 +1293,21 @@
1279
  $( '#ctc_child_template' ).val( '' );
1280
  self.set_existing();
1281
  } );
 
 
 
 
 
 
 
 
1282
  $( '#ctc_child_type_new, #ctc_child_template' ).on( 'focus click', function() {
1283
  // change the inputs to use new child theme
1284
  $( '#ctc_child_type_existing' ).prop( 'checked', false );
 
 
1285
  $( '#ctc_child_type_new' ).prop( 'checked', true );
 
1286
  $( '#ctc_child_name' ).val( self.testname );
1287
  $( '#ctc_child_template' ).val( self.testslug );
1288
  } );
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 1.7.4
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
9
  * Copyright (C) 2014-2015 Lilaea Media
10
  */
11
  ;
 
12
  ( function( $ ) {
13
  $.chldthmcfg = {
14
  //console.log( 'executing main function' );
661
  $( '#ctc_child_themeuri' ).val( ctcAjax.themes[ 'child' ][ child ].ThemeURI );
662
  $( '#ctc_child_descr' ).val( ctcAjax.themes[ 'child' ][ child ].Descr );
663
  $( '#ctc_child_tags' ).val( ctcAjax.themes[ 'child' ][ child ].Tags );
664
+ $( '#ctc_duplicate_theme' ).prop( 'checked', false );
665
+ $( '#ctc_duplicate_theme_slug' ).val( '' );
666
+ $( '#input_row_duplicate_theme' ).show();
667
  }
668
  }
669
  },
685
  },
686
 
687
  set_parent_menu: function( obj ) {
688
+ $( '#ctc_theme_parnt' ).parents( '.ctc-input-row' ).first()
689
  .append( '<span class="ctc-status-icon spinner"></span>' );
690
  $( '.spinner' ).show();
691
  document.location='?page=' + ctcAjax.page + '&ctc_parent=' + obj.value;
692
  },
693
 
694
  set_child_menu: function( obj ) {
695
+ var self = this,
696
+ template,
697
+ parent;
698
  if ( !self.is_empty( ctcAjax.themes.child[ obj.value ] ) ) {
699
+ template = ctcAjax.themes.child[ obj.value ].Template,
700
+ parent = $( '#ctc_theme_parnt' ).val();
701
+ console.log( 'template: ' + template + ' parent: ' + parent );
702
+ if ( template == parent ) {
703
+ $( '#ctc_child_name' ).val( ctcAjax.themes.child[ obj.value ].Name );
704
+ $( '#ctc_child_author' ).val( ctcAjax.themes.child[ obj.value ].Author );
705
+ $( '#ctc_child_version' ).val( ctcAjax.themes.child[ obj.value ].Version );
706
+ } else {
707
+ $( '#ctc_theme_child' ).parents( '.ctc-input-row' ).first()
708
+ .append( '<span class="ctc-status-icon spinner"></span>' );
709
+ $( '.spinner' ).show();
710
+ document.location='?page=' + ctcAjax.page + '&ctc_parent=' + template + '&ctc_child=' + obj.value;
711
+ }
712
  }
713
  },
714
 
1261
  } );
1262
  $( '.ctc-section-toggle' ).on( 'click', function( e ) {
1263
  e.preventDefault();
1264
+ $( this ).parents( '.ctc-input-row, .update-nag' ).first().find( '.ctc-section-toggle' )
1265
  .each( function() {
1266
  $( this ).toggleClass( 'open' );
1267
  } );
1293
  $( '#ctc_child_template' ).val( '' );
1294
  self.set_existing();
1295
  } );
1296
+ $( '#ctc_duplicate_theme' ).on( 'click', function() {
1297
+ if ( $( '#ctc_duplicate_theme' ).is( ':checked' ) ) {
1298
+ $( '#ctc_child_name' ).val( self.testname );
1299
+ $( '#ctc_duplicate_theme_slug' ).val( self.testslug );
1300
+ } else {
1301
+ self.set_existing();
1302
+ }
1303
+ } );
1304
  $( '#ctc_child_type_new, #ctc_child_template' ).on( 'focus click', function() {
1305
  // change the inputs to use new child theme
1306
  $( '#ctc_child_type_existing' ).prop( 'checked', false );
1307
+ $( '#ctc_duplicate_theme' ).prop( 'checked', false );
1308
+ $( '#ctc_duplicate_theme_slug' ).val( '' );
1309
  $( '#ctc_child_type_new' ).prop( 'checked', true );
1310
+ $( '#input_row_duplicate_theme' ).hide();
1311
  $( '#ctc_child_name' ).val( self.testname );
1312
  $( '#ctc_child_template' ).val( self.testslug );
1313
  } );
js/chld-thm-cfg.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e.chldthmcfg={esc_quot:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e){return(text=ctcAjax[e+"_txt"])?text:""},from_ascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},to_ascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(ctcAjax.themes,function(i,r){return e.each(r,function(e){return e!=t||"parnt"!=i&&"new"!=c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c).toLowerCase():"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c).toLowerCase():n,r=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"==r&&(i=n),t.theme_exists(i,r)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),""===i&&a.push(t.getxt("inval_theme")),""===e("#ctc_child_name").val()&&a.push(t.getxt("inval_name")),a.length?(t.set_notice({error:a}),!1):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=slugbase=c+"-child",i=ctcAjax.themes.parnt[c].Name+" Child",r="",a="",s="00";t.theme_exists(n,"new");)r=""==r?2:r+1,a=s.substring(0,s.length-r.toString().length)+r.toString(),n=slugbase+a;t.testslug=n,t.testname=i+(a.length?" "+a:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(".ctc-selector-container").hide(),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.esc_quot(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},fade_update_notice:function(){e(".updated, .error").slideUp("slow",function(){e(".updated").remove()})},coalesce_inputs:function(t){var c=this,n=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,i=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),r=i.find(".ctc-swatch").first(),a={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},l={child:!1,parent:!1},o={};return i.find(".ctc-parent-value, .ctc-child-value").each(function(){var i,r,_=e(this).attr("id"),u=_.toString().match(n),d=u[2],p=u[3],h="undefined"==typeof u[4]?"":u[4],m=u[5],v="undefined"==typeof u[6]?"":u[6],f="parent"==p?e(this).text().replace(/!$/,""):e(this).val(),g="ctc_"+d+"_child_"+h+"_i_"+m;if(c.is_empty(e(this).data("color"))||(f=e(this).data("color"),e(this).data("color",null)),"child"==p&&(o[_]=f,o[g]=e("#"+g).is(":checked")?1:0),""!=f)if(c.is_empty(v))(i=h.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!f.match(/none/))?(r=f.toString().split(/ +/),a[p][h+"-width"]="undefined"==typeof r[0]?"":r[0],a[p][h+"-style"]="undefined"==typeof r[1]?"":r[1],a[p][h+"-color"]="undefined"==typeof r[2]?"":r[2]):"background-image"!=h||f.match(/none/)?"seq"!=h&&(a[p][h]=f):f.toString().match(/url\(/)?a[p]["background-image"]=c.image_url(p,f):(r=f.toString().split(/ +/),r.length>2?(s[p].origin="undefined"==typeof r[0]?"top":r[0],s[p].start="undefined"==typeof r[1]?"transparent":r[1],s[p].end="undefined"==typeof r[2]?"transparent":r[2],l[p]=!0):a[p]["background-image"]=f);else switch(v){case"_border_width":a[p][h+"-width"]="none"==f?0:f;break;case"_border_style":a[p][h+"-style"]=f;break;case"_border_color":a[p][h+"-color"]=f;break;case"_background_url":a[p]["background-image"]=c.image_url(p,f);break;case"_background_color":a[p]["background-color"]=t.value;break;case"_background_color1":s[p].start=f,l[p]=!0;break;case"_background_color2":s[p].end=f,l[p]=!0;break;case"_background_origin":s[p].origin=f,l[p]=!0}}),"undefined"==typeof r||c.is_empty(r.attr("id"))||(r.removeAttr("style"),l.parent&&r.ctcgrad(s.parent.origin,[s.parent.start,s.parent.end]),r.css(a.parent),r.attr("id").toString().match(/parent/)||(l.child&&r.ctcgrad(s.child.origin,[s.child.start,s.child.end]),r.css(a.child)),r.css({"z-index":-1})),o},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c=this,n={orig:t};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i=t.toString().split(/ +/);n.names=["_border_width","_border_style","_border_color"],n.values=["undefined"==typeof i[0]?"":i[0],"undefined"==typeof i[1]?"":i[1],"undefined"==typeof i[2]?"":i[2]]}else if(e.toString().match(/^background\-image/))if(n.names=["_background_url","_background_origin","_background_color1","_background_color2"],n.values=["","","",""],!1!==c.is_empty(t)||t.toString().match(/(url|none)/))n.values[0]=t;else{var i=t.toString().split(/:/);n.values[1]="undefined"==typeof i[0]?"":i[0],n.values[2]="undefined"==typeof i[1]?"":i[1],n.values[3]="undefined"==typeof i[3]?"":i[3],n.orig=[n.values[1],n.values[2],n.values[3]].join(" ")}else n.names=[""],n.values=[t];return n},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),r=n.is_empty(i)?null:i[1],a=ctcAjax.theme_uri+"/"+("parent"==e?ctcAjax.parnt:ctcAjax.child)+"/";return r?c=r.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+r+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.current_query)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.current_query)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.current_qsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i"),r=e.chldthmcfg.current_qsdata,a=e.chldthmcfg.is_empty(r)||e.chldthmcfg.is_empty(r.value);e.each(e("#ctc_rule_menu").data("menu"),function(t,c){var s=!1;if(i.test(t)){if(!a&&(e.each(r.value,function(e){return t==e.replace(/\d+/g,self.from_ascii)?(s=!0,!1):void 0}),s))return;n.push({label:t,value:c})}}),c(n)},input_row:function(t,c,n,i){var r=this,a="",s=r.is_empty(i)||r.is_empty(i.value)||r.is_empty(i.value[c])?"":i.value[c],l=r.decode_value(c,r.is_empty(s)?"":s.parnt),o=r.is_empty(s)||r.is_empty(s.i_parnt)||1!=s.i_parnt?"":r.getxt("important"),_=r.decode_value(c,r.is_empty(s)?"":s.child),u=r.is_empty(s)||r.is_empty(s.i_child)||1!=s.i_child?0:1,d="ctc_"+n+"_child_"+c+"_i_"+t;return r.is_empty(i)||(a+='<div class="ctc-'+("ovrd"==n?"input":"selector")+'-row clearfix">\n<div class="ctc-input-cell">'+("ovrd"==n?c.replace(/\d+/g,r.from_ascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+r.getxt("edit")+"</a> "+(r.is_empty(l.orig)?r.getxt("child_only"):""))+"</div>\n","ovrd"==n&&(a+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+n+"_parent_"+c+"_"+t+'">'+(r.is_empty(l.orig)?"[no value]":l.orig+o)+"</div>\n"),a+='<div class="ctc-input-cell">\n',r.is_empty(l.names)||(e.each(l.names,function(e,i){i=r.is_empty(i)?"":i,a+='<div class="ctc-child-input-cell">\n';var s,l="ctc_"+n+"_child_"+c+"_"+t+i;!1===(s=_.values.shift())&&(s=""),a+=(r.is_empty(i)?"":r.getxt(i)+":<br/>")+'<input type="text" id="'+l+'" name="'+l+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+r.esc_quot(s)+'" />\n</div>\n'}),a+='<label for="'+d+'"><input type="checkbox" id="'+d+'" name="'+d+'" value="1" '+(1===u?"checked":"")+" />"+r.getxt("important")+"</label>\n"),a+="</div>\n"+("ovrd"==n?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+'_swatch">'+r.getxt("swatch")+'</div>\n<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+'_cell">\n<input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+'" name="ctc_save_'+c+"_"+t+'" value="Save" /></div>\n')+"</div><!-- end input row -->\n"),a},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var e,t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(t){var c=this;try{e(t).iris({change:function(n,i){e(t).data("color",i.color.toString()),c.coalesce_inputs(t)}})}catch(n){c.jquery_exception(n,"Iris Color Picker")}},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Rule Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault(),t.is_empty(t.current_qsdata.value)&&(t.current_qsdata.value={}),t.current_qsdata.value[n.item.label]={child:""};var i,r=n.item.label.replace(/[^\w\-]/g,t.to_ascii),a=e(t.input_row(t.current_qsid,r,"ovrd",t.current_qsdata));return e("#ctc_sel_ovrd_rule_inputs").append(a),e("#ctc_new_rule_menu").val(""),a.find('input[type="text"]').each(function(c,n){i||(i=n),e(n).hasClass("color-picker")&&t.setup_iris(n)}),i&&e(i).focus(),t.jquery_err.length&&t.jquery_notice(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Rule Menu")}},set_existing:function(){var t=this;if(e("#ctc_theme_child").length&&e("#ctc_child_type_existing").is(":checked")){var c=e("#ctc_theme_child").val();t.is_empty(c)||(e("#ctc_child_name").val(ctcAjax.themes.child[c].Name),e("#ctc_child_author").val(ctcAjax.themes.child[c].Author),e("#ctc_child_version").val(ctcAjax.themes.child[c].Version),e("#ctc_child_authoruri").val(ctcAjax.themes.child[c].AuthorURI),e("#ctc_child_themeuri").val(ctcAjax.themes.child[c].ThemeURI),e("#ctc_child_descr").val(ctcAjax.themes.child[c].Descr),e("#ctc_child_tags").val(ctcAjax.themes.child[c].Tags))}},set_notice:function(t){var c=this,n="";c.is_empty(t)||e.each(t,function(t,c){n+='<div class="'+t+'"><ul>\n',e(c).each(function(e,t){n+="<li>"+t.toString()+"</li>\n"}),n+="</ul></div>"}),e("#ctc_error_notice").html(n),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(t){e("#ctc_theme_parent").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+t.value},set_child_menu:function(t){var c=this;c.is_empty(ctcAjax.themes.child[t.value])||(e("#ctc_child_name").val(ctcAjax.themes.child[t.value].Name),e("#ctc_child_author").val(ctcAjax.themes.child[t.value].Author),e("#ctc_child_version").val(ctcAjax.themes.child[t.value].Version))},set_query:function(t){var c=this;c.current_query=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors()},set_selector:function(t){var c=this;e("#ctc_sel_ovrd_selector").val(""),c.current_qsid=t,c.reload_menus=!1,c.load_selector_values()},set_rule:function(t,c){var n=this;e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t)},set_qsid:function(t){var c=this;c.current_qsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload_menus=!0,c.load_selector_values()},set_addl_css:function(){var t,c=this,n=e("#ctc_theme_parnt").val(),i=ctcAjax.theme_uri.replace(/^https?:\/\//,""),r=ctcAjax.homeurl.replace(/^https?/,ctcAjax.ssl?"https":"http"),a=r+"?preview=1&p=x&template="+n+"&stylesheet="+n,s=new RegExp("<link rel=[\"']stylesheet[\"'][^>]+?"+i+"/"+n+"/(.+?\\.css)[^>]+?>","g");c.is_empty(n)||(n!=ctcAjax.parnt?e.get(a,function(c){for(;(t=s.exec(c))&&"style.css"!=t[1];)t[1].match(/bootstrap/)||e(".ctc_checkbox").each(function(){e(this).val()==t[1]&&e(this).prop("checked",!0)});c=null}):e(ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){e(this).val()==c&&e(this).prop("checked",!0)})}))},query_css:function(t,c,n){var i=this,r={ctc_query_obj:t,ctc_query_key:c},a="#ctc_status_"+t+("val_qry"==t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){r["ctc_query_"+e]=t}),e(".query-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner query-icon"></span>'),e(".spinner").show(),r.action=i.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_query":"ctc_plgqry",r._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,r)},save:function(t){var c,n,i,r,a,s=this,l=(ctcAjax.ajaxurl,{}),o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"==e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),s.reload_menus=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"==e(t).attr("id")?l.ctc_child_imports=i.val():"ctc_is_debug"==e(t).attr("id")?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=s.coalesce_inputs(t),e(".save-icon").show(),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){r=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),s.is_empty(r)||!r.toString().match(/\w/)?r=a:(l.ctc_rewrite_selector=r,s.reload_menus=!0),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(r)}),l.action=s.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),s.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this,r=ctcAjax.ajaxurl;e.ajax({url:r,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"==t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jquery_err.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(){var t=this,c=[],n=[];e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var n=e(this).prop("src");t.is_empty(n)||!n.match(/jquery(\.min|\.js|\-?ui)/i)||n.match(/load\-scripts.php/)||c.push("<code><small>"+n.split(/\?/)[0]+"</small></code>")}),n.push("<strong>"+t.getxt("js")+"</strong> "+t.getxt("contact")),1==ctcAjax.is_debug&&n.push(t.jquery_err.join("<br/>")),c.length&&n.push(t.getxt("jquery")+"<br/>"+c.join("<br/>")),n.push(t.getxt("plugin")),t.set_notice({error:n})},update:{qsid:function(t){var c,n,i,r=this;r.current_qsid=t.key,r.current_qsdata=t.data,e("#ctc_sel_ovrd_qsid").val(r.current_qsid),r.is_empty(r.current_qsdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+r.current_qsid,i=parseInt(r.current_qsdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),r.is_empty(r.current_qsdata.value)?(e("#ctc_sel_ovrd_rule_inputs").empty(),e("#ctc_sel_ovrd_rule_header").hide()):(n="",e.each(r.current_qsdata.value,function(e){n+=r.input_row(r.current_qsid,e,"ovrd",r.current_qsdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){r.setup_iris(this)}),r.coalesce_inputs("#ctc_child_all_0_swatch"),e("#ctc_sel_ovrd_rule_header").show()),r.jquery_err.length?r.jquery_notice():(r.reload_menus&&(r.set_query(r.current_qsdata.query),r.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(r.current_qsdata.selector),e(".ctc-rewrite-toggle").text(r.getxt("rename")),e("#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show())},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var r=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+r.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c=this,n="";c.is_empty(t.data)||e.each(t.data,function(i,r){page_rule=i,e.each(r,function(r,a){n+='<h4 class="ctc-query-heading">'+r+"</h4>\n",c.is_empty(a)||e.each(a,function(e,r){n+=c.input_row(e,i,t.key,r)})})}),selector="#ctc_selector_"+rule+"_"+t.key+"_rows",e(selector).html(n).find(".color-picker").each(function(){c.setup_iris(this)}),e(selector).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)}),c.jquery_err.length&&c.jquery_notice()},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)}},init:function(){var t=this;if(t.autogen_slugs(),t.set_existing(),!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>");return e("#ctc_theme_option_"+c.value).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.is_empty(t.jquery_err)?(e("#ctc_main").on("focus",".color-picker",function(){try{e(".color-picker").not(this).iris("hide"),e(this).iris("toggle"),e(".iris-picker").css({position:"absolute","z-index":10})}catch(c){t.jquery_exception(c,"Iris Color Picker")}}),e("#ctc_main").on("change",".ctc-child-value, input[type=checkbox]",function(){t.coalesce_inputs(this)}),e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n=e(this).attr("id").toString().replace("_close",""),i=n.toString().match(/_([^_]+)_(\d+)$/);e("#"+n+"_container").is(":hidden")&&(t.is_empty(i[1])||t.is_empty(i[2])||(rule=i[1],valid=i[2],t.query_css("val_qry",valid,{rule:rule}))),e("#"+n+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+n+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button]",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.save(this))}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"==c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e(".ctc-section-toggle").on("click",function(t){t.preventDefault(),e(this).parents(".ctc-input-row").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){return c.preventDefault(),$this=e("#ctc_save_query_selector"),$this.hasClass("ajax-pending")?!1:($this.addClass("ajax-pending"),t.save($this),!1)}),e("#ctc_theme_child, #ctc_theme_child-button, #ctc_child_type_existing").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!0),e("#ctc_child_type_new").prop("checked",!1),e("#ctc_child_template").val(""),t.set_existing()}),e("#ctc_child_type_new, #ctc_child_template").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!1),e("#ctc_child_type_new").prop("checked",!0),e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug)}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),t.set_addl_css(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),setTimeout(t.fade_update_notice,2e4)):t.jquery_notice()},testslug:"",testname:"",reload_menus:!1,current_query:"base",current_qsid:null,current_qsdata:{},jquery_err:[]}}(jQuery),jQuery(document).ready(function(e){e.chldthmcfg.init()});
1
+ !function(e){e.chldthmcfg={esc_quot:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e){return(text=ctcAjax[e+"_txt"])?text:""},from_ascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},to_ascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(ctcAjax.themes,function(i,a){return e.each(a,function(e){return e!=t||"parnt"!=i&&"new"!=c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c).toLowerCase():"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c).toLowerCase():n,a=e("input[name=ctc_child_type]:checked").val(),r=[];return"new"==a&&(i=n),t.theme_exists(i,a)&&r.push(t.getxt("theme_exists").toString().replace(/%s/,i)),""===i&&r.push(t.getxt("inval_theme")),""===e("#ctc_child_name").val()&&r.push(t.getxt("inval_name")),r.length?(t.set_notice({error:r}),!1):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=slugbase=c+"-child",i=ctcAjax.themes.parnt[c].Name+" Child",a="",r="",s="00";t.theme_exists(n,"new");)a=""==a?2:a+1,r=s.substring(0,s.length-a.toString().length)+a.toString(),n=slugbase+r;t.testslug=n,t.testname=i+(r.length?" "+r:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(".ctc-selector-container").hide(),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.esc_quot(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},fade_update_notice:function(){e(".updated, .error").slideUp("slow",function(){e(".updated").remove()})},coalesce_inputs:function(t){var c=this,n=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,i=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),a=i.find(".ctc-swatch").first(),r={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},l={child:!1,parent:!1},o={};return i.find(".ctc-parent-value, .ctc-child-value").each(function(){var i,a,_=e(this).attr("id"),u=_.toString().match(n),d=u[2],p=u[3],h="undefined"==typeof u[4]?"":u[4],m=u[5],v="undefined"==typeof u[6]?"":u[6],f="parent"==p?e(this).text().replace(/!$/,""):e(this).val(),g="ctc_"+d+"_child_"+h+"_i_"+m;if(c.is_empty(e(this).data("color"))||(f=e(this).data("color"),e(this).data("color",null)),"child"==p&&(o[_]=f,o[g]=e("#"+g).is(":checked")?1:0),""!=f)if(c.is_empty(v))(i=h.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!f.match(/none/))?(a=f.toString().split(/ +/),r[p][h+"-width"]="undefined"==typeof a[0]?"":a[0],r[p][h+"-style"]="undefined"==typeof a[1]?"":a[1],r[p][h+"-color"]="undefined"==typeof a[2]?"":a[2]):"background-image"!=h||f.match(/none/)?"seq"!=h&&(r[p][h]=f):f.toString().match(/url\(/)?r[p]["background-image"]=c.image_url(p,f):(a=f.toString().split(/ +/),a.length>2?(s[p].origin="undefined"==typeof a[0]?"top":a[0],s[p].start="undefined"==typeof a[1]?"transparent":a[1],s[p].end="undefined"==typeof a[2]?"transparent":a[2],l[p]=!0):r[p]["background-image"]=f);else switch(v){case"_border_width":r[p][h+"-width"]="none"==f?0:f;break;case"_border_style":r[p][h+"-style"]=f;break;case"_border_color":r[p][h+"-color"]=f;break;case"_background_url":r[p]["background-image"]=c.image_url(p,f);break;case"_background_color":r[p]["background-color"]=t.value;break;case"_background_color1":s[p].start=f,l[p]=!0;break;case"_background_color2":s[p].end=f,l[p]=!0;break;case"_background_origin":s[p].origin=f,l[p]=!0}}),"undefined"==typeof a||c.is_empty(a.attr("id"))||(a.removeAttr("style"),l.parent&&a.ctcgrad(s.parent.origin,[s.parent.start,s.parent.end]),a.css(r.parent),a.attr("id").toString().match(/parent/)||(l.child&&a.ctcgrad(s.child.origin,[s.child.start,s.child.end]),a.css(r.child)),a.css({"z-index":-1})),o},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c=this,n={orig:t};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i=t.toString().split(/ +/);n.names=["_border_width","_border_style","_border_color"],n.values=["undefined"==typeof i[0]?"":i[0],"undefined"==typeof i[1]?"":i[1],"undefined"==typeof i[2]?"":i[2]]}else if(e.toString().match(/^background\-image/))if(n.names=["_background_url","_background_origin","_background_color1","_background_color2"],n.values=["","","",""],!1!==c.is_empty(t)||t.toString().match(/(url|none)/))n.values[0]=t;else{var i=t.toString().split(/:/);n.values[1]="undefined"==typeof i[0]?"":i[0],n.values[2]="undefined"==typeof i[1]?"":i[1],n.values[3]="undefined"==typeof i[3]?"":i[3],n.orig=[n.values[1],n.values[2],n.values[3]].join(" ")}else n.names=[""],n.values=[t];return n},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),a=n.is_empty(i)?null:i[1],r=ctcAjax.theme_uri+"/"+("parent"==e?ctcAjax.parnt:ctcAjax.child)+"/";return a?c=a.toString().match(/^(data:|https?:|\/)/)?t:"url("+r+a+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.current_query)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.current_query)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.current_qsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i"),a=e.chldthmcfg.current_qsdata,r=e.chldthmcfg.is_empty(a)||e.chldthmcfg.is_empty(a.value);e.each(e("#ctc_rule_menu").data("menu"),function(t,c){var s=!1;if(i.test(t)){if(!r&&(e.each(a.value,function(e){return t==e.replace(/\d+/g,self.from_ascii)?(s=!0,!1):void 0}),s))return;n.push({label:t,value:c})}}),c(n)},input_row:function(t,c,n,i){var a=this,r="",s=a.is_empty(i)||a.is_empty(i.value)||a.is_empty(i.value[c])?"":i.value[c],l=a.decode_value(c,a.is_empty(s)?"":s.parnt),o=a.is_empty(s)||a.is_empty(s.i_parnt)||1!=s.i_parnt?"":a.getxt("important"),_=a.decode_value(c,a.is_empty(s)?"":s.child),u=a.is_empty(s)||a.is_empty(s.i_child)||1!=s.i_child?0:1,d="ctc_"+n+"_child_"+c+"_i_"+t;return a.is_empty(i)||(r+='<div class="ctc-'+("ovrd"==n?"input":"selector")+'-row clearfix">\n<div class="ctc-input-cell">'+("ovrd"==n?c.replace(/\d+/g,a.from_ascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+a.getxt("edit")+"</a> "+(a.is_empty(l.orig)?a.getxt("child_only"):""))+"</div>\n","ovrd"==n&&(r+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+n+"_parent_"+c+"_"+t+'">'+(a.is_empty(l.orig)?"[no value]":l.orig+o)+"</div>\n"),r+='<div class="ctc-input-cell">\n',a.is_empty(l.names)||(e.each(l.names,function(e,i){i=a.is_empty(i)?"":i,r+='<div class="ctc-child-input-cell">\n';var s,l="ctc_"+n+"_child_"+c+"_"+t+i;!1===(s=_.values.shift())&&(s=""),r+=(a.is_empty(i)?"":a.getxt(i)+":<br/>")+'<input type="text" id="'+l+'" name="'+l+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+a.esc_quot(s)+'" />\n</div>\n'}),r+='<label for="'+d+'"><input type="checkbox" id="'+d+'" name="'+d+'" value="1" '+(1===u?"checked":"")+" />"+a.getxt("important")+"</label>\n"),r+="</div>\n"+("ovrd"==n?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+'_swatch">'+a.getxt("swatch")+'</div>\n<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+'_cell">\n<input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+'" name="ctc_save_'+c+"_"+t+'" value="Save" /></div>\n')+"</div><!-- end input row -->\n"),r},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var e,t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(t){var c=this;try{e(t).iris({change:function(n,i){e(t).data("color",i.color.toString()),c.coalesce_inputs(t)}})}catch(n){c.jquery_exception(n,"Iris Color Picker")}},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Rule Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault(),t.is_empty(t.current_qsdata.value)&&(t.current_qsdata.value={}),t.current_qsdata.value[n.item.label]={child:""};var i,a=n.item.label.replace(/[^\w\-]/g,t.to_ascii),r=e(t.input_row(t.current_qsid,a,"ovrd",t.current_qsdata));return e("#ctc_sel_ovrd_rule_inputs").append(r),e("#ctc_new_rule_menu").val(""),r.find('input[type="text"]').each(function(c,n){i||(i=n),e(n).hasClass("color-picker")&&t.setup_iris(n)}),i&&e(i).focus(),t.jquery_err.length&&t.jquery_notice(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Rule Menu")}},set_existing:function(){var t=this;if(e("#ctc_theme_child").length&&e("#ctc_child_type_existing").is(":checked")){var c=e("#ctc_theme_child").val();t.is_empty(c)||(e("#ctc_child_name").val(ctcAjax.themes.child[c].Name),e("#ctc_child_author").val(ctcAjax.themes.child[c].Author),e("#ctc_child_version").val(ctcAjax.themes.child[c].Version),e("#ctc_child_authoruri").val(ctcAjax.themes.child[c].AuthorURI),e("#ctc_child_themeuri").val(ctcAjax.themes.child[c].ThemeURI),e("#ctc_child_descr").val(ctcAjax.themes.child[c].Descr),e("#ctc_child_tags").val(ctcAjax.themes.child[c].Tags),e("#ctc_duplicate_theme").prop("checked",!1),e("#ctc_duplicate_theme_slug").val(""),e("#input_row_duplicate_theme").show())}},set_notice:function(t){var c=this,n="";c.is_empty(t)||e.each(t,function(t,c){n+='<div class="'+t+'"><ul>\n',e(c).each(function(e,t){n+="<li>"+t.toString()+"</li>\n"}),n+="</ul></div>"}),e("#ctc_error_notice").html(n),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(t){e("#ctc_theme_parnt").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+t.value},set_child_menu:function(t){var c,n,i=this;i.is_empty(ctcAjax.themes.child[t.value])||(c=ctcAjax.themes.child[t.value].Template,n=e("#ctc_theme_parnt").val(),console.log("template: "+c+" parent: "+n),c==n?(e("#ctc_child_name").val(ctcAjax.themes.child[t.value].Name),e("#ctc_child_author").val(ctcAjax.themes.child[t.value].Author),e("#ctc_child_version").val(ctcAjax.themes.child[t.value].Version)):(e("#ctc_theme_child").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+c+"&ctc_child="+t.value))},set_query:function(t){var c=this;c.current_query=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors()},set_selector:function(t){var c=this;e("#ctc_sel_ovrd_selector").val(""),c.current_qsid=t,c.reload_menus=!1,c.load_selector_values()},set_rule:function(t,c){var n=this;e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t)},set_qsid:function(t){var c=this;c.current_qsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload_menus=!0,c.load_selector_values()},set_addl_css:function(){var t,c=this,n=e("#ctc_theme_parnt").val(),i=ctcAjax.theme_uri.replace(/^https?:\/\//,""),a=ctcAjax.homeurl.replace(/^https?/,ctcAjax.ssl?"https":"http"),r=a+"?preview=1&p=x&template="+n+"&stylesheet="+n,s=new RegExp("<link rel=[\"']stylesheet[\"'][^>]+?"+i+"/"+n+"/(.+?\\.css)[^>]+?>","g");c.is_empty(n)||(n!=ctcAjax.parnt?e.get(r,function(c){for(;(t=s.exec(c))&&"style.css"!=t[1];)t[1].match(/bootstrap/)||e(".ctc_checkbox").each(function(){e(this).val()==t[1]&&e(this).prop("checked",!0)});c=null}):e(ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){e(this).val()==c&&e(this).prop("checked",!0)})}))},query_css:function(t,c,n){var i=this,a={ctc_query_obj:t,ctc_query_key:c},r="#ctc_status_"+t+("val_qry"==t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){a["ctc_query_"+e]=t}),e(".query-icon").remove(),e(r+" .ctc-status-icon").remove(),e(r).append('<span class="ctc-status-icon spinner query-icon"></span>'),e(".spinner").show(),a.action=i.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_query":"ctc_plgqry",a._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,a)},save:function(t){var c,n,i,a,r,s=this,l=(ctcAjax.ajaxurl,{}),o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"==e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),s.reload_menus=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"==e(t).attr("id")?l.ctc_child_imports=i.val():"ctc_is_debug"==e(t).attr("id")?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=s.coalesce_inputs(t),e(".save-icon").show(),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){a=e("#ctc_rewrite_selector").val(),r=e("#ctc_rewrite_selector_orig").val(),s.is_empty(a)||!a.toString().match(/\w/)?a=r:(l.ctc_rewrite_selector=a,s.reload_menus=!0),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(a)}),l.action=s.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),s.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this,a=ctcAjax.ajaxurl;e.ajax({url:a,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"==t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jquery_err.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(){var t=this,c=[],n=[];e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var n=e(this).prop("src");t.is_empty(n)||!n.match(/jquery(\.min|\.js|\-?ui)/i)||n.match(/load\-scripts.php/)||c.push("<code><small>"+n.split(/\?/)[0]+"</small></code>")}),n.push("<strong>"+t.getxt("js")+"</strong> "+t.getxt("contact")),1==ctcAjax.is_debug&&n.push(t.jquery_err.join("<br/>")),c.length&&n.push(t.getxt("jquery")+"<br/>"+c.join("<br/>")),n.push(t.getxt("plugin")),t.set_notice({error:n})},update:{qsid:function(t){var c,n,i,a=this;a.current_qsid=t.key,a.current_qsdata=t.data,e("#ctc_sel_ovrd_qsid").val(a.current_qsid),a.is_empty(a.current_qsdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+a.current_qsid,i=parseInt(a.current_qsdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),a.is_empty(a.current_qsdata.value)?(e("#ctc_sel_ovrd_rule_inputs").empty(),e("#ctc_sel_ovrd_rule_header").hide()):(n="",e.each(a.current_qsdata.value,function(e){n+=a.input_row(a.current_qsid,e,"ovrd",a.current_qsdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){a.setup_iris(this)}),a.coalesce_inputs("#ctc_child_all_0_swatch"),e("#ctc_sel_ovrd_rule_header").show()),a.jquery_err.length?a.jquery_notice():(a.reload_menus&&(a.set_query(a.current_qsdata.query),a.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(a.current_qsdata.selector),e(".ctc-rewrite-toggle").text(a.getxt("rename")),e("#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show())},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var a=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+a.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c=this,n="";c.is_empty(t.data)||e.each(t.data,function(i,a){page_rule=i,e.each(a,function(a,r){n+='<h4 class="ctc-query-heading">'+a+"</h4>\n",c.is_empty(r)||e.each(r,function(e,a){n+=c.input_row(e,i,t.key,a)})})}),selector="#ctc_selector_"+rule+"_"+t.key+"_rows",e(selector).html(n).find(".color-picker").each(function(){c.setup_iris(this)}),e(selector).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)}),c.jquery_err.length&&c.jquery_notice()},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)}},init:function(){var t=this;if(t.autogen_slugs(),t.set_existing(),!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>");return e("#ctc_theme_option_"+c.value).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.is_empty(t.jquery_err)?(e("#ctc_main").on("focus",".color-picker",function(){try{e(".color-picker").not(this).iris("hide"),e(this).iris("toggle"),e(".iris-picker").css({position:"absolute","z-index":10})}catch(c){t.jquery_exception(c,"Iris Color Picker")}}),e("#ctc_main").on("change",".ctc-child-value, input[type=checkbox]",function(){t.coalesce_inputs(this)}),e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n=e(this).attr("id").toString().replace("_close",""),i=n.toString().match(/_([^_]+)_(\d+)$/);e("#"+n+"_container").is(":hidden")&&(t.is_empty(i[1])||t.is_empty(i[2])||(rule=i[1],valid=i[2],t.query_css("val_qry",valid,{rule:rule}))),e("#"+n+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+n+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button]",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.save(this))}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"==c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e(".ctc-section-toggle").on("click",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .update-nag").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){return c.preventDefault(),$this=e("#ctc_save_query_selector"),$this.hasClass("ajax-pending")?!1:($this.addClass("ajax-pending"),t.save($this),!1)}),e("#ctc_theme_child, #ctc_theme_child-button, #ctc_child_type_existing").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!0),e("#ctc_child_type_new").prop("checked",!1),e("#ctc_child_template").val(""),t.set_existing()}),e("#ctc_duplicate_theme").on("click",function(){e("#ctc_duplicate_theme").is(":checked")?(e("#ctc_child_name").val(t.testname),e("#ctc_duplicate_theme_slug").val(t.testslug)):t.set_existing()}),e("#ctc_child_type_new, #ctc_child_template").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!1),e("#ctc_duplicate_theme").prop("checked",!1),e("#ctc_duplicate_theme_slug").val(""),e("#ctc_child_type_new").prop("checked",!0),e("#input_row_duplicate_theme").hide(),e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug)}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),t.set_addl_css(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),setTimeout(t.fade_update_notice,2e4)):t.jquery_notice()},testslug:"",testname:"",reload_menus:!1,current_query:"base",current_qsid:null,current_qsdata:{},jquery_err:[]}}(jQuery),jQuery(document).ready(function(e){e.chldthmcfg.init()});
lang/chld_thm_cfg.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Child Theme Configurator 1.7.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2015-03-25 19:56:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,7 +12,7 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #. #-#-#-#-# chld_thm_cfg.pot (Child Theme Configurator 1.7.3) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
  #: child-theme-configurator.php:78 child-theme-configurator.php:88
18
  #: includes/forms/main.php:23
@@ -28,194 +28,194 @@ msgstr ""
28
  msgid "Child Theme Configurator requires WordPress version %s or later."
29
  msgstr ""
30
 
31
- #: includes/class-ctc-ui.php:51
32
  msgid "A stylesheet link tag is hard-coded into the header template."
33
  msgstr ""
34
 
35
- #: includes/class-ctc-ui.php:52
36
  msgid "<code>wp_enqueue_style()</code> called from the header template."
37
  msgstr ""
38
 
39
- #: includes/class-ctc-ui.php:54
40
  msgid ""
41
  "Code exists between the <code>wp_head()</code> function and the closing "
42
  "<code>&lt;/head&gt;</code> tag."
43
  msgstr ""
44
 
45
- #: includes/class-ctc-ui.php:160
46
  msgid "Child Theme files modified successfully."
47
  msgstr ""
48
 
49
- #: includes/class-ctc-ui.php:163
50
  msgid ""
51
  "Child Theme <strong>%s</strong> has been generated successfully.\n"
52
  " "
53
  msgstr ""
54
 
55
- #: includes/class-ctc-ui.php:166
56
  msgid "IMPORTANT:"
57
  msgstr ""
58
 
59
- #: includes/class-ctc-ui.php:168 includes/forms/themepreview.php:20
60
  msgid "Go to Themes"
61
  msgstr ""
62
 
63
- #: includes/class-ctc-ui.php:168
64
  msgid "Network enable"
65
  msgstr ""
66
 
67
- #: includes/class-ctc-ui.php:168
68
  msgid "your child theme."
69
  msgstr ""
70
 
71
- #: includes/class-ctc-ui.php:170 includes/forms/themepreview.php:18
72
  msgid "Live Preview"
73
  msgstr ""
74
 
75
- #: includes/class-ctc-ui.php:170
76
  msgid "Test your child theme"
77
  msgstr ""
78
 
79
- #: includes/class-ctc-ui.php:170
80
  msgid "before activating."
81
  msgstr ""
82
 
83
- #: includes/class-ctc.php:144
84
  msgid "URL/None"
85
  msgstr ""
86
 
87
- #: includes/class-ctc.php:145
88
  msgid "Origin"
89
  msgstr ""
90
 
91
- #: includes/class-ctc.php:146
92
  msgid "Color 1"
93
  msgstr ""
94
 
95
- #: includes/class-ctc.php:147
96
  msgid "Color 2"
97
  msgstr ""
98
 
99
- #: includes/class-ctc.php:148
100
  msgid "Width/None"
101
  msgstr ""
102
 
103
- #: includes/class-ctc.php:149
104
  msgid "Style"
105
  msgstr ""
106
 
107
- #: includes/class-ctc.php:150
108
  msgid "Color"
109
  msgstr ""
110
 
111
- #: includes/class-ctc.php:152
112
  msgid "Are you sure? This will replace your current settings."
113
  msgstr ""
114
 
115
- #: includes/class-ctc.php:153
116
  msgid "<span style=\"font-size:10px\">!</span>"
117
  msgstr ""
118
 
119
- #: includes/class-ctc.php:154 includes/forms/rule-value.php:32
120
  msgid "Selectors"
121
  msgstr ""
122
 
123
- #: includes/class-ctc.php:155
124
  msgid "Close"
125
  msgstr ""
126
 
127
- #: includes/class-ctc.php:156
128
  msgid "Edit"
129
  msgstr ""
130
 
131
- #: includes/class-ctc.php:157
132
  msgid "Cancel"
133
  msgstr ""
134
 
135
- #: includes/class-ctc.php:158
136
  msgid "Rename"
137
  msgstr ""
138
 
139
- #: includes/class-ctc.php:159
140
  msgid "The stylesheet cannot be displayed."
141
  msgstr ""
142
 
143
- #: includes/class-ctc.php:160
144
  msgid "(Child Only)"
145
  msgstr ""
146
 
147
- #: includes/class-ctc.php:161
148
  msgid "Please enter a valid Child Theme."
149
  msgstr ""
150
 
151
- #: includes/class-ctc.php:162
152
  msgid "Please enter a valid Child Theme name."
153
  msgstr ""
154
 
155
- #: includes/class-ctc.php:163
156
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
157
  msgstr ""
158
 
159
- #: includes/class-ctc.php:164
160
  msgid "The page could not be loaded correctly."
161
  msgstr ""
162
 
163
- #: includes/class-ctc.php:166
164
  msgid ""
165
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
166
  msgstr ""
167
 
168
- #: includes/class-ctc.php:168
169
  msgid "Deactivating or replacing plugins may resolve this issue."
170
  msgstr ""
171
 
172
- #: includes/class-ctc.php:169
173
  msgid "%sWhy am I seeing this?%s"
174
  msgstr ""
175
 
176
- #: includes/class-ctc.php:388
177
  msgid "Zip file creation failed."
178
  msgstr ""
179
 
180
- #: includes/class-ctc.php:424
181
  msgid "The Functions file is required and cannot be deleted."
182
  msgstr ""
183
 
184
- #: includes/class-ctc.php:505
185
  msgid "You do not have permission to configure child themes."
186
  msgstr ""
187
 
188
- #: includes/class-ctc.php:552
189
  msgid "%s does not exist. Please select a valid Parent Theme."
190
  msgstr ""
191
 
192
- #: includes/class-ctc.php:556
193
  msgid "Please select a valid Parent Theme."
194
  msgstr ""
195
 
196
- #: includes/class-ctc.php:559
197
  msgid "Please enter a valid Child Theme directory."
198
  msgstr ""
199
 
200
- #: includes/class-ctc.php:567
201
  msgid "Please enter a valid Child Theme template name."
202
  msgstr ""
203
 
204
- #: includes/class-ctc.php:572
205
  msgid ""
206
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
207
  "name."
208
  msgstr ""
209
 
210
- #: includes/class-ctc.php:578
211
  msgid "Your theme directories are not writable."
212
  msgstr ""
213
 
214
- #: includes/class-ctc.php:652
215
  msgid "Your stylesheet is not writable."
216
  msgstr ""
217
 
218
- #: includes/class-ctc.php:946
219
  msgid ""
220
  "A closing PHP tag was detected in Child theme functions file so \"Parent "
221
  "Stylesheet Handling\" option was not configured. Closing PHP at the end of "
@@ -224,47 +224,47 @@ msgid ""
224
  "click \"Generate/Rebuild Child Theme Files\" again."
225
  msgstr ""
226
 
227
- #: includes/class-ctc.php:1039
228
  msgid "Could not delete file."
229
  msgstr ""
230
 
231
- #: includes/class-ctc.php:1115
232
  msgid "Could not set write permissions."
233
  msgstr ""
234
 
235
- #: includes/class-ctc.php:1189
236
  msgid "There were errors while resetting permissions."
237
  msgstr ""
238
 
239
- #: includes/class-ctc.php:1231
240
  msgid "Could not upload file."
241
  msgstr ""
242
 
243
- #: includes/class-ctc.php:1314
244
  msgid ""
245
- "Child Theme Configurator is unable to write to the stylesheet. This can be "
246
- "resolved using one of the following options:<ol>"
247
  msgstr ""
248
 
249
- #: includes/class-ctc.php:1317
250
  msgid ""
251
- "<li>Temporarily make the stylesheet writable by clicking the button below. "
252
- "You should change this back when you are finished editing for security by "
253
- "clicking \"Make read-only\" under the \"Files\" tab.</li>"
254
  msgstr ""
255
 
256
- #: includes/class-ctc.php:1320
257
- msgid "Temporarily make stylesheet writable"
258
  msgstr ""
259
 
260
- #: includes/class-ctc.php:1321
261
  msgid ""
262
  "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
263
  "config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
264
  "your FTP/SSH credentials to the WordPress config file</a>.</li>"
265
  msgstr ""
266
 
267
- #: includes/class-ctc.php:1323
268
  msgid ""
269
  "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
270
  "cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
@@ -272,19 +272,18 @@ msgid ""
272
  "li>"
273
  msgstr ""
274
 
275
- #: includes/class-ctc.php:1324
276
  msgid ""
277
  "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
278
- "Changing_File_Permissions\" title=\"Changing File Permissions\">Set the "
279
- "stylesheet write permissions on the server manually</a> (not recommended).</"
280
- "li>"
281
  msgstr ""
282
 
283
- #: includes/class-ctc.php:1326
284
  msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
285
  msgstr ""
286
 
287
- #: includes/class-ctc.php:1336
288
  msgid ""
289
  "This Child Theme is not owned by your website account. It may have been "
290
  "created by a prior version of this plugin or by another program. Moving "
@@ -293,25 +292,25 @@ msgid ""
293
  "below."
294
  msgstr ""
295
 
296
- #: includes/class-ctc.php:1339
297
  msgid "Correct Child Theme Permissions"
298
  msgstr ""
299
 
300
- #: includes/class-ctc.php:1346
301
  msgid ""
302
  "Child Theme Configurator needs to update its interal data. Please set your "
303
  "preferences below and click \"Generate Child Theme Files\" to update your "
304
  "configuration."
305
  msgstr ""
306
 
307
- #: includes/class-ctc.php:1352
308
  msgid ""
309
  "<strong>However, some styles could not be parsed due to memory limits.</"
310
  "strong> Try deselecting \"Additional Stylesheets\" below and click "
311
  "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
312
  msgstr ""
313
 
314
- #: includes/class-ctc.php:1361
315
  msgid ""
316
  "Child Theme Configurator did not detect any configuration data because a "
317
  "previously configured Child Theme has been removed. Please set your "
@@ -322,7 +321,7 @@ msgstr ""
322
  msgid "Parse additional stylesheets:"
323
  msgstr ""
324
 
325
- #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:239
326
  msgid ""
327
  "Stylesheets that are currently being loaded by the parent theme are "
328
  "automatically selected below (except for Bootstrap stylesheets which add a "
@@ -427,13 +426,13 @@ msgid "Return to recently edited selectors from a toggleable sidebar."
427
  msgstr ""
428
 
429
  #: includes/forms/addl_panels.php:28
430
- msgid "Free Upgrades"
431
  msgstr ""
432
 
433
  #: includes/forms/addl_panels.php:29
434
  msgid ""
435
- "Your Update Key gives you access to new Pro features as soon as they are "
436
- "released."
437
  msgstr ""
438
 
439
  #: includes/forms/addl_panels.php:30
@@ -449,18 +448,14 @@ msgid "Tutorial Videos"
449
  msgstr ""
450
 
451
  #: includes/forms/addl_panels.php:34
452
- msgid "For a limited time save over 15% off Child Theme Configurator Pro."
453
- msgstr ""
454
-
455
- #: includes/forms/addl_panels.php:35
456
  msgid "Upgrade Now"
457
  msgstr ""
458
 
459
- #: includes/forms/addl_panels.php:35
460
- msgid "Buy Now - Only $14.95 USD*"
461
  msgstr ""
462
 
463
- #: includes/forms/addl_panels.php:35
464
  msgid "*Prices subject to change."
465
  msgstr ""
466
 
@@ -472,7 +467,7 @@ msgstr ""
472
  msgid "Backup"
473
  msgstr ""
474
 
475
- #: includes/forms/backups.php:10 includes/forms/parent-child.php:222
476
  msgid "Restore backup from"
477
  msgstr ""
478
 
@@ -621,7 +616,7 @@ msgid "Use Existing Child Theme"
621
  msgstr ""
622
 
623
  #: includes/forms/parent-child.php:48
624
- msgid "Theme Slug"
625
  msgstr ""
626
 
627
  #: includes/forms/parent-child.php:59
@@ -664,58 +659,75 @@ msgstr ""
664
  msgid "Version"
665
  msgstr ""
666
 
667
- #: includes/forms/parent-child.php:110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  msgid "Stylesheet handling"
669
  msgstr ""
670
 
671
- #: includes/forms/parent-child.php:111
672
  msgid "(click to view options)"
673
  msgstr ""
674
 
675
- #: includes/forms/parent-child.php:113
676
  msgid ""
677
  "This theme may not apply child theme styles correctly with the current "
678
  "settings:"
679
  msgstr ""
680
 
681
- #: includes/forms/parent-child.php:115
682
  msgid "Don't show again."
683
  msgstr ""
684
 
685
- #: includes/forms/parent-child.php:115
686
  msgid "View options"
687
  msgstr ""
688
 
689
- #: includes/forms/parent-child.php:118
690
  msgid "Which option should I use?"
691
  msgstr ""
692
 
693
- #: includes/forms/parent-child.php:123
694
  msgid "None (handled by theme)"
695
  msgstr ""
696
 
697
- #: includes/forms/parent-child.php:127
698
  msgid ""
699
  "Select this option if all stylesheets are correctly enqueued for child "
700
  "themes. If you find that styles are not being applied correctly, use a "
701
  "different option."
702
  msgstr ""
703
 
704
- #: includes/forms/parent-child.php:134
705
  msgid "Enqueue parent stylesheet (default)"
706
  msgstr ""
707
 
708
- #: includes/forms/parent-child.php:137
709
  msgid ""
710
  "Select this option if the theme enqueues the active stylesheet but has no "
711
  "special handling for child themes. Start with this option if unsure."
712
  msgstr ""
713
 
714
- #: includes/forms/parent-child.php:144
715
  msgid "Enqueue child stylesheet"
716
  msgstr ""
717
 
718
- #: includes/forms/parent-child.php:147
719
  msgid ""
720
  "Select this option if the theme enqueues the parent stylesheet but does not "
721
  "enqueue the child stylesheet at all. This can happen if "
@@ -723,71 +735,67 @@ msgid ""
723
  "used to link the stylesheet."
724
  msgstr ""
725
 
726
- #: includes/forms/parent-child.php:150
727
  msgid "Recommended for this theme:"
728
  msgstr ""
729
 
730
- #: includes/forms/parent-child.php:156
731
  msgid "Enqueue both parent and child stylesheets"
732
  msgstr ""
733
 
734
- #: includes/forms/parent-child.php:159
735
  msgid ""
736
  "Select this option if stylesheet link tags are hard-coded into the header "
737
  "template (common in older themes). This enables the child stylesheet to "
738
  "override the parent stylesheet without using <code>@import</code>."
739
  msgstr ""
740
 
741
- #: includes/forms/parent-child.php:166
742
  msgid "<code>@import</code> parent stylesheet"
743
  msgstr ""
744
 
745
- #: includes/forms/parent-child.php:169
746
  msgid ""
747
  "This option imports the parent stylesheet from the child stylesheet. This "
748
  "enables the child stylesheet to override the parent stylesheet, but using "
749
  "<code>@import</code> is no longer recommended."
750
  msgstr ""
751
 
752
- #: includes/forms/parent-child.php:174
753
- msgid "Copy Parent Theme Menus, Widgets and other Options"
754
  msgstr ""
755
 
756
- #: includes/forms/parent-child.php:181 includes/forms/parent-child.php:196
757
- msgid "NOTE:"
758
- msgstr ""
759
-
760
- #: includes/forms/parent-child.php:183
761
  msgid "This will overwrite child theme options you may have already set."
762
  msgstr ""
763
 
764
- #: includes/forms/parent-child.php:189
765
  msgid "Backup current stylesheet"
766
  msgstr ""
767
 
768
- #: includes/forms/parent-child.php:198
769
  msgid ""
770
  "This creates a copy of the current stylesheet before applying changes. You "
771
  "can remove old backup files using the Files tab."
772
  msgstr ""
773
 
774
- #: includes/forms/parent-child.php:203
775
  msgid "Reset/Restore from backup"
776
  msgstr ""
777
 
778
- #: includes/forms/parent-child.php:209
779
  msgid "Leave unchanged"
780
  msgstr ""
781
 
782
- #: includes/forms/parent-child.php:215
783
  msgid "Reset all"
784
  msgstr ""
785
 
786
- #: includes/forms/parent-child.php:235
787
  msgid "Parse additional stylesheets"
788
  msgstr ""
789
 
790
- #: includes/forms/parent-child.php:258
791
  msgid "Generate/Rebuild Child Theme Files"
792
  msgstr ""
793
 
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 1.7.4\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2015-04-11 16:59:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #. #-#-#-#-# child-theme-configurator.pot (Child Theme Configurator 1.7.4) #-#-#-#-#
16
  #. Plugin Name of the plugin/theme
17
  #: child-theme-configurator.php:78 child-theme-configurator.php:88
18
  #: includes/forms/main.php:23
28
  msgid "Child Theme Configurator requires WordPress version %s or later."
29
  msgstr ""
30
 
31
+ #: includes/class-ctc-ui.php:52
32
  msgid "A stylesheet link tag is hard-coded into the header template."
33
  msgstr ""
34
 
35
+ #: includes/class-ctc-ui.php:53
36
  msgid "<code>wp_enqueue_style()</code> called from the header template."
37
  msgstr ""
38
 
39
+ #: includes/class-ctc-ui.php:55
40
  msgid ""
41
  "Code exists between the <code>wp_head()</code> function and the closing "
42
  "<code>&lt;/head&gt;</code> tag."
43
  msgstr ""
44
 
45
+ #: includes/class-ctc-ui.php:162
46
  msgid "Child Theme files modified successfully."
47
  msgstr ""
48
 
49
+ #: includes/class-ctc-ui.php:165
50
  msgid ""
51
  "Child Theme <strong>%s</strong> has been generated successfully.\n"
52
  " "
53
  msgstr ""
54
 
55
+ #: includes/class-ctc-ui.php:168
56
  msgid "IMPORTANT:"
57
  msgstr ""
58
 
59
+ #: includes/class-ctc-ui.php:170 includes/forms/themepreview.php:20
60
  msgid "Go to Themes"
61
  msgstr ""
62
 
63
+ #: includes/class-ctc-ui.php:170
64
  msgid "Network enable"
65
  msgstr ""
66
 
67
+ #: includes/class-ctc-ui.php:170
68
  msgid "your child theme."
69
  msgstr ""
70
 
71
+ #: includes/class-ctc-ui.php:172 includes/forms/themepreview.php:18
72
  msgid "Live Preview"
73
  msgstr ""
74
 
75
+ #: includes/class-ctc-ui.php:172
76
  msgid "Test your child theme"
77
  msgstr ""
78
 
79
+ #: includes/class-ctc-ui.php:172
80
  msgid "before activating."
81
  msgstr ""
82
 
83
+ #: includes/class-ctc.php:143
84
  msgid "URL/None"
85
  msgstr ""
86
 
87
+ #: includes/class-ctc.php:144
88
  msgid "Origin"
89
  msgstr ""
90
 
91
+ #: includes/class-ctc.php:145
92
  msgid "Color 1"
93
  msgstr ""
94
 
95
+ #: includes/class-ctc.php:146
96
  msgid "Color 2"
97
  msgstr ""
98
 
99
+ #: includes/class-ctc.php:147
100
  msgid "Width/None"
101
  msgstr ""
102
 
103
+ #: includes/class-ctc.php:148
104
  msgid "Style"
105
  msgstr ""
106
 
107
+ #: includes/class-ctc.php:149
108
  msgid "Color"
109
  msgstr ""
110
 
111
+ #: includes/class-ctc.php:151
112
  msgid "Are you sure? This will replace your current settings."
113
  msgstr ""
114
 
115
+ #: includes/class-ctc.php:152
116
  msgid "<span style=\"font-size:10px\">!</span>"
117
  msgstr ""
118
 
119
+ #: includes/class-ctc.php:153 includes/forms/rule-value.php:32
120
  msgid "Selectors"
121
  msgstr ""
122
 
123
+ #: includes/class-ctc.php:154
124
  msgid "Close"
125
  msgstr ""
126
 
127
+ #: includes/class-ctc.php:155
128
  msgid "Edit"
129
  msgstr ""
130
 
131
+ #: includes/class-ctc.php:156
132
  msgid "Cancel"
133
  msgstr ""
134
 
135
+ #: includes/class-ctc.php:157
136
  msgid "Rename"
137
  msgstr ""
138
 
139
+ #: includes/class-ctc.php:158
140
  msgid "The stylesheet cannot be displayed."
141
  msgstr ""
142
 
143
+ #: includes/class-ctc.php:159
144
  msgid "(Child Only)"
145
  msgstr ""
146
 
147
+ #: includes/class-ctc.php:160
148
  msgid "Please enter a valid Child Theme."
149
  msgstr ""
150
 
151
+ #: includes/class-ctc.php:161
152
  msgid "Please enter a valid Child Theme name."
153
  msgstr ""
154
 
155
+ #: includes/class-ctc.php:162
156
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
157
  msgstr ""
158
 
159
+ #: includes/class-ctc.php:163
160
  msgid "The page could not be loaded correctly."
161
  msgstr ""
162
 
163
+ #: includes/class-ctc.php:165
164
  msgid ""
165
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
166
  msgstr ""
167
 
168
+ #: includes/class-ctc.php:167
169
  msgid "Deactivating or replacing plugins may resolve this issue."
170
  msgstr ""
171
 
172
+ #: includes/class-ctc.php:168
173
  msgid "%sWhy am I seeing this?%s"
174
  msgstr ""
175
 
176
+ #: includes/class-ctc.php:391
177
  msgid "Zip file creation failed."
178
  msgstr ""
179
 
180
+ #: includes/class-ctc.php:427
181
  msgid "The Functions file is required and cannot be deleted."
182
  msgstr ""
183
 
184
+ #: includes/class-ctc.php:509
185
  msgid "You do not have permission to configure child themes."
186
  msgstr ""
187
 
188
+ #: includes/class-ctc.php:556
189
  msgid "%s does not exist. Please select a valid Parent Theme."
190
  msgstr ""
191
 
192
+ #: includes/class-ctc.php:560
193
  msgid "Please select a valid Parent Theme."
194
  msgstr ""
195
 
196
+ #: includes/class-ctc.php:563
197
  msgid "Please enter a valid Child Theme directory."
198
  msgstr ""
199
 
200
+ #: includes/class-ctc.php:571 includes/class-ctc.php:586
201
  msgid "Please enter a valid Child Theme template name."
202
  msgstr ""
203
 
204
+ #: includes/class-ctc.php:576 includes/class-ctc.php:590
205
  msgid ""
206
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
207
  "name."
208
  msgstr ""
209
 
210
+ #: includes/class-ctc.php:603
211
  msgid "Your theme directories are not writable."
212
  msgstr ""
213
 
214
+ #: includes/class-ctc.php:679
215
  msgid "Your stylesheet is not writable."
216
  msgstr ""
217
 
218
+ #: includes/class-ctc.php:948
219
  msgid ""
220
  "A closing PHP tag was detected in Child theme functions file so \"Parent "
221
  "Stylesheet Handling\" option was not configured. Closing PHP at the end of "
224
  "click \"Generate/Rebuild Child Theme Files\" again."
225
  msgstr ""
226
 
227
+ #: includes/class-ctc.php:1048
228
  msgid "Could not delete file."
229
  msgstr ""
230
 
231
+ #: includes/class-ctc.php:1124
232
  msgid "Could not set write permissions."
233
  msgstr ""
234
 
235
+ #: includes/class-ctc.php:1223
236
  msgid "There were errors while resetting permissions."
237
  msgstr ""
238
 
239
+ #: includes/class-ctc.php:1265
240
  msgid "Could not upload file."
241
  msgstr ""
242
 
243
+ #: includes/class-ctc.php:1348
244
  msgid ""
245
+ "The child theme is in read-only mode and Child Theme Configurator cannot "
246
+ "apply changes. Click to see options"
247
  msgstr ""
248
 
249
+ #: includes/class-ctc.php:1351
250
  msgid ""
251
+ "<li>Temporarily set write permissions by clicking the button below. When you "
252
+ "are finished editing, revert to read-only by clicking \"Make read-only\" "
253
+ "under the \"Files\" tab.</li>"
254
  msgstr ""
255
 
256
+ #: includes/class-ctc.php:1354
257
+ msgid "Make files writable"
258
  msgstr ""
259
 
260
+ #: includes/class-ctc.php:1355
261
  msgid ""
262
  "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
263
  "config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
264
  "your FTP/SSH credentials to the WordPress config file</a>.</li>"
265
  msgstr ""
266
 
267
+ #: includes/class-ctc.php:1357
268
  msgid ""
269
  "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
270
  "cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
272
  "li>"
273
  msgstr ""
274
 
275
+ #: includes/class-ctc.php:1358
276
  msgid ""
277
  "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
278
+ "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
279
+ "permissions on the server manually</a> (not recommended).</li>"
 
280
  msgstr ""
281
 
282
+ #: includes/class-ctc.php:1360
283
  msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
284
  msgstr ""
285
 
286
+ #: includes/class-ctc.php:1371
287
  msgid ""
288
  "This Child Theme is not owned by your website account. It may have been "
289
  "created by a prior version of this plugin or by another program. Moving "
292
  "below."
293
  msgstr ""
294
 
295
+ #: includes/class-ctc.php:1374
296
  msgid "Correct Child Theme Permissions"
297
  msgstr ""
298
 
299
+ #: includes/class-ctc.php:1381
300
  msgid ""
301
  "Child Theme Configurator needs to update its interal data. Please set your "
302
  "preferences below and click \"Generate Child Theme Files\" to update your "
303
  "configuration."
304
  msgstr ""
305
 
306
+ #: includes/class-ctc.php:1387
307
  msgid ""
308
  "<strong>However, some styles could not be parsed due to memory limits.</"
309
  "strong> Try deselecting \"Additional Stylesheets\" below and click "
310
  "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
311
  msgstr ""
312
 
313
+ #: includes/class-ctc.php:1396
314
  msgid ""
315
  "Child Theme Configurator did not detect any configuration data because a "
316
  "previously configured Child Theme has been removed. Please set your "
321
  msgid "Parse additional stylesheets:"
322
  msgstr ""
323
 
324
+ #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:256
325
  msgid ""
326
  "Stylesheets that are currently being loaded by the parent theme are "
327
  "automatically selected below (except for Bootstrap stylesheets which add a "
426
  msgstr ""
427
 
428
  #: includes/forms/addl_panels.php:28
429
+ msgid "Genesis Framework Support"
430
  msgstr ""
431
 
432
  #: includes/forms/addl_panels.php:29
433
  msgid ""
434
+ "Automatically detects and configures Genesis Child Themes with more "
435
+ "frameworks on the way."
436
  msgstr ""
437
 
438
  #: includes/forms/addl_panels.php:30
448
  msgstr ""
449
 
450
  #: includes/forms/addl_panels.php:34
 
 
 
 
451
  msgid "Upgrade Now"
452
  msgstr ""
453
 
454
+ #: includes/forms/addl_panels.php:34
455
+ msgid "Buy Now - Only $17.95 USD*"
456
  msgstr ""
457
 
458
+ #: includes/forms/addl_panels.php:34
459
  msgid "*Prices subject to change."
460
  msgstr ""
461
 
467
  msgid "Backup"
468
  msgstr ""
469
 
470
+ #: includes/forms/backups.php:10 includes/forms/parent-child.php:239
471
  msgid "Restore backup from"
472
  msgstr ""
473
 
616
  msgstr ""
617
 
618
  #: includes/forms/parent-child.php:48
619
+ msgid "New Child Theme Slug"
620
  msgstr ""
621
 
622
  #: includes/forms/parent-child.php:59
659
  msgid "Version"
660
  msgstr ""
661
 
662
+ #: includes/forms/parent-child.php:109
663
+ msgid "Duplicate Existing Child Theme"
664
+ msgstr ""
665
+
666
+ #: includes/forms/parent-child.php:115
667
+ msgid "Duplicate Theme Slug"
668
+ msgstr ""
669
+
670
+ #: includes/forms/parent-child.php:118 includes/forms/parent-child.php:198
671
+ #: includes/forms/parent-child.php:213
672
+ msgid "NOTE:"
673
+ msgstr ""
674
+
675
+ #: includes/forms/parent-child.php:120
676
+ msgid "This will copy all child theme files and apply changes to new version."
677
+ msgstr ""
678
+
679
+ #: includes/forms/parent-child.php:127
680
  msgid "Stylesheet handling"
681
  msgstr ""
682
 
683
+ #: includes/forms/parent-child.php:128
684
  msgid "(click to view options)"
685
  msgstr ""
686
 
687
+ #: includes/forms/parent-child.php:130
688
  msgid ""
689
  "This theme may not apply child theme styles correctly with the current "
690
  "settings:"
691
  msgstr ""
692
 
693
+ #: includes/forms/parent-child.php:132
694
  msgid "Don't show again."
695
  msgstr ""
696
 
697
+ #: includes/forms/parent-child.php:132
698
  msgid "View options"
699
  msgstr ""
700
 
701
+ #: includes/forms/parent-child.php:135
702
  msgid "Which option should I use?"
703
  msgstr ""
704
 
705
+ #: includes/forms/parent-child.php:140
706
  msgid "None (handled by theme)"
707
  msgstr ""
708
 
709
+ #: includes/forms/parent-child.php:144
710
  msgid ""
711
  "Select this option if all stylesheets are correctly enqueued for child "
712
  "themes. If you find that styles are not being applied correctly, use a "
713
  "different option."
714
  msgstr ""
715
 
716
+ #: includes/forms/parent-child.php:151
717
  msgid "Enqueue parent stylesheet (default)"
718
  msgstr ""
719
 
720
+ #: includes/forms/parent-child.php:154
721
  msgid ""
722
  "Select this option if the theme enqueues the active stylesheet but has no "
723
  "special handling for child themes. Start with this option if unsure."
724
  msgstr ""
725
 
726
+ #: includes/forms/parent-child.php:161
727
  msgid "Enqueue child stylesheet"
728
  msgstr ""
729
 
730
+ #: includes/forms/parent-child.php:164
731
  msgid ""
732
  "Select this option if the theme enqueues the parent stylesheet but does not "
733
  "enqueue the child stylesheet at all. This can happen if "
735
  "used to link the stylesheet."
736
  msgstr ""
737
 
738
+ #: includes/forms/parent-child.php:167
739
  msgid "Recommended for this theme:"
740
  msgstr ""
741
 
742
+ #: includes/forms/parent-child.php:173
743
  msgid "Enqueue both parent and child stylesheets"
744
  msgstr ""
745
 
746
+ #: includes/forms/parent-child.php:176
747
  msgid ""
748
  "Select this option if stylesheet link tags are hard-coded into the header "
749
  "template (common in older themes). This enables the child stylesheet to "
750
  "override the parent stylesheet without using <code>@import</code>."
751
  msgstr ""
752
 
753
+ #: includes/forms/parent-child.php:183
754
  msgid "<code>@import</code> parent stylesheet"
755
  msgstr ""
756
 
757
+ #: includes/forms/parent-child.php:186
758
  msgid ""
759
  "This option imports the parent stylesheet from the child stylesheet. This "
760
  "enables the child stylesheet to override the parent stylesheet, but using "
761
  "<code>@import</code> is no longer recommended."
762
  msgstr ""
763
 
764
+ #: includes/forms/parent-child.php:191
765
+ msgid "Copy Parent Theme Menus, Widgets and other Customizer Options"
766
  msgstr ""
767
 
768
+ #: includes/forms/parent-child.php:200
 
 
 
 
769
  msgid "This will overwrite child theme options you may have already set."
770
  msgstr ""
771
 
772
+ #: includes/forms/parent-child.php:206
773
  msgid "Backup current stylesheet"
774
  msgstr ""
775
 
776
+ #: includes/forms/parent-child.php:215
777
  msgid ""
778
  "This creates a copy of the current stylesheet before applying changes. You "
779
  "can remove old backup files using the Files tab."
780
  msgstr ""
781
 
782
+ #: includes/forms/parent-child.php:220
783
  msgid "Reset/Restore from backup"
784
  msgstr ""
785
 
786
+ #: includes/forms/parent-child.php:226
787
  msgid "Leave unchanged"
788
  msgstr ""
789
 
790
+ #: includes/forms/parent-child.php:232
791
  msgid "Reset all"
792
  msgstr ""
793
 
794
+ #: includes/forms/parent-child.php:252
795
  msgid "Parse additional stylesheets"
796
  msgstr ""
797
 
798
+ #: includes/forms/parent-child.php:275
799
  msgid "Generate/Rebuild Child Theme Files"
800
  msgstr ""
801
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: child theme, child themes, customize theme, CSS, responsive, css editor, child theme generator, child theme creator, stylesheet, customizer
5
  Requires at least: 3.9
6
  Tested up to: 4.1.1
7
- Stable tag: 1.7.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -269,6 +269,12 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
269
  7. Files tab
270
 
271
  == Changelog ==
 
 
 
 
 
 
272
  = 1.7.3 =
273
  * 1.7.3.1 added dismiss option to warnings by popular demand.
274
  * Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.
4
  Tags: child theme, child themes, customize theme, CSS, responsive, css editor, child theme generator, child theme creator, stylesheet, customizer
5
  Requires at least: 3.9
6
  Tested up to: 4.1.1
7
+ Stable tag: 1.7.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
269
  7. Files tab
270
 
271
  == Changelog ==
272
+ = 1.7.4 =
273
+ * Restored multisite admin menu link under Tools by popular demand
274
+ * Automatically Network enables new child theme on creation
275
+ * Fix for FTP notice - now uses PHP_OS constant to detect win vs nix
276
+ * Added duplicate child theme feature
277
+
278
  = 1.7.3 =
279
  * 1.7.3.1 added dismiss option to warnings by popular demand.
280
  * Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.