Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
a9f97dc6
Commit
a9f97dc6
authored
Apr 08, 2019
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3133 - Отключение sitemap.xml страниц на анг.
parent
459e70dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
common/modules/blog/components/TagBehavior.php
common/modules/blog/components/TagBehavior.php
+9
-12
common/modules/blog/controllers/PostController.php
common/modules/blog/controllers/PostController.php
+4
-0
common/modules/documentation/controllers/PageController.php
common/modules/documentation/controllers/PageController.php
+3
-1
common/modules/faq/controllers/FaqController.php
common/modules/faq/controllers/FaqController.php
+4
-0
No files found.
common/modules/blog/components/TagBehavior.php
View file @
a9f97dc6
<?php
namespace
common\modules\blog\components
;
use
Yii
;
...
...
@@ -25,10 +26,8 @@ class TagBehavior extends Behavior
private
function
clearPostTags
()
{
if
(
$this
->
owner
->
postTagAssigns
)
{
foreach
(
$this
->
owner
->
postTagAssigns
as
$tag
)
{
if
(
$this
->
owner
->
postTagAssigns
)
{
foreach
(
$this
->
owner
->
postTagAssigns
as
$tag
)
{
$tag
->
delete
();
}
}
...
...
@@ -36,15 +35,13 @@ class TagBehavior extends Behavior
private
function
insertPostTags
()
{
if
(
$this
->
tags
)
{
foreach
(
$this
->
tags
as
$tag
)
{
$tags
=
explode
(
','
,
$this
->
tags
);
if
(
is_array
(
$tags
))
{
foreach
(
$tags
as
$tag
)
{
$tg
=
PostTag
::
find
()
->
where
([
'name'
=>
$tag
])
->
one
();
if
(
!
$tg
)
{
if
(
!
$tg
)
{
// Убрана возможность создавать новые теги
return
false
;
return
false
;
// $tg = new PostTag;
// $tg->name = $tag;
// $tg->save();
...
...
@@ -60,7 +57,7 @@ class TagBehavior extends Behavior
public
function
eventFind
(
$event
)
{
$this
->
tags
=
array_keys
(
ArrayHelper
::
map
(
$this
->
owner
->
postTags
,
'name'
,
'id'
));
$this
->
tags
=
implode
(
','
,
array_keys
(
ArrayHelper
::
map
(
$this
->
owner
->
postTags
,
'name'
,
'id'
)
));
}
public
function
Save
(
$event
)
...
...
common/modules/blog/controllers/PostController.php
View file @
a9f97dc6
...
...
@@ -135,6 +135,10 @@ class PostController extends BaseController
public
function
actionView
(
$url
)
{
$model
=
$this
->
findModelByUrl
(
$url
);
if
(
!
$model
->
lang
||
$model
->
lang
->
hidden
)
{
throw
new
NotFoundHttpException
(
'Page not found!'
);
}
$this
->
meta_title
=
$model
->
metaTag
->
title
;
$this
->
meta_description
=
$model
->
metaTag
->
description
;
...
...
common/modules/documentation/controllers/PageController.php
View file @
a9f97dc6
...
...
@@ -24,7 +24,9 @@ class PageController extends \common\components\BaseController
$model
=
$this
->
findDocumentModel
(
$document
);
$modelContent
=
$model
->
getLang
()
->
one
();
if
(
!
$model
->
lang
||
$model
->
lang
->
hidden
)
{
throw
new
NotFoundHttpException
(
'Page not found!'
);
}
$documentation
=
$model
->
lang
->
html
;
$this
->
meta_title
=
$model
->
metaTag
->
title
;
$this
->
meta_description
=
$model
->
metaTag
->
description
;
...
...
common/modules/faq/controllers/FaqController.php
View file @
a9f97dc6
...
...
@@ -110,6 +110,10 @@ class FaqController extends BaseController
{
$model
=
$this
->
findModelByUrl
(
$url
);
if
(
!
$model
->
lang
||
$model
->
lang
->
hidden
)
{
throw
new
NotFoundHttpException
(
'Page not found!'
);
}
$this
->
meta_title
=
$model
->
metaTag
?
$model
->
metaTag
->
title
:
' '
;
$this
->
meta_description
=
$model
->
metaTag
?
$model
->
metaTag
->
description
:
' '
;
$this
->
meta_keywords
=
$model
->
metaTag
?
$model
->
metaTag
->
keywords
:
' '
;
...
...
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