当前位置: 首页>>代码示例>>PHP>>正文


PHP FileUtils::getCapImage方法代码示例

本文整理汇总了PHP中FileUtils::getCapImage方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::getCapImage方法的具体用法?PHP FileUtils::getCapImage怎么用?PHP FileUtils::getCapImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUtils的用法示例。


在下文中一共展示了FileUtils::getCapImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getItemsTable

 public function getItemsTable($pageNumber, $num, $response, $key, $valueToSearch)
 {
     $mainTag = new Div();
     $tdNum = 3;
     $tdNumTotal = $tdNum * 2 - 1;
     $indOnPage = 0;
     $items = 0;
     $td = 0;
     $item = new Item();
     $rowIndex = 1;
     $tdHeight = Utils::isSquareViewMode() ? 300 : 30;
     $highLightId = Utils::getFromGET(UrlParameters::HIGH_LIGHT_ELEMENT);
     $isMetro = array_key_exists(UrlParameters::VIEW_MODE, $_GET) && Utils::getFromGET(UrlParameters::VIEW_MODE) == "metro" || !array_key_exists(UrlParameters::VIEW_MODE, $_GET);
     $isCompact = array_key_exists(UrlParameters::VIEW_MODE, $_GET) && Utils::getFromGET(UrlParameters::VIEW_MODE) == "compact";
     $isExtend = array_key_exists(UrlParameters::VIEW_MODE, $_GET) && Utils::getFromGET(UrlParameters::VIEW_MODE) == "extend";
     $isList = array_key_exists(UrlParameters::VIEW_MODE, $_GET) && Utils::getFromGET(UrlParameters::VIEW_MODE) == "list";
     $rowViewClass = $isCompact ? 'compact' : ($isMetro ? "metro" : ($isExtend ? "extend" : ($isList ? "list" : "list")));
     if ($response != 0) {
         $mainTag->addStyleClass("items_table");
         $rowView = new Div();
         $mainTag->addChild($rowView);
         while ($row = mysql_fetch_array($response)) {
             $items++;
             $indOnPage++;
             $td++;
             if (ceil(fmod($indOnPage, $tdNum)) == 1) {
                 $rowIndex++;
                 $indOnPage = 1;
                 $td = 1;
             } elseif (Utils::isEven($td)) {
                 $td++;
             }
             $rowView->addStyleClass($rowViewClass);
             $cellView = new Div();
             $rowView->addChild($cellView);
             $keyItem = $row["key_item"];
             $images = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $keyItem . DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, 'jpg');
             if (count($images) == 0) {
                 $capImage = FileUtils::getCapImage(Labels::CAP_IMAGE_FOR_CLOTHING);
                 $images = [$capImage];
             }
             $item = null;
             if ($isMetro) {
                 $item = Item::getMetroItemView($row["name"], $images, $row["key_item"], $pageNumber, $num, $key, $valueToSearch, $row['god_type'], Utils::formatClotheTitle($row["name"]), $highLightId == $row["key_item"]);
             } elseif ($isCompact) {
                 //$name, $images, $itemId, $pageNumber, $num, $key, $valueToSearch, $type, $trimName, $isHighLightElement
                 $item = Item::getCompactItemView($row["name"], $images, $row["key_item"], $pageNumber, $num, $key, $valueToSearch, $row['god_type'], Utils::formatClotheTitle($row["name"]), $highLightId == $row["key_item"]);
             } elseif ($isExtend) {
                 $item = Item::getSquareItemView($row["name"], $images, $row["key_item"], $pageNumber, $num, $key, $valueToSearch, $row['god_type'], Utils::formatClotheTitle($row["name"]));
             } elseif ($isList) {
                 $item = Item::getLineItemView($row["name"], $images, $row["key_item"], $pageNumber, $num, $key, $valueToSearch, $row['god_type'], Utils::trimFormatClotheTitle($row["name"]), $highLightId == $row["key_item"]);
             }
             $cellView->addChild($item);
             $cellView->addStyleClass("catalog_good_item");
         }
     }
     return $mainTag;
 }
开发者ID:gingerP,项目名称:shop,代码行数:58,代码来源:Items.php

