Skip to content

Commit

Permalink
Backend top menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Chechkin committed May 13, 2015
1 parent 41bef1c commit 9d4063c
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 78 deletions.
32 changes: 32 additions & 0 deletions .top.menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?
$aMenuLinks = Array(
Array(
"О заводе",
"/o-zavode/",
Array(),
Array(),
""
),
Array(
"Продукция",
"/produktsiya/",
Array(),
Array(),
""
),
Array(
"Для строителей",
"/dlya-stroiteley/",
Array(),
Array(),
""
),
Array(
"Контакты",
"/kontakty/",
Array(),
Array(),
""
)
);
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>

<?if (!empty($arResult)):?>
<section class="mainmenu">
<div class="content-block">
<nav>
<ul>
<?foreach($arResult as $arItem){?>
<li <?if($arItem['SELECTED'] == '1'){?>class="active"<?}?>><a href="<?=$arItem['LINK'];?>"><?=$arItem['TEXT'];?></a></li>
<?}?>
</ul>
</nav>
</div>
</section>

<?endif?>
148 changes: 77 additions & 71 deletions bitrix/templates/main/header.php
Original file line number Diff line number Diff line change
@@ -1,71 +1,77 @@
<?php
$html_classes = array();
$main_classes = array();
// <html> classes
if(defined('404'))
$html_classes = array('page404');
if(defined('CATALOG'))
$html_classes = array('catalog');
if(defined('CONTACTS'))
$html_classes = array('contacts');
if(defined('ABOUT'))
$html_classes = array('about');
if(defined('BUILDERS'))
$html_classes = array('builders');

$html_classes = implode(" ", $html_classes);
$main_classes = implode(" ", $main_classes);
$tplPath = "/bitrix/templates/main/";?>
<!DOCTYPE html>
<html class="<?=$html_classes?>">
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if gte IE 9]><link href="<?=$tplPath?>styles/src/ie.css" rel="stylesheet"><![endif]-->
<title><?$APPLICATION->ShowTitle()?></title>
<link rel="shortcut icon" href="<?=$tplPath;?>/images/favicon.ico" type="image/x-icon" />
<?$APPLICATION->ShowMeta("keywords")?>
<?$APPLICATION->ShowMeta("description")?>
<?$APPLICATION->ShowCSS();?>
<link href="/bower_components/slick-carousel/slick/slick-theme.css" rel="stylesheet">
<link href="/bower_components/slick-carousel/slick/slick.css" rel="stylesheet">
<link href="<?=$tplPath;?>styles/build/build.css" rel="stylesheet">
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/slick-carousel/slick/slick.min.js"></script>
<script src="<?=$tplPath;?>scripts/libs/InlineSVG/jquery.inlinesvg.js"></script>
<script src="<?=$tplPath;?>scripts/main.js"></script>
</head>

<body>
<?$APPLICATION->ShowPanel();?>
<div class="wrapper">

<header class="header">
<section class="mainmenu">
<div class="content-block">
<nav>
<ul>
<li><a href="/about.php">О заводе</a></li>
<li><a href="/catalog.php">Продукция</a></li>
<li><a href="/for_builders.php">Для строителей</a></li>
<li><a href="/contacts.php">Контакты</a></li>
</ul>
</nav>
</div>
</section>
<section class="main">
<div class="content-block">
<?if($_SERVER['REQUEST_URI'] == '/'){?>
<div id="logo"></div>
<?}else{?>
<a href="/" id="logo"></a>
<?}?>
<div id="right">
<h1><a href="tel:+7 (86350) 48-8-48">+7 (86350) 48-8-48</a></h1>
<p><a href="tel:(863) 256-91-01">(863) 256-91-01</a></p>
</div>
</div>
</section>
</header><!-- .header-->

<main class="content">
<?php
$html_classes = array();
$main_classes = array();
// <html> classes
if(defined('404'))
$html_classes = array('page404');
if(defined('CATALOG'))
$html_classes = array('catalog');
if(defined('CONTACTS'))
$html_classes = array('contacts');
if(defined('ABOUT'))
$html_classes = array('about');
if(defined('BUILDERS'))
$html_classes = array('builders');

$html_classes = implode(" ", $html_classes);
$main_classes = implode(" ", $main_classes);
$tplPath = "/bitrix/templates/main/";?>
<!DOCTYPE html>
<html class="<?=$html_classes?>">
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if gte IE 9]><link href="<?=$tplPath?>styles/src/ie.css" rel="stylesheet"><![endif]-->
<title><?$APPLICATION->ShowTitle();?></title>
<link rel="shortcut icon" href="<?=$tplPath;?>/images/favicon.ico" type="image/x-icon" />
<?$APPLICATION->ShowMeta("keywords");?>
<?$APPLICATION->ShowMeta("description");?>
<?$APPLICATION->ShowHead();?>
<link href="/bower_components/slick-carousel/slick/slick-theme.css" rel="stylesheet">
<link href="/bower_components/slick-carousel/slick/slick.css" rel="stylesheet">
<link href="<?=$tplPath;?>styles/build/build.css" rel="stylesheet">
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/slick-carousel/slick/slick.min.js"></script>
<script src="<?=$tplPath;?>scripts/libs/InlineSVG/jquery.inlinesvg.js"></script>
<script src="<?=$tplPath;?>scripts/main.js"></script>
</head>

<body>
<?$APPLICATION->ShowPanel();?>
<div class="wrapper">

<header class="header">
<?$APPLICATION->IncludeComponent(
"bitrix:menu",
"main_menu",
array(
"ROOT_MENU_TYPE" => "top",
"MENU_CACHE_TYPE" => "N",
"MENU_CACHE_TIME" => "3600",
"MENU_CACHE_USE_GROUPS" => "Y",
"MENU_CACHE_GET_VARS" => array(
),
"MAX_LEVEL" => "1",
"CHILD_MENU_TYPE" => "",
"USE_EXT" => "N",
"DELAY" => "N",
"ALLOW_MULTI_SELECT" => "N"
),
false
);?>
<section class="main">
<div class="content-block">
<?if($_SERVER['REQUEST_URI'] == '/'){?>
<div id="logo"></div>
<?}else{?>
<a href="/" id="logo"></a>
<?}?>
<div id="right">
<h1><a href="tel:+7 (86350) 48-8-48">+7 (86350) 48-8-48</a></h1>
<p><a href="tel:(863) 256-91-01">(863) 256-91-01</a></p>
</div>
</div>
</section>
</header><!-- .header-->

<main class="content">
6 changes: 5 additions & 1 deletion bitrix/templates/main/styles/src/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,13 @@ html {
}

.active {
&:before, &:after { content: ''; }
&:before{ content: ''; }

&:last-child:after { content: ''; }

background: #C9673D;
position: relative;
left: 10px;
}
//active
}
Expand Down
6 changes: 6 additions & 0 deletions dlya-stroiteley/.section.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?
$sSectionName = "Для строителей";
$arDirProperties = Array(

);
?>
8 changes: 8 additions & 0 deletions dlya-stroiteley/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Для строителей");
?>

Text here....

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
6 changes: 2 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/header.php');
$APPLICATION->SetTitle('Главная');
?>

<?
$APPLICATION->SetTitle("Главная");
?><?
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/footer.php');
?>
6 changes: 6 additions & 0 deletions kontakty/.section.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?
$sSectionName = "Контакты";
$arDirProperties = Array(

);
?>
8 changes: 8 additions & 0 deletions kontakty/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Контакты");
?>

Text here....

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
6 changes: 6 additions & 0 deletions o-zavode/.section.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?
$sSectionName = "О заводе";
$arDirProperties = Array(

);
?>
8 changes: 8 additions & 0 deletions o-zavode/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("О заводе");
?>

Text here....

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"gulp-minify-css": "^1.1.1",
"gulp-rename": "^1.2.2"
},
"scripts": {
},
"scripts": {},
"author": "Andrey Chechkin",
"license": "ISC"
}
6 changes: 6 additions & 0 deletions produktsiya/.section.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?
$sSectionName = "Продукция";
$arDirProperties = Array(

);
?>
8 changes: 8 additions & 0 deletions produktsiya/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Продукция");
?>

Text here....

<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");?>

0 comments on commit 9d4063c

Please sign in to comment.