Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
addcpm-json
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Чаплыгин
addcpm-json
Commits
6b9e5022
Commit
6b9e5022
authored
Nov 19, 2018
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Настройка редиректов на стр. обновления профиля, инфо-сообщение при смене пароля
parent
52152268
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
22 deletions
+11
-22
script-set-prof.js
src/public/js/script-set-prof.js
+9
-20
layout-main.phtml
src/templates/layout/layout-main.phtml
+2
-2
No files found.
src/public/js/script-set-prof.js
View file @
6b9e5022
$
(
document
).
ready
(
function
(){
$
(
'.wrapp-button'
).
on
(
'click'
,
function
(){
var
$this
=
$
(
this
);
//var form = $(this).parent().parent()[0].querySelector('form');
var
form
=
$
(
this
).
parent
(
'form'
)[
0
];
var
formData
=
new
FormData
(
form
);
var
redirect
;
var
$this
=
$
(
this
),
form
=
$
(
this
).
parent
(
'form'
)[
0
],
formData
=
new
FormData
(
form
),
redirectUrl
=
$
(
form
).
attr
(
"data-url-success"
);
if
(
$this
.
eq
(
0
).
hasClass
(
"reset"
))
{
var
redirectUrl
=
$this
.
eq
(
0
).
data
(
"url"
);
redirect
=
function
()
{
document
.
location
.
href
=
redirectUrl
;
};
setTimeout
(
function
()
{
$
(
"main"
).
animate
({
opacity
:
0
},
500
);
setTimeout
(
redirect
,
500
);
},
1000
);
}
else
{
$
.
ajax
({
url
:
$
(
form
).
attr
(
"data-url"
),
...
...
@@ -34,13 +22,14 @@ $(document).ready(function(){
success
:
function
(
data
)
{
if
(
data
.
result
)
{
console
.
log
(
data
);
$
.
showMessage
(
'info'
,
$this
.
data
(
'action'
));
setTimeout
(
function
(){
document
.
location
.
reload
();
//document.location.reload();
document
.
location
.
href
=
redirectUrl
;
},
1000
);
}
else
{
console
.
log
(
data
);
$
.
showMessage
(
'error'
,
data
.
msg
.
text
);
}
},
error
:
function
(
e
)
{
...
...
src/templates/layout/layout-main.phtml
View file @
6b9e5022
...
...
@@ -58,7 +58,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
<body>
<?php
//$urlHome = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ?'adm.index' :'home',['lang' => $lang]);
//
$urlHome = $this->url('user.cabinet',['lang' => $lang]);
$urlHome
=
$this
->
url
(
'user.cabinet'
,[
'lang'
=>
$lang
]);
?>
...
...
@@ -96,7 +96,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
//$urlCabinet = $this->url('user.cabinet',['lang' => $lang]);
$urlCabinet
=
$this
->
url
(
'user.cabinet.profile'
,[
'lang'
=>
$lang
]);
?>
<a
href=
"
<?=
$urlCabinet
?>
"
class=
"annotation"
title=
"
<?=
_t
(
"
Мой кабинет
"
)
?>
"
>
<?=
$identity
->
getEmail
()
?>
</a>
<a
href=
"
<?=
$urlCabinet
?>
"
class=
"annotation"
title=
"
<?=
_t
(
"
Настройки профиля
"
)
?>
"
>
<?=
$identity
->
getEmail
()
?>
</a>
</div>
<div
class=
"header-logout col sm-2 order-xs-1"
>
<a
href=
"
<?=
$this
->
url
(
'logout'
,
[
'lang'
=>
$lang
])
?>
"
title=
"
<?=
_t
(
"Выход"
)
?>
"
class=
"annotation"
>
<?=
_t
(
"Выход"
)
?>
</a>
...
...
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