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
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
42 deletions
+68
-42
Typos.php
cp/application/controllers/users/Typos.php
+2
-2
menu_helper.php
cp/application/helpers/menu_helper.php
+25
-9
header.php
cp/application/views/header.php
+0
-5
menu.php
cp/application/views/menus/menu.php
+40
-17
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 {
...
@@ -50,11 +50,11 @@ class Typos extends CI_Controller {
$data
[
'base_url'
]
=
$this
->
config
->
base_url
();
$data
[
'base_url'
]
=
$this
->
config
->
base_url
();
if
(
$this
->
session
->
usertype
==
'admin'
)
{
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'
)
{
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
);
$this
->
load
->
view
(
$this
->
header_name
,
$data
);
...
...
cp/application/helpers/menu_helper.php
View file @
333809ea
...
@@ -8,25 +8,41 @@
...
@@ -8,25 +8,41 @@
/**
/**
* Composes and returns a admin menu as array of items
* Composes and returns a admin menu as array of items
* @return
string
* @return
array
*/
*/
function
menu_admin
(
$baseUrl
)
{
function
menu_admin
(
$baseUrl
)
{
$data
[
'sites'
]
=
"<a href='"
.
$baseUrl
.
"index.php/admins/sites'>Сайты</a>"
;
$data
=
[];
$data
[
'users'
]
=
"<a href='"
.
$baseUrl
.
"index.php/admins/users'>Пользователи</a>"
;
$data
[
'typos'
]
=
"<a href='"
.
$baseUrl
.
"index.php/users/typos'>Опечатки</a>"
;
$data
[]
=
[
$data
[
'logout'
]
=
"<a href='"
.
$baseUrl
.
"index.php/authorization/logout'>Выйти</a>"
;
"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
;
return
$data
;
}
}
/**
/**
* Composes and returns a user menu as array of items
* Composes and returns a user menu as array of items
* @return
string
* @return
array
*/
*/
function
menu_user
(
$baseUrl
)
{
function
menu_user
(
$baseUrl
)
{
//$data['typos'] = "<a href='".$baseUrl."index.php/users/typos'>Опечатки</a>";
$data
=
[];
$data
[
'logout'
]
=
"<a href='"
.
$baseUrl
.
"index.php/authorization/logout'>Выйти</a>"
;
$data
[]
=
[
"href"
=>
"${baseUrl}index.php/users/typos"
,
"name"
=>
"Опечатки"
];
return
$data
;
return
$data
;
}
}
cp/application/views/header.php
View file @
333809ea
...
@@ -17,8 +17,3 @@
...
@@ -17,8 +17,3 @@
</head>
</head>
<body>
<body>
<!-- Шапка -->
<header
id=
"head"
>
<h1>
TYPOS@ETERSOFT - Сервис опечаток
</h1>
</header>
cp/application/views/menus/menu.php
View file @
333809ea
<div
class=
"left"
>
<!-- Шапка-меню -->
<div
id=
"menu"
>
<nav
class=
"header navbar navbar-expand-md navbar-light bg-light"
>
<span
class=
"heading"
>
Меню
</span>
<a
href=
"#"
class=
"navbar-brand"
>
<hr>
<img
src=
"//time.office.etersoft.ru/images/logo.png"
width=
"30"
height=
"30"
alt=
"Etersoft Logo"
>
<div
class=
"items"
>
TYPOS@ETERSOFT - Сервис опечаток
<ul>
</a>
<?php
if
(
$items
)
{
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarNav"
foreach
(
$items
as
$item
)
{
area-controls=
"#navbarNav"
area-expanded=
"false"
area-label=
"Раскрыть меню"
>
echo
"<li>"
.
$item
.
"</li>"
;
<span
class=
"navbar-toggler-icon"
></span>
}
</button>
}
?>
<div
class=
"collapse navbar-collapse "
id=
"navbarNav"
>
</ul>
<ul
class=
"navbar-nav mr-auto"
>
</div>
<?
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>
</nav>
\ No newline at end of file
\ No newline at end of file
cp/stylesheet/stylesheet.css
View file @
333809ea
...
@@ -50,16 +50,8 @@ body {
...
@@ -50,16 +50,8 @@ body {
float
:
left
;
float
:
left
;
}
}
#head
{
.header
{
padding
:
8px
;
margin-bottom
:
15px
;
margin-bottom
:
15px
;
background-color
:
#F3F3F3
;
}
#head
h1
{
vertical-align
:
center
;
margin
:
0
;
color
:
#FF9C00
;
}
}
#footer
{
#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