Commit f68ac566 authored by john's avatar john

3010

parent 97c7ca96
...@@ -43,14 +43,16 @@ class SearchDocList extends DocList ...@@ -43,14 +43,16 @@ class SearchDocList extends DocList
*/ */
public function search($params) public function search($params)
{ {
$idList = array_keys($this->getParentList($this, 0, 0, true));
$idListInt = [-1];
foreach ($idList as $_id)
$idListInt[] = (int) $_id;
$query = DocList::find(); $query = DocList::find();
$query->joinWith(['lang']); $query->joinWith(['lang']);
$query->orderBy([ new \yii\db\Expression('FIELD (`doc_list`.`id`, ' . implode(',', $idListInt) . ')')]);
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
'sort' => [ 'sort' => [
'defaultOrder' => [
'id' => SORT_DESC,
],
'attributes' => [ 'attributes' => [
'id', 'id',
'active', 'active',
......
...@@ -6,6 +6,7 @@ use yii\grid\GridView; ...@@ -6,6 +6,7 @@ use yii\grid\GridView;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel common\modules\documentation\models\SearchCoCategory */ /* @var $searchModel common\modules\documentation\models\SearchCoCategory */
/* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $dataProvider yii\data\ActiveDataProvider */
$parentList = $searchModel->getParentList($searchModel, 0, 0, true);
?> ?>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
...@@ -27,8 +28,10 @@ use yii\grid\GridView; ...@@ -27,8 +28,10 @@ use yii\grid\GridView;
], ],
[ [
'attribute' => 'name', 'attribute' => 'name',
'value' => function($model) { 'format'=>'raw',
return $model->lang->name; 'value' => function($model)use($parentList) {
return '<p style="white-space: nowrap;">'.$parentList[$model->id . ' '].'</p>';
// return $model->lang->name;
} }
], ],
[ [
......
<?php <?php
use yii\widgets\Pjax; use yii\widgets\Pjax;
use yii\helpers\Url;
use common\modules\documentation\assets\DocumentationAsset; use common\modules\documentation\assets\DocumentationAsset;
use common\modules\documentation\models\DocList; use common\modules\documentation\models\DocList;
...@@ -10,7 +11,16 @@ use common\modules\documentation\models\DocList; ...@@ -10,7 +11,16 @@ use common\modules\documentation\models\DocList;
DocumentationAsset::register($this); DocumentationAsset::register($this);
$modelDocList = new DocList(); $modelDocList = new DocList();
$encodedUrl = yii\helpers\Url::current([], true); $encodedUrl = yii\helpers\Url::current([], true);
$encodedUrl = yii\helpers\Url::current([], true);
$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/logo.png']);
$this->registerMetaTag(['property' => 'og:description', 'content' => 'Разработка высоконагруженных сервисов, интернет порталов, корпоративных порталов.']);
$this->registerMetaTag(['property' => 'og:url', 'content' => Url::base(true)]);
$this->registerMetaTag(['property' => 'og:site_name', 'content' => 'Арт Проект']);
?> ?>
...@@ -71,7 +81,7 @@ $encodedUrl = yii\helpers\Url::current([], true); ...@@ -71,7 +81,7 @@ $encodedUrl = yii\helpers\Url::current([], true);
<div class="share-links"> <div class="share-links">
<a <a
class="social-button shape-circle sb-facebook" class="social-button shape-circle sb-facebook"
href="https://www.facebook.com/sharer/sharer.php?u=<?= $encodedUrl ?>&t=<?php echo $modelContent->name ?>" href="https://www.facebook.com/sharer/sharer.php?u=<?= $encodedUrl ?>&t=<?php echo $modelContent->name ?>&text=<?php echo $modelContent->name ?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"
target="_blank" target="_blank"
data-toggle="tooltip" data-toggle="tooltip"
...@@ -87,13 +97,22 @@ $encodedUrl = yii\helpers\Url::current([], true); ...@@ -87,13 +97,22 @@ $encodedUrl = yii\helpers\Url::current([], true);
data-placement="top" data-placement="top"
data-original-title="Twitter"><i class="socicon-twitter"></i></a> data-original-title="Twitter"><i class="socicon-twitter"></i></a>
<a <a
class="social-button shape-circle sb-vk"
href="https://vk.com/share.php?url=<?= $encodedUrl ?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');return false;"
target="_blank"
data-toggle="tooltip"
data-placement="top"
data-original-title="ВКонтакте"><i class="socicon-vkontakte"></i></a>
<!-- <a
class="social-button shape-circle sb-google-plus" class="social-button shape-circle sb-google-plus"
href="https://plus.google.com/share?url=<?= $encodedUrl ?>" href="https://plus.google.com/share?url=<?= $encodedUrl ?>"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');return false;" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=480');return false;"
target="_blank" target="_blank"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="top" data-placement="top"
data-original-title="Google +"><i class="socicon-googleplus"></i></a></div> data-original-title="Google +"><i class="socicon-googleplus"></i></a>-->
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -5,17 +5,17 @@ RewriteCond %{HTTP_HOST} ^www.task-on\.com$ [NC] ...@@ -5,17 +5,17 @@ RewriteCond %{HTTP_HOST} ^www.task-on\.com$ [NC]
RewriteRule ^(.*)$ http://task-on.com/$1 [R=301,L] RewriteRule ^(.*)$ http://task-on.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://task-on.com/ [R=301,L] RewriteRule ^index\.php$ http://task-on.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off RewriteCond %{HTTP} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$ RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ https://task-on.com/$1 [R=301,L] RewriteRule ^(.+)/$ http://task-on.com/$1 [R=301,L]
Redirect 301 /portfolio/appl /portfolio Redirect 301 /portfolio/appl /portfolio
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment