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
2c0480eb
Commit
2c0480eb
authored
Feb 03, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix content
parent
f263f64b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
41 deletions
+27
-41
common/modules/content/controllers/ContentAdminController.php
...on/modules/content/controllers/ContentAdminController.php
+17
-16
common/modules/content/models/SearchCoBlocks.php
common/modules/content/models/SearchCoBlocks.php
+2
-3
common/modules/content/views/content-admin/index.php
common/modules/content/views/content-admin/index.php
+8
-10
common/modules/content/views/content-admin/updatecontent.php
common/modules/content/views/content-admin/updatecontent.php
+0
-12
No files found.
common/modules/content/controllers/ContentAdminController.php
View file @
2c0480eb
...
@@ -28,7 +28,7 @@ class ContentAdminController extends AdminController
...
@@ -28,7 +28,7 @@ class ContentAdminController extends AdminController
'Update'
=>
'Редактирование контента'
,
'Update'
=>
'Редактирование контента'
,
'Delete'
=>
'Удаление контента'
,
'Delete'
=>
'Удаление контента'
,
'View'
=>
'Просмотр контента'
,
'View'
=>
'Просмотр контента'
,
'Copypage
'
=>
''
,
// 'Copy
' => '',
];
];
}
}
...
@@ -44,21 +44,22 @@ class ContentAdminController extends AdminController
...
@@ -44,21 +44,22 @@ class ContentAdminController extends AdminController
];
];
}
}
public
function
actionCopypage
(
$id
)
{
// public function actionCopy($id)
$model
=
$this
->
findModel
(
$id
);
// {
$meta
=
$model
->
metaTags
->
attributes
;
// $model = $this->findModel($id);
// $meta = $model->metaTags->attributes;
\Yii
::
$app
->
request
->
setBodyParams
([
'MetaTags'
=>
$meta
]);
$newPage
=
new
CoContent
();
// \Yii::$app->request->setBodyParams(['MetaTags' => $meta]);
$data
=
$model
->
attributes
;
// $newPage = new CoContent();
unset
(
$data
[
'id'
]);
// $data = $model->attributes;
$data
[
'url'
]
=
''
;
// unset($data['id']);
$newPage
->
setAttributes
(
$data
);
// $data['url'] = '';
$newPage
->
name
.=
' (Копия)'
;
// $newPage->setAttributes($data);
$newPage
->
save
(
false
);
// $newPage->name .= ' (Копия)';
// $newPage->save(false);
$this
->
redirect
([
'manage'
]);
}
// $this->redirect(['manage']);
// }
/**
/**
* Lists all CoContent models.
* Lists all CoContent models.
...
...
common/modules/content/models/SearchCoBlocks.php
View file @
2c0480eb
...
@@ -19,7 +19,7 @@ class SearchCoBlocks extends CoBlocks
...
@@ -19,7 +19,7 @@ class SearchCoBlocks extends CoBlocks
{
{
return
[
return
[
[[
'id'
],
'integer'
],
[[
'id'
],
'integer'
],
[[
'lang'
,
'title'
,
'name'
,
'
text'
,
'
category_id'
],
'safe'
],
[[
'lang'
,
'title'
,
'name'
,
'category_id'
],
'safe'
],
];
];
}
}
...
@@ -62,8 +62,7 @@ class SearchCoBlocks extends CoBlocks
...
@@ -62,8 +62,7 @@ class SearchCoBlocks extends CoBlocks
$query
->
andFilterWhere
([
'like'
,
'lang'
,
$this
->
lang
])
$query
->
andFilterWhere
([
'like'
,
'lang'
,
$this
->
lang
])
->
andFilterWhere
([
'like'
,
'title'
,
$this
->
title
])
->
andFilterWhere
([
'like'
,
'title'
,
$this
->
title
])
->
andFilterWhere
([
'like'
,
'name'
,
$this
->
name
])
->
andFilterWhere
([
'like'
,
'name'
,
$this
->
name
]);
->
andFilterWhere
([
'like'
,
'text'
,
$this
->
text
]);
return
$dataProvider
;
return
$dataProvider
;
}
}
...
...
common/modules/content/views/content-admin/index.php
View file @
2c0480eb
...
@@ -40,17 +40,15 @@ use yii\grid\GridView;
...
@@ -40,17 +40,15 @@ use yii\grid\GridView;
],
],
[
[
'class'
=>
'common\components\ColorActionColumn'
,
'class'
=>
'common\components\ColorActionColumn'
,
'template'
=>
'{
copy} {
update} {delete}'
,
'template'
=>
'{update} {delete}'
,
'buttons'
=>
[
'buttons'
=>
[
// 'copy' => function ($url, $model, $key) {
// Дмитрий Королев: хочется посмотреть как это будет вглядеть
// return '<a href="'.Url::toRoute(['copy', 'id' => $model->id]).'">'.Html::beginTag('i', [
'copy'
=>
function
(
$url
,
$model
,
$key
)
{
// 'title' => "Копировать страницу",
return
'<a href="'
.
Url
::
toRoute
([
'copypage'
,
'id'
=>
$model
->
id
])
.
'">'
.
Html
::
beginTag
(
'i'
,
[
// 'data-toggle' => 'tooltip',
'title'
=>
"Копировать страницу"
,
// 'class' => 'fa fa-copy fa-lg'
'data-toggle'
=>
'tooltip'
,
// ]) . Html::endTag('i') . '</a>';
'class'
=>
'fa fa-copy fa-lg'
// },
])
.
Html
::
endTag
(
'i'
)
.
'</a>'
;
},
],
],
],
],
],
],
...
...
common/modules/content/views/content-admin/updatecontent.php
deleted
100644 → 0
View file @
f263f64b
<?php
$blocks
=
\common\modules\content\models\CoBlocks
::
find
()
->
all
();
if
(
count
(
$blocks
))
{
echo
"<ul>"
;
foreach
(
$blocks
as
$block
)
{
echo
"<li>
{
{$block->name}
}
{
$block
->
title
}
</li>"
;
}
echo
"</ul><hr />"
;
}
echo
$form
;
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