示例2: createGeneralContent

 protected function createGeneralContent()
 {
     $mainTag = new Div();
     $goods = new DBGoodsType();
     $itemId = Utils::getFromGET("page_id");
     $goods->executeRequest(DB::TABLE_GOODS__KEY_ITEM, $itemId, DB::TABLE_GOODS___ORDER, DB::ASC);
     $response = $goods->getResponse();
     $mainTag->addStyleClasses(["single_item"]);
     $row = mysql_fetch_array($response);
     if ($row) {
         $imagePathes = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $itemId . DIRECTORY_SEPARATOR, Constants::SMALL_IMAGE, 'jpg');
         $filesSmall = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $itemId . DIRECTORY_SEPARATOR, Constants::SMALL_IMAGE, "jpg");
         $filesMedium = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $itemId . DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, "jpg");
         $firstImage = FileUtils::getFirstFileInDirectoryByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $itemId . DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, 'jpg');
         if ($firstImage == '') {
             $firstImage = FileUtils::getCapImage(Labels::CAP_IMAGE_FOR_CLOTHING);
         }
         sort($imagePathes);
         sort($filesSmall);
         sort($filesMedium);
         $defaultBackgroundImage = $this->getFirstImage($itemId, Constants::MEDIUM_IMAGE);
         $titleBlock = new Strong();
         $titleBlock->addStyleClasses(["title", "f-30"]);
         $titleBlock->addChild($row[DB::TABLE_GOODS__NAME]);
         $this->updateTitleTagChildren([$row[DB::TABLE_GOODS__NAME] . ' - ']);
         $metaDesc = new Meta();
         $metaDesc->addAttributes(["name" => "description", "content" => "на этой странице Вы найдете подробное описание для товара " . $row[DB::TABLE_GOODS__NAME] . ", а также сможете пролистать фотографии и просмотреть их увеличенную версию"]);
         $this->addMetaTags($metaDesc);
         $infoBlock = new Div();
         $infoBlock->addStyleClass("info");
         $leftBlock = new Div();
         $leftBlock->addStyleClasses(["left_block"]);
         $bigImg = new Div();
         $bigImg->addStyleClasses(["big_img", "float_left"]);
         $bigImg->addAttribute("style", "background-image: url({$defaultBackgroundImage});filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$defaultBackgroundImage}',sizingMethod='scale');-ms-filter: \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$defaultBackgroundImage}',sizingMethod='scale')\";");
         $square = new Div();
         $square->addStyleClass("squareX");
         $zoom = new Div();
         $zoom->addStyleClass("zoom_image");
         $zoom->addAttribute("style", "background-image: url(.{$defaultBackgroundImage}.)");
         $img1 = new Img();
         $img1->addAttribute("src", $firstImage);
         $img1->updateId("main_gallery_image");
         $img2 = new Img();
         $img2->addAttribute("src", $firstImage);
         $img2->updateId("img_effect");
         $square->addChildList([$zoom, $img1, $img2]);
         $square->addChildList($this->getImageSwitcher());
         $leftBlock->addChildList([$square, $this->getPreviewImages($filesMedium, Constants::MEDIUM_IMAGE . "images", false)]);
         $rightBlock = new Div();
         $rightBlock->addStyleClasses(["right_block"]);
         $overviewImgs = $this->getPreviewImages($filesSmall, Constants::SMALL_IMAGE . "images", true);
         $overviewImgs->updateId("gallery");
         $overviewImgs->addStyleClass("w-100p");
         $rightBlock->addChildList([$overviewImgs]);
         $index = 0;
         $imgList = new Div();
         $imgList->addStyleClass("scroll_child");
         /*foreach($imagePathes as $imagePath) {
               if (count(trim($imagePath)) != 0) {
                   $index++;
                   $activeImg = '';
                   $cursor = 'review';
                   if ($index == 1) {
                       $active = 'preview_image_current_border';
                       $activeImg = 'img_to_front';
                   } else {
                       $active = "preview_image_hover_border";
                       $cursor = 'cursor_pointer';
                   }
                   $imgItem = new Div();
                   $imgItem->addStyleClasses(["image_item", "float_left", $cursor]);
                   $zoomWindowContainer = new Div();
                   $zoomWindowContainer->addStyleClass("zoom_window_container");
                   $zoomWindow = new Div();
                   $zoomWindow->addStyleClass("zoom_window");
                   $zoomWindowContainer->addChild($zoomWindow);
                   $previewImgBorder = new Div();
                   $previewImgBorder->addStyleClasses("preview_image_border", $active);
                   $previewImage = new Img();
                   $previewImage->addAttribute("src", $imagePath);
                   $previewImage->addStyleClasses(["preview_image", $activeImg]);
                   $imgItem->addChildList([$zoomWindowContainer, $previewImgBorder, $previewImage]);
               }
           }*/
     }
     $description = $this->getImageDescription($row[DB::TABLE_GOODS__DESCRIPTION]);
     return $mainTag->addChildList([$titleBlock, $infoBlock->addChildList([$leftBlock, $rightBlock, $description])]);
 }
开发者ID:gingerP,项目名称:shop,代码行数:89,代码来源:SingleItemPage.php

示例3: renderGalleryItemWithSingleItem

 private function renderGalleryItemWithSingleItem($data)
 {
     $mainDiv = new Div();
     $mainDiv->addStyleClasses(["main_page_item", "blackout", "catalog_item_button_container"]);
     $container = new Div();
     $container->addStyleClass("main_page_item_sub");
     $urlToItem = URLBuilder::getItemLinkForComplexType("", $data[DB::TABLE_GOODS__KEY_ITEM], 1, 48);
     $itemImagePath = '';
     $itemName = $data[DB::TABLE_GOODS__NAME];
     $images = FileUtils::getFilesByPrefixByDescription(Constants::DEFAULT_ROOT_CATALOG_PATH . DIRECTORY_SEPARATOR . $data[DB::TABLE_GOODS__KEY_ITEM] . DIRECTORY_SEPARATOR, Constants::MEDIUM_IMAGE, 'jpg');
     if ($images[0] == '') {
         $itemImagePath = FileUtils::getCapImage(Labels::CAP_IMAGE_FOR_CLOTHING);
     } else {
         $itemImagePath = $images[0];
     }
     $singleItemView = new Div();
     $singleItemView->addStyleClasses(["main_page_item_sub_single"]);
     $imgView = new Img();
     $noteView = null;
     $imgView->addAttribute("src", $itemImagePath);
     if ($data[DB::TABLE_GOODS__GOD_TYPE] == "HARD") {
         $singleItemView->addStyleClass("cursor_pointer");
         $noteView = TagUtils::createNote($itemName, "");
     } else {
         $noteView = TagUtils::createNote($itemName, "");
     }
     $noteView->addStyleClasses(["f-15"]);
     $container->addChildList([$singleItemView, $noteView, Item::getItemButton($urlToItem)]);
     $singleItemView->addChild($imgView);
     return $mainDiv->addChild($container);
 }
开发者ID:gingerP,项目名称:shop,代码行数:31,代码来源:MainPage.php


注:本文中的FileUtils::getCapImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。