function customization_settings_box() { $cuttz_customizations = cuttz_customization_aggregator(); ?> <div class="gl-section"> <div class="gl-desc"> <table class="gl-col-table"> <tr> <td colspan="2"> <p class="l-desc"><label><?php _e('Please select a skin to use. The following skins are available.', 'cuttz-framework'); ?> </label></p> </td> </tr><tr> <td class="gl-label"><p> <label for="<?php echo $this->settings_field . '[skin]'; ?> "><?php _e('Skins', 'cuttz-framework'); ?> </label> </p></td> <td class="cuttz-input"><p> <?php if (is_array($cuttz_customizations)) { echo '<select class="customization" id="' . $this->settings_field . '[skin]" name="' . $this->settings_field . '[skin]">'; $current_customization = genesis_get_option('skin', $this->settings_field, false); foreach ($cuttz_customizations as $key => $value) { $selected = selected($current_customization, $key, 0); echo '<option ' . $selected . ' value="' . $key . '">' . $value['name'] . '</option>' . "\n"; } echo '</select>'; } else { _e('Currently there are no customizations. But you can create one.', 'cuttz-framework'); } ?> </p></td> </tr> <tr><td colspan="2"><p><?php printf(__('Please go to <a href="%s" >Cuttz Design</a> to set up the initial design.', 'cuttz-framework'), esc_url(menu_page_url(cuttz_get_skin_page_id(), 0))); ?> </p><?php $current_skin = genesis_get_option('skin', $this->settings_field, false); if (is_array($cuttz_customizations) && array_key_exists($current_skin, $cuttz_customizations)) { $current_skin = $cuttz_customizations[$current_skin]; if ($current_skin['type'] != 'core') { echo '<p>' . __('Please edit the following file(s) to customize the skin further.', 'cuttz-framework') . '</p>'; if (array_key_exists('functions', $current_skin)) { echo '<pre>■ ' . str_ireplace(ABSPATH, '', $current_skin['functions']) . '</pre>'; } if (array_key_exists('sass', $current_skin)) { $path = str_ireplace(ABSPATH, '', $current_skin['functions']); $path = str_ireplace('functions.php', 'style.scss', $path); echo '<pre>■ ' . $path . '</pre>'; } } } ?> </td></tr> <tr><td class="gl-label"><p class="l-desc"><label><?php _e('Or create a new skin', 'cuttz-framework'); ?> </label></p></td><td class="cuttz-input"> <p><input class="new-skin" type="text" id="<?php echo $this->settings_field; ?> [new-skin]" name="<?php echo $this->settings_field; ?> [new-skin]" value="<?php ?> " /></p> </td></tr> </table> </div> </div> <?php }
function cuttz_current_skin() { $skin = ''; $available_skins = cuttz_customization_aggregator(); $skin = genesis_get_option('skin', CHILD_SETTINGS_FIELD_EXTRAS, false); if (is_array($available_skins) && array_key_exists($skin, $available_skins)) { return $available_skins[$skin]; } }
/** * Enqueues the skin specific css * @return none * @since 1.0 */ function cuttz_customizations_css() { if (!genesis_get_option('current-skin-style-enabled', CHILD_SETTINGS_FIELD_EXTRAS, false)) { return; } $customization = ''; $all_customizations = cuttz_customization_aggregator(); $customization = genesis_get_option('skin', CHILD_SETTINGS_FIELD_EXTRAS, false); if (is_array($all_customizations) && array_key_exists($customization, $all_customizations)) { $current_customization = $all_customizations[$customization]; if (is_array($current_customization) && array_key_exists('style', $current_customization)) { wp_enqueue_style('cuttz-customization-style', $current_customization['style']); } } }