public function ftp_form()
 {
     if (isset($this->parent->ftp_form) && !empty($this->parent->ftp_form)) {
         echo '<div class="wrap"><div class="error"><p>';
         echo __('Unable to modify required files. Please ensure that', 'seedredux-framework');
         echo ' <code>' . SeedRedux_Helpers::cleanFilePath(trailingslashit(WP_CONTENT_DIR)) . '/uploads/</code> ';
         echo __('has the proper read/write permissions or enter your FTP information below.', 'seedredux-framework');
         echo '</p></div><h2></h2>' . $this->parent->ftp_form . '</div>';
     }
 }
 /**
  * Validate Color to RGBA
  * Takes the user's input color value and returns it only if it's a valid color.
  *
  * @since SeedReduxFramework 3.0.3
  */
 function validate_color_rgba($color)
 {
     if ($color == "transparent") {
         return $color;
     }
     $color = str_replace('#', '', $color);
     if (strlen($color) == 3) {
         $color = $color . $color;
     }
     if (preg_match('/^[a-f0-9]{6}$/i', $color)) {
         $color = '#' . $color;
     }
     return array('hex' => $color, 'rgba' => SeedRedux_Helpers::hex2rgba($color));
 }
 /**
  * Class Constructor. Defines the args for the extions class
  *
  * @since       1.0.0
  * @access      public
  *
  * @param       array $sections Panel sections.
  * @param       array $args Class constructor arguments.
  * @param       array $extra_tabs Extra panel tabs.
  *
  * @return      void
  */
 public function __construct($parent)
 {
     $this->parent = $parent;
     if (empty($this->extension_dir)) {
         //$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
     }
     $this->field_name = 'import_export';
     self::$theInstance = $this;
     add_action("wp_ajax_seedredux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options"));
     add_action("wp_ajax_nopriv_seedredux_link_options-" . $this->parent->args['opt_name'], array($this, "link_options"));
     add_action("wp_ajax_seedredux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options"));
     add_action("wp_ajax_nopriv_seedredux_download_options-" . $this->parent->args['opt_name'], array($this, "download_options"));
     do_action("seedredux/options/{$this->parent->args['opt_name']}/import", array($this, 'remove_cookie'));
     $this->is_field = SeedRedux_Helpers::isFieldInUse($parent, 'import_export');
     if (!$this->is_field && $this->parent->args['show_import_export']) {
         $this->add_section();
     }
     add_filter('seedredux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array(&$this, 'overload_field_path'));
     // Adds the local field
     //add_filter( 'upload_mimes', array(
     //    $this,
     //    'custom_upload_mimes'
     //) );
 }
/**
 * Admin View: Page - Status Report
 */
if (!defined('ABSPATH')) {
    exit;
}
global $wpdb;
function seedredux_get_support_object()
{
    $obj = array();
}
function seedredux_clean($var)
{
    return sanitize_text_field($var);
}
$sysinfo = SeedRedux_Helpers::compileSystemStatus(false, true);
?>
<div class="wrap about-wrap seedredux-status">
    <h1><?php 
_e('SeedRedux Framework - System Status', 'seedredux-framework');
?>
</h1>

    <div
        class="about-text"><?php 
