本文整理汇总了PHP中Div::addStyleClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Div::addStyleClass方法的具体用法?PHP Div::addStyleClass怎么用?PHP Div::addStyleClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Div
的用法示例。
在下文中一共展示了Div::addStyleClass方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainTreeRender
private function mainTreeRender(Tree &$tree, $selectedKey)
{
$li = new Li();
$mainDiv = new Div();
$mainDiv->addStyleClasses(["expand", "text_non_select", "tree_text_node", "input_hover"]);
$table = new Table();
$tr = new Tr();
$nodeIcon = new Td();
$nodeText = new Td();
$nodeText->addStyleClass("tree_text");
$nodeSearchCount = new Td();
$nodeSearchCount->addStyleClass("tree_search_count");
if (count($tree->childrens) > 0) {
$nodeIcon->addStyleClasses(["tree_btn"]);
$icon = new Img();
$icon->addAttribute("style", "top: 2px; position: relative; margin: 0 5px;");
$icon->addAttribute("src", $this->treeLevel <= $this->DEFAULT_TREE_LEVEL_TO_SHOW || $tree->show ? "images/arrow90.png" : "images/arrow00.png");
$nodeIcon->addChild($icon);
} else {
$nodeIcon->addStyleClass("tree_empty");
}
$link = new A();
$link->addAttribute("href", URLBuilder::getCatalogLinkForTree($tree->key));
$link->addChild($tree->value);
$link->addStyleClass("input_hover");
$nodeSelected = new Div();
$nodeSelected->addStyleClass($tree->key == $selectedKey ? 'selected' : 'tree_empty');
$link->addChild($nodeSelected);
$nodeText->addChild($link);
return $li->addChild($mainDiv->addChild($table->addChild($tr->addChildList([$nodeIcon, $nodeText, $nodeSearchCount]))));
}
示例2: createBottomTreeDom
private function createBottomTreeDom()
{
$mainDiv = new Div();
$mainDiv->addStyleClass("bottom_panel");
$div01 = new Div();
$mainDiv->addChild($div01);
$div01->addStyleClasses(["bottom_panel_window"]);
$container = new Div();
$container->addStyleClasses(["bottom_panel_item", "w-31p"]);
$container->updateId("bottom_catalog_tree");
$containerChild = new Div();
$containerChild->addStyleClasses(["catalog"]);
$container->addChild($containerChild);
$div01->addChildList([$container]);
$mainTitle = new A();
$mainTitle->addChild("Каталог");
$mainTitle->addAttribute("href", Labels::$TOP_NAVIGATION_LINKS["catalog"]);
$mainTitle->addStyleClasses(["f-16", "title"]);
$containerChild->addChild($mainTitle);
$treeContainer = new Div();
$treeContainer->addStyleClass("content");
$containerChild->addChild($treeContainer);
$this->treeProcessBottom($this->mainTree, $treeContainer);
return $mainDiv;
}
示例3: getMap
private function getMap()
{
$mainTag = new Div();
$mainTag->addStyleClass("map_viewport");
$map = new Div();
$map->updateId("google_map");
return $mainTag->addChild($map);
}
示例4: 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;
}
示例5: getPaginationLinks
public function getPaginationLinks($pageNumber, $num, $totalCount, $topBottom)
{
$mainTag = new Div();
$catalogLink = new CatalogLink();
$dots = false;
$topBottomStyle = $topBottom == 'bottom' ? 'link_next_prev_bottom' : '';
if ($totalCount != 0) {
$amountPages = ceil($totalCount / $num);
if ($pageNumber > 0 && $pageNumber <= $amountPages) {
$mainTag->addStyleClasses(["pagination_bar", "right_top_bar", $topBottomStyle]);
$brokerTag = new Div();
$mainTag->addChild($brokerTag);
$tagCenterContainer = new Span();
if ($pageNumber != 1) {
$tagPrevious = new A();
$tagPrevious->addStyleClasses(["f-16", "text_non_select", "link_style", "link_next_prev", "input_hover", "prev_link"]);
$tagPrevious->addAttribute("href", URLBuilder::getCatalogLinkPrev($pageNumber, $num));
$text = new Div();
$text->addStyleClass("text");
$text->addChild("назад");
$arrow = new Div();
$arrow->addStyleClass("arrow");
$tagCenterContainer->addChild($tagPrevious->addChildList([$arrow, $text]));
}
$brokerTag->addChild($tagCenterContainer);
$tagCenterContainer->addStyleClasses(["numeric_links", "f-15"]);
for ($currentRenderPage = 1; $currentRenderPage <= $amountPages; $currentRenderPage++) {
if ($currentRenderPage < 2 || $currentRenderPage > $pageNumber - $this->linksGroupCount && $currentRenderPage < $pageNumber + $this->linksGroupCount || $currentRenderPage > $amountPages - 1) {
$dots = false;
if ($currentRenderPage != $pageNumber) {
$tagCenterContainer->addChild($catalogLink->getLink($currentRenderPage, $num));
} else {
$emptyLinkView = $catalogLink->getEmptyLink($pageNumber);
$emptyLinkView->addStyleClass("f-16");
$tagCenterContainer->addChild($emptyLinkView);
}
} else {
if (!$dots) {
$dots = true;
$tagCenterContainer->addChild($catalogLink->get3dots());
}
}
}
if ($pageNumber != $amountPages) {
$tagNext = new A();
$tagNext->addStyleClasses(["f-16", "text_non_select", "link_style", "input_hover", "link_next_prev", "next_link"]);
$tagNext->addAttribute("href", URLBuilder::getCatalogLinkNext($pageNumber, $num));
$text = new Div();
$text->addStyleClass("text");
$text->addChild("вперед");
$arrow = new Div();
$arrow->addStyleClass("arrow");
$tagCenterContainer->addChild($tagNext->addChildList([$text, $arrow]));
}
}
}
return $mainTag;
}
示例6: createGeneralContentForEmptyResult
private function createGeneralContentForEmptyResult($valueToSearch)
{
$mainTag = new Div();
$mainTag->addStyleClass("empty_search_result");
$emptySearchResultLabel = new Div();
$emptySearchResultLabel->addStyleClasses(["empty_search_result_label", "f-16"]);
$mainTag->addChild($emptySearchResultLabel->addChild(Labels::prefillMessage([$valueToSearch], Labels::EMPTY_SEARCH_RESULT)));
TagUtils::createShadow($mainTag);
return $mainTag;
}
示例7: createShadow
public static function createShadow(&$mainDiv)
{
if (Utils::isIE()) {
$shadowTop = new Div();
$shadowTop->addStyleClass("shadow_top");
$shadowRight = new Div();
$shadowRight->addStyleClass("shadow_right");
$shadowBottom = new Div();
$shadowBottom->addStyleClass("shadow_bottom");
$shadowLeft = new Div();
$shadowLeft->addStyleClass("shadow_left");
$mainDiv->addChild($shadowTop);
$mainDiv->addChild($shadowRight);
$mainDiv->addChild($shadowBottom);
$mainDiv->addChild($shadowLeft);
}
}
示例8: getImageSwitcher
private function getImageSwitcher()
{
$leftArrow = new Div();
$leftArrow->addStyleClasses(["gallery_left_arrow", "icon_viewPort"]);
$leftArrowImg = new Div();
$leftArrowImg->addStyleClass("icon");
$leftArrow->addChild($leftArrowImg);
$rightArrow = new Div();
$rightArrow->addStyleClasses(["gallery_right_arrow", "icon_viewPort"]);
$rightArrowImg = new Div();
$rightArrowImg->addStyleClass("icon");
$rightArrow->addChild($rightArrowImg);
return [$leftArrow, $rightArrow];
}
示例9: getDOMForViewMode
private static function getDOMForViewMode($type)
{
$mainDom = new Div();
$mainDom->addStyleClass($type);
$mainDom->addAttribute("view_type", $type);
switch ($type) {
case "compact":
$mainDom->addChildList([new Div(), new Div(), new Div(), new Div(), new Div(), new Div()]);
break;
case "extend":
$mainDom->addChildList([new Div(), new Div(), new Div()]);
break;
case "metro":
$mainDom->addChildList([new Div(), new Div()]);
break;
default:
$mainDom->addChildList([new Div(), new Div(), new Div(), new Div(), new Div(), new Div()]);
}
return $mainDom;
}
示例10: createTopNavigationLinks
public function createTopNavigationLinks()
{
$topNavigationLinks = new TopNavigationLinks();
$mainDiv = new Div();
$mainDiv->addStyleClass("top_panel");
$linkToHome = new A();
$linkToHome->addAttribute("href", "/");
$linkToHome->addStyleClass("logo");
$backGround = new Div();
$backGround->addStyleClass("top_panel_background");
$div11 = new Div();
$div11->addStyleClasses(array("top_bar", "border-round-7px"));
$div111 = new Div();
$div111->updateId("top_panel_fixed");
$div111->addChildList([$backGround, $linkToHome]);
//TagUtils::createShadow($div111);
$div1111 = new Div();
$div1111->addStyleClass("top_bar_relative");
$mainDiv->addChildList([$div11->addChild($div111->addChild($div1111))]);
$div1111->addChild($topNavigationLinks->getDOM());
return $mainDiv;
}
示例11: getCompactItemView
public static function getCompactItemView($name, $images, $itemId, $pageNumber, $num, $key, $valueToSearch, $type, $trimName, $isHighLightElement)
{
$blackOut = new Div();
$blackOut->addStyleClasses(["blackout", "catalog_item_button_container"]);
$blackOut->addAttributes(["itemscope" => "", "itemtype" => "http://data-vocabulary.org/Product"]);
$mainDiv = new Div();
$blackOut->addChild($mainDiv);
TagUtils::createShadow($mainDiv);
$mainDiv->addStyleClasses(["simple_item_compact", $isHighLightElement ? Constants::HIGH_LIGHT_ELEMENT : ""]);
$imagesContainer = new Div();
$imagesContainer->addStyleClass("catalog_img_container");
$mainDiv->addChild($imagesContainer);
$index = 0;
foreach ($images as $image) {
if ($index == 1) {
break;
}
$imgView = new Img();
$imgView->addAttributes(array("src" => addslashes($image), "alt" => $name, TagLabels::ON_CLICK => "openSimpleImg(arguments[0])"));
$imagesContainer->addChild($imgView);
$index++;
}
if ($type == 'HARD') {
$url = URLBuilder::getCatalogLinkForSingleItem($pageNumber, $num, $itemId, array(UrlParameters::KEY => $key, UrlParameters::SEARCH_VALUE => $valueToSearch));
$mainDiv->addStyleClass("cursor_pointer");
$link = TagUtils::createNote($trimName, "");
$blackOut->addChild($link);
$blackOut->addChild(self::getItemButton($url));
} elseif ($type == 'SIMPLE') {
$text = TagUtils::createNote($trimName, "");
$blackOut->addChild($text);
}
return $blackOut;
}
示例12: getStyledTextList
private function getStyledTextList($textList, $styles)
{
$mainDiv = new Div();
$styleIndex = 0;
for ($textIndex = 0; $textIndex < count($textList); $textIndex++) {
$text = new Div();
$text->addChild($textList[$textIndex]);
$text->addStyleClass($styles[$styleIndex]);
if ($styleIndex == count($styles) - 1) {
$styleIndex = 0;
} else {
$styleIndex++;
}
$mainDiv->addChild($text);
}
return $mainDiv;
}
示例13: createPriceListLink
public static function createPriceListLink()
{
$pref = new DBPreferencesType();
$pricesDir = $pref->getPreference(Constants::PRICE_DIRECTORY)[DB::TABLE_PREFERENCES__VALUE];
$prices = FileUtils::getFilesByDescription($pricesDir, 'xls');
$descriptions = FileUtils::getFilesByDescription($pricesDir, 'txt');
$mainTag = new Div();
$mainTag->addStyleClass("download_table");
for ($index = 0; $index < count($prices); $index++) {
$priceItem = new Div();
$priceIcon = new Div();
$priceIcon->addStyleClasses(["price_icon", "float_left"]);
$priceText = new Div();
$priceText->addStyleClass(["download_description", "float_left"]);
$priceText->addChild(file_get_contents($descriptions[$index]));
$priceItem->addChildList([$priceIcon, $priceText]);
$mainTag->addChild($priceItem);
}
return $mainTag;
}