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
49d65e08
Commit
49d65e08
authored
Mar 12, 2019
by
john
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3010
parent
330cee17
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
152 additions
and
11 deletions
+152
-11
common/modules/documentation/assets/src/css/documentation.css
...on/modules/documentation/assets/src/css/documentation.css
+5
-0
common/modules/documentation/controllers/DocumentationListAdminController.php
...entation/controllers/DocumentationListAdminController.php
+58
-2
common/modules/documentation/models/SearchDocList.php
common/modules/documentation/models/SearchDocList.php
+6
-3
common/modules/documentation/views/documentation-list-admin/_form.php
...es/documentation/views/documentation-list-admin/_form.php
+3
-1
common/modules/documentation/views/documentation-list-admin/index.php
...es/documentation/views/documentation-list-admin/index.php
+6
-0
common/modules/documentation/views/documentation-list-admin/sort.php
...les/documentation/views/documentation-list-admin/sort.php
+67
-0
common/modules/documentation/views/page/view.php
common/modules/documentation/views/page/view.php
+7
-5
No files found.
common/modules/documentation/assets/src/css/documentation.css
View file @
49d65e08
...
...
@@ -4,3 +4,8 @@
.faq_sec
img
{
max-width
:
100%
;
}
.faq_sec
p
img
,
.faq_sec
li
img
{
margin-top
:
20px
;
margin-bottom
:
20px
}
\ No newline at end of file
common/modules/documentation/controllers/DocumentationListAdminController.php
View file @
49d65e08
...
...
@@ -26,6 +26,7 @@ class DocumentationListAdminController extends AdminController
'View'
=>
'Просмотр модуля'
,
'Delete'
=>
''
,
'Createcontroller'
=>
'Создание контроллера'
,
'Sort'
=>
'Соктировка списка'
,
'Deletecontroller'
=>
''
,
'Updatecontroller'
=>
''
,
];
...
...
@@ -65,6 +66,59 @@ class DocumentationListAdminController extends AdminController
]);
}
/**
* Lists all DocList models.
* @return mixed
*/
public
function
actionSort
(
$id
=
0
)
{
$items
=
yii
::
$app
->
request
->
post
(
'items'
);
if
(
$items
)
{
$items
=
\yii\helpers\Json
::
decode
(
$items
,
true
);
$newOrder
=
[];
$models
=
[];
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
$success
=
true
;
$newOrder
=
[];
$models
=
[];
foreach
(
$items
as
$old
=>
$new
)
{
$models
[
$new
]
=
$this
->
findModel
(
$new
);
$newOrder
[
$old
]
=
$models
[
$new
]
->
position
;
}
foreach
(
$newOrder
as
$modelId
=>
$orderValue
)
{
$models
[
$modelId
]
->
position
=
$orderValue
;
if
(
!
$models
[
$modelId
]
->
save
())
{
$success
=
false
;
}
}
if
(
$success
)
{
$transaction
->
commit
();
}
else
{
$transaction
->
rollBack
();
}
}
catch
(
\Exception
$e
)
{
$transaction
->
rollBack
();
throw
$e
;
}
return
;
}
$searchModel
=
new
SearchDocList
();
$dataProvider
=
$searchModel
->
search
(
Yii
::
$app
->
request
->
queryParams
,
2000000
);
$dataProvider
->
query
->
andWhere
([
'='
,
'parent_id'
,
$id
]);
\yii
::
$app
->
controller
->
page_title
=
\yii
::
t
(
'documentation'
,
'Соктировка списка'
);
\yii
::
$app
->
controller
->
breadcrumbs
=
[
\yii
::
t
(
'documentation'
,
'Соктировка списка'
),
];
return
$this
->
render
(
'sort'
,
[
'searchModel'
=>
$searchModel
,
'dataProvider'
=>
$dataProvider
,
]);
}
/**
* Displays a single DocList model.
* @param integer $id
...
...
@@ -132,8 +186,10 @@ class DocumentationListAdminController extends AdminController
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
$model
->
parent_id
=
(
int
)
$model
->
parent_id
;
if
(
$model
->
isNewRecord
)
$model
->
position
=
DocList
::
find
()
->
where
([
'='
,
'parent_id'
,
(
int
)
$model
->
parent_id
])
->
count
();
if
(
$model
->
isNewRecord
)
{
$last
=
DocList
::
find
()
->
where
([
'='
,
'parent_id'
,
(
int
)
$model
->
parent_id
])
->
orderBy
([
'position'
=>
SORT_DESC
])
->
one
();
$model
->
position
=
$last
?
$last
->
position
+
1
:
0
;
}
if
(
$model
->
save
())
{
$transaction
->
commit
();
return
$this
->
redirect
(
\yii\helpers\Url
::
toRoute
([
'manage'
]));
...
...
common/modules/documentation/models/SearchDocList.php
View file @
49d65e08
...
...
@@ -41,7 +41,7 @@ class SearchDocList extends DocList
*
* @return ActiveDataProvider
*/
public
function
search
(
$params
)
public
function
search
(
$params
,
$pagesize
=
20
)
{
$idList
=
array_keys
(
$this
->
getParentList
(
$this
,
0
,
0
,
true
));
$idListInt
=
[
-
1
];
...
...
@@ -55,6 +55,9 @@ class SearchDocList extends DocList
$query
->
orderBy
([
new
\yii\db\Expression
(
'FIELD (`doc_list`.`id`, '
.
implode
(
','
,
$idListInt
)
.
')'
)]);
$dataProvider
=
new
ActiveDataProvider
([
'query'
=>
$query
,
'pagination'
=>
[
'pageSize'
=>
$pagesize
,
],
'sort'
=>
[
'attributes'
=>
[
'id'
,
...
...
@@ -72,7 +75,7 @@ class SearchDocList extends DocList
if
(
!
$this
->
validate
())
{
// uncomment the following line if you do not want to any records when validation fails
//
$query->where('0=1');
$query
->
where
(
'0=1'
);
return
$dataProvider
;
}
...
...
common/modules/documentation/views/documentation-list-admin/_form.php
View file @
49d65e08
...
...
@@ -45,7 +45,9 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
<?php
endforeach
;
?>
</div>
<?=
$form
->
field
(
$model
,
'parent_id'
)
->
dropDownList
(
$model
->
getParentList
(
$model
),
[
'class'
=>
'form-control'
,
'prompt'
=>
'Выберите родительский раздел'
])
?>
<?=
(
yii
::
$app
->
request
->
get
(
'position'
))
?
$form
->
field
(
$model
,
'position'
)
->
textInput
([
'class'
=>
'form-control'
])
:
''
;
?>
<?=
$form
->
field
(
$model
,
'parent_id'
)
->
dropDownList
(
$model
->
getParentList
(
$model
),
[
'class'
=>
'form-control'
,
'prompt'
=>
'Выберите родительский раздел'
])
?>
<?=
$form
->
field
(
$model
,
'active'
,
[
'template'
=>
'{input}<a href="#" class="btn btn-xs btn-success m-l-5 disabled">Пункт меню скрыт от пользователя / Пункт меню виднен для пользователю</a>'
...
...
common/modules/documentation/views/documentation-list-admin/index.php
View file @
49d65e08
...
...
@@ -56,6 +56,12 @@ $parentList = $searchModel->getParentList($searchModel, 0, 0, true);
/* 'url:url', */
[
'class'
=>
'common\components\ColorActionColumn'
,
'template'
=>
'{sort} {view} {update} {delete}'
,
'buttons'
=>
[
'sort'
=>
function
(
$url
,
$model
,
$key
)
{
return
Html
::
a
(
'<i class="fa fa-sort fa-lg"></i>'
,
[
'/documentation/documentation-list-admin/sort'
,
'id'
=>
$model
->
parent_id
],
[
"title"
=>
"Сортировать"
,
'data-toggle'
=>
"tooltip"
,
"data-pjax"
=>
"0"
]);
},
],
'headerOptions'
=>
[
'style'
=>
'width: 150px;'
]
...
...
common/modules/documentation/views/documentation-list-admin/sort.php
0 → 100644
View file @
49d65e08
<?php
use
yii\helpers\Html
;
use
himiklab\sortablegrid\SortableGridView
/* @var $this yii\web\View */
/* @var $searchModel common\modules\documentation\models\SearchCoCategory */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<?=
SortableGridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'header' => '<span class="glyphicon glyphicon-align-justify"></span>',
// 'label' => '<span class="glyphicon glyphicon-align-justify"></span>',
'attribute' => 'id',
'format' => 'raw',
'value' => function() {
return '<i class="fa fa-sort fa-lg"></i>'
;
}
],
[
'header'
=>
$searchModel
->
getAttributeLabel
(
'id'
),
'attribute'
=>
'id'
,
],
[
'header'
=>
$searchModel
->
getAttributeLabel
(
'position'
),
'attribute'
=>
'position'
,
],
[
'header'
=>
$searchModel
->
getAttributeLabel
(
'name'
),
'attribute'
=>
'name'
,
'format'
=>
'raw'
,
'value'
=>
function
(
$model
)
{
return
'<p style="white-space: nowrap;">'
.
$model
->
lang
->
name
.
'</p>'
;
}
],
[
'header'
=>
$searchModel
->
getAttributeLabel
(
'parent_id'
),
'attribute'
=>
'parent_id'
,
'value'
=>
function
(
$model
)
{
return
$model
->
parent
?
$model
->
parent
->
lang
->
name
:
null
;
}
],
[
'header'
=>
$searchModel
->
getAttributeLabel
(
'active'
),
'attribute'
=>
'active'
,
'value'
=>
function
(
$model
)
{
$list
=
[
'0'
=>
'Пункт меню скрыт от пользователя '
,
'1'
=>
'Пункт меню виднен для пользователю'
];
return
$list
[
$model
->
active
];
}
],
],
]);
?>
<style>
.table
thead
tr
th
:nth-child
(
1
)
,
.table
tbody
tr
td
:nth-child
(
1
)
{
width
:
0.1px
;
padding
:
10px
2px
;
text-align
:
center
;
}
</style>
\ No newline at end of file
common/modules/documentation/views/page/view.php
View file @
49d65e08
...
...
@@ -18,10 +18,9 @@ $this->registerMetaTag(['property' => 'og:type', 'content' => 'article']);
$this
->
registerMetaTag
([
'property'
=>
'og:title'
,
'content'
=>
$modelContent
->
name
]);
$this
->
registerMetaTag
([
'property'
=>
'og:image'
,
'content'
=>
'https://task-on.com/images/taskon.png'
]);
$this
->
registerMetaTag
([
'property'
=>
'og:description'
,
'content'
=>
'Разработка высоконагруженных сервисов, интернет порталов, корпоративных порталов.'
]);
$this
->
registerMetaTag
([
'property'
=>
'og:url'
,
'content'
=>
Url
::
current
([],
true
)]);
$this
->
registerMetaTag
([
'property'
=>
'og:url'
,
'content'
=>
Url
::
current
([],
true
)]);
//$this->registerMetaTag(['property' => 'og:url', 'content' => Url::base(true)]);
$this
->
registerMetaTag
([
'property'
=>
'og:site_name'
,
'content'
=>
'Арт Проект'
]);
?>
...
...
@@ -36,9 +35,9 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<div
class=
"col-sm-12"
>
<ul>
<li
class=
"active"
>
<a
href=
"
faq.html
"
>
<a
href=
"
/faq
"
>
<span
class=
"icon_info_2"
>
</span>
Документаци
я
</a>
</span>
Руководство пользовател
я
</a>
</li>
</ul>
</div>
...
...
@@ -50,7 +49,10 @@ $this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Пр
<div
class=
"col-sm-12"
>
<div
class=
"way"
>
<a
href=
"/"
>
Главная
</a>
<span>
|
</span>
Документация
<span>
|
</span>
<a
href=
"/faq/"
>
Руководство пользователя
</a>
<span>
|
</span>
<a
href=
"/yii-dokumentaciya/"
>
Документаци для разраотчиков
</a>
<span>
|
</span>
<?php
echo
$modelContent
->
name
?>
<br>
<br>
</div>
</div>
...
...
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