/**
  * create input field for CSS export
  *
  * @return
  */
 static function export_css_input($field, $item)
 {
     // bail if items missing
     if (!$field || !$item) {
         return;
     }
     // first check for the data
     $saved = get_option('gppro-settings');
     // display message without saved options
     if (empty($saved)) {
         $text = __('No data has been saved. Please save your settings before attempting to export.', 'gppro-export-css');
         return '<div class="gppro-input gppro-description-input"><p class="description">' . esc_attr($text) . '</p></div>';
     }
     // get my values
     $id = GP_Pro_Helper::get_field_id($field);
     $name = GP_Pro_Helper::get_field_name($field);
     $button = !empty($item['button']) ? esc_attr($item['button']) : __('Export File', 'gppro-export-css');
     // get CSS file for link
     $file = Genesis_Palette_Pro::filebase();
     // create export URL with nonce
     $expnonce = wp_create_nonce('gppro_css_export_nonce');
     // set the empty
     $input = '';
     // begin markup
     $input .= '<div class="gppro-input gppro-css-export-input gppro-setting-input">';
     // handle label with optional CSS file link
     $input .= '<div class="gppro-input-item gppro-input-wrap"><p class="description">';
     $input .= esc_attr($item['label']);
     // handle browser link
     if (file_exists($file['dir']) && !empty($file['url'])) {
         $input .= '<a class="gppro-css-export-view" href="' . esc_url($file['url']) . '" title="' . __('View in browser', 'gppro-export-css') . '" target="_blank">';
         $input .= '<i class="dashicons dashicons-admin-site"></i>';
         $input .= '</a>';
     }
     $input .= '</p></div>';
     // display button
     $input .= '<div class="gppro-input-item gppro-input-label choice-label">';
     $input .= '<span class="gppro-settings-button">';
     $input .= '<a name="' . esc_attr($name) . '" id="' . sanitize_html_class($id) . '" href="' . menu_page_url('genesis-palette-pro', 0) . '&gppro-css-export=go&_wpnonce=' . $expnonce . '" class="button-primary button-small ' . esc_attr($field) . '">' . $button . '</a>';
     $input .= '</span>';
     $input .= '</div>';
     // close markup
     $input .= '</div>';
     // send it back
     return $input;
 }
 /**
  * Create the input fields for the custom CSS entry.
  *
  * @param  array $field  The parameters of the defined field.
  * @param  array $item   The array of data contained.
  *
  * @return mixed/HTML $input  The new input field.
  */
 public static function freeform_css_input($field, $item)
 {
     // Get the standard field info.
     $id = GP_Pro_Helper::get_field_id($field);
     $name = GP_Pro_Helper::get_field_name($field);
     // Fetch the viewport field.
     $view = !empty($item['viewport']) ? $item['viewport'] : 'global';
     // Get our custom data.
     $value = self::get_custom_css($view);
     // Start the field.
     $input = '';
     // Set the field wrappers.
     $input .= '<div class="gppro-input gppro-freeform-input">';
     $input .= '<div class="gppro-input-wrap gppro-freeform-wrap">';
     // Show the description above the field.
     $input .= !empty($item['desc']) ? '<p class="description">' . esc_html($item['desc']) . '</p>' : '';
     // Load the textarea itself.
     $input .= '<textarea name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" class="widefat code css-entry css-global">' . esc_html($value) . '</textarea>';
     // Load the viewport button.
     $input .= '<span data-viewport="' . esc_attr($view) . '" class="button button-secondary button-small gppro-button-right gppro-freeform-preview">' . __('Preview CSS', 'gp-pro-freeform-style') . '</span>';
     // Close up the field wrapper.
     $input .= '</div>';
     $input .= '</div>';
     // Send it back.
     return $input;
 }
 /**
  * check for correct child theme being active
  *
  * @return notice
  */
 public function enews_active_check()
 {
     // Confirm we are on the correct screen to check.
     if (class_exists('GP_Pro_Utilities') && false === ($check = GP_Pro_Utilities::check_current_dpp_screen())) {
         return;
     }
     // get our Genesis Plugin dependency name
     $info = $this->plugin_info();
     // Bail without our file, name, or key.
     if (empty($info['file']) || empty($info['name']) || empty($info['key'])) {
         return;
     }
     // set the file and name
     $file = esc_attr($info['file']);
     $name = esc_attr($info['name']);
     $key = esc_attr($info['key']);
     // Check our ignore flag.
     if (class_exists('GP_Pro_Helper') && false !== ($ignore = GP_Pro_Helper::get_single_option('gppro-warning-' . $key, '', false))) {
         return;
     }
     // check if plugin is active, display warning
     if (false === ($active = is_plugin_active($file))) {
         echo '<div id="message" class="error notice gppro-admin-warning gppro-admin-warning-' . $key . '"><p>';
         echo '<strong>' . __('Warning: You have the ' . $name . ' widget add-on enabled but do not have the ' . $name . ' plugin active.', 'gpwen') . '</strong>';
         echo '<span class="ignore" data-child="' . $key . '">' . __('Ignore this message', 'gpwen') . '</span>';
         echo '</p></div>';
     }
 }