Child Theme Configurator - Version 1.4.0

Version Description

  • New Feature: Theme Files tab:
  • Copy parent templates to child theme to be edited using the Theme Editor.
  • Remove child theme templates.
  • Upload child theme images.
  • Remove child theme images.
  • Upload child theme screenshot.
Download this release

Release Info

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

Code changes from version 1.3.4 to 1.4.0

child-theme-configurator.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Create a Child Theme from any installed Theme. Each CSS selector, rule and value can then be searched, previewed and modified.
9
- Version: 1.3.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -16,7 +16,7 @@ if ( !defined('ABSPATH')) exit;
16
  */
17
 
18
  defined('LF') or define('LF', "\n");
19
- define('CHLD_THM_CFG_VERSION', '1.3.4');
20
  define('CHLD_THM_CFG_MAX_SELECTORS', '5000');
21
  define('CHLD_THM_CFG_MAX_RECURSE_LOOPS', '100');
22
 
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Create a Child Theme from any installed Theme. Each CSS selector, rule and value can then be searched, previewed and modified.
9
+ Version: 1.4.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
16
  */
17
 
18
  defined('LF') or define('LF', "\n");
19
+ define('CHLD_THM_CFG_VERSION', '1.4.0');
20
  define('CHLD_THM_CFG_MAX_SELECTORS', '5000');
21
  define('CHLD_THM_CFG_MAX_RECURSE_LOOPS', '100');
22
 
css/chld-thm-cfg.css CHANGED
@@ -201,3 +201,6 @@
201
  .ie7 .clearfix {
202
  zoom: 1;
203
  }
 
 
 
201
  .ie7 .clearfix {
202
  zoom: 1;
203
  }
