當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UniteFunctionsRev::validateArrayFieldExists方法代碼示例

本文整理匯總了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;
 }
開發者ID:DanyCan,項目名稱:wisten.github.io,代碼行數:74,代碼來源:helper.class.php


注:本文中的UniteFunctionsRev::validateArrayFieldExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。