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
a4a90a3d
Commit
a4a90a3d
authored
Nov 10, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1467: Редирект 301
parent
f0fbe93b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
common/modules/blog/controllers/PostAdminController.php
common/modules/blog/controllers/PostAdminController.php
+3
-2
common/modules/blog/controllers/PostController.php
common/modules/blog/controllers/PostController.php
+6
-0
common/modules/blog/models/PostTag.php
common/modules/blog/models/PostTag.php
+2
-1
No files found.
common/modules/blog/controllers/PostAdminController.php
View file @
a4a90a3d
...
@@ -86,7 +86,7 @@ class PostAdminController extends AdminController
...
@@ -86,7 +86,7 @@ class PostAdminController extends AdminController
*/
*/
public
function
actionCreate
()
public
function
actionCreate
()
{
{
$model
=
new
Post
();
$model
=
new
Post
(
'manual'
);
if
(
Yii
::
$app
->
request
->
isPost
)
if
(
Yii
::
$app
->
request
->
isPost
)
{
{
...
@@ -124,6 +124,7 @@ class PostAdminController extends AdminController
...
@@ -124,6 +124,7 @@ class PostAdminController extends AdminController
public
function
actionUpdate
(
$id
)
public
function
actionUpdate
(
$id
)
{
{
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
$model
->
setScenario
(
'manual'
);
if
(
Yii
::
$app
->
request
->
isPost
)
if
(
Yii
::
$app
->
request
->
isPost
)
{
{
...
@@ -162,7 +163,7 @@ class PostAdminController extends AdminController
...
@@ -162,7 +163,7 @@ class PostAdminController extends AdminController
{
{
$this
->
findModel
(
$id
)
->
delete
();
$this
->
findModel
(
$id
)
->
delete
();
return
$this
->
redirect
([
'
index
'
]);
return
$this
->
redirect
([
'
manage
'
]);
}
}
public
function
actionAutocomplete
(
$term
)
public
function
actionAutocomplete
(
$term
)
...
...
common/modules/blog/controllers/PostController.php
View file @
a4a90a3d
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
common\modules\blog\controllers
;
namespace
common\modules\blog\controllers
;
use
common\modules\blog\models\SearchPost
;
use
common\modules\blog\models\SearchPost
;
use
common\modules\languages\models\Languages
;
use
Yii
;
use
Yii
;
use
common\components\BaseController
;
use
common\components\BaseController
;
use
yii\web\NotFoundHttpException
;
use
yii\web\NotFoundHttpException
;
...
@@ -95,6 +96,11 @@ class PostController extends BaseController
...
@@ -95,6 +96,11 @@ class PostController extends BaseController
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
throw
new
NotFoundHttpException
(
'The requested page does not exist.'
);
}
}
$language
=
Languages
::
getCurrent
();
if
(
$model
->
lang_id
!=
$language
->
id
)
{
return
$this
->
redirect
([
'/blog'
]);
}
$this
->
meta_title
=
Yii
::
t
(
'app'
,
'Tag'
)
.
': '
.
$model
->
name
;
$this
->
meta_title
=
Yii
::
t
(
'app'
,
'Tag'
)
.
': '
.
$model
->
name
;
return
$this
->
render
(
'tag'
,
[
return
$this
->
render
(
'tag'
,
[
...
...
common/modules/blog/models/PostTag.php
View file @
a4a90a3d
...
@@ -16,6 +16,7 @@ use dosamigos\transliterator\TransliteratorHelper;
...
@@ -16,6 +16,7 @@ use dosamigos\transliterator\TransliteratorHelper;
*
*
* @property integer $id
* @property integer $id
* @property string $name
* @property string $name
* @property integer $lang_id
* @property integer $created_at
* @property integer $created_at
* @property integer $updated_at
* @property integer $updated_at
*
*
...
@@ -44,7 +45,7 @@ class PostTag extends \common\components\ActiveRecordModel
...
@@ -44,7 +45,7 @@ class PostTag extends \common\components\ActiveRecordModel
{
{
return
[
return
[
[[
'name'
],
'required'
],
[[
'name'
],
'required'
],
[[
'lang_id'
],
'
safe
'
],
[[
'lang_id'
],
'
required'
,
'on'
=>
'manual
'
],
[[
'created_at'
,
'updated_at'
,
'lang_id'
],
'integer'
],
[[
'created_at'
,
'updated_at'
,
'lang_id'
],
'integer'
],
[[
'name'
,
'translit'
],
'string'
,
'max'
=>
255
],
[[
'name'
,
'translit'
],
'string'
,
'max'
=>
255
],
];
];
...
...
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