204
+ .smaller {
205
+ font-size: .85em;
206
+ }
includes/class-ctc-css.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Class: Child_Theme_Configurator_CSS
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Handles all CSS output, parsing, normalization
9
- Version: 1.3.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -44,7 +44,7 @@ class Child_Theme_Configurator_CSS {
44
 
45
  function __construct() {
46
  // scalars
47
- $this->version = '1.3.4';
48
  $this->querykey = 0;
49
  $this->selkey = 0;
50
  $this->qskey = 0;
@@ -261,9 +261,14 @@ class Child_Theme_Configurator_CSS {
261
  }
262
 
263
  function recurse_directory($rootdir, $ext = 'css') {
 
264
  $files = array();
265
  $dirs = array($rootdir);
266
  $loops = 0;
 
 
 
 
267
  while(count($dirs) && $loops < CHLD_THM_CFG_MAX_RECURSE_LOOPS):
268
  $loops++;
269
  $dir = array_shift($dirs);
@@ -1036,8 +1041,9 @@ class Child_Theme_Configurator_CSS {
1036
  // remove any ../ manipulations
1037
  $stylesheet = preg_replace("%\.\./%", '/', $stylesheet);
1038
  if ('read' == $permission && !is_file($stylesheet)) return false;
 
1039
  // sanity check for php files
1040
- if (preg_match('%php$%', $stylesheet)) return false;
1041
  // check if in themes dir;
1042
  if (preg_match('%^' . preg_quote(get_theme_root()) . '%', $stylesheet)) return $stylesheet;
1043
  // check if in plugins dir
6
  Class: Child_Theme_Configurator_CSS
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Handles all CSS output, parsing, normalization
9
+ Version: 1.4.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
44
 
45
  function __construct() {
46
  // scalars
47
+ $this->version = '1.4.0';
48
  $this->querykey = 0;
49
  $this->selkey = 0;
50
  $this->qskey = 0;
261
  }
262
 
263
  function recurse_directory($rootdir, $ext = 'css') {
264
+ if (!$this->is_file_ok($rootdir, 'search')) return array(); // make sure we are only recursing theme and plugin files
265
  $files = array();
266
  $dirs = array($rootdir);
267
  $loops = 0;
268
+ if ('img' == $ext):
269
+ global $chld_thm_cfg;
270
+ $ext = '(' . implode('|', $chld_thm_cfg->image_formats) . ')';
271
+ endif;
272
  while(count($dirs) && $loops < CHLD_THM_CFG_MAX_RECURSE_LOOPS):
273
  $loops++;
274
  $dir = array_shift($dirs);
1041
  // remove any ../ manipulations
1042
  $stylesheet = preg_replace("%\.\./%", '/', $stylesheet);
1043
  if ('read' == $permission && !is_file($stylesheet)) return false;
1044
+ if ('search' == $permission && !is_dir($stylesheet)) return false;
1045
  // sanity check for php files
1046
+ //if (!preg_match('%' . preg_quote($ext) . '$%', $stylesheet)) return false;
1047
  // check if in themes dir;
1048
  if (preg_match('%^' . preg_quote(get_theme_root()) . '%', $stylesheet)) return $stylesheet;
1049
  // check if in plugins dir
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.lilaeamedia.com/plugins/child-theme-configurator/
7
  Description: Handles the plugin User Interface
8
- Version: 1.3.4
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -33,10 +33,11 @@ class Child_Theme_Configurator_UI {
33
  $hidechild = (count($themes['child']) ? '' : 'style="display:none"');
34
  $imports = $css->get_prop('imports');
35
  $id = 0;
36
- ?>
37
 
38
  <div class="wrap">
39
- <div id="icon-tools" class="icon32"></div><?php echo $this->extLink; ?>
 
40
  <h2><?php echo $chld_thm_cfg->pluginName; ?></h2>
41
  <div id="ctc_error_notice">
42
  <?php $this->settings_errors(); ?>
@@ -44,35 +45,44 @@ class Child_Theme_Configurator_UI {
44
  <?php
45
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'parent_child_options';
46
  ?>
47
- <h2 class="nav-tab-wrapper"> <a id="parent_child_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=parent_child_options"
48
  class="nav-tab<?php echo 'parent_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
49
  <?php _e('Parent/Child', 'chld_thm_cfg'); ?>
50
- </a> <a id="query_selector_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=query_selector_options"
51
  class="nav-tab<?php echo 'query_selector_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
52
  <?php _e('Query/Selector', 'chld_thm_cfg'); ?>
53
- </a> <a id="rule_value_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=rule_value_options"
54
  class="nav-tab<?php echo 'rule_value_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
55
  <?php _e('Rule/Value', 'chld_thm_cfg'); ?>
56
- </a> <a id="import_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=import_options"
57
  class="nav-tab<?php echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
58
  <?php _e('@import', 'chld_thm_cfg'); ?>
59
- </a> <a id="view_child_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=view_child_options"
60
  class="nav-tab<?php echo 'view_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
61
- <?php _e('View Child CSS', 'chld_thm_cfg'); ?>
62
- </a> <a id="view_parnt_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=view_parnt_options"
63
  class="nav-tab<?php echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
64
- <?php _e('View Parent CSS', 'chld_thm_cfg'); ?>
65
- </a><?php do_action('chld_thm_cfg_tabs', $chld_thm_cfg, $active_tab, $hidechild);?> <i id="ctc_status_preview"></i></h2>
 
 
 
 
 
 
 
 
 
 
 
66
  <div class="ctc-option-panel-container">
67
  <div id="parent_child_options_panel" class="ctc-option-panel<?php echo 'parent_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>">
68
  <form id="ctc_load_form" method="post" action="">
69
  <?php wp_nonce_field( 'ctc_update' ); ?>
70
  <div class="ctc-input-row clearfix" id="input_row_parnt">
71
- <div class="ctc-input-cell">
72
- <label>
73
- <?php _e('Parent Theme', 'chld_thm_cfg'); ?>
74
- </label>
75
- </div>
76
  <div class="ctc-input-cell">
77
  <select class="ctc-select" id="ctc_theme_parnt" name="ctc_theme_parnt">
78
  <?php echo $chld_thm_cfg->render_menu('parnt', $parent); ?>
@@ -80,11 +90,9 @@ class Child_Theme_Configurator_UI {
80
  </div>
81
  </div>
82
  <div class="ctc-input-row clearfix" id="input_row_child">
83
- <div class="ctc-input-cell">
84
- <label>
85
- <?php _e('Child Theme', 'chld_thm_cfg'); ?>
86
- </label>
87
- </div>
88
  <div class="ctc-input-cell">
89
  <input class="ctc-radio" id="ctc_child_type_new" name="ctc_child_type" type="radio" value="new"
90
  <?php echo (!empty($hidechild) ? 'checked' : ''); ?>
@@ -102,9 +110,7 @@ class Child_Theme_Configurator_UI {
102
  <?php _e('Use Existing Child Theme', 'chld_thm_cfg'); ?>
103
  </label>
104
  </div>
105
- <div class="ctc-input-cell" style="clear:both">
106
- <label>&nbsp;</label>
107
- </div>
108
  <div class="ctc-input-cell" >
109
  <input class="ctc_text" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e('Theme Slug', 'chld_thm_cfg'); ?>" autocomplete="off"/>
110
  </div>
@@ -115,11 +121,9 @@ class Child_Theme_Configurator_UI {
115
  </div>
116
  </div>
117
  <div class="ctc-input-row clearfix" id="input_row_child_name">
118
- <div class="ctc-input-cell">
119
- <label>
120
- <?php _e('Child Theme Name', 'chld_thm_cfg'); ?>
121
- </label>
122
- </div>
123
  <div class="ctc-input-cell">
124
  <input class="ctc_text" id="ctc_child_name" name="ctc_child_name" type="text"
125
  value="<?php echo esc_attr($css->get_prop('child_name')); ?>" placeholder="<?php _e('Theme Name', 'chld_thm_cfg'); ?>" autocomplete="off" />
@@ -127,53 +131,43 @@ class Child_Theme_Configurator_UI {
127
  </div>
128
  <?php if ('' == $hidechild) do_action('chld_thm_cfg_controls', $chld_thm_cfg); ?>
129
  <div class="ctc-input-row clearfix" id="input_row_child_template">
130
- <div class="ctc-input-cell">
131
- <label>
132
- <?php _e('Author', 'chld_thm_cfg'); ?>
133
- </label>
134
- </div>
135
  <div class="ctc-input-cell">
136
  <input class="ctc_text" id="ctc_child_author" name="ctc_child_author" type="text"
137
  value="<?php echo esc_attr($css->get_prop('author')); ?>" placeholder="<?php _e('Author', 'chld_thm_cfg'); ?>" autocomplete="off" />
138
  </div>
139
  </div>
140
  <div class="ctc-input-row clearfix" id="input_row_child_template">
141
- <div class="ctc-input-cell">
142
- <label>
143
- <?php _e('Version', 'chld_thm_cfg'); ?>
144
- </label>
145
- </div>
146
  <div class="ctc-input-cell">
147
  <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
148
  value="<?php echo esc_attr($css->get_prop('version')); ?>" placeholder="<?php _e('Version', 'chld_thm_cfg'); ?>" autocomplete="off" />
149
  </div>
150
  </div>
151
  <div class="ctc-input-row clearfix" id="input_row_child_template">
152
- <div class="ctc-input-cell">
153
- <label>
154
- <?php _e('Backup Stylesheet', 'chld_thm_cfg'); ?>
155
- </label>
156
- </div>
157
  <div class="ctc-input-cell">
158
  <input class="ctc_checkbox" id="ctc_backup" name="ctc_backup" type="checkbox"
159
  value="1" />
160
  </div>
161
  </div>
162
  <div class="ctc-input-row clearfix" id="input_row_child_template">
163
- <div class="ctc-input-cell">
164
- <label>
165
- <?php _e('Scan Parent Theme<br/>for Additional Stylesheets', 'chld_thm_cfg'); ?>
166
- </label>
167
- </div>
168
  <div class="ctc-input-cell">
169
  <input class="ctc_checkbox" id="ctc_scan_subdirs" name="ctc_scan_subdirs" type="checkbox"
170
  value="1" />
171
  </div>
172
  </div>
173
  <div class="ctc-input-row clearfix" id="input_row_child_template">
174
- <div class="ctc-input-cell">
175
- <label>&nbsp;</label>
176
- </div>
177
  <div class="ctc-input-cell">
178
  <input class="ctc_submit button button-primary" id="ctc_load_styles" name="ctc_load_styles" type="submit"
179
  value="<?php _e('Generate Child Theme Files', 'chld_thm_cfg'); ?>" disabled />
@@ -249,7 +243,7 @@ class Child_Theme_Configurator_UI {
249
  <div id="ctc_status_sel_val"></div>
250
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
251
  <input type="button" class="button button-primary ctc-save-input" id="ctc_save_query_selector"
252
- name="ctc_save_query_selector" value="Save" disabled />
253
  <input type="hidden" id="ctc_sel_ovrd_qsid"
254
  name="ctc_sel_ovrd_qsid" value="" />
255
  </div>
@@ -289,7 +283,7 @@ class Child_Theme_Configurator_UI {
289
  </strong>
290
  <div class="ctc-textarea-button-cell" id="ctc_save_query_selector_cell">
291
  <input type="button" class="button ctc-save-input" id="ctc_save_new_selectors"
292
- name="ctc_save_new_selectors" value="Save" disabled />
293
  </div>
294
  </div>
295
  <div class="ctc-input-cell-wide">
@@ -308,7 +302,7 @@ class Child_Theme_Configurator_UI {
308
  </strong>
309
  <div class="ctc-textarea-button-cell" id="ctc_save_imports_cell">
310
  <input type="button" class="button ctc-save-input" id="ctc_save_imports"
311
- name="ctc_save_imports" value="Save" disabled />
312
  </div>
313
  </div>
314
  <div class="ctc-input-cell-wide">
@@ -326,7 +320,59 @@ class Child_Theme_Configurator_UI {
326
  class="ctc-option-panel<?php echo 'view_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
327
  <div id="view_parnt_options_panel"
328
  class="ctc-option-panel<?php echo 'view_parnt_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
329
- <?php do_action('chld_thm_cfg_panels', $chld_thm_cfg, $active_tab, $hidechild); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  </div>
331
  </div>
332
  <style type="text/css">
@@ -352,6 +398,125 @@ class Child_Theme_Configurator_UI {
352
  <?php
353
  }
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  function settings_errors() {
356
  global $chld_thm_cfg;
357
  if (count($chld_thm_cfg->errors)):
@@ -361,11 +526,14 @@ class Child_Theme_Configurator_UI {
361
  endforeach;
362
  echo '</ul></div>' . LF;
363
  elseif (isset($_GET['updated'])):
364
- echo '<div class="updated"><p>' . LF
365
- . apply_filters('chld_thm_cfg_update_msg', sprintf(__('Child Theme <strong>%s</strong> has been generated successfully.', 'chld_thm_cfg'),
 
 
 
366
  $chld_thm_cfg->css->get_prop('child_name')), $chld_thm_cfg) . LF
367
  . '</p>';
368
-
369
  if ( 9 == $_GET['updated']) echo '<p>' . __('Please verify the imports below and remove any imports that are not needed by the front end, such as admin or configuration stylesheets.', 'chld_thm_cfg') . '</p>' . LF;
370
  echo '</div>' . LF;
371
  endif;
@@ -459,11 +627,28 @@ class Child_Theme_Configurator_UI {
459
  ),
460
  ) );
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  $screen->add_help_tab( array(
463
  'id' => 'ctc_preview',
464
  'title' => __( 'Preview and Activate', 'chld_thm_cfg' ),
465
  'content' => __( '
466
- <p>Click the View Child or Parent CSS tab to reference the stylesheet code. To preview the stylesheet as a WordPress theme follow these steps:</p>
467
  <ol><li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
468
  <li>Click "Live Preview" below the new Child Theme to see it in action.</li>
469
  <li>When you are ready to take the Child Theme live, click "Activate."</li></ol>
@@ -480,6 +665,12 @@ class Child_Theme_Configurator_UI {
480
  <h5 id="doesnt_work">Why doesn’t this work with my (insert theme vendor here) theme?</h5>
481
  <p>Some themes (particularly commercial themes) do not adhere to the Theme Development guidelines set forth by WordPress.org, and do not automatically load child theme stylesheets or php files. This is unfortunate, because it effectively prohibits the webmaster from adding any customizations (other than those made through the admin theme options) that will survive past an upgrade.</p>
482
  <p>Contact the vendor directly to ask for this core functionality. It is our opinion that ALL themes (especially commercial ones) must pass the Theme Unit Tests outlined by WordPress.org.</p>
 
 
 
 
 
 
483
  <h5 id="menus-broken">Why are my menus displaying incorrectly when I activate the new child theme?</h5>
484
  <p>The child theme creates a new instance in the WordPress options data and the menus have to be assigned. Go to Appearance &gt; Menus and assign locations to each of the menus for the new Child Theme.</p>
485
  <h5 "preview-not-loading">Why do the preview tabs return "Stylesheet could not be displayed"?</h5>
@@ -504,8 +695,8 @@ class Child_Theme_Configurator_UI {
504
  <h5 id="web_fonts">How do I add Web Fonts?</h5>
505
  <p>The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the @import tab. The fonts will then be available to use as a value of the <strong>font-family</strong> rule. Be sure you understand the license for any embedded fonts.</p>
506
  <p>You can also create a secondary stylesheet that contains @font-face rules and import it using the @import tab. <strong>Note:</strong> Currently the Child Theme Configurator does not generate previews of imported web fonts, but will in a later release.</p>
507
- <h5 id="functions_file">Where is the functions.php file?</h5>
508
- <p>You can add your own functions.php file, and any other files and directories you need for your Child Theme. The Child Theme Configurator helps you identify and override the Parent stylesheet without touching the other files.</p>
509
  ', 'chld_thm_cfg'
510
  ),
511
  ) );
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
7
  Description: Handles the plugin User Interface
8
+ Version: 1.4.0
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
33
  $hidechild = (count($themes['child']) ? '' : 'style="display:none"');
34
  $imports = $css->get_prop('imports');
35
  $id = 0;
36
+ add_thickbox(); ?>
37
 
38
  <div class="wrap">
39
+ <div id="icon-tools" class="icon32"></div>
40
+ <?php echo $this->extLink; ?>
41
  <h2><?php echo $chld_thm_cfg->pluginName; ?></h2>
42
  <div id="ctc_error_notice">
43
  <?php $this->settings_errors(); ?>
45
  <?php
46
  $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'parent_child_options';
47
  ?>
48
+ <h2 class="nav-tab-wrapper"><a id="parent_child_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=parent_child_options"
49
  class="nav-tab<?php echo 'parent_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
50
  <?php _e('Parent/Child', 'chld_thm_cfg'); ?>
51
+ </a><!----><a id="query_selector_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=query_selector_options"
52
  class="nav-tab<?php echo 'query_selector_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
53
  <?php _e('Query/Selector', 'chld_thm_cfg'); ?>
54
+ </a><!----><a id="rule_value_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=rule_value_options"
55
  class="nav-tab<?php echo 'rule_value_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
56
  <?php _e('Rule/Value', 'chld_thm_cfg'); ?>
57
+ </a><!----><a id="import_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=import_options"
58
  class="nav-tab<?php echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
59
  <?php _e('@import', 'chld_thm_cfg'); ?>
60
+ </a><!----><a id="view_child_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=view_child_options"
61
  class="nav-tab<?php echo 'view_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
62
+ <?php _e('Child CSS', 'chld_thm_cfg'); ?>
63
+ </a><!----><a id="view_parnt_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=view_parnt_options"
64
  class="nav-tab<?php echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
65
+ <?php _e('Parent CSS', 'chld_thm_cfg'); ?>
66
+ </a>
67
+ <?php
68
+ if ('' == $hidechild && (empty($configtype) || 'theme' == $configtype)):
69
+ ?>
70
+ <a id="file_options" href="?page=<?php echo $chld_thm_cfg->menuName; ?>&amp;tab=file_options"
71
+ class="nav-tab<?php echo 'file_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
72
+ <?php _e('Files', 'chld_thm_cfg'); ?>
73
+ </a>
74
+ <?php
75
+ endif;
76
+ do_action('chld_thm_cfg_tabs', $chld_thm_cfg, $active_tab, $hidechild);?>
77
+ <i id="ctc_status_preview"></i></h2>
78
  <div class="ctc-option-panel-container">
79
  <div id="parent_child_options_panel" class="ctc-option-panel<?php echo 'parent_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>">
80
  <form id="ctc_load_form" method="post" action="">
81
  <?php wp_nonce_field( 'ctc_update' ); ?>
82
  <div class="ctc-input-row clearfix" id="input_row_parnt">
83
+ <div class="ctc-input-cell"> <strong>
84
+ <?php _e('Parent Theme', 'chld_thm_cfg'); ?>
85
+ </strong> </div>
 
 
86
  <div class="ctc-input-cell">
87
  <select class="ctc-select" id="ctc_theme_parnt" name="ctc_theme_parnt">
88
  <?php echo $chld_thm_cfg->render_menu('parnt', $parent); ?>
90
  </div>
91
  </div>
92
  <div class="ctc-input-row clearfix" id="input_row_child">
93
+ <div class="ctc-input-cell"> <strong>
94
+ <?php _e('Child Theme', 'chld_thm_cfg'); ?>
95
+ </strong> </div>
 
 
96
  <div class="ctc-input-cell">
97
  <input class="ctc-radio" id="ctc_child_type_new" name="ctc_child_type" type="radio" value="new"
98
  <?php echo (!empty($hidechild) ? 'checked' : ''); ?>
110
  <?php _e('Use Existing Child Theme', 'chld_thm_cfg'); ?>
111
  </label>
112
  </div>
113
+ <div class="ctc-input-cell" style="clear:both"> <strong>&nbsp;</strong> </div>
 
 
114
  <div class="ctc-input-cell" >
115
  <input class="ctc_text" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e('Theme Slug', 'chld_thm_cfg'); ?>" autocomplete="off"/>
116
  </div>
121
  </div>
122
  </div>
123
  <div class="ctc-input-row clearfix" id="input_row_child_name">
124
+ <div class="ctc-input-cell"> <strong>
125
+ <?php _e('Child Theme Name', 'chld_thm_cfg'); ?>
126
+ </strong> </div>
 
 
127
  <div class="ctc-input-cell">
128
  <input class="ctc_text" id="ctc_child_name" name="ctc_child_name" type="text"
129
  value="<?php echo esc_attr($css->get_prop('child_name')); ?>" placeholder="<?php _e('Theme Name', 'chld_thm_cfg'); ?>" autocomplete="off" />
131
  </div>
132
  <?php if ('' == $hidechild) do_action('chld_thm_cfg_controls', $chld_thm_cfg); ?>
133
  <div class="ctc-input-row clearfix" id="input_row_child_template">
134
+ <div class="ctc-input-cell"> <strong>
135
+ <?php _e('Author', 'chld_thm_cfg'); ?>
136
+ </strong> </div>
 
 
137
  <div class="ctc-input-cell">
138
  <input class="ctc_text" id="ctc_child_author" name="ctc_child_author" type="text"
139
  value="<?php echo esc_attr($css->get_prop('author')); ?>" placeholder="<?php _e('Author', 'chld_thm_cfg'); ?>" autocomplete="off" />
140
  </div>
141
  </div>
142
  <div class="ctc-input-row clearfix" id="input_row_child_template">
143
+ <div class="ctc-input-cell"> <strong>
144
+ <?php _e('Version', 'chld_thm_cfg'); ?>
145
+ </strong> </div>
 
 
146
  <div class="ctc-input-cell">
147
  <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
148
  value="<?php echo esc_attr($css->get_prop('version')); ?>" placeholder="<?php _e('Version', 'chld_thm_cfg'); ?>" autocomplete="off" />
149
  </div>
150
  </div>
151
  <div class="ctc-input-row clearfix" id="input_row_child_template">
152
+ <div class="ctc-input-cell"> <strong>
153
+ <?php _e('Backup Stylesheet', 'chld_thm_cfg'); ?>
154
+ </strong> </div>
 
 
155
  <div class="ctc-input-cell">
156
  <input class="ctc_checkbox" id="ctc_backup" name="ctc_backup" type="checkbox"
157
  value="1" />
158
  </div>
159
  </div>
160
  <div class="ctc-input-row clearfix" id="input_row_child_template">
161
+ <div class="ctc-input-cell"> <strong>
162
+ <?php _e('Scan Parent Theme<br/>for Additional Stylesheets', 'chld_thm_cfg'); ?>
163
+ </strong> </div>
 
 
164
  <div class="ctc-input-cell">
165
  <input class="ctc_checkbox" id="ctc_scan_subdirs" name="ctc_scan_subdirs" type="checkbox"
166
  value="1" />
167
  </div>
168
  </div>
169
  <div class="ctc-input-row clearfix" id="input_row_child_template">
170
+ <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
 
 
171
  <div class="ctc-input-cell">
172
  <input class="ctc_submit button button-primary" id="ctc_load_styles" name="ctc_load_styles" type="submit"
173
  value="<?php _e('Generate Child Theme Files', 'chld_thm_cfg'); ?>" disabled />
243
  <div id="ctc_status_sel_val"></div>
244
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
245
  <input type="button" class="button button-primary ctc-save-input" id="ctc_save_query_selector"
246
+ name="ctc_save_query_selector" value="<?php _e('Save', 'chld_thm_cfg'); ?>" disabled />
247
  <input type="hidden" id="ctc_sel_ovrd_qsid"
248
  name="ctc_sel_ovrd_qsid" value="" />
249
  </div>
283
  </strong>
284
  <div class="ctc-textarea-button-cell" id="ctc_save_query_selector_cell">
285
  <input type="button" class="button ctc-save-input" id="ctc_save_new_selectors"
286
+ name="ctc_save_new_selectors" value="<?php _e('Save', 'chld_thm_cfg'); ?>" disabled />
287
  </div>
288
  </div>
289
  <div class="ctc-input-cell-wide">
302
  </strong>
303
  <div class="ctc-textarea-button-cell" id="ctc_save_imports_cell">
304
  <input type="button" class="button ctc-save-input" id="ctc_save_imports"
305
+ name="ctc_save_imports" value="<?php _e('Save', 'chld_thm_cfg'); ?>" disabled />
306
  </div>
307
  </div>
308
  <div class="ctc-input-cell-wide">
320
  class="ctc-option-panel<?php echo 'view_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
321
  <div id="view_parnt_options_panel"
322
  class="ctc-option-panel<?php echo 'view_parnt_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
323
+ <?php if ('' == $hidechild && (empty($configtype) || 'theme' == $configtype)): ?>
324
+ <div id="file_options_panel"
325
+ class="ctc-option-panel<?php echo 'file_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>>
326
+ <?php $this->render_file_form('parnt'); ?>
327
+ <?php $this->render_file_form('child'); ?>
328
+ <?php $this->render_image_form(); ?>
329
+ <div class="ctc-input-row clearfix" id="input_row_theme_image">
330
+ <form id="ctc_<?php echo $template; ?>_theme_image_form" method="post" action="" enctype="multipart/form-data">
331
+ <?php wp_nonce_field( 'ctc_update' ); ?>
332
+ <div class="ctc-input-cell"> <strong>
333
+ <?php _e('Upload New Child Theme Image', 'chld_thm_cfg'); ?>
334
+ </strong>
335
+ <p class="howto">
336
+ <?php _e('Theme images reside under the <code>images</code> directory in your child theme and are meant for stylesheet use only. Use the media gallery for content images.', 'chld_thm_cfg'); ?>
337
+ </p>
338
+ </div>
339
+ <div class="ctc-input-cell-wide">
340
+ <input type="file" id="ctc_theme_image" name="ctc_theme_image" value="" />
341
+ <input class="ctc_submit button button-primary" id="ctc_theme_image_submit"
342
+ name="ctc_theme_image_submit" type="submit"
343
+ value="<?php _e('Upload', 'chld_thm_cfg'); ?>" />
344
+ </div>
345
+ </form>
346
+ </div>
347
+ <?php if ($screenshot = $this->get_theme_screenshot()): ?>
348
+ <div class="ctc-input-row clearfix" id="input_row_screenshot_view">
349
+ <div class="ctc-input-cell"> <strong>
350
+ <?php _e('Child Theme Screenshot', 'chld_thm_cfg'); ?>
351
+ </strong> </div>
352
+ <div class="ctc-input-cell-wide"> <a href="<?php echo $screenshot; ?>" class="thickbox"><img src="<?php echo $screenshot; ?>" height="150" width="200" style="max-height:150px;max-width:200px;width:auto;height:auto" /></a> </div>
353
+ </div>
354
+ <?php endif; ?>
355
+ <div class="ctc-input-row clearfix" id="input_row_screenshot">
356
+ <form id="ctc_screenshot_form" method="post" action="" enctype="multipart/form-data">
357
+ <?php wp_nonce_field( 'ctc_update' ); ?>
358
+ <div class="ctc-input-cell"> <strong>
359
+ <?php _e('Upload New Screenshot', 'chld_thm_cfg'); ?>
360
+ </strong>
361
+ <p class="howto">
362
+ <?php _e('The theme screenshot should be a 4:3 ratio (eg., 880px x 660px) JPG, PNG or GIF. It will be renamed <code>screenshot</code>.', 'chld_thm_cfg'); ?>
363
+ </p>
364
+ </div>
365
+ <div class="ctc-input-cell-wide">
366
+ <input type="file" id="ctc_theme_screenshot" name="ctc_theme_screenshot" value="" />
367
+ <input class="ctc_submit button button-primary" id="ctc_theme_screenshot_submit"
368
+ name="ctc_theme_screenshot_submit" type="submit"
369
+ value="<?php _e('Upload', 'chld_thm_cfg'); ?>" />
370
+ </div>
371
+ </form>
372
+ </div>
373
+ </div>
374
+ <?php endif; ?>
375
+ <?php do_action('chld_thm_cfg_panels', $chld_thm_cfg, $active_tab, $hidechild); ?>
376
  </div>
377
  </div>
378
  <style type="text/css">
398
  <?php
399
  }
400
 
401
+ function render_file_form($template = 'parnt') {
402
+ global $chld_thm_cfg;
403
+ if ($theme = $chld_thm_cfg->css->get_prop($template)):
404
+ $themeroot = get_theme_root() . '/' . $theme;
405
+ $files = $chld_thm_cfg->css->recurse_directory($themeroot, 'php');
406
+ $counter = 0;
407
+ sort($files);
408
+ ob_start();
409
+ foreach ($files as $file):
410
+ $templatefile = preg_replace('%(^' . preg_quote($themeroot) . '\/|\.php$)%', '', $file);
411
+ if (preg_match('%^(inc|core|lang|css|js)%',$templatefile) || 'functions' == basename($templatefile)) continue; ?>
412
+ <label class="ctc-input-cell smaller">
413
+ <input class="ctc_checkbox" id="ctc_file_<?php echo $template . '_' . ++$counter; ?>"
414
+ name="ctc_file_<?php echo $template; ?>[]" type="checkbox"
415
+ value="<?php echo $templatefile; ?>" />
416
+ <?php echo $templatefile; ?></label>
417
+ <?php
418
+ endforeach;
419
+ $inputs = ob_get_contents();
420
+ ob_end_clean();
421
+ if ($counter): ?>
422
+ <div class="ctc-input-row clearfix" id="input_row_<?php echo $template; ?>_templates">
423
+ <form id="ctc_<?php echo $template; ?>_templates_form" method="post">
424
+ <?php wp_nonce_field( 'ctc_update' ); ?>
425
+ <div class="ctc-input-cell"> <strong>
426
+ <?php _e(('parnt' == $template ? 'Parent' : 'Child') . ' Templates', 'chld_thm_cfg'); ?>
427
+ </strong>
428
+ <p class="howto">
429
+ <?php if ('parnt' == $template):
430
+ _e('Copy PHP template files from the parent theme by selecting them here.', 'chld_thm_cfg');?>
431
+ </p>
432
+ <p><strong>
433
+ <?php _e('CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied.', 'chld_thm_cfg');?>
434
+ </strong></p>
435
+ <p class="howto">
436
+ <?php _e('The <code>functions.php</code> file is generated separately and cannot be copied here.', 'chld_thm_cfg');
437
+ else:
438
+ $linktext = __('Click here to edit template files using the Theme Editor', 'chld_thm_cfg');
439
+ $editorlink = 'theme-editor.php?file=functions.php&theme=' . $theme;
440
+ ?>
441
+ <a href="<?php echo admin_url($editorlink); ?>" title="<?php echo $linktext; ?>"><?php echo $linktext; ?></a></p>
442
+ <p class="howto">
443
+ <?php _e('Remove child theme templates by selecting them here.', 'chld_thm_cfg');
444
+ endif; ?>
445
+ </p>
446
+ </div>
447
+ <div class="ctc-input-cell-wide"> <?php echo $inputs; ?> </div>
448
+ <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
449
+ <div class="ctc-input-cell-wide" style="margin-top:10px;margin-bottom:10px">
450
+ <input class="ctc_submit button button-primary" id="ctc_<?php echo $template; ?>_templates_submit"
451
+ name="ctc_<?php echo $template; ?>_templates_submit" type="submit"
452
+ value="<?php echo ('parnt' == $template ? __('Copy Selected to Child Theme', 'chld_thm_cfg') : __('Remove Selected from Child Theme', 'chld_thm_cfg')); ?>" />
453
+ </div>
454
+ </form>
455
+ </div>
456
+ <?php
457
+ endif;
458
+ endif;
459
+ }
460
+
461
+ function render_image_form() {
462
+ global $chld_thm_cfg;
463
+ if ($theme = $chld_thm_cfg->css->get_prop('child')):
464
+ $themeroot = get_theme_root() . '/' . $theme . '/images';
465
+ $themeuri = get_theme_root_uri() . '/' . $theme . '/images/';
466
+ $files = $chld_thm_cfg->css->recurse_directory($themeroot, 'img');
467
+ $counter = 0;
468
+ sort($files);
469
+ ob_start();
470
+ foreach ($files as $file):
471
+ $templatefile = preg_replace('%^' . preg_quote($themeroot) . '/%', '', $file); ?>
472
+ <div class="ctc-input-cell" style="height:100px">
473
+ <label class="smaller">
474
+ <input class="ctc_checkbox" id="ctc_img_<?php echo ++$counter; ?>"
475
+ name="ctc_img[]" type="checkbox"
476
+ value="<?php echo $templatefile; ?>" />
477
+ <?php echo $templatefile; ?></label>
478
+ <br/>
479
+ <a href="<?php echo $themeuri . $templatefile . '?' . time(); ?>" class="thickbox"><img src="<?php echo $themeuri . $templatefile . '?' . time(); ?>" height="72" width="72" style="max-height:72px;max-width:100%;width:auto;height:auto" /></a></div>
480
+ <?php
481
+ endforeach;
482
+ $inputs = ob_get_contents();
483
+ ob_end_clean();
484
+ if ($counter): ?>
485
+ <div class="ctc-input-row clearfix" id="input_row_images">
486
+ <form id="ctc_image_form" method="post" action="">
487
+ <?php wp_nonce_field( 'ctc_update' ); ?>
488
+ <div class="ctc-input-cell"> <strong>
489
+ <?php _e('Child Theme Images', 'chld_thm_cfg'); ?>
490
+ </strong>
491
+ <p class="howto">
492
+ <?php _e('Remove child theme images by selecting them here.', 'chld_thm_cfg');?>
493
+ </p>
494
+ </div>
495
+ <div class="ctc-input-cell-wide"> <?php echo $inputs; ?> </div>
496
+ <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
497
+ <div class="ctc-input-cell-wide" style="margin-top:10px;margin-bottom:10px">
498
+ <input class="ctc_submit button button-primary" id="ctc_image_submit"
499
+ name="ctc_image_submit" type="submit"
500
+ value="<?php _e('Remove Selected', 'chld_thm_cfg'); ?>" disabled />
501
+ </div>
502
+ </form>
503
+ </div>
504
+ <?php
505
+ endif;
506
+ endif;
507
+ }
508
+
509
+ function get_theme_screenshot() {
510
+ global $chld_thm_cfg;
511
+ foreach ($chld_thm_cfg->image_formats as $ext):
512
+ if ($screenshot = $chld_thm_cfg->css->is_file_ok($chld_thm_cfg->css->get_child_target('screenshot.' . $ext))):
513
+ $screenshot = preg_replace('%^' . preg_quote(get_theme_root()) . '%', get_theme_root_uri(), $screenshot);
514
+ return $screenshot . '?' . time();
515
+ endif;
516
+ endforeach;
517
+ return false;
518
+ }
519
+
520
  function settings_errors() {
521
  global $chld_thm_cfg;
522
  if (count($chld_thm_cfg->errors)):
526
  endforeach;
527
  echo '</ul></div>' . LF;
528
  elseif (isset($_GET['updated'])):
529
+ echo '<div class="updated">' . LF;
530
+ if ( 8 == $_GET['updated']):
531
+ echo '<p>' . __('Child Theme files modified successfully.', 'chld_thm_cfg') . '</p>' . LF;
532
+ else:
533
+ echo '<p>' . apply_filters('chld_thm_cfg_update_msg', sprintf(__('Child Theme <strong>%s</strong> has been generated successfully.', 'chld_thm_cfg'),
534
  $chld_thm_cfg->css->get_prop('child_name')), $chld_thm_cfg) . LF
535
  . '</p>';
536
+ endif;
537
  if ( 9 == $_GET['updated']) echo '<p>' . __('Please verify the imports below and remove any imports that are not needed by the front end, such as admin or configuration stylesheets.', 'chld_thm_cfg') . '</p>' . LF;
538
  echo '</div>' . LF;
539
  endif;
627
  ),
628
  ) );
629
 
630
+ $screen->add_help_tab( array(
631
+ 'id' => 'ctc_files',
632
+ 'title' => __( 'Files', 'chld_thm_cfg' ),
633
+ 'content' => __( '
634
+ <h5>Parent Templates</h5><p>Copy PHP template files from the parent theme by checking the boxes and clicking "Copy Selected to Child Theme" and the templates will be added to the child theme directory.</p>
635
+ <p><strong>CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied.</strong></p>
636
+ <p>The <code>functions.php</code> file is generated separately and cannot be copied here.</p>
637
+ <h5>Child Templates</h5><p>Templates copied from the parent are listed here. These can be edited using the Theme Editor in the Appearance Menu.</p>
638
+ <p>Remove child theme images by checking the boxes and clicking "Remove Selected from Child Theme."</p>
639
+ <h5>Child Theme Images</h5><p>Theme images reside under the <code>images</code> directory in your child theme and are meant for stylesheet use only. Use the media gallery for content images.</p>
640
+ <p>You can upload new images using the image upload form.</p>
641
+ <h5>Child Theme Screenshot</h5><p>You can upload a custom screenshot for the child theme here.</p>
642
+ <p>The theme screenshot should be a 4:3 ratio (eg., 880px x 660px) JPG, PNG or GIF. It will be renamed <code>screenshot</code>.</p>
643
+ ', 'chld_thm_cfg'
644
+ ),
645
+ ) );
646
+
647
  $screen->add_help_tab( array(
648
  'id' => 'ctc_preview',
649
  'title' => __( 'Preview and Activate', 'chld_thm_cfg' ),
650
  'content' => __( '
651
+ <p>Click the Child or Parent CSS tab to reference the stylesheet code. To preview the stylesheet as a WordPress theme follow these steps:</p>
652
  <ol><li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
653
  <li>Click "Live Preview" below the new Child Theme to see it in action.</li>
654
  <li>When you are ready to take the Child Theme live, click "Activate."</li></ol>
665
  <h5 id="doesnt_work">Why doesn’t this work with my (insert theme vendor here) theme?</h5>
666
  <p>Some themes (particularly commercial themes) do not adhere to the Theme Development guidelines set forth by WordPress.org, and do not automatically load child theme stylesheets or php files. This is unfortunate, because it effectively prohibits the webmaster from adding any customizations (other than those made through the admin theme options) that will survive past an upgrade.</p>
667
  <p>Contact the vendor directly to ask for this core functionality. It is our opinion that ALL themes (especially commercial ones) must pass the Theme Unit Tests outlined by WordPress.org.</p>
668
+ <h5>Can I edit the Child Theme stylesheet manually offline or by using the Editor or do I have to use the Configurator?</h5>
669
+ <p>You can make any manual changes you wish to the stylesheet. Just make sure you import the revised stylesheet using the Parent/Child panel or the Configurator will overwrite your changes the next time you use it. Just follow the steps as usual but select the "Use Existing Child Theme" radio button as the "Child Theme" option. The Configurator will automatically update its internal data from the new stylesheet.</p>
670
+ <h5>Why doesn\'t the Parent Theme have any styles when I "View Parent CSS"?</h5>
671
+ <p>Your Parent theme is probably using a non-standard location for the stylesheets. Check "Scan Parent Theme for additional stylesheets" on the Parent/Child tab and load the Child Theme again.</p>
672
+ <h5>Why is everything backwards?</h5>
673
+ <p>More than likely you selected "Scan Parent Theme for additional stylesheets" and your theme uses a "right-to-left" (rtl) stylesheet. Go to the @imports tab and remove the rtl stylesheet from the list of imported stylesheets.</p>
674
  <h5 id="menus-broken">Why are my menus displaying incorrectly when I activate the new child theme?</h5>
675
  <p>The child theme creates a new instance in the WordPress options data and the menus have to be assigned. Go to Appearance &gt; Menus and assign locations to each of the menus for the new Child Theme.</p>
676
  <h5 "preview-not-loading">Why do the preview tabs return "Stylesheet could not be displayed"?</h5>
695
  <h5 id="web_fonts">How do I add Web Fonts?</h5>
696
  <p>The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the @import tab. The fonts will then be available to use as a value of the <strong>font-family</strong> rule. Be sure you understand the license for any embedded fonts.</p>
697
  <p>You can also create a secondary stylesheet that contains @font-face rules and import it using the @import tab. <strong>Note:</strong> Currently the Child Theme Configurator does not generate previews of imported web fonts, but will in a later release.</p>
698
+ <h5 id="functions_file">Where are the PHP files?</h5>
699
+ <p>The configurator automatically adds a blank functions.php file to the child theme directory. Other parent theme files can be copied using the "Files" tab. Theme images and a custom screenshot can be uploaded there as well.</p>
700
  ', 'chld_thm_cfg'
701
  ),
702
  ) );
includes/class-ctc.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Main Controller Class
9
- Version: 1.3.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -32,6 +32,7 @@ class Child_Theme_Configurator {
32
  var $is_ajax;
33
  var $updated;
34
  var $image_formats;
 
35
  function __construct($file) {
36
  $this->dir = dirname( $file );
37
  $this->optionsName = 'chld_thm_cfg_options';
@@ -66,6 +67,7 @@ class Child_Theme_Configurator {
66
  if ($this->hook == $hook):
67
  wp_enqueue_style('chld-thm-cfg-admin', $this->pluginURL . 'css/chld-thm-cfg.css');
68
  wp_enqueue_script('iris');
 
69
  wp_enqueue_script('ctc-thm-cfg-ctcgrad', $this->pluginURL . 'js/ctcgrad.min.js', array('iris'), '1.0');
70
  wp_enqueue_script('chld-thm-cfg-admin', $this->pluginURL . 'js/chld-thm-cfg.min.js',
71
  array('jquery-ui-autocomplete'), '1.0', true);
@@ -189,6 +191,8 @@ class Child_Theme_Configurator {
189
  function load_config() {
190
  if (!($this->css = get_option($this->optionsName))
191
  || !is_object($this->css)
 
 
192
  // upgrade to v.1.1.1
193
  || !($version = $this->css->get_prop('version'))
194
  )
@@ -197,69 +201,104 @@ class Child_Theme_Configurator {
197
  }
198
 
199
  function write_config() {
200
- if (!isset($_POST['ctc_load_styles'])) return false;
 
 
 
 
 
201
  $this->errors = array();
202
- if (current_user_can('install_themes') && $this->validate_post()):
203
- foreach (array(
204
- 'ctc_theme_parnt',
205
- 'ctc_child_type',
206
- 'ctc_theme_child',
207
- 'ctc_child_name',
208
- 'ctc_configtype',
209
- 'ctc_child_template',
210
- 'ctc_child_author',
211
- 'ctc_child_version') as $postfield):
212
- $varparts = explode('_', $postfield);
213
- $varname = end($varparts);
214
- ${$varname} = empty($_POST[$postfield])?'':sanitize_text_field($_POST[$postfield]);
215
- endforeach;
216
- if ($parnt):
217
- if (! $this->check_theme_exists($parnt)):
218
- $this->errors[] = sprintf(__('%s does not exist. Please select a valid Parent Theme', 'chld_thm_cfg'), $parnt);
 
 
 
 
 
219
  endif;
220
- else:
221
- $this->errors[] = __('Please select a valid Parent Theme', 'chld_thm_cfg');
222
- endif;
223
- if ('new' == $type):
224
- $configtype = 'theme'; // no custom stylesheets until style.css exists!
225
- $child = strtolower(preg_replace("%[^\w\-]%", '', $template));
226
- if ($this->check_theme_exists($child)):
227
- $this->errors[] = sprintf(__('<strong>%s</strong> exists. Please enter a different Child Theme template name', 'chld_thm_cfg'), $child);
228
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  endif;
230
- if (empty($child)):
231
- $this->errors[] = __('Please enter a valid Child Theme template name', 'chld_thm_cfg');
232
- endif;
233
- if (empty($name)):
234
- $this->errors[] = __('Please enter a valid Child Theme name', 'chld_thm_cfg');
235
- endif;
236
- if (false === $this->verify_child_theme($child)):
237
- $this->errors[] = __('Your theme directories are not writable. Please adjust permissions and try again.', 'chld_thm_cfg');
238
  endif;
239
  else:
240
  $this->errors[] = __('You do not have permission to configure child themes.', 'chld_thm_cfg');
241
  endif;
242
- if (empty($this->errors)):
243
- $this->css = new Child_Theme_Configurator_CSS();
244
- $this->css->set_prop('parnt', $parnt);
245
- $this->css->set_prop('child', $child);
246
- $this->css->set_prop('child_name', $name);
247
- $this->css->set_prop('child_author', $author);
248
- $this->css->set_prop('child_version', $version);
249
- $this->css->set_prop('configtype', $configtype);
250
- do_action('chld_thm_cfg_addl_files', $this); // hook for add'l plugin files and subdirectories
251
- $this->css->parse_css_file('parnt');
252
- $this->css->parse_css_file('child');
253
- if (false === $this->css->write_css(isset($_POST['ctc_backup']))):
254
- $this->errors[] = __('Your stylesheet is not writable. Please adjust permissions and try again.', 'chld_thm_cfg');
255
- return false;
256
- endif;
257
- $this->css->reset_updates();
258
- update_option($this->optionsName, $this->css);
259
- do_action('chld_thm_cfg_addl_options', $this); // hook for add'l plugin options
260
- $msg = isset($_POST['ctc_scan_subdirs']) ? '9&tab=import_options' : 1;
261
- $this->update_redirect($msg);
262
- endif;
263
  //$this->errors[] = sprintf(__('Child Theme %s was unchanged.', 'chld_thm_cfg'), $name, $this->optionsName);
264
  }
265
 
@@ -306,7 +345,7 @@ class Child_Theme_Configurator {
306
 
307
  function add_functions_file($obj){
308
  // add functions.php file
309
- $file = $obj->css->is_file_ok($obj->css->get_child_target('functions.php'));
310
  if ($file && !file_exists($file)):
311
  if (false === file_put_contents($file,
312
  "<?php\n// Exit if accessed directly\nif ( !defined('ABSPATH')) exit;\n\n/* Add custom functions below */")) return false;
@@ -314,13 +353,106 @@ class Child_Theme_Configurator {
314
  }
315
 
316
  function copy_screenshot($obj) {
317
- foreach ($this->image_formats as $ext):
318
- if ($screenshot_parent = $obj->css->is_file_ok($obj->css->get_parent_source('screenshot.' . $ext))) break;
319
- endforeach;
320
- $screenshot_child = $obj->css->get_child_target('screenshot.' . $ext);
321
- if ($screenshot_parent && $screenshot_child && !file_exists($screenshot_child)):
322
- if (false === file_put_contents($screenshot_child,
323
- @file_get_contents($screenshot_parent))) return false;
 
 
 
 
 
324
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  }
326
  }
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Main Controller Class
9
+ Version: 1.3.5
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
32
  var $is_ajax;
33
  var $updated;
34
  var $image_formats;
35
+
36
  function __construct($file) {
37
  $this->dir = dirname( $file );
38
  $this->optionsName = 'chld_thm_cfg_options';
67
  if ($this->hook == $hook):
68
  wp_enqueue_style('chld-thm-cfg-admin', $this->pluginURL . 'css/chld-thm-cfg.css');
69
  wp_enqueue_script('iris');
70
+ // wp_enqueue_script('thickbox');
71
  wp_enqueue_script('ctc-thm-cfg-ctcgrad', $this->pluginURL . 'js/ctcgrad.min.js', array('iris'), '1.0');
72
  wp_enqueue_script('chld-thm-cfg-admin', $this->pluginURL . 'js/chld-thm-cfg.min.js',
73
  array('jquery-ui-autocomplete'), '1.0', true);
191
  function load_config() {
192
  if (!($this->css = get_option($this->optionsName))
193
  || !is_object($this->css)
194
+ || ! $this->check_theme_exists($this->css->get_prop('child'))
195
+ || ! $this->check_theme_exists($this->css->get_prop('parnt'))
196
  // upgrade to v.1.1.1
197
  || !($version = $this->css->get_prop('version'))
198
  )
201
  }
202
 
203
  function write_config() {
204
+ if (!isset($_POST['ctc_load_styles'])
205
+ && !isset($_POST['ctc_parnt_templates_submit'])
206
+ && !isset($_POST['ctc_child_templates_submit'])
207
+ && !isset($_POST['ctc_image_submit'])
208
+ && !isset($_POST['ctc_theme_image_submit'])
209
+ && !isset($_POST['ctc_theme_screenshot_submit'])) return false;
210
  $this->errors = array();
211
+ //die(print_r($_POST, true));
212
+ if (current_user_can('install_themes')): // && $this->validate_post()):
213
+ if (isset($_POST['ctc_load_styles'])):
214
+ foreach (array(
215
+ 'ctc_theme_parnt',
216
+ 'ctc_child_type',
217
+ 'ctc_theme_child',
218
+ 'ctc_child_name',
219
+ 'ctc_configtype',
220
+ 'ctc_child_template',
221
+ 'ctc_child_author',
222
+ 'ctc_child_version') as $postfield):
223
+ $varparts = explode('_', $postfield);
224
+ $varname = end($varparts);
225
+ ${$varname} = empty($_POST[$postfield])?'':sanitize_text_field($_POST[$postfield]);
226
+ endforeach;
227
+ if ($parnt):
228
+ if (! $this->check_theme_exists($parnt)):
229
+ $this->errors[] = sprintf(__('%s does not exist. Please select a valid Parent Theme', 'chld_thm_cfg'), $parnt);
230
+ endif;
231
+ else:
232
+ $this->errors[] = __('Please select a valid Parent Theme', 'chld_thm_cfg');
233
  endif;
234
+ if ('new' == $type):
235
+ $configtype = 'theme'; // no custom stylesheets until style.css exists!
236
+ $child = strtolower(preg_replace("%[^\w\-]%", '', $template));
237
+ if ($this->check_theme_exists($child)):
238
+ $this->errors[] = sprintf(__('<strong>%s</strong> exists. Please enter a different Child Theme template name', 'chld_thm_cfg'), $child);
239
+ endif;
 
 
240
  endif;
241
+ if (empty($child)):
242
+ $this->errors[] = __('Please enter a valid Child Theme template name', 'chld_thm_cfg');
243
+ endif;
244
+ if (empty($name)):
245
+ $this->errors[] = __('Please enter a valid Child Theme name', 'chld_thm_cfg');
246
+ endif;
247
+ if (false === $this->verify_child_theme($child)):
248
+ $this->errors[] = __('Your theme directories are not writable. Please adjust permissions and try again.', 'chld_thm_cfg');
249
+ endif;
250
+ if (empty($this->errors)):
251
+ $this->css = new Child_Theme_Configurator_CSS();
252
+ $this->css->set_prop('parnt', $parnt);
253
+ $this->css->set_prop('child', $child);
254
+ $this->css->set_prop('child_name', $name);
255
+ $this->css->set_prop('child_author', $author);
256
+ $this->css->set_prop('child_version', $version);
257
+ $this->css->set_prop('configtype', $configtype);
258
+ do_action('chld_thm_cfg_addl_files', $this); // hook for add'l plugin files and subdirectories
259
+ $this->css->parse_css_file('parnt');
260
+ $this->css->parse_css_file('child');
261
+ if (false === $this->css->write_css(isset($_POST['ctc_backup']))):
262
+ $this->errors[] = __('Your stylesheet is not writable. Please adjust permissions and try again.', 'chld_thm_cfg');
263
+ return false;
264
+ endif;
265
+ $this->css->reset_updates();
266
+ update_option($this->optionsName, $this->css);
267
+ do_action('chld_thm_cfg_addl_options', $this); // hook for add'l plugin options
268
+ $msg = isset($_POST['ctc_scan_subdirs']) ? '9&tab=import_options' : 1;
269
+ endif;
270
+ elseif (isset($_POST['ctc_parnt_templates_submit']) && isset($_POST['ctc_file_parnt'])):
271
+ foreach ($_POST['ctc_file_parnt'] as $file):
272
+ $this->copy_parent_file(sanitize_text_field($file));
273
+ endforeach;
274
+ $msg = '8&tab=file_options';
275
+ elseif (isset($_POST['ctc_child_templates_submit']) && isset($_POST['ctc_file_child'])):
276
+ foreach ($_POST['ctc_file_child'] as $file):
277
+ $this->delete_child_file(sanitize_text_field($file));
278
+ endforeach;
279
+ $msg = '8&tab=file_options';
280
+ elseif (isset($_POST['ctc_image_submit']) && isset($_POST['ctc_img'])):
281
+ foreach ($_POST['ctc_img'] as $file):
282
+
283
+ $this->delete_child_file('images/' . sanitize_text_field($file), 'img');
284
+ endforeach;
285
+ $msg = '8&tab=file_options';
286
+ elseif (isset($_POST['ctc_theme_image_submit']) && isset($_FILES['ctc_theme_image'])):
287
+ $this->handle_file_upload('ctc_theme_image', 'images');
288
+ $msg = '8&tab=file_options';
289
+ elseif (isset($_POST['ctc_theme_screenshot_submit']) && isset($_FILES['ctc_theme_screenshot'])):
290
+ $this->handle_file_upload('ctc_theme_screenshot');
291
+ $msg = '8&tab=file_options';
292
+ else:
293
+ $msg = '8&tab=file_options';
294
  endif;
295
+ if (empty($this->errors)):
296
+ $this->update_redirect($msg);
 
 
 
 
 
 
297
  endif;
298
  else:
299
  $this->errors[] = __('You do not have permission to configure child themes.', 'chld_thm_cfg');
300
  endif;
301
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  //$this->errors[] = sprintf(__('Child Theme %s was unchanged.', 'chld_thm_cfg'), $name, $this->optionsName);
303
  }
304
 
345
 
346
  function add_functions_file($obj){
347
  // add functions.php file
348
+ $file = $obj->css->is_file_ok($obj->css->get_child_target('functions.php'), 'write');
349
  if ($file && !file_exists($file)):
350
  if (false === file_put_contents($file,
351
  "<?php\n// Exit if accessed directly\nif ( !defined('ABSPATH')) exit;\n\n/* Add custom functions below */")) return false;
353
  }
354
 
355
  function copy_screenshot($obj) {
356
+ // always copy screenshot
357
+ $this->copy_parent_file('screenshot');
358
+ }
359
+
360
+ function copy_parent_file($file, $ext = 'php') {
361
+ $parent_file = NULL;
362
+ if ('screenshot' == $file):
363
+ foreach ($this->image_formats as $ext):
364
+ if ($parent_file = $this->css->is_file_ok($this->css->get_parent_source('screenshot.' . $ext))) break;
365
+ endforeach;
366
+ else:
367
+ $parent_file = $this->css->is_file_ok($this->css->get_parent_source($file . '.' . $ext));
368
  endif;
369
+ $child_file = $this->css->get_child_target($file . '.' . $ext);
370
+
371
+ if ($parent_file && $child_file && !file_exists($child_file)):
372
+ $childdir = dirname($child_file);
373
+ if (! is_dir($childdir)):
374
+ if (! @mkdir($childdir, 0755, true)):
375
+ return false;
376
+ endif;
377
+ elseif (! is_writable($childdir)):
378
+ return false;
379
+ endif;
380
+ if (false === file_put_contents($child_file,
381
+ @file_get_contents($parent_file))) return false;
382
+ endif;
383
+ }
384
+
385
+ function delete_child_file($file, $ext = 'php') {
386
+ // verify file is in child theme and exists before removing.
387
+ $file = ('img' == $ext ? $file : $file . '.' . $ext);
388
+ $child_file = $this->css->get_child_target($file);
389
+ if ($this->css->is_file_ok($child_file, 'write') && file_exists($child_file)):
390
+ if (false === @unlink($child_file)) return false;
391
+ endif;
392
+
393
+
394
+ }
395
+
396
+ function handle_file_upload($field, $childdir = NULL){
397
+ /* adapted from http://www.php.net/manual/en/features.file-upload.php#114004 */
398
+ try {
399
+ // Undefined | Multiple Files | $_FILES Corruption Attack
400
+ // If this request falls under any of them, treat it invalid.
401
+ if ( !isset($_FILES[$field]['error']) || is_array($_FILES[$field]['error']) ):
402
+ throw new RuntimeException('Invalid parameters.');
403
+ endif;
404
+
405
+ // Check $_FILES['upfile']['error'] value.
406
+ switch ($_FILES[$field]['error']):
407
+ case UPLOAD_ERR_OK:
408
+ break;
409
+ case UPLOAD_ERR_NO_FILE:
410
+ throw new RuntimeException('Please select a file to upload.');
411
+ case UPLOAD_ERR_INI_SIZE:
412
+ case UPLOAD_ERR_FORM_SIZE:
413
+ throw new RuntimeException('File is too large.');
414
+ default:
415
+ throw new RuntimeException('There was a problem uploading the file.');
416
+ endswitch;
417
+
418
+ if ($_FILES[$field]['size'] > 1024 * 1024):
419
+ throw new RuntimeException('Theme images cannot be over 1MB.');
420
+ endif;
421
+
422
+ if (false === ($ext = array_search(
423
+ exif_imagetype($_FILES[$field]['tmp_name']),
424
+ array(
425
+ 'jpg' => IMAGETYPE_JPEG,
426
+ 'png' => IMAGETYPE_PNG,
427
+ 'gif' => IMAGETYPE_GIF,
428
+ ),
429
+ true
430
+ ))):
431
+ throw new RuntimeException('Theme images must be JPG, PNG or GIF.');
432
+ endif;
433
+ // strip extension
434
+ $filename = preg_replace('%\.[^\.]+$%', '', $_FILES[$field]['name']);
435
+ // strip non alphas and replace with dash
436
+ $filename = preg_replace('%[^\w]+%', '-', $filename);
437
+ // Ensure target is in child theme
438
+ $target = $this->css->get_child_target(isset($childdir) ? $childdir . '/' . $filename . '.' . $ext : 'screenshot.' . $ext);
439
+ $targetdir = dirname($target);
440
+ if (! is_dir($targetdir)):
441
+ if (! @mkdir($targetdir, 0755, true)):
442
+ throw new RuntimeException('Unable to create directory.');
443
+ endif;
444
+ elseif (! is_writable($targetdir)):
445
+ throw new RuntimeException('Child theme directory is not writable.');
446
+ endif;
447
+ if (!$target || !move_uploaded_file(
448
+ $_FILES[$field]['tmp_name'],
449
+ $target
450
+ )):
451
+ throw new RuntimeException('There was a problem uploading the file.');
452
+ endif;
453
+
454
+ } catch (RuntimeException $e) {
455
+ $this->errors[] = $e->getMessage();
456
+ }
457
  }
458
  }
js/chld-thm-cfg.js CHANGED
@@ -2,7 +2,7 @@
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 1.3.4
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 1.4.0
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
js/chld-thm-cfg.min.js CHANGED
@@ -2,7 +2,7 @@
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 1.3.4
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 1.4.0
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
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.2.2\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2014-02-15 19:13:22+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,135 +12,247 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: includes/class-ctc-ui.php:46
 
 
 
 
 
 
 
 
16
  msgid "Parent/Child"
17
  msgstr ""
18
 
19
- #: includes/class-ctc-ui.php:49 includes/class-ctc-ui.php:390
20
  msgid "Query/Selector"
21
  msgstr ""
22
 
23
- #: includes/class-ctc-ui.php:52 includes/class-ctc-ui.php:404
24
  msgid "Rule/Value"
25
  msgstr ""
26
 
27
- #: includes/class-ctc-ui.php:55
28
  msgid "@import"
29
  msgstr ""
30
 
31
- #: includes/class-ctc-ui.php:58
32
- msgid "View Child CSS"
 
 
 
 
33
  msgstr ""
34
 
35
- #: includes/class-ctc-ui.php:61
36
- msgid "View Parent CSS"
37
  msgstr ""
38
 
39
- #: includes/class-ctc-ui.php:70
40
  msgid "Parent Theme"
41
  msgstr ""
42
 
43
- #: includes/class-ctc-ui.php:82
44
  msgid "Child Theme"
45
  msgstr ""
46
 
47
- #: includes/class-ctc-ui.php:90
48
  msgid "Create New Child Theme"
49
  msgstr ""
50
 
51
- #: includes/class-ctc-ui.php:99
52
  msgid "Use Existing Child Theme"
53
  msgstr ""
54
 
55
- #: includes/class-ctc-ui.php:117
 
 
 
 
56
  msgid "Child Theme Name"
57
  msgstr ""
58
 
59
- #: includes/class-ctc-ui.php:128
 
 
 
 
60
  msgid "Author"
61
  msgstr ""
62
 
63
- #: includes/class-ctc-ui.php:139
64
  msgid "Version"
65
  msgstr ""
66
 
67
- #: includes/class-ctc-ui.php:150
68
  msgid "Backup Stylesheet"
69
  msgstr ""
70
 
71
- #: includes/class-ctc-ui.php:164
72
- msgid "Generate Child Theme"
 
 
 
 
73
  msgstr ""
74
 
75
- #: includes/class-ctc-ui.php:175 includes/class-ctc-ui.php:244
76
  msgid "Rule"
77
  msgstr ""
78
 
79
- #: includes/class-ctc-ui.php:188
80
  msgid "Value"
81
  msgstr ""
82
 
83
- #: includes/class-ctc-ui.php:191 includes/class-ctc-ui.php:229
84
- #: includes/class-ctc.php:94
85
  msgid "Sample"
86
  msgstr ""
87
 
88
- #: includes/class-ctc-ui.php:194 includes/class-ctc.php:96
89
  msgid "Selectors"
90
  msgstr ""
91
 
92
- #: includes/class-ctc-ui.php:205
93
  msgid "Query"
94
  msgstr ""
95
 
96
- #: includes/class-ctc-ui.php:216
97
  msgid "Selector"
98
  msgstr ""
99
 
100
- #: includes/class-ctc-ui.php:247
 
 
 
 
 
101
  msgid "Parent Value"
102
  msgstr ""
103
 
104
- #: includes/class-ctc-ui.php:250
105
  msgid "Child Value"
106
  msgstr ""
107
 
108
- #: includes/class-ctc-ui.php:256
109
  msgid "New Rule"
110
  msgstr ""
111
 
112
- #: includes/class-ctc-ui.php:266
113
  msgid "Order"
114
  msgstr ""
115
 
116
- #: includes/class-ctc-ui.php:273
117
  msgid "Raw CSS"
118
  msgstr ""
119
 
120
- #: includes/class-ctc-ui.php:292
121
  msgid "@import Statements"
122
  msgstr ""
123
 
124
- #: includes/class-ctc-ui.php:348
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
126
  msgstr ""
127
 
128
- #: includes/class-ctc-ui.php:366
 
 
 
 
 
 
129
  msgid "Tutorial Video"
130
  msgstr ""
131
 
132
- #: includes/class-ctc-ui.php:367
133
  msgid ""
134
  "<iframe width=\"480\" height=\"270\" src=\"//www.youtube.com/embed/"
135
  "xL2HkWQxgOA?rel=0&modestbranding=1\" frameborder=\"0\" allowfullscreen></"
136
  "iframe>"
137
  msgstr ""
138
 
139
- #: includes/class-ctc-ui.php:373
140
  msgid "Start Here"
141
  msgstr ""
142
 
143
- #: includes/class-ctc-ui.php:374
144
  msgid ""
145
  "\n"
146
  "<p>The first step is to create a child theme and import your parent theme "
@@ -155,13 +267,15 @@ msgid ""
155
  "<li>Enter a Name for the child theme.</li>\n"
156
  "<li>Enter an author for the child theme.</li>\n"
157
  "<li>Enter the child theme version number.</li>\n"
 
 
158
  "<li>Click \"Generate Child Theme.\" If you are loading an existing child "
159
  "theme, The Child Theme Configurator will create a backup of your existing "
160
  "stylesheet in the theme directory.</li></ol>\n"
161
  "\t\t\t\t "
162
  msgstr ""
163
 
164
- #: includes/class-ctc-ui.php:391
165
  msgid ""
166
  "\n"
167
  "<p>There are two ways to identify and override parent styles. The Child "
@@ -194,7 +308,7 @@ msgid ""
194
  "\t\t\t\t "
195
  msgstr ""
196
 
197
- #: includes/class-ctc-ui.php:405
198
  msgid ""
199
  "\n"
200
  "<p>There are two ways to identify and override parent styles. The Child "
@@ -221,11 +335,11 @@ msgid ""
221
  "\t\t\t\t "
222
  msgstr ""
223
 
224
- #: includes/class-ctc-ui.php:417
225
  msgid "Add New Styles"
226
  msgstr ""
227
 
228
- #: includes/class-ctc-ui.php:418
229
  msgid ""
230
  "\n"
231
  "<p>If you wish to add additional rules to a given selector, first load the "
@@ -245,17 +359,22 @@ msgid ""
245
  "\t\t\t\t "
246
  msgstr ""
247
 
248
- #: includes/class-ctc-ui.php:428
249
  msgid "@imports"
250
  msgstr ""
251
 
252
- #: includes/class-ctc-ui.php:429
253
  msgid ""
254
  "\n"
255
  "<p>You can add additional stylesheets and web fonts by typing @import rules "
256
  "into the textarea on the @import tab. <strong>Important: The Child Theme "
257
  "Configurator adds the @import rule that loads the Parent Theme's stylesheet "
258
  "automatically. Do not need to add it here.</strong></p>\n"
 
 
 
 
 
259
  "<p>Below is an example that loads a local custom stylesheet (you would have "
260
  "to add the \"fonts\" directory and stylesheet) as well as the web font "
261
  "\"Open Sans\" from Google Web Fonts:</p>\n"
@@ -267,15 +386,41 @@ msgid ""
267
  "\t\t\t\t "
268
  msgstr ""
269
 
270
- #: includes/class-ctc-ui.php:442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  msgid "Preview and Activate"
272
  msgstr ""
273
 
274
- #: includes/class-ctc-ui.php:443
275
  msgid ""
276
  "\n"
277
- "<p>Click the View Child or Parent CSS tab to reference the stylesheet code. "
278
- "To preview the stylesheet as a WordPress theme follow these steps:</p>\n"
279
  "<ol><li>Navigate to Appearance > Themes in the WordPress Admin. You will now "
280
  "see the new Child Theme as one of the installed Themes.</li>\n"
281
  "<li>Click \"Live Preview\" below the new Child Theme to see it in action.</"
@@ -285,13 +430,58 @@ msgid ""
285
  "\t\t\t\t "
286
  msgstr ""
287
 
288
- #: includes/class-ctc-ui.php:454
289
  msgid "FAQs"
290
  msgstr ""
291
 
292
- #: includes/class-ctc-ui.php:455
293
  msgid ""
294
  "\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  "<h5 id=\"specific_color\">How do I change a specific color/font style/"
296
  "background?</h5>\n"
297
  "<p>You can override a specific value globally using the Rule/Value tab. See "
@@ -344,19 +534,19 @@ msgid ""
344
  "and import it using the @import tab. <strong>Note:</strong> Currently the "
345
  "Child Theme Configurator does not generate previews of imported web fonts, "
346
  "but will in a later release.</p>\n"
347
- "<h5 id=\"functions_file\">Where is the functions.php file?</h5>\n"
348
- "<p>You can add your own functions.php file, and any other files and "
349
- "directories you need for your Child Theme. The Child Theme Configurator "
350
- "helps you identify and override the Parent stylesheet without touching the "
351
- "other files.</p>\n"
352
  " "
353
  msgstr ""
354
 
355
- #: includes/class-ctc-ui.php:484
356
  msgid "Glossary"
357
  msgstr ""
358
 
359
- #: includes/class-ctc-ui.php:485
360
  msgid ""
361
  "\n"
362
  "<h3 id=\"terms\">Glossary</h3>\n"
@@ -396,31 +586,31 @@ msgid ""
396
  "\t\t\t\t "
397
  msgstr ""
398
 
399
- #: includes/class-ctc-ui.php:506
400
  msgid "Contact us"
401
  msgstr ""
402
 
403
- #: includes/class-ctc-ui.php:507
404
  msgid "Plugin Website"
405
  msgstr ""
406
 
407
- #: includes/class-ctc-ui.php:508
408
  msgid "Donate"
409
  msgstr ""
410
 
411
- #: includes/class-ctc-ui.php:509
412
  msgid "Give Us 5 Stars"
413
  msgstr ""
414
 
415
- #: includes/class-ctc-ui.php:510
416
  msgid "WordPress Codex"
417
  msgstr ""
418
 
419
- #: includes/class-ctc-ui.php:511
420
  msgid "WordPress Answers"
421
  msgstr ""
422
 
423
- #. #-#-#-#-# ctc.pot.txt (Child Theme Configurator 1.2.2) #-#-#-#-#
424
  #. Plugin Name of the plugin/theme
425
  #: includes/class-ctc.php:43
426
  msgid "Child Theme Configurator"
@@ -430,108 +620,109 @@ msgstr ""
430
  msgid "Child Themes"
431
  msgstr ""
432
 
433
- #: includes/class-ctc.php:84
434
  msgid "URL/None"
435
  msgstr ""
436
 
437
- #: includes/class-ctc.php:85
438
  msgid "Origin"
439
  msgstr ""
440
 
441
- #: includes/class-ctc.php:86
442
  msgid "Color 1"
443
  msgstr ""
444
 
445
- #: includes/class-ctc.php:87
446
  msgid "Color 2"
447
  msgstr ""
448
 
449
- #: includes/class-ctc.php:88
450
  msgid "Width"
451
  msgstr ""
452
 
453
- #: includes/class-ctc.php:89
454
  msgid "Style"
455
  msgstr ""
456
 
457
- #: includes/class-ctc.php:90
458
  msgid "Color"
459
  msgstr ""
460
 
461
- #: includes/class-ctc.php:92
462
  msgid "Are you sure? This will replace your current settings."
463
  msgstr ""
464
 
465
- #: includes/class-ctc.php:95
466
  msgid "<span style=\"font-size:10px\">!</span>"
467
  msgstr ""
468
 
469
- #: includes/class-ctc.php:97
470
  msgid "Close"
471
  msgstr ""
472
 
473
- #: includes/class-ctc.php:98
474
  msgid "Edit"
475
  msgstr ""
476
 
477
- #: includes/class-ctc.php:99
478
  msgid "Cancel"
479
  msgstr ""
480
 
481
- #: includes/class-ctc.php:100
482
  msgid "Rename"
483
  msgstr ""
484
 
485
- #: includes/class-ctc.php:101
486
  msgid "The stylesheet cannot be displayed."
487
  msgstr ""
488
 
489
- #: includes/class-ctc.php:102
490
  msgid "(Child Only)"
491
  msgstr ""
492
 
493
- #: includes/class-ctc.php:103
494
  msgid "Please enter a valid Child Theme"
495
  msgstr ""
496
 
497
- #: includes/class-ctc.php:104 includes/class-ctc.php:223
498
  msgid "Please enter a valid Child Theme name"
499
  msgstr ""
500
 
501
- #: includes/class-ctc.php:105
502
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
503
  msgstr ""
504
 
505
- #: includes/class-ctc.php:208
506
  msgid "%s does not exist. Please select a valid Parent Theme"
507
  msgstr ""
508
 
509
- #: includes/class-ctc.php:211
510
  msgid "Please select a valid Parent Theme"
511
  msgstr ""
512
 
513
- #: includes/class-ctc.php:216
514
  msgid ""
515
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
516
  "name"
517
  msgstr ""
518
 
519
- #: includes/class-ctc.php:220
520
  msgid "Please enter a valid Child Theme template name"
521
  msgstr ""
522
 
523
- #: includes/class-ctc.php:226
524
- msgid "You do not have permission to configure child themes."
 
 
525
  msgstr ""
526
 
527
- #: includes/class-ctc.php:238
528
  msgid ""
529
- "Your theme directory is not writable. Please adjust permissions and try "
530
- "again."
531
  msgstr ""
532
 
533
- #: includes/class-ctc.php:245
534
- msgid "Child Theme %s was unchanged."
535
  msgstr ""
536
 
537
  #. Plugin URI of the plugin/theme
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.4.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2014-04-25 22:05:14+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
+ #: includes/class-ctc-ui.php:23
16
+ msgid "Easily customize your plugins with the CTC Plugin Extension"
17
+ msgstr ""
18
+
19
+ #: includes/class-ctc-ui.php:23
20
+ msgid "Use this to customize your plugins"
21
+ msgstr ""
22
+
23
+ #: includes/class-ctc-ui.php:50
24
  msgid "Parent/Child"
25
  msgstr ""
26
 
27
+ #: includes/class-ctc-ui.php:53 includes/class-ctc-ui.php:579
28
  msgid "Query/Selector"
29
  msgstr ""
30
 
31
+ #: includes/class-ctc-ui.php:56 includes/class-ctc-ui.php:593
32
  msgid "Rule/Value"
33
  msgstr ""
34
 
35
+ #: includes/class-ctc-ui.php:59
36
  msgid "@import"
37
  msgstr ""
38
 
39
+ #: includes/class-ctc-ui.php:62
40
+ msgid "Child CSS"
41
+ msgstr ""
42
+
43
+ #: includes/class-ctc-ui.php:65
44
+ msgid "Parent CSS"
45
  msgstr ""
46
 
47
+ #: includes/class-ctc-ui.php:72 includes/class-ctc-ui.php:632
48
+ msgid "Files"
49
  msgstr ""
50
 
51
+ #: includes/class-ctc-ui.php:84
52
  msgid "Parent Theme"
53
  msgstr ""
54
 
55
+ #: includes/class-ctc-ui.php:94
56
  msgid "Child Theme"
57
  msgstr ""
58
 
59
+ #: includes/class-ctc-ui.php:101
60
  msgid "Create New Child Theme"
61
  msgstr ""
62
 
63
+ #: includes/class-ctc-ui.php:110
64
  msgid "Use Existing Child Theme"
65
  msgstr ""
66
 
67
+ #: includes/class-ctc-ui.php:115
68
+ msgid "Theme Slug"
69
+ msgstr ""
70
+
71
+ #: includes/class-ctc-ui.php:125
72
  msgid "Child Theme Name"
73
  msgstr ""
74
 
75
+ #: includes/class-ctc-ui.php:129
76
+ msgid "Theme Name"
77
+ msgstr ""
78
+
79
+ #: includes/class-ctc-ui.php:135 includes/class-ctc-ui.php:139
80
  msgid "Author"
81
  msgstr ""
82
 
83
+ #: includes/class-ctc-ui.php:144 includes/class-ctc-ui.php:148
84
  msgid "Version"
85
  msgstr ""
86
 
87
+ #: includes/class-ctc-ui.php:153
88
  msgid "Backup Stylesheet"
89
  msgstr ""
90
 
91
+ #: includes/class-ctc-ui.php:162
92
+ msgid "Scan Parent Theme<br/>for Additional Stylesheets"
93
+ msgstr ""
94
+
95
+ #: includes/class-ctc-ui.php:173
96
+ msgid "Generate Child Theme Files"
97
  msgstr ""
98
 
99
+ #: includes/class-ctc-ui.php:184 includes/class-ctc-ui.php:253
100
  msgid "Rule"
101
  msgstr ""
102
 
103
+ #: includes/class-ctc-ui.php:197
104
  msgid "Value"
105
  msgstr ""
106
 
107
+ #: includes/class-ctc-ui.php:200 includes/class-ctc-ui.php:238
108
+ #: includes/class-ctc.php:102
109
  msgid "Sample"
110
  msgstr ""
111
 
112
+ #: includes/class-ctc-ui.php:203 includes/class-ctc.php:104
113
  msgid "Selectors"
114
  msgstr ""
115
 
116
+ #: includes/class-ctc-ui.php:214
117
  msgid "Query"
118
  msgstr ""
119
 
120
+ #: includes/class-ctc-ui.php:225
121
  msgid "Selector"
122
  msgstr ""
123
 
124
+ #: includes/class-ctc-ui.php:246 includes/class-ctc-ui.php:286
125
+ #: includes/class-ctc-ui.php:305
126
+ msgid "Save"
127
+ msgstr ""
128
+
129
+ #: includes/class-ctc-ui.php:256
130
  msgid "Parent Value"
131
  msgstr ""
132
 
133
+ #: includes/class-ctc-ui.php:259
134
  msgid "Child Value"
135
  msgstr ""
136
 
137
+ #: includes/class-ctc-ui.php:265
138
  msgid "New Rule"
139
  msgstr ""
140
 
141
+ #: includes/class-ctc-ui.php:275
142
  msgid "Order"
143
  msgstr ""
144
 
145
+ #: includes/class-ctc-ui.php:282
146
  msgid "Raw CSS"
147
  msgstr ""
148
 
149
+ #: includes/class-ctc-ui.php:301
150
  msgid "@import Statements"
151
  msgstr ""
152
 
153
+ #: includes/class-ctc-ui.php:333
154
+ msgid "Upload New Child Theme Image"
155
+ msgstr ""
156
+
157
+ #: includes/class-ctc-ui.php:336
158
+ msgid ""
159
+ "Theme images reside under the <code>images</code> directory in your child "
160
+ "theme and are meant for stylesheet use only. Use the media gallery for "
161
+ "content images."
162
+ msgstr ""
163
+
164
+ #: includes/class-ctc-ui.php:343 includes/class-ctc-ui.php:369
165
+ msgid "Upload"
166
+ msgstr ""
167
+
168
+ #: includes/class-ctc-ui.php:350
169
+ msgid "Child Theme Screenshot"
170
+ msgstr ""
171
+
172
+ #: includes/class-ctc-ui.php:359
173
+ msgid "Upload New Screenshot"
174
+ msgstr ""
175
+
176
+ #: includes/class-ctc-ui.php:362
177
+ msgid ""
178
+ "The theme screenshot should be a 4:3 ratio (eg., 880px x 660px) JPG, PNG or "
179
+ "GIF. It will be renamed <code>screenshot</code>."
180
+ msgstr ""
181
+
182
+ #: includes/class-ctc-ui.php:430
183
+ msgid "Copy PHP template files from the parent theme by selecting them here."
184
+ msgstr ""
185
+
186
+ #: includes/class-ctc-ui.php:433
187
+ msgid ""
188
+ "CAUTION: If your child theme is active, the child theme version of the file "
189
+ "will be used instead of the parent immediately after it is copied."
190
+ msgstr ""
191
+
192
+ #: includes/class-ctc-ui.php:436
193
+ msgid ""
194
+ "The <code>functions.php</code> file is generated separately and cannot be "
195
+ "copied here."
196
+ msgstr ""
197
+
198
+ #: includes/class-ctc-ui.php:438
199
+ msgid "Click here to edit template files using the Theme Editor"
200
+ msgstr ""
201
+
202
+ #: includes/class-ctc-ui.php:443
203
+ msgid "Remove child theme templates by selecting them here."
204
+ msgstr ""
205
+
206
+ #: includes/class-ctc-ui.php:452
207
+ msgid "Copy Selected to Child Theme"
208
+ msgstr ""
209
+
210
+ #: includes/class-ctc-ui.php:452
211
+ msgid "Remove Selected from Child Theme"
212
+ msgstr ""
213
+
214
+ #: includes/class-ctc-ui.php:489
215
+ msgid "Child Theme Images"
216
+ msgstr ""
217
+
218
+ #: includes/class-ctc-ui.php:492
219
+ msgid "Remove child theme images by selecting them here."
220
+ msgstr ""
221
+
222
+ #: includes/class-ctc-ui.php:500
223
+ msgid "Remove Selected"
224
+ msgstr ""
225
+
226
+ #: includes/class-ctc-ui.php:531
227
+ msgid "Child Theme files modified successfully."
228
+ msgstr ""
229
+
230
+ #: includes/class-ctc-ui.php:533
231
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
232
  msgstr ""
233
 
234
+ #: includes/class-ctc-ui.php:537
235
+ msgid ""
236
+ "Please verify the imports below and remove any imports that are not needed "
237
+ "by the front end, such as admin or configuration stylesheets."
238
+ msgstr ""
239
+
240
+ #: includes/class-ctc-ui.php:554
241
  msgid "Tutorial Video"
242
  msgstr ""
243
 
244
+ #: includes/class-ctc-ui.php:555
245
  msgid ""
246
  "<iframe width=\"480\" height=\"270\" src=\"//www.youtube.com/embed/"
247
  "xL2HkWQxgOA?rel=0&modestbranding=1\" frameborder=\"0\" allowfullscreen></"
248
  "iframe>"
249
  msgstr ""
250
 
251
+ #: includes/class-ctc-ui.php:561
252
  msgid "Start Here"
253
  msgstr ""
254
 
255
+ #: includes/class-ctc-ui.php:562
256
  msgid ""
257
  "\n"
258
  "<p>The first step is to create a child theme and import your parent theme "
267
  "<li>Enter a Name for the child theme.</li>\n"
268
  "<li>Enter an author for the child theme.</li>\n"
269
  "<li>Enter the child theme version number.</li>\n"
270
+ "<li>If your theme uses multiple stylesheets, check \"Scan Parent Theme for "
271
+ "additional stylesheets.</li>\n"
272
  "<li>Click \"Generate Child Theme.\" If you are loading an existing child "
273
  "theme, The Child Theme Configurator will create a backup of your existing "
274
  "stylesheet in the theme directory.</li></ol>\n"
275
  "\t\t\t\t "
276
  msgstr ""
277
 
278
+ #: includes/class-ctc-ui.php:580
279
  msgid ""
280
  "\n"
281
  "<p>There are two ways to identify and override parent styles. The Child "
308
  "\t\t\t\t "
309
  msgstr ""
310
 
311
+ #: includes/class-ctc-ui.php:594
312
  msgid ""
313
  "\n"
314
  "<p>There are two ways to identify and override parent styles. The Child "
335
  "\t\t\t\t "
336
  msgstr ""
337
 
338
+ #: includes/class-ctc-ui.php:606
339
  msgid "Add New Styles"
340
  msgstr ""
341
 
342
+ #: includes/class-ctc-ui.php:607
343
  msgid ""
344
  "\n"
345
  "<p>If you wish to add additional rules to a given selector, first load the "
359
  "\t\t\t\t "
360
  msgstr ""
361
 
362
+ #: includes/class-ctc-ui.php:617
363
  msgid "@imports"
364
  msgstr ""
365
 
366
+ #: includes/class-ctc-ui.php:618
367
  msgid ""
368
  "\n"
369
  "<p>You can add additional stylesheets and web fonts by typing @import rules "
370
  "into the textarea on the @import tab. <strong>Important: The Child Theme "
371
  "Configurator adds the @import rule that loads the Parent Theme's stylesheet "
372
  "automatically. Do not need to add it here.</strong></p>\n"
373
+ "<p><strong>Important:</strong> If you chose \"Scan Parent Theme for "
374
+ "additional stylesheets,\" the Child Theme Configurator automically places "
375
+ "@import rules for the additional stylesheets here. Be sure to delete any "
376
+ "imports that are not needed by the front end, such as admin or configuration "
377
+ "stylesheets.</p>\n"
378
  "<p>Below is an example that loads a local custom stylesheet (you would have "
379
  "to add the \"fonts\" directory and stylesheet) as well as the web font "
380
  "\"Open Sans\" from Google Web Fonts:</p>\n"
386
  "\t\t\t\t "
387
  msgstr ""
388
 
389
+ #: includes/class-ctc-ui.php:633
390
+ msgid ""
391
+ "\n"
392
+ "<h5>Parent Templates</h5><p>Copy PHP template files from the parent theme by "
393
+ "checking the boxes and clicking \"Copy Selected to Child Theme\" and the "
394
+ "templates will be added to the child theme directory.</p>\n"
395
+ "<p><strong>CAUTION: If your child theme is active, the child theme version "
396
+ "of the file will be used instead of the parent immediately after it is "
397
+ "copied.</strong></p>\n"
398
+ "<p>The <code>functions.php</code> file is generated separately and cannot be "
399
+ "copied here.</p>\n"
400
+ "<h5>Child Templates</h5><p>Templates copied from the parent are listed here. "
401
+ "These can be edited using the Theme Editor in the Appearance Menu.</p>\n"
402
+ "<p>Remove child theme images by checking the boxes and clicking \"Remove "
403
+ "Selected from Child Theme.\"</p>\n"
404
+ "<h5>Child Theme Images</h5><p>Theme images reside under the <code>images</"
405
+ "code> directory in your child theme and are meant for stylesheet use only. "
406
+ "Use the media gallery for content images.</p>\n"
407
+ "<p>You can upload new images using the image upload form.</p>\n"
408
+ "<h5>Child Theme Screenshot</h5><p>You can upload a custom screenshot for the "
409
+ "child theme here.</p>\n"
410
+ "<p>The theme screenshot should be a 4:3 ratio (eg., 880px x 660px) JPG, PNG "
411
+ "or GIF. It will be renamed <code>screenshot</code>.</p>\n"
412
+ "\t\t\t\t "
413
+ msgstr ""
414
+
415
+ #: includes/class-ctc-ui.php:649
416
  msgid "Preview and Activate"
417
  msgstr ""
418
 
419
+ #: includes/class-ctc-ui.php:650
420
  msgid ""
421
  "\n"
422
+ "<p>Click the Child or Parent CSS tab to reference the stylesheet code. To "
423
+ "preview the stylesheet as a WordPress theme follow these steps:</p>\n"
424
  "<ol><li>Navigate to Appearance > Themes in the WordPress Admin. You will now "
425
  "see the new Child Theme as one of the installed Themes.</li>\n"
426
  "<li>Click \"Live Preview\" below the new Child Theme to see it in action.</"
430
  "\t\t\t\t "
431
  msgstr ""
432
 
433
+ #: includes/class-ctc-ui.php:661
434
  msgid "FAQs"
435
  msgstr ""
436
 
437
+ #: includes/class-ctc-ui.php:662
438
  msgid ""
439
  "\n"
440
+ "<h5>Does it work with Plugins?</h5>\n"
441
+ "<p>We offer a premium extension to let you easily modify styles for any "
442
+ "WordPress Plugin installed on your website. The Child Theme Configurator "
443
+ "Plugin Extension scans your plugins and allows you to create custom "
444
+ "stylesheets in your Child Theme. <a href=\"http://www.lilaeamedia.com/"
445
+ "plugins/child-theme-plugin-styles\" title=\"Child Theme Configurator "
446
+ "Extension\">Learn more</a></p>\n"
447
+ "<h5 id=\"doesnt_work\">Why doesn’t this work with my (insert theme vendor "
448
+ "here) theme?</h5>\n"
449
+ "<p>Some themes (particularly commercial themes) do not adhere to the Theme "
450
+ "Development guidelines set forth by WordPress.org, and do not automatically "
451
+ "load child theme stylesheets or php files. This is unfortunate, because it "
452
+ "effectively prohibits the webmaster from adding any customizations (other "
453
+ "than those made through the admin theme options) that will survive past an "
454
+ "upgrade.</p>\n"
455
+ "<p>Contact the vendor directly to ask for this core functionality. It is our "
456
+ "opinion that ALL themes (especially commercial ones) must pass the Theme "
457
+ "Unit Tests outlined by WordPress.org.</p>\n"
458
+ "<h5>Can I edit the Child Theme stylesheet manually offline or by using the "
459
+ "Editor or do I have to use the Configurator?</h5>\n"
460
+ "<p>You can make any manual changes you wish to the stylesheet. Just make "
461
+ "sure you import the revised stylesheet using the Parent/Child panel or the "
462
+ "Configurator will overwrite your changes the next time you use it. Just "
463
+ "follow the steps as usual but select the \"Use Existing Child Theme\" radio "
464
+ "button as the \"Child Theme\" option. The Configurator will automatically "
465
+ "update its internal data from the new stylesheet.</p>\n"
466
+ "<h5>Why doesn't the Parent Theme have any styles when I \"View Parent CSS\"?"
467
+ "</h5>\n"
468
+ "<p>Your Parent theme is probably using a non-standard location for the "
469
+ "stylesheets. Check \"Scan Parent Theme for additional stylesheets\" on the "
470
+ "Parent/Child tab and load the Child Theme again.</p>\n"
471
+ "<h5>Why is everything backwards?</h5>\n"
472
+ "<p>More than likely you selected \"Scan Parent Theme for additional "
473
+ "stylesheets\" and your theme uses a \"right-to-left\" (rtl) stylesheet. Go "
474
+ "to the @imports tab and remove the rtl stylesheet from the list of imported "
475
+ "stylesheets.</p>\n"
476
+ "<h5 id=\"menus-broken\">Why are my menus displaying incorrectly when I "
477
+ "activate the new child theme?</h5>\n"
478
+ "<p>The child theme creates a new instance in the WordPress options data and "
479
+ "the menus have to be assigned. Go to Appearance &gt; Menus and assign "
480
+ "locations to each of the menus for the new Child Theme.</p>\n"
481
+ "<h5 \"preview-not-loading\">Why do the preview tabs return \"Stylesheet "
482
+ "could not be displayed\"?</h5>\n"
483
+ "<p>You have to configure at least one child theme from the Parent/Child tab "
484
+ "for the preview to display.</p>\n"
485
  "<h5 id=\"specific_color\">How do I change a specific color/font style/"
486
  "background?</h5>\n"
487
  "<p>You can override a specific value globally using the Rule/Value tab. See "
534
  "and import it using the @import tab. <strong>Note:</strong> Currently the "
535
  "Child Theme Configurator does not generate previews of imported web fonts, "
536
  "but will in a later release.</p>\n"
537
+ "<h5 id=\"functions_file\">Where are the PHP files?</h5>\n"
538
+ "<p>The configurator automatically adds a blank functions.php file to the "
539
+ "child theme directory. Other parent theme files can be copied using the "
540
+ "\"Files\" tab. Theme images and a custom screenshot can be uploaded there as "
541
+ "well.</p>\n"
542
  " "
543
  msgstr ""
544
 
545
+ #: includes/class-ctc-ui.php:706
546
  msgid "Glossary"
547
  msgstr ""
548
 
549
+ #: includes/class-ctc-ui.php:707
550
  msgid ""
551
  "\n"
552
  "<h3 id=\"terms\">Glossary</h3>\n"
586
  "\t\t\t\t "
587
  msgstr ""
588
 
589
+ #: includes/class-ctc-ui.php:730
590
  msgid "Contact us"
591
  msgstr ""
592
 
593
+ #: includes/class-ctc-ui.php:731
594
  msgid "Plugin Website"
595
  msgstr ""
596
 
597
+ #: includes/class-ctc-ui.php:732
598
  msgid "Donate"
599
  msgstr ""
600
 
601
+ #: includes/class-ctc-ui.php:733
602
  msgid "Give Us 5 Stars"
603
  msgstr ""
604
 
605
+ #: includes/class-ctc-ui.php:734
606
  msgid "WordPress Codex"
607
  msgstr ""
608
 
609
+ #: includes/class-ctc-ui.php:735
610
  msgid "WordPress Answers"
611
  msgstr ""
612
 
613
+ #. #-#-#-#-# ctc.pot.txt (Child Theme Configurator 1.4.0) #-#-#-#-#
614
  #. Plugin Name of the plugin/theme
615
  #: includes/class-ctc.php:43
616
  msgid "Child Theme Configurator"
620
  msgid "Child Themes"
621
  msgstr ""
622
 
623
+ #: includes/class-ctc.php:92
624
  msgid "URL/None"
625
  msgstr ""
626
 
627
+ #: includes/class-ctc.php:93
628
  msgid "Origin"
629
  msgstr ""
630
 
631
+ #: includes/class-ctc.php:94
632
  msgid "Color 1"
633
  msgstr ""
634
 
635
+ #: includes/class-ctc.php:95
636
  msgid "Color 2"
637
  msgstr ""
638
 
639
+ #: includes/class-ctc.php:96
640
  msgid "Width"
641
  msgstr ""
642
 
643
+ #: includes/class-ctc.php:97
644
  msgid "Style"
645
  msgstr ""
646
 
647
+ #: includes/class-ctc.php:98
648
  msgid "Color"
649
  msgstr ""
650
 
651
+ #: includes/class-ctc.php:100
652
  msgid "Are you sure? This will replace your current settings."
653
  msgstr ""
654
 
655
+ #: includes/class-ctc.php:103
656
  msgid "<span style=\"font-size:10px\">!</span>"
657
  msgstr ""
658
 
659
+ #: includes/class-ctc.php:105
660
  msgid "Close"
661
  msgstr ""
662
 
663
+ #: includes/class-ctc.php:106
664
  msgid "Edit"
665
  msgstr ""
666
 
667
+ #: includes/class-ctc.php:107
668
  msgid "Cancel"
669
  msgstr ""
670
 
671
+ #: includes/class-ctc.php:108
672
  msgid "Rename"
673
  msgstr ""
674
 
675
+ #: includes/class-ctc.php:109
676
  msgid "The stylesheet cannot be displayed."
677
  msgstr ""
678
 
679
+ #: includes/class-ctc.php:110
680
  msgid "(Child Only)"
681
  msgstr ""
682
 
683
+ #: includes/class-ctc.php:111
684
  msgid "Please enter a valid Child Theme"
685
  msgstr ""
686
 
687
+ #: includes/class-ctc.php:112 includes/class-ctc.php:245
688
  msgid "Please enter a valid Child Theme name"
689
  msgstr ""
690
 
691
+ #: includes/class-ctc.php:113
692
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
693
  msgstr ""
694
 
695
+ #: includes/class-ctc.php:229
696
  msgid "%s does not exist. Please select a valid Parent Theme"
697
  msgstr ""
698
 
699
+ #: includes/class-ctc.php:232
700
  msgid "Please select a valid Parent Theme"
701
  msgstr ""
702
 
703
+ #: includes/class-ctc.php:238
704
  msgid ""
705
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
706
  "name"
707
  msgstr ""
708
 
709
+ #: includes/class-ctc.php:242
710
  msgid "Please enter a valid Child Theme template name"
711
  msgstr ""
712
 
713
+ #: includes/class-ctc.php:248
714
+ msgid ""
715
+ "Your theme directories are not writable. Please adjust permissions and try "
716
+ "again."
717
  msgstr ""
718
 
719
+ #: includes/class-ctc.php:262
720
  msgid ""
721
+ "Your stylesheet is not writable. Please adjust permissions and try again."
 
722
  msgstr ""
723
 
724
+ #: includes/class-ctc.php:299
725
+ msgid "You do not have permission to configure child themes."
726
  msgstr ""
727
 
728
  #. Plugin URI of the plugin/theme
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: lilaeamedia
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
  Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
5
  Requires at least: 3.7
6
- Tested up to: 3.8.2
7
- Stable tag: 1.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,17 +14,23 @@ Create a Child Theme from any installed Theme. Each CSS selector, rule and value
14
 
15
  Created by Lilaea Media, the team that brought you IntelliWidget, the Child Theme Configurator provides a new approach to WordPress stylesheets. The Child Theme Configurator lets you identify and override only the Parent Theme style attributes you want to change. It gives you unlimited control over your WordPress look and feel while leaving your Parent Theme untouched.
16
 
 
 
 
 
17
  = Now it works with plugins! =
18
 
19
  We offer a premium extension to let you easily modify styles for any WordPress Plugin installed on your website. The Child Theme Configurator Plugin Extension scans your plugins and allows you to create custom stylesheets in your Child Theme. Learn more at http://www.lilaeamedia.com/plugins/child-theme-plugin-styles
20
 
21
- The Child Theme Configurator parses and indexes a Theme's stylesheet so that every media query, selector, rule and value are at your fingertips. Second, it shows you how each change you make will look before you commit it to the Child Theme.Finally, it saves your work so that you can fine-tune your Child Theme without the risk of losing your edits.
 
 
22
 
23
  You can create any number of Child Themes from any existing Parent Theme. The Child Theme Configurator lets you choose from your installed themes (even existing Child Themes) and save the results in your Themes directory.
24
 
25
  When you are ready, just activate the Child Theme and your WordPress site takes on the new look and feel automatically.
26
 
27
- Why create Child Themes using the Child Theme Configurator?
28
 
29
  * Apply changes in a Child Theme without touching the Parent Theme
30
  * Identify and override exact selectors from the Parent Theme
@@ -35,6 +41,9 @@ Why create Child Themes using the Child Theme Configurator?
35
  * View style changes before commiting to them
36
  * Add and modify individual @media queries
37
  * Import web fonts and use them in place of Theme fonts
 
 
 
38
  * Save hours of development time
39
 
40
  == Installation ==
@@ -99,7 +108,7 @@ A child theme is not a "copy" of the parent theme. It is a special feature of Wo
99
 
100
  = Where are the .php files? =
101
 
102
- The configurator automatically adds a blank functions.php file to the child theme directory. You can add any additional files and directories you need for your Child Theme. The Child Theme Configurator helps you identify and override selectors in the Parent stylesheet without touching the other files.
103
 
104
  = How do I change a specific color/font style/background? =
105
 
@@ -149,7 +158,15 @@ You can also create a secondary stylesheet that contains @font-face rules and im
149
 
150
  == Changelog ==
151
 
152
- = 1.3.4 =
 
 
 
 
 
 
 
 
153
  * Fixes a bug with the way the @import data is stored that threw errors on php 5.3 and corrupted v1.3.2 @import data.
154
 
155
  = 1.3.3 =
@@ -232,8 +249,11 @@ You can also create a secondary stylesheet that contains @font-face rules and im
232
  * Initial release.
233
 
234
  == Upgrade Notice ==
235
- = 1.3.3+ =
236
- * This version adds the ability to parse additional stylesheets from the Parent theme as well as the main style.css file.
 
 
 
237
 
238
  == Create Your Child Theme ==
239
 
@@ -294,6 +314,26 @@ You can add additional stylesheets and web fonts by typing @import rules into th
294
 
295
  If you checked "Scan Parent Theme for additional stylesheets" when you created your child theme, the "@import" tab will appear automatically. Important: By default, any additional stylesheets are added as imports. If your theme has a "right-to-left" stylesheet, it will appear here as well. In many cases, the theme will automatically load the additional stylesheets, so you do not need to import them (for example, the "Responsive" theme). Remove any @import statements that are not needed by the front end, such as admin or configuration stylesheets, or, as in the case described above, any stylesheets that are automatically loaded by the Theme.
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  == Preview and Activate ==
298
 
299
  Click the Preview CSS tab to see your new masterpiece as CSS code. To preview the stylesheet as a WordPress theme follow these steps:
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
  Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
5
  Requires at least: 3.7
6
+ Tested up to: 3.9
7
+ Stable tag: 1.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  Created by Lilaea Media, the team that brought you IntelliWidget, the Child Theme Configurator provides a new approach to WordPress stylesheets. The Child Theme Configurator lets you identify and override only the Parent Theme style attributes you want to change. It gives you unlimited control over your WordPress look and feel while leaving your Parent Theme untouched.
16
 
17
+ = New Files Tab! =
18
+
19
+ Now you can copy parent theme template files into your child themes and edit them using the Theme Editor. We've also added an image uploader to add custom theme images for your stylesheets along with a screenshot uploader.
20
+
21
  = Now it works with plugins! =
22
 
23
  We offer a premium extension to let you easily modify styles for any WordPress Plugin installed on your website. The Child Theme Configurator Plugin Extension scans your plugins and allows you to create custom stylesheets in your Child Theme. Learn more at http://www.lilaeamedia.com/plugins/child-theme-plugin-styles
24
 
25
+ = Take Control of Your Child Themes =
26
+
27
+ The Child Theme Configurator parses and indexes a Theme's stylesheet so that every media query, selector, rule and value are at your fingertips. Second, it shows you how each change you make will look before you commit it to the Child Theme. Finally, it saves your work so that you can fine-tune your Child Theme without the risk of losing your edits.
28
 
29
  You can create any number of Child Themes from any existing Parent Theme. The Child Theme Configurator lets you choose from your installed themes (even existing Child Themes) and save the results in your Themes directory.
30
 
31
  When you are ready, just activate the Child Theme and your WordPress site takes on the new look and feel automatically.
32
 
33
+ = Why create Child Themes using the Child Theme Configurator? =
34
 
35
  * Apply changes in a Child Theme without touching the Parent Theme
36
  * Identify and override exact selectors from the Parent Theme
41
  * View style changes before commiting to them
42
  * Add and modify individual @media queries
43
  * Import web fonts and use them in place of Theme fonts
44
+ * Copy theme templates and edit them using Theme Editor
45
+ * Upload theme images for use with stylesheets
46
+ * Upload custom screenshot for your child theme
47
  * Save hours of development time
48
 
49
  == Installation ==
108
 
109
  = Where are the .php files? =
110
 
111
+ The configurator automatically adds a blank functions.php file to the child theme directory. Other parent theme files can be copied using the "Files" tab. Theme images and a custom screenshot can be uploaded there as well.
112
 
113
  = How do I change a specific color/font style/background? =
114
 
158
 
159
  == Changelog ==
160
 
161
+ = 1.4.0 =
162
+ * New Feature: Theme Files tab:
163
+ * Copy parent templates to child theme to be edited using the Theme Editor.
164
+ * Remove child theme templates.
165
+ * Upload child theme images.
166
+ * Remove child theme images.
167
+ * Upload child theme screenshot.
168
+
169
+ = 1.3.5 =
170
  * Fixes a bug with the way the @import data is stored that threw errors on php 5.3 and corrupted v1.3.2 @import data.
171
 
172
  = 1.3.3 =
249
  * Initial release.
250
 
251
  == Upgrade Notice ==
252
+
253
+ = 1.4.0 =
254
+ * New Files Tab!
255
+ * Now you can copy parent theme template files into your child themes and edit them using the Theme Editor.
256
+ * We've also added an image uploader to add custom theme images for your stylesheets along with a screenshot uploader.
257
 
258
  == Create Your Child Theme ==
259
 
314
 
315
  If you checked "Scan Parent Theme for additional stylesheets" when you created your child theme, the "@import" tab will appear automatically. Important: By default, any additional stylesheets are added as imports. If your theme has a "right-to-left" stylesheet, it will appear here as well. In many cases, the theme will automatically load the additional stylesheets, so you do not need to import them (for example, the "Responsive" theme). Remove any @import statements that are not needed by the front end, such as admin or configuration stylesheets, or, as in the case described above, any stylesheets that are automatically loaded by the Theme.
316
 
317
+ == Files ==
318
+
319
+ = Parent Templates =
320
+
321
+ Copy PHP template files from the parent theme by checking the boxes and clicking "Copy Selected to Child Theme" and the templates will be added to the child theme directory.
322
+
323
+ CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied. The functions.php file is generated separately and cannot be copied here.
324
+
325
+ = Child Templates =
326
+
327
+ Templates copied from the parent are listed here. These can be edited using the Theme Editor in the Appearance Menu. Remove child theme images by checking the boxes and clicking "Remove Selected from Child Theme."</p>
328
+
329
+ = Child Theme Images =
330
+
331
+ Theme images reside under the <code>images</code> directory in your child theme and are meant for stylesheet use only. Use the media gallery for content images. You can upload new images using the image upload form.
332
+
333
+ = Child Theme Screenshot =
334
+
335
+ You can upload a custom screenshot for the child theme here. The theme screenshot should be a 4:3 ratio (eg., 880px x 660px) JPG, PNG or GIF. It will be renamed "screenshot".
336
+
337
  == Preview and Activate ==
338
 
339
  Click the Preview CSS tab to see your new masterpiece as CSS code. To preview the stylesheet as a WordPress theme follow these steps: