Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
333809ea
You need to sign in or sign up before continuing.
Commit
333809ea
authored
Apr 11, 2018
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Задача 12794] Изменил верстку меню на использование bootstrap navigation bar. Изменил menu helper.
parent
15bf7e76
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
40 deletions
+66
-40
Typos.php
cp/application/controllers/users/Typos.php
+2
-2
menu_helper.php
cp/application/helpers/menu_helper.php
+24
-8
header.php
cp/application/views/header.php
+0
-5
menu.php
cp/application/views/menus/menu.php
+39
-16
stylesheet.css
cp/stylesheet/stylesheet.css
+1
-9
No files found.
cp/application/controllers/users/Typos.php
View file @
333809ea
...
...
@@ -50,11 +50,11 @@ class Typos extends CI_Controller {
$data
[
'base_url'
]
=
$this
->
config
->
base_url
();
if
(
$this
->
session
->
usertype
==
'admin'
)
{
$data
[
'
i
tems'
]
=
menu_admin
(
$data
[
'base_url'
]);
$data
[
'
menuI
tems'
]
=
menu_admin
(
$data
[
'base_url'
]);
}
if
(
$this
->
session
->
usertype
==
'user'
)
{
$data
[
'
i
tems'
]
=
menu_user
(
$data
[
'base_url'
]);
$data
[
'
menuI
tems'
]
=
menu_user
(
$data
[
'base_url'
]);
}
$this
->
load
->
view
(
$this
->
header_name
,
$data
);
...
...
cp/application/helpers/menu_helper.php
View file @
333809ea
...
...
@@ -8,24 +8,40 @@
/**
* Composes and returns a admin menu as array of items
* @return
string
* @return
array
*/
function
menu_admin
(
$baseUrl
)
{
$data
[
'sites'
]
=
"<a href='"
.
$baseUrl
.
"index.php/admins/sites'>Сайты</a>"
;
$data
[
'users'
]
=
"<a href='"
.
$baseUrl
.
"index.php/admins/users'>Пользователи</a>"
;
$data
[
'typos'
]
=
"<a href='"
.
$baseUrl
.
"index.php/users/typos'>Опечатки</a>"
;
$data
[
'logout'
]
=
"<a href='"
.
$baseUrl
.
"index.php/authorization/logout'>Выйти</a>"
;
$data
=
[];
$data
[]
=
[
"href"
=>
"${baseUrl}index.php/admins/sites"
,
"name"
=>
"Сайты"
];
$data
[]
=
[
"href"
=>
"${baseUrl}index.php/admins/users"
,
"name"
=>
"Пользователи"
];
$data
[]
=
[
"href"
=>
"${baseUrl}index.php/users/typos"
,
"name"
=>
"Опечатки"
];
return
$data
;
}
/**
* Composes and returns a user menu as array of items
* @return
string
* @return
array
*/
function
menu_user
(
$baseUrl
)
{
//$data['typos'] = "<a href='".$baseUrl."index.php/users/typos'>Опечатки</a>";
$data
[
'logout'
]
=
"<a href='"
.
$baseUrl
.
"index.php/authorization/logout'>Выйти</a>"
;
$data
=
[];
$data
[]
=
[
"href"
=>
"${baseUrl}index.php/users/typos"
,
"name"
=>
"Опечатки"
];
return
$data
;
}
...
...
cp/application/views/header.php
View file @
333809ea
...
...
@@ -17,8 +17,3 @@
</head>
<body>
<!-- Шапка -->
<header
id=
"head"
>
<h1>
TYPOS@ETERSOFT - Сервис опечаток
</h1>
</header>
cp/application/views/menus/menu.php
View file @
333809ea
<div
class=
"left"
>
<div
id=
"menu"
>
<span
class=
"heading"
>
Меню
</span>
<hr>
<div
class=
"items"
>
<ul>
<?php
if
(
$items
)
{
foreach
(
$items
as
$item
)
{
echo
"<li>"
.
$item
.
"</li>"
;
}
}
?>
<!-- Шапка-меню -->
<nav
class=
"header navbar navbar-expand-md navbar-light bg-light"
>
<a
href=
"#"
class=
"navbar-brand"
>
<img
src=
"//time.office.etersoft.ru/images/logo.png"
width=
"30"
height=
"30"
alt=
"Etersoft Logo"
>
TYPOS@ETERSOFT - Сервис опечаток
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarNav"
area-controls=
"#navbarNav"
area-expanded=
"false"
area-label=
"Раскрыть меню"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse "
id=
"navbarNav"
>
<ul
class=
"navbar-nav mr-auto"
>
<?
foreach
(
$menuItems
as
$index
=>
$item
)
:
?>
<?
if
(
$index
===
0
)
:
?>
<li
class=
"nav-item active"
>
<a
href=
"
<?=
$item
[
"href"
]
?>
"
class=
"nav-link"
>
<?=
$item
[
"name"
]
?>
<span
class=
"sr-only"
>
(текущая)
</span>
</a>
</li>
<?
else
:?>
<
li
class
="
nav
-
item
">
<a href="
<?=
$item
[
"href"
]
?>
" class="nav-link">
<?=
$item
[
"name"
]
?>
</a>
</li>
<?
endif
;
?>
<?
endforeach
;
?>
</ul>
<ul
class=
"navbar-nav"
>
<li
class=
"nav-item"
>
<a
href=
"
<?=
$base_url
?>
index.php/authorization/logout"
>
Выйти
</a>
</li>
</ul>
</div>
</div>
</div>
\ No newline at end of file
</nav>
\ No newline at end of file
cp/stylesheet/stylesheet.css
View file @
333809ea
...
...
@@ -50,16 +50,8 @@ body {
float
:
left
;
}
#head
{
padding
:
8px
;
.header
{
margin-bottom
:
15px
;
background-color
:
#F3F3F3
;
}
#head
h1
{
vertical-align
:
center
;
margin
:
0
;
color
:
#FF9C00
;
}
#footer
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment