本文整理汇总了PHP中UniteFunctionsRev::validateArrayFieldExists方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::validateArrayFieldExists方法的具体用法?PHP UniteFunctionsRev::validateArrayFieldExists怎么用?PHP UniteFunctionsRev::validateArrayFieldExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::validateArrayFieldExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBulletsHtml
/**
*
* pub bullets set html
* @param mixed $set - can be array or set name
*/
public static function getBulletsHtml($set, $num = 5)
{
if ($num < 3) {
$num = 3;
}
if (gettype($set) == "string") {
$set = HelperUniteRev::getBulletsSet($set);
}
$options = $set["options"];
$imgLeft = UniteFunctionsRev::getVal($set, "url_bgleft");
$imgRight = UniteFunctionsRev::getVal($set, "url_bgright");
$imgCenter = UniteFunctionsRev::getVal($set, "url_bgrepeat");
$idBackground = false;
if (!empty($imgCenter)) {
$idBackground = true;
//validate background fields
UniteFunctionsRev::validateArrayFieldExists($options, "bg_height,bg_left_width,bg_right_width,padding_top", "getBulletsHtml, background field not found in options");
UniteFunctionsRev::validateNotEmpty($imgRight, "right image");
UniteFunctionsRev::validateNotEmpty($imgLeft, "left image");
}
$space_middle = UniteFunctionsRev::getVal($options, "space_middle", 3);
$html = "";
//Width Background
if ($idBackground == true) {
$bgHeight = $options["bg_height"];
$bgWidthLeft = $options["bg_left_width"];
$bgWidthRight = $options["bg_right_width"];
$paddingTop = $options["padding_top"];
$styleLeft = "float:left;height:{$bgHeight}px;width:{$bgWidthLeft}px;background-image:url(\"{$imgLeft}\");background-repeat:no-repeat;";
$styleRight = "float:left;height:{$bgHeight}px;width:{$bgWidthLeft}px;background-image:url(\"{$imgRight}\");background-repeat:no-repeat;";
$styleCenter = "float:left;height:{$bgHeight}px;background-image:url(\"{$imgCenter}\");background-repeat:releat-x;";
$html .= "<div class='bullets_left' style='{$styleLeft}' ></div>";
$html .= "<div class='bullets_middle' style='{$styleCenter}'>";
$html .= "<div class='bullets_inner' style='padding-top:" . $paddingTop . "px;'>";
$html .= '<ul>';
for ($i = 0; $i < $num; $i++) {
$urlBullet = $set["url_normal"];
if ($i == 1) {
$urlBullet = $set["url_active"];
}
$styleLI = "";
if ($i > 0) {
$styleLI = "margin-left:" . $space_middle . "px";
}
$html .= "<li style='{$styleLI}'><img src='{$urlBullet}'/></li>";
}
$html .= '</ul>';
$html .= '</div>';
$html .= '</div>';
$html .= "<div class='bullets_right' style='{$styleRight}'></div>";
} else {
//no background:
$html .= '<ul>';
for ($i = 0; $i < $num; $i++) {
$urlBullet = $set["url_normal"];
if ($i == 1) {
$urlBullet = $set["url_active"];
}
$styleLI = "";
if ($i > 0) {
$styleLI = "margin-left:" . $space_middle . "px";
}
$html .= "<li style='{$styleLI}'><img src='{$urlBullet}'/></li>";
}
$html .= '</ul>';
}
$html .= '<div class="clear"></div>';
return $html;
}