$v) { $_tmp = explode('classname-', $k); if ($_tmp!=null && count($_tmp)>1) { ob_start(); $c = new $v('0', '0', $params[$_tmp[1]]); $out = ob_get_clean(); $params['selected-'.$_tmp[1]] = $c->getSelected(); } $_tmp = null; $_tmp = explode('wpdfont-', $k); if ($_tmp!=null && count($_tmp)>1) { ob_start(); $c = new $v('0', '0', $params[$_tmp[1]]); $out = ob_get_clean(); $params['import-'.$_tmp[1]] = $c->getImport(); } } return $params; } } if (!function_exists("wpdreams_admin_hex2rgb")) { function wpdreams_admin_hex2rgb($color) { if (strlen($color)>7) return $color; if (strlen($color)<3) return "rgba(0, 0, 0, 1)"; if ($color[0] == '#') $color = substr($color, 1); if (strlen($color) == 6) list($r, $g, $b) = array($color[0].$color[1], $color[2].$color[3], $color[4].$color[5]); elseif (strlen($color) == 3) list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]); else return false; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); return "rgba(".$r.", ".$g.", ".$b.", 1)"; } } if (!function_exists("wpdreams_four_to_string")) { function wpdreams_four_to_string($data) { // 1.Top 2.Bottom 3.Right 4.Left preg_match("/\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|(.*?)\|\|/", $data, $matches); // 1.Top 3.Right 2.Bottom 4.Left return $matches[1]." ".$matches[3]." ".$matches[2]." ".$matches[4]; } } if (!function_exists("wpdreams_box_shadow_css")) { function wpdreams_box_shadow_css($css) { $css = str_replace("\n", "", $css); preg_match("/box-shadow:(.*?)px (.*?)px (.*?)px (.*?)px (.*?);/", $css, $matches); $ci = $matches[5]; $hlength = $matches[1]; $vlength = $matches[2]; $blurradius = $matches[3]; $spread = $matches[4]; $moz_blur = ($blurradius>2)?$blurradius - 2:0; if ($hlength==0 && $vlength==0 && $blurradius==0 && $spread==0) { echo "box-shadow: none;"; } else { echo "box-shadow:".$hlength."px ".$vlength."px ".$moz_blur."px ".$spread."px ".$ci.";"; echo "-webkit-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";"; echo "-ms-box-shadow:".$hlength."px ".$vlength."px ".$blurradius."px ".$spread."px ".$ci.";"; } } } if (!function_exists("wpdreams_gradient_css")) { function wpdreams_gradient_css($data, $print=true) { $data = str_replace("\n", "", $data); preg_match("/(.*?)-(.*?)-(.*?)-(.*)/", $data, $matches); if (!isset($matches[1]) || !isset($matches[2]) || !isset($matches[3])) { // Probably only 1 color.. if ($print) echo "background: ".$data.";"; return "background: ".$data.";"; } $type = $matches[1]; $deg = $matches[2]; $color1 = wpdreams_admin_hex2rgb($matches[3]); $color2 = wpdreams_admin_hex2rgb($matches[4]); // Check for full transparency preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color1, $opacity1); preg_match("/rgba\(.*?,.*?,.*?,[\s]*(.*?)\)/", $color2, $opacity2); if (isset($opacity1[1]) && $opacity1[1] == "0" && isset($opacity2[1]) && $opacity2[1] == "0") { if ($print) echo "background: transparent;"; return "background: transparent;"; } ob_start(); //compatibility /*if (strlen($color1)>7) { preg_match("/\((.*?)\)/", $color1, $matches); $colors = explode(',', $matches[1]); echo "background: rgb($colors[0], $colors[1], $colors[2]);"; } else { echo "background: ".$color1.";"; } */ //linear if ($type!='0' || $type!=0) { ?> background-image: linear-gradient(deg, , ); background-image: -webkit-linear-gradient(deg, , ); background-image: -moz-linear-gradient(deg, , ); background-image: -o-linear-gradient(deg, , ); background-image: -ms-linear-gradient(deg, , ); background-image: -moz-radial-gradient(center, ellipse cover, , ); background-image: -webkit-gradient(radial, center center, 0px, center center, 100%, , ); background-image: -webkit-radial-gradient(center, ellipse cover, , ); background-image: -o-radial-gradient(center, ellipse cover, , ); background-image: -ms-radial-gradient(center, ellipse cover, , ); background-image: radial-gradient(ellipse at center, , ); linear-gradient(deg, , )radial-gradient(ellipse at center, , ) true, '_builtin' => false ); $output = 'names'; // or objects $operator = 'and'; // 'and' or 'or' $taxonomies = get_taxonomies( $args, $output, $operator ); return $taxonomies; } } if (!function_exists("wpdreams_get_all_terms")) { function wpdreams_get_all_terms() { $taxonomies = wpdreams_get_all_taxonomies(); $terms = array(); $_terms = array(); foreach ($taxonomies as $taxonomy) { $_temp = get_terms($taxonomy, 'orderby=name'); foreach ($_temp as $k=>$v) $terms[] = $v; } foreach ($terms as $k=>$v) { $_terms[$v->term_id] = $v; } return $_terms; } } if (!function_exists("wpdreams_get_all_term_ids")) { function wpdreams_get_all_term_ids() { $taxonomies = wpdreams_get_all_taxonomies(); $terms = array(); foreach ($taxonomies as $taxonomy) { $_temp = get_terms($taxonomy, 'orderby=name'); foreach ($_temp as $k=>$v) $terms[] = $v->term_id; } return $terms; } } ?>