本文整理汇总了PHP中RevSliderFunctions::add_missing_val方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctions::add_missing_val方法的具体用法?PHP RevSliderFunctions::add_missing_val怎么用?PHP RevSliderFunctions::add_missing_val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderFunctions
的用法示例。
在下文中一共展示了RevSliderFunctions::add_missing_val方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseDbArrayToCss
public static function parseDbArrayToCss($cssArray, $nl = "\n\r")
{
$css = '';
$deformations = self::get_deformation_css_tags();
$transparency = array('color' => 'color-transparency', 'background-color' => 'background-transparency', 'border-color' => 'border-transparency');
$check_parameters = array('border-width' => 'px', 'border-radius' => 'px', 'padding' => 'px', 'font-size' => 'px', 'line-height' => 'px');
foreach ($cssArray as $id => $attr) {
$stripped = '';
if (strpos($attr['handle'], '.tp-caption') !== false) {
$stripped = trim(str_replace('.tp-caption', '', $attr['handle']));
}
$attr['advanced'] = json_decode($attr['advanced'], true);
$styles = json_decode(str_replace("'", '"', $attr['params']), true);
$styles_adv = $attr['advanced']['idle'];
if ($stripped == '.News-Title') {
/*echo '<pre>';
print_r($attr);
echo '</pre>';
exit;*/
}
$css .= $attr['handle'];
if (!empty($stripped)) {
$css .= ', ' . $stripped;
}
$css .= " {" . $nl;
if (is_array($styles) || is_array($styles_adv)) {
if (is_array($styles)) {
foreach ($styles as $name => $style) {
if (in_array($name, $deformations) && $name !== 'css_cursor') {
continue;
}
if (!is_array($name) && isset($transparency[$name])) {
//the style can have transparency!
if (isset($styles[$transparency[$name]]) && $style !== 'transparent') {
$style = RevSliderFunctions::hex2rgba($style, $styles[$transparency[$name]] * 100);
}
}
if (!is_array($name) && isset($check_parameters[$name])) {
$style = RevSliderFunctions::add_missing_val($style, $check_parameters[$name]);
}
if (is_array($style)) {
$style = implode(' ', $style);
}
$ret = self::check_for_modifications($name, $style);
if ($ret['name'] == 'cursor' && $ret['style'] == 'auto') {
continue;
}
$css .= $ret['name'] . ':' . $ret['style'] . ";" . $nl;
}
}
if (is_array($styles_adv)) {
foreach ($styles_adv as $name => $style) {
if (in_array($name, $deformations) && $name !== 'css_cursor') {
continue;
}
if (is_array($style)) {
$style = implode(' ', $style);
}
$ret = self::check_for_modifications($name, $style);
if ($ret['name'] == 'cursor' && $ret['style'] == 'auto') {
continue;
}
$css .= $ret['name'] . ':' . $ret['style'] . ";" . $nl;
}
}
}
$css .= "}" . $nl . $nl;
//add hover
$setting = json_decode($attr['settings'], true);
if (isset($setting['hover']) && $setting['hover'] == 'true') {
$hover = json_decode(str_replace("'", '"', $attr['hover']), true);
$hover_adv = $attr['advanced']['hover'];
if (is_array($hover) || is_array($hover_adv)) {
$css .= $attr['handle'] . ":hover";
if (!empty($stripped)) {
$css .= ', ' . $stripped . ':hover';
}
$css .= " {" . $nl;
if (is_array($hover)) {
foreach ($hover as $name => $style) {
if (in_array($name, $deformations) && $name !== 'css_cursor') {
continue;
}
if (!is_array($name) && isset($transparency[$name])) {
//the style can have transparency!
if (isset($hover[$transparency[$name]]) && $style !== 'transparent') {
$style = RevSliderFunctions::hex2rgba($style, $hover[$transparency[$name]] * 100);
}
}
if (!is_array($name) && isset($check_parameters[$name])) {
$style = RevSliderFunctions::add_missing_val($style, $check_parameters[$name]);
}
if (is_array($style)) {
$style = implode(' ', $style);
}
$ret = self::check_for_modifications($name, $style);
if ($ret['name'] == 'cursor' && $ret['style'] == 'auto') {
continue;
}
$css .= $ret['name'] . ':' . $ret['style'] . ";" . $nl;
//.........这里部分代码省略.........
示例2: putCreativeLayer
//.........这里部分代码省略.........
$ids = RevSliderFunctions::getVal($layer, 'attrID');
$classes = RevSliderFunctions::getVal($layer, 'attrClasses');
$title = RevSliderFunctions::getVal($layer, 'attrTitle');
$rel = RevSliderFunctions::getVal($layer, 'attrRel');
if (trim($ids) == '') {
if ($static_slide) {
$ids = 'slider-' . preg_replace("/[^\\w]+/", "", $this->slider->getID()) . '-layer-' . $unique_id;
} else {
$ids = 'slide-' . preg_replace("/[^\\w]+/", "", $slideID) . '-layer-' . $unique_id;
}
}
$ids = $ids != '' ? ' id="' . $ids . '"' : '';
$classes = $classes != '' ? ' ' . $classes : '';
$title = $title != '' ? ' title="' . $title . '"' : '';
$rel = $rel != '' ? ' rel="' . $rel . '"' : '';
$inline_styles = '';
$do_rotation = false;
$add_data = '';
$videoType = '';
$cover = false;
$toggle_allow = RevSliderFunctions::getVal($layer, 'toggle', false);
//set html:
$html = '';
$html_toggle = '';
switch ($type) {
case 'shape':
break;
case 'svg':
$max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
$max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
$max_width = is_object($max_width) ? RevSliderFunctions::get_biggest_device_setting($max_width, $enabled_sizes) : $max_width;
$max_height = is_object($max_height) ? RevSliderFunctions::get_biggest_device_setting($max_height, $enabled_sizes) : $max_height;
if ($max_width !== 'auto') {
$max_width = $max_width !== 'none' ? RevSliderFunctions::add_missing_val($max_width) : $max_width;
$inline_styles .= ' min-width: ' . $max_width . '; max-width: ' . $max_width . ';';
}
if ($max_height !== 'auto') {
$max_height = $max_height !== 'none' ? RevSliderFunctions::add_missing_val($max_height) : $max_height;
$inline_styles .= ' max-width: ' . $max_height . '; max-width: ' . $max_height . ';';
}
$svg_val = RevSliderFunctions::getVal($layer, 'svg', false);
$static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
if (!empty($static_styles)) {
$static_styles = (array) $static_styles;
if (!empty($static_styles['color'])) {
if (is_object($static_styles['color'])) {
$use_color = RevSliderFunctions::get_biggest_device_setting($static_styles['color'], $enabled_sizes);
} else {
$use_color = $static_styles['color'];
}
$def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
$color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
if ($color_trans != $dcot || $use_color != $dco) {
if ($color_trans > 0) {
$color_trans *= 100;
}
$color_trans = intval($color_trans);
$use_color = RevSliderFunctions::hex2rgba($use_color, $color_trans);
$inline_styles .= ' color: ' . $use_color . ';';
}
}
}
break;
default:
//case 'no_edit':
//case 'no_edit':