Ejemplo n.º 1
0
 /**
  * Validate Color to RGBA
  * Takes the user's input color value and returns it only if it's a valid color.
  *
  * @since AvadaReduxFramework 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' => AvadaRedux_Helpers::hex2rgba($color));
 }
Ejemplo n.º 2
0
	metaboxes =>
	widget areas =>
	shortcodes =>
	icon select => gallery
	tracking =>
	* */
$iconMap = array('repeater' => 'tags', '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' . esc_html($key) . ' .theme-screenshot{background-color:' . esc_html(AvadaRedux_Helpers::hex2rgba($color, 0.45)) . ';}';
    echo '.theme-browser .theme.color' . esc_html($key) . ':hover .theme-screenshot{background-color:' . esc_html(AvadaRedux_Helpers::hex2rgba($color, 0.75)) . ';}';
}
echo '</style>';
$color = 1;
?>
<div class="wrap about-wrap">
	<h1><?php 
esc_html_e('AvadaRedux Framework - Extensions', 'avadaredux-framework');
?>
</h1>

	<div class="about-text">
		<?php 
printf(__('Supercharge your AvadaRedux experience. Our extensions provide you with features that will take your products to the next level.', 'avadaredux-framework'), esc_html($this->display_version));
?>
	</div>
 /**
  * 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 = AvadaRedux_Helpers::hex2rgba($color, $alpha);
             }
         }
         // Only build rgba output if alpha ia less than 1
         if ($alpha < 1 && $alpha != '') {
             $color = $rgba;
         }
     }
     return $color;
 }