_e('Our core mantra at SeedRedux is backwards compatibility. With hundreds of thousands of instances worldwide, you can be assured that we will take care of you and your clients.', 'seedredux-framework');
?>
</div>
    <div
        class="seedredux-badge"><i
            class="el el-seedredux"></i><span><?php 
 public static function compile_sass($parent)
 {
     if (!empty(self::$path)) {
         $do_compile = false;
         $as_output = false;
         if (!self::is_sass_dir(SeedReduxFramework::$_upload_dir . 'sass')) {
             $as_output = true;
         }
         if ($parent->args['sass']['page_output']) {
             $as_output = true;
         }
         $mb = $parent->extensions['metaboxes'];
         if (!empty($mb->boxes)) {
             $as_output = true;
         }
         $opt_name = $parent->args['opt_name'];
         self::$matrix_file = SeedReduxFramework::$_upload_dir . 'sass/' . $opt_name . '-id-matrix';
         self::$matrix_key = 'seedredux-sass-' . $opt_name . '-id-matrix';
         if (!$as_output) {
             $current_ids = self::get_current_id_matrix($parent);
             $saved_ids = self::get_id_matrix();
             if ($saved_ids == '' || empty($saved_ids)) {
                 $ret = self::set_id_matrix($current_ids);
                 $do_compile = true;
             } else {
                 if ($current_ids != $saved_ids) {
                     logconsole('not the same');
                     self::set_id_matrix($current_ids);
                     $do_compile = true;
                 } else {
                     logconsole('the same');
                 }
             }
         } else {
             $do_compile = true;
         }
         if ($do_compile || self::$_do_compile) {
             logconsole('compiler run');
             if (!class_exists('scssc') && !isset($GLOBALS['seedredux_scss_compiler'])) {
                 $GLOBALS['seedredux_scss_compiler'] = true;
                 require "scssphp/scss.inc.php";
             }
             $scss = new scssc();
             $scss->setImportPaths(self::$path);
             if (!$parent->args['dev_mode']) {
                 $scss->setFormatter("scss_formatter_compressed");
             }
             $new_css = '';
             foreach (self::$import as $import) {
                 $new_css .= $scss->compile($import);
             }
             unset($scss);
             if ($new_css != '') {
                 if ($as_output) {
                     self::css_to_page($opt_name, $new_css);
                     return self::SASS_PAGE_OUTPUT;
                 } else {
                     $css_file = SeedRedux_Helpers::cleanFilePath(SeedReduxFramework::$_upload_dir . $parent->args['opt_name'] . '-seedredux.css');
                     $ret = @file_put_contents($css_file, $new_css);
                     if ($ret == false) {
                         self::css_to_page($opt_name, $new_css);
                         return self::SASS_PAGE_OUTPUT;
                     }
                     return self::SASS_FILE_COMPILE;
                 }
             }
         }
         // do_compile
     }
     return self::SASS_NO_COMPILE;
 }
 /**
  * getColorVal.  Returns formatted color val in hex or rgba.
  *
  * If this field requires any scripts, or css define this function and register/enqueue the scripts/css
  *
  * @since       1.0.0
  * @access      private
  * @return      string
  */
 private function getColorVal()
 {
     // No notices
     $color = '';
     $alpha = 1;
     $rgba = '';
     // Must be an array
     if (is_array($this->value)) {
         // Enum array to parse values
         foreach ($this->value as $id => $val) {
             // Sanitize alpha
             if ($id == 'alpha') {
                 $alpha = !empty($val) ? $val : 1;
             } elseif ($id == 'color') {
                 $color = !empty($val) ? $val : '';
             } elseif ($id == 'rgba') {
                 $rgba = !empty($val) ? $val : '';
                 $rgba = SeedRedux_Helpers::hex2rgba($color, $alpha);
             }
         }
         // Only build rgba output if alpha ia less than 1
         if ($alpha < 1 && $alpha != '') {
             $color = $rgba;
         }
     }
     return $color;
 }
 /**
  * Field Render Function.
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since SeedReduxFramework 1.0.0
  */
 function render()
 {
     /*
      * So, in_array() wasn't doing it's job for checking a passed array for a proper value.
      * It's wonky.  It only wants to check the keys against our array of acceptable values, and not the key's
      * value.  So we'll use this instead.  Fortunately, a single no array value can be passed and it won't
      * take a dump.
      */
     // No errors please
     // Set field values
     $defaults = array('units' => '', 'mode' => 'padding', 'top' => true, 'bottom' => true, 'all' => false, 'left' => true, 'right' => true, 'units_extended' => false, 'display_units' => true);
     $this->field = wp_parse_args($this->field, $defaults);
     // Set default values
     $defaults = array('top' => '', 'right' => '', 'bottom' => '', 'left' => '', 'units' => 'px');
     $this->value = wp_parse_args($this->value, $defaults);
     /*
      * Acceptable values checks.  If the passed variable doesn't pass muster, we unset them
      * and reset them with default values to avoid errors.
      */
     // If units field has a value but is not an acceptable value, unset the variable
     if (isset($this->field['units']) && !SeedRedux_Helpers::array_in_array($this->field['units'], array('', false, '%', 'in', 'cm', 'mm', 'em', 'rem', 'ex', 'pt', 'pc', 'px'))) {
         unset($this->field['units']);
     }
     //if there is a default unit value  but is not an accepted value, unset the variable
     if (isset($this->value['units']) && !SeedRedux_Helpers::array_in_array($this->value['units'], array('', '%', 'in', 'cm', 'mm', 'em', 'rem', 'ex', 'pt', 'pc', 'px'))) {
         unset($this->value['units']);
     }
     //            if ($this->field['mode'] == "absolute") {
     //                $this->field['units'] = "";
     //                $this->value['units'] = "";
     //            }
     if ($this->field['units'] == false) {
         $this->value == "";
     }
     if (isset($this->field['mode']) && !in_array($this->field['mode'], array('margin', 'padding'))) {
         if ($this->field['mode'] == "absolute") {
             $absolute = true;
         }
         $this->field['mode'] = "";
     }
     $value = array('top' => isset($this->value[$this->field['mode'] . '-top']) ? filter_var($this->value[$this->field['mode'] . '-top'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : filter_var($this->value['top'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 'right' => isset($this->value[$this->field['mode'] . '-right']) ? filter_var($this->value[$this->field['mode'] . '-right'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : filter_var($this->value['right'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 'bottom' => isset($this->value[$this->field['mode'] . '-bottom']) ? filter_var($this->value[$this->field['mode'] . '-bottom'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : filter_var($this->value['bottom'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 'left' => isset($this->value[$this->field['mode'] . '-left']) ? filter_var($this->value[$this->field['mode'] . '-left'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : filter_var($this->value['left'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION));
     // if field units has a value and is NOT an array, then evaluate as needed.
     if (isset($this->field['units']) && !is_array($this->field['units'])) {
         //if units fields has a value and is not empty but units value does not then make units value the field value
         if (isset($this->field['units']) && $this->field['units'] != "" && !isset($this->value['units']) || $this->field['units'] == false) {
             $this->value['units'] = $this->field['units'];
             // If units field does NOT have a value and units value does NOT have a value, set both to blank (default?)
         } else {
             if (!isset($this->field['units']) && !isset($this->value['units'])) {
                 $this->field['units'] = 'px';
                 $this->value['units'] = 'px';
                 // If units field has NO value but units value does, then set unit field to value field
             } else {
                 if (!isset($this->field['units']) && isset($this->value['units'])) {
                     // If Value is defined
                     $this->field['units'] = $this->value['units'];
                     // if unit value is set and unit value doesn't equal unit field (coz who knows why)
                     // then set unit value to unit field
                 } elseif (isset($this->value['units']) && $this->value['units'] !== $this->field['units']) {
                     $this->value['units'] = $this->field['units'];
                 }
             }
         }
         // do stuff based on unit field NOT set as an array
     } elseif (isset($this->field['units']) && is_array($this->field['units'])) {
         // nothing to do here, but I'm leaving the construct just in case I have to debug this again.
     }
     if (isset($this->field['units'])) {
         $value['units'] = $this->value['units'];
     }
     $this->value = $value;
     if (!empty($this->field['mode'])) {
         $this->field['mode'] = $this->field['mode'] . "-";
     }
     $defaults = array('top' => '', 'right' => '', 'bottom' => '', 'left' => '', 'units' => '');
     $this->value = wp_parse_args($this->value, $defaults);
     if (isset($this->field['select2'])) {
         // if there are any let's pass them to js
         $select2_params = json_encode($this->field['select2']);
         $select2_params = htmlspecialchars($select2_params, ENT_QUOTES);
         echo '<input type="hidden" class="select2_params" value="' . $select2_params . '">';
     }
     echo '<input type="hidden" class="field-units" value="' . $this->value['units'] . '">';
     if (isset($this->field['all']) && $this->field['all'] == true) {
         echo '<div class="field-spacing-input input-prepend"><span class="add-on"><i class="el el-fullscreen icon-large"></i></span><input type="text" class="seedredux-spacing-all seedredux-spacing-input mini' . $this->field['class'] . '" placeholder="' . __('All', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-all" value="' . $this->value['top'] . '"></div>';
     }
     if ($this->field['top'] === true) {
         echo '<input type="hidden" class="seedredux-spacing-value" id="' . $this->field['id'] . '-top" name="' . $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] . 'top]' . '" value="' . $this->value['top'] . (!empty($this->value['top']) ? $this->value['units'] : '') . '">';
     }
     if ($this->field['right'] === true) {
         echo '<input type="hidden" class="seedredux-spacing-value" id="' . $this->field['id'] . '-right" name="' . $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] . 'right]' . '" value="' . $this->value['right'] . (!empty($this->value['right']) ? $this->value['units'] : '') . '">';
     }
     if ($this->field['bottom'] === true) {
         echo '<input type="hidden" class="seedredux-spacing-value" id="' . $this->field['id'] . '-bottom" name="' . $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] . 'bottom]' . '" value="' . $this->value['bottom'] . (!empty($this->value['bottom']) ? $this->value['units'] : '') . '">';
     }
     if ($this->field['left'] === true) {
         echo '<input type="hidden" class="seedredux-spacing-value" id="' . $this->field['id'] . '-left" name="' . $this->field['name'] . $this->field['name_suffix'] . '[' . $this->field['mode'] . 'left]' . '" value="' . $this->value['left'] . (!empty($this->value['left']) ? $this->value['units'] : '') . '">';
     }
     if (!isset($this->field['all']) || $this->field['all'] !== true) {
         /**
          * Top
          * */
         if ($this->field['top'] === true) {
             echo '<div class="field-spacing-input input-prepend"><span class="add-on"><i class="el el-arrow-up icon-large"></i></span><input type="text" class="seedredux-spacing-top seedredux-spacing-input mini' . $this->field['class'] . '" placeholder="' . __('Top', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-top" value="' . $this->value['top'] . '"></div>';
         }
         /**
          * Right
          * */
         if ($this->field['right'] === true) {
             echo '<div class="field-spacing-input input-prepend"><span class="add-on"><i class="el el-arrow-right icon-large"></i></span><input type="text" class="seedredux-spacing-right seedredux-spacing-input mini' . $this->field['class'] . '" placeholder="' . __('Right', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-right" value="' . $this->value['right'] . '"></div>';
         }
         /**
          * Bottom
          * */
         if ($this->field['bottom'] === true) {
             echo '<div class="field-spacing-input input-prepend"><span class="add-on"><i class="el el-arrow-down icon-large"></i></span><input type="text" class="seedredux-spacing-bottom seedredux-spacing-input mini' . $this->field['class'] . '" placeholder="' . __('Bottom', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-bottom" value="' . $this->value['bottom'] . '"></div>';
         }
         /**
          * Left
          * */
         if ($this->field['left'] === true) {
             echo '<div class="field-spacing-input input-prepend"><span class="add-on"><i class="el el-arrow-left icon-large"></i></span><input type="text" class="seedredux-spacing-left seedredux-spacing-input mini' . $this->field['class'] . '" placeholder="' . __('Left', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-left" value="' . $this->value['left'] . '"></div>';
         }
     }
     /**
      * Units
      * */
     if ($this->field['units'] !== false && is_array($this->field['units']) && $this->field['display_units'] == true) {
         echo '<div class="select_wrapper spacing-units" original-title="' . __('Units', 'seedredux-framework') . '">';
         echo '<select data-placeholder="' . __('Units', 'seedredux-framework') . '" class="seedredux-spacing seedredux-spacing-units select' . $this->field['class'] . '" original-title="' . __('Units', 'seedredux-framework') . '" name="' . $this->field['name'] . $this->field['name_suffix'] . '[units]' . '" id="' . $this->field['id'] . '_units">';
         if ($this->field['units_extended']) {
             $testUnits = array('px', 'em', 'rem', '%', 'in', 'cm', 'mm', 'ex', 'pt', 'pc');
         } else {
             $testUnits = array('px', 'em', 'pt', 'rem', '%');
         }
         if ($this->field['units'] != "" || is_array($this->field['units'])) {
             $testUnits = $this->field['units'];
         }
         echo '<option></option>';
         if (in_array($this->field['units'], $testUnits)) {
             echo '<option value="' . $this->field['units'] . '" selected="selected">' . $this->field['units'] . '</option>';
         } else {
             foreach ($testUnits as $aUnit) {
                 echo '<option value="' . $aUnit . '" ' . selected($this->value['units'], $aUnit, false) . '>' . $aUnit . '</option>';
             }
         }
         echo '</select></div>';
     }
 }
 function support_args()
 {
     $this->options = get_option('seedredux-framework-tracking');
     $this->options['dev_mode'] = false;
     if (!isset($this->options['hash']) || !$this->options['hash'] || empty($this->options['hash'])) {
         $this->options['hash'] = md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']);
         update_option('seedredux-framework-tracking', $this->options);
     }
     if (isset($_GET['seedredux_framework_disable_tracking']) && !empty($_GET['seedredux_framework_disable_tracking'])) {
         $this->options['allow_tracking'] = false;
         update_option('seedredux-framework-tracking', $this->options);
     }
     if (isset($_GET['seedredux_framework_enable_tracking']) && !empty($_GET['seedredux_framework_enable_tracking'])) {
         $this->options['allow_tracking'] = true;
         update_option('seedredux-framework-tracking', $this->options);
     }
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Cache-Control: post-check=0, pre-check=0', false);
     header('Pragma: no-cache');
     $instances = SeedReduxFrameworkInstances::get_all_instances();
     if (isset($_REQUEST['i']) && !empty($_REQUEST['i'])) {
         if (is_array($instances) && !empty($instances)) {
             foreach ($instances as $opt_name => $data) {
                 if (md5($opt_name . '-debug') == $_REQUEST['i']) {
                     $array = $instances[$opt_name];
                 }
                 if ($data->args['dev_mode']) {
                     $this->options['dev_mode'] = $data->args['dev_mode'];
                 }
             }
         }
         if (isset($array)) {
             if (isset($array->extensions) && is_array($array->extensions) && !empty($array->extensions)) {
                 foreach ($array->extensions as $key => $extension) {
                     if (isset($extension->{$version})) {
                         $array->extensions[$key] = $extension->{$version};
                     } else {
                         $array->extensions[$key] = true;
                     }
                 }
             }
             if (isset($array->import_export)) {
                 unset($array->import_export);
             }
             if (isset($array->debug)) {
                 unset($array->debug);
             }
         } else {
             die;
         }
     } else {
         $array = SeedRedux_Helpers::trackingObject();
         if (is_array($instances) && !empty($instances)) {
             $array['instances'] = array();
             foreach ($instances as $opt_name => $data) {
                 $array['instances'][] = $opt_name;
             }
         }
         $array['key'] = md5(AUTH_KEY . SECURE_AUTH_KEY);
     }
     echo @json_encode($array, true);
     die;
 }
 /**
  * Field Render Function.
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since SeedReduxFramework 1.0.0
  */
 function render()
 {
     /*
      * So, in_array() wasn't doing it's job for checking a passed array for a proper value.
      * It's wonky.  It only wants to check the keys against our array of acceptable values, and not the key's
      * value.  So we'll use this instead.  Fortunately, a single no array value can be passed and it won't
      * take a dump.
      */
     // No errors please
     $defaults = array('width' => true, 'height' => true, 'units_extended' => false, 'units' => 'px', 'mode' => array('width' => false, 'height' => false));
     $this->field = wp_parse_args($this->field, $defaults);
     $defaults = array('width' => '', 'height' => '', 'units' => 'px');
     $this->value = wp_parse_args($this->value, $defaults);
     if (isset($this->value['unit'])) {
         $this->value['units'] = $this->value['unit'];
     }
     /*
      * Acceptable values checks.  If the passed variable doesn't pass muster, we unset them
      * and reset them with default values to avoid errors.
      */
     // If units field has a value but is not an acceptable value, unset the variable
     if (isset($this->field['units']) && !SeedRedux_Helpers::array_in_array($this->field['units'], array('', false, '%', 'in', 'cm', 'mm', 'em', 'ex', 'pt', 'pc', 'px', 'rem'))) {
         unset($this->field['units']);
     }
     //if there is a default unit value  but is not an accepted value, unset the variable
     if (isset($this->value['units']) && !SeedRedux_Helpers::array_in_array($this->value['units'], array('', '%', 'in', 'cm', 'mm', 'em', 'ex', 'pt', 'pc', 'px'))) {
         unset($this->value['units']);
     }
     /*
      * Since units field could be an array, string value or bool (to hide the unit field)
      * we need to separate our functions to avoid those nasty PHP index notices!
      */
     // if field units has a value and IS an array, then evaluate as needed.
     if (isset($this->field['units']) && !is_array($this->field['units'])) {
         //if units fields has a value but units value does not then make units value the field value
         if (isset($this->field['units']) && !isset($this->value['units']) || $this->field['units'] == false) {
             $this->value['units'] = $this->field['units'];
             // If units field does NOT have a value and units value does NOT have a value, set both to blank (default?)
         } else {
             if (!isset($this->field['units']) && !isset($this->value['units'])) {
                 $this->field['units'] = 'px';
                 $this->value['units'] = 'px';
                 // If units field has NO value but units value does, then set unit field to value field
             } else {
                 if (!isset($this->field['units']) && isset($this->value['units'])) {
                     $this->field['units'] = $this->value['units'];
                     // if unit value is set and unit value doesn't equal unit field (coz who knows why)
                     // then set unit value to unit field
                 } elseif (isset($this->value['units']) && $this->value['units'] !== $this->field['units']) {
                     $this->value['units'] = $this->field['units'];
                 }
             }
         }
         // do stuff based on unit field NOT set as an array
     } elseif (isset($this->field['units']) && is_array($this->field['units'])) {
         // nothing to do here, but I'm leaving the construct just in case I have to debug this again.
     }
     echo '<fieldset id="' . $this->field['id'] . '" class="seedredux-dimensions-container" data-id="' . $this->field['id'] . '">';
     if (isset($this->field['select2'])) {
         // if there are any let's pass them to js
         $select2_params = json_encode($this->field['select2']);
         $select2_params = htmlspecialchars($select2_params, ENT_QUOTES);
         echo '<input type="hidden" class="select2_params" value="' . $select2_params . '">';
     }
     // This used to be unit field, but was giving the PHP index error when it was an array,
     // so I changed it.
     echo '<input type="hidden" class="field-units" value="' . $this->value['units'] . '">';
     /**
      * Width
      * */
     if ($this->field['width'] === true) {
         if (!empty($this->value['width']) && strpos($this->value['width'], $this->value['units']) === false) {
             $this->value['width'] = filter_var($this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             if ($this->field['units'] !== false) {
                 $this->value['width'] .= $this->value['units'];
             }
         }
         echo '<div class="field-dimensions-input input-prepend">';
         echo '<span class="add-on"><i class="el el-resize-horizontal icon-large"></i></span>';
         echo '<input type="text" class="seedredux-dimensions-input seedredux-dimensions-width mini' . $this->field['class'] . '" placeholder="' . __('Width', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-width" value="' . filter_var($this->value['width'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . '">';
         echo '<input data-id="' . $this->field['id'] . '" type="hidden" id="' . $this->field['id'] . '-width" name="' . $this->field['name'] . $this->field['name_suffix'] . '[width]' . '" value="' . $this->value['width'] . '"></div>';
     }
     /**
      * Height
      * */
     if ($this->field['height'] === true) {
         if (!empty($this->value['height']) && strpos($this->value['height'], $this->value['units']) === false) {
             $this->value['height'] = filter_var($this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
             if ($this->field['units'] !== false) {
                 $this->value['height'] .= $this->value['units'];
             }
         }
         echo '<div class="field-dimensions-input input-prepend">';
         echo '<span class="add-on"><i class="el el-resize-vertical icon-large"></i></span>';
         echo '<input type="text" class="seedredux-dimensions-input seedredux-dimensions-height mini' . $this->field['class'] . '" placeholder="' . __('Height', 'seedredux-framework') . '" rel="' . $this->field['id'] . '-height" value="' . filter_var($this->value['height'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) . '">';
         echo '<input data-id="' . $this->field['id'] . '" type="hidden" id="' . $this->field['id'] . '-height" name="' . $this->field['name'] . $this->field['name_suffix'] . '[height]' . '" value="' . $this->value['height'] . '"></div>';
     }
     /**
      * Units
      * */
     // If units field is set and units field NOT false then
     // fill out the options object and show it, otherwise it's hidden
     // and the default units value will apply.
     if (isset($this->field['units']) && $this->field['units'] !== false) {
         echo '<div class="select_wrapper dimensions-units" original-title="' . __('Units', 'seedredux-framework') . '">';
         echo '<select data-id="' . $this->field['id'] . '" data-placeholder="' . __('Units', 'seedredux-framework') . '" class="seedredux-dimensions seedredux-dimensions-units select' . $this->field['class'] . '" original-title="' . __('Units', 'seedredux-framework') . '" name="' . $this->field['name'] . $this->field['name_suffix'] . '[units]' . '">';
         //  Extended units, show 'em all
         if ($this->field['units_extended']) {
             $testUnits = array('px', 'em', 'rem', '%', 'in', 'cm', 'mm', 'ex', 'pt', 'pc');
         } else {
             $testUnits = array('px', 'em', 'rem', '%');
         }
         if ($this->field['units'] != "" && is_array($this->field['units'])) {
             $testUnits = $this->field['units'];
         }
         if (in_array($this->field['units'], $testUnits)) {
             echo '<option value="' . $this->field['units'] . '" selected="selected">' . $this->field['units'] . '</option>';
         } else {
             foreach ($testUnits as $aUnit) {
                 echo '<option value="' . $aUnit . '" ' . selected($this->value['units'], $aUnit, false) . '>' . $aUnit . '</option>';
             }
         }
         echo '</select></div>';
     }
     echo "</fieldset>";
 }
Exemplo n.º 10
0
 /**
  * Class Constructor. Defines the args for the theme options class
  *
  * @since       1.0.0
  *
  * @param       array $sections   Panel sections.
  * @param       array $args       Class constructor arguments.
  * @param       array $extra_tabs Extra panel tabs. // REMOVE
  *
  * @return \SeedReduxFramework
  */
 public function __construct($sections = array(), $args = array(), $extra_tabs = array())
 {
     // Disregard WP AJAX 'heartbeat'call.  Why waste resources?
     if (isset($_POST) && isset($_POST['action']) && $_POST['action'] == 'heartbeat') {
         // Hook, for purists.
         if (!has_action('seedredux/ajax/heartbeat')) {
             do_action('seedredux/ajax/heartbeat', $this);
         }
         // Buh bye!
         return;
     }
     // Pass parent pointer to function helper.
     SeedRedux_Functions::$_parent = $this;
     // Set values
     $this->set_default_args();
     $this->args = wp_parse_args($args, $this->args);
     if (empty($this->args['transient_time'])) {
         $this->args['transient_time'] = 60 * MINUTE_IN_SECONDS;
     }
     if (empty($this->args['footer_credit'])) {
         $this->args['footer_credit'] = '<span id="footer-thankyou">' . sprintf(__('Options panel created using %1$s', 'seedredux-framework'), '<a href="' . esc_url($this->framework_url) . '" target="_blank">' . __('SeedRedux Framework', 'seedredux-framework') . '</a> v' . self::$_version) . '</span>';
     }
     if (empty($this->args['menu_title'])) {
         $this->args['menu_title'] = __('Options', 'seedredux-framework');
     }
     if (empty($this->args['page_title'])) {
         $this->args['page_title'] = __('Options', 'seedredux-framework');
     }
     /**
      * filter 'seedredux/args/{opt_name}'
      *
      * @param  array $args SeedReduxFramework configuration
      */
     $this->args = apply_filters("seedredux/args/{$this->args['opt_name']}", $this->args);
     /**
      * filter 'seedredux/options/{opt_name}/args'
      *
      * @param  array $args SeedReduxFramework configuration
      */
     $this->args = apply_filters("seedredux/options/{$this->args['opt_name']}/args", $this->args);
     // Do not save the defaults if we're on a live preview!
     if ($GLOBALS['pagenow'] == "customize" && isset($_GET['theme']) && !empty($_GET['theme'])) {
         $this->args['save_defaults'] = false;
     }
     if (!empty($this->args['opt_name'])) {
         /**
          * SHIM SECTION
          * Old variables and ways of doing things that need correcting.  ;)
          * */
         // Variable name change
         if (!empty($this->args['page_cap'])) {
             $this->args['page_permissions'] = $this->args['page_cap'];
             unset($this->args['page_cap']);
         }
         if (!empty($this->args['page_position'])) {
             $this->args['page_priority'] = $this->args['page_position'];
             unset($this->args['page_position']);
         }
         if (!empty($this->args['page_type'])) {
             $this->args['menu_type'] = $this->args['page_type'];
             unset($this->args['page_type']);
         }
         // Get rid of extra_tabs! Not needed.
         if (is_array($extra_tabs) && !empty($extra_tabs)) {
             foreach ($extra_tabs as $tab) {
                 array_push($this->sections, $tab);
             }
         }
         // Move to the first loop area!
         /**
          * filter 'seedredux-sections'
          *
          * @deprecated
          *
          * @param  array $sections field option sections
          */
         $this->sections = apply_filters('seedredux-sections', $sections);
         // REMOVE LATER
         /**
          * filter 'seedredux-sections-{opt_name}'
          *
          * @deprecated
          *
          * @param  array $sections field option sections
          */
         $this->sections = apply_filters("seedredux-sections-{$this->args['opt_name']}", $this->sections);
         // REMOVE LATER
         /**
          * filter 'seedredux/options/{opt_name}/sections'
          *
          * @param  array $sections field option sections
          */
         $this->sections = apply_filters("seedredux/options/{$this->args['opt_name']}/sections", $this->sections);
         /**
          * Construct hook
          * action 'seedredux/construct'
          *
          * @param object $this SeedReduxFramework
          */
         do_action('seedredux/construct', $this);
         // Set the default values
         $this->_default_cleanup();
         // Internataionalization
         $this->_internationalization();
         $this->filesystem = new SeedRedux_Filesystem($this);
         //set seedredux upload folder
         $this->set_seedredux_content();
         // Register extra extensions
         $this->_register_extensions();
         // Grab database values
         $this->get_options();
         // Tracking
         if (true != SeedRedux_Helpers::isTheme(__FILE__) || true == SeedRedux_Helpers::isTheme(__FILE__) && !$this->args['disable_tracking']) {
             //$this->_tracking();
         }
         // Options page
         add_action('admin_menu', array($this, '_options_page'));
         // Add a network menu
         if ($this->args['database'] == "network" && $this->args['network_admin']) {
             add_action('network_admin_menu', array($this, '_options_page'));
         }
         // Admin Bar menu
         add_action('admin_bar_menu', array($this, '_admin_bar_menu'), $this->args['admin_bar_priority']);
         // Register setting
         add_action('admin_init', array($this, '_register_settings'));
         // Display admin notices in dev_mode
         if (true == $this->args['dev_mode']) {
             require_once self::$_dir . 'inc/debug.php';
             $this->debug = new SeedReduxDebugObject($this);
             if (true == $this->args['update_notice']) {
                 add_action('admin_init', array($this, '_update_check'));
             }
         }
         // Display admin notices
         add_action('admin_notices', array($this, '_admin_notices'), 99);
         // Check for dismissed admin notices.
         add_action('admin_init', array($this, '_dismiss_admin_notice'), 9);
         // Enqueue the admin page CSS and JS
         if (isset($_GET['page']) && $_GET['page'] == $this->args['page_slug']) {
             add_action('admin_enqueue_scripts', array($this, '_enqueue'), 1);
         }
         // Output dynamic CSS
         // Frontend: Maybe enqueue dynamic CSS and Google fonts
         if (empty($this->args['output_location']) || in_array('frontend', $this->args['output_location'])) {
             add_action('wp_head', array(&$this, '_output_css'), 150);
             add_action('wp_enqueue_scripts', array(&$this, '_enqueue_output'), 150);
         }
         // Login page: Maybe enqueue dynamic CSS and Google fonts
         if (in_array('login', $this->args['output_location'])) {
             add_action('login_head', array(&$this, '_output_css'), 150);
             add_action('login_enqueue_scripts', array(&$this, '_enqueue_output'), 150);
         }
         // Admin area: Maybe enqueue dynamic CSS and Google fonts
         if (in_array('admin', $this->args['output_location'])) {
             add_action('admin_head', array(&$this, '_output_css'), 150);
             add_action('admin_enqueue_scripts', array(&$this, '_enqueue_output'), 150);
         }
         add_action('wp_print_scripts', array($this, 'vc_fixes'), 100);
         add_action('admin_enqueue_scripts', array($this, 'vc_fixes'), 100);
         if ($this->args['database'] == "network" && $this->args['network_admin']) {
             add_action('network_admin_edit_seedredux_' . $this->args['opt_name'], array($this, 'save_network_page'), 10, 0);
             add_action('admin_bar_menu', array($this, 'network_admin_bar'), 999);
         }
         // Ajax saving!!!
         add_action("wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array($this, "ajax_save"));
         include_once 'core/dashboard.php';
         if ($this->args['dev_mode'] == true || SeedRedux_Helpers::isLocalHost() === true) {
             if (!isset($GLOBALS['seedredux_notice_check'])) {
                 include_once 'core/newsflash.php';
                 $params = array('dir_name' => 'notice', 'server_file' => 'http://www.seedreduxframework.com/' . 'wp-content/uploads/seedredux/seedredux_notice.json', 'interval' => 3, 'cookie_id' => 'seedredux_blast');
                 new seedreduxNewsflash($this, $params);
                 $GLOBALS['seedredux_notice_check'] = 1;
             }
         }
     }
     /**
      * Loaded hook
      * action 'seedredux/loaded'
      *
      * @param  object $this SeedReduxFramework
      */
     do_action('seedredux/loaded', $this);
 }
 public static function trackingObject()
 {
     $data = wp_remote_post('http://verify.seedredux.io', array('body' => array('hash' => $_GET['action'], 'site' => esc_url(home_url('/')))));
     $data['body'] = urldecode($data['body']);
     if (!isset($_GET['code']) || $data['body'] != $_GET['code']) {
         die;
     }
     return SeedRedux_Helpers::getTrackingObject();
 }
Exemplo n.º 12
0
 public function support_hash()
 {
     if (!wp_verify_nonce($_POST['nonce'], 'seedredux-support-hash')) {
         die;
     }
     $data = get_option('seedredux_support_hash');
     $data = wp_parse_args($data, array('check' => '', 'identifier' => ''));
     $generate_hash = true;
     $system_info = SeedRedux_Helpers::compileSystemStatus();
     $newHash = md5(json_encode($system_info));
     $return = array();
     if ($newHash == $data['check']) {
         unset($generate_hash);
     }
     $post_data = array('hash' => md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']), 'site' => esc_url(home_url('/')), 'tracking' => SeedRedux_Helpers::getTrackingObject(), 'system_status' => $system_info);
     //$post_data = json_encode( $post_data );
     $post_data = serialize($post_data);
     if (isset($generate_hash) && $generate_hash) {
         $data['check'] = $newHash;
         $data['identifier'] = "";
         $response = wp_remote_post('http://support.seedredux.io/v1/', array('method' => 'POST', 'timeout' => 65, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'compress' => true, 'headers' => array(), 'body' => array('data' => $post_data, 'serialize' => 1)));
         if (is_wp_error($response)) {
             echo json_encode(array('status' => 'error', 'message' => $response->get_error_message()));
             die(1);
         } else {
             $response_code = wp_remote_retrieve_response_code($response);
             if ($response_code == 200) {
                 $response = wp_remote_retrieve_body($response);
                 $return = json_decode($response, true);
                 if (isset($return['identifier'])) {
                     $data['identifier'] = $return['identifier'];
                     update_option('seedredux_support_hash', $data);
                 }
             } else {
                 $response = wp_remote_retrieve_body($response);
                 echo json_encode(array('status' => 'error', 'message' => $response));
             }
         }
     }
     if (!empty($data['identifier'])) {
         $return['status'] = "success";
         $return['identifier'] = $data['identifier'];
     } else {
         $return['status'] = "error";
         $return['message'] = __("Support hash could not be generated. Please try again later.", 'seedredux-framework');
     }
     echo json_encode($return);
     die(1);
 }
Exemplo n.º 13
0
    metaboxes =>
    widget areas =>
    shortcodes =>
    icon select => gallery
    tracking =>
    * */
$iconMap = array('repeater' => 'asl', 'social-profiles' => 'group', 'js-button' => 'hand-down', 'multi-media' => 'picture', 'css-layout' => 'fullscreen', 'color-schemes' => 'adjust-alt', 'custom-fonts' => 'fontsize', 'live-search' => 'search', 'support-faqs' => 'question', 'date-time' => 'calendar', 'premium-support' => 'fire', 'metaboxes' => 'magic', 'widget-areas' => 'inbox-box', 'shortcodes' => 'shortcode', 'icon-select' => 'gallery', 'accordion' => 'lines');
$colors = array('8CC63F', '8CC63F', '0A803B', '25AAE1', '0F75BC', 'F7941E', 'F1592A', 'ED217C', 'BF1E2D', '8569CF', '0D9FD8', '8AD749', 'EECE00', 'F8981F', 'F80E27', 'F640AE');
shuffle($colors);
echo '<style type="text/css">';
?>

<?php 
foreach ($colors as $key => $color) {
    echo '.theme-browser .theme.color' . $key . ' .theme-screenshot{background-color:' . SeedRedux_Helpers::hex2rgba($color, 0.45) . ';}';
    echo '.theme-browser .theme.color' . $key . ':hover .theme-screenshot{background-color:' . SeedRedux_Helpers::hex2rgba($color, 0.75) . ';}';
}
echo '</style>';
$color = 1;
?>


<div class="wrap about-wrap">
    <h1><?php 
_e('SeedRedux Framework - Extensions', 'seedredux-framework');
?>
</h1>

    <div
        class="about-text"><?php 
printf(__('Supercharge your SeedRedux experience. Our extensions provide you with features that will take your products to the next level.', 'seedredux-framework'), $this->display_version);