Initial import

This commit is contained in:
Admin Nasledstvo
2026-05-01 20:52:04 +03:00
commit ac168868ee
10028 changed files with 2337954 additions and 0 deletions
@@ -0,0 +1,58 @@
<?php
use app\models\Articles;
$lg = Yii::$app->language;
$per_page = 10;
$page = $_GET['page'] ?? 1
/**
* @var \yii\web\View $this
*/
?>
<?php
$articles = Articles::find();
if (!empty($_GET['art_table']) && $_GET['art_table'] != 'all')
$articles = $articles->andWhere(['art_table' => $_GET['art_table']]);
if (!empty($_GET['partner_id'])) {
$articles = $articles->andWhere([
'partner_id' => $_GET['partner_id'],
'on_partner_page' => 1
]);
} else {
$articles = $articles->andWhere(['is_active' => 1]);
}
if (!empty($_GET['order_title'])) {
$articles = $articles->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
if(empty($_GET['partner_id'])) {
$articles = $articles->orderBy(['publish_date' => SORT_DESC]);
} else {
$articles = $articles->orderBy(['id' => SORT_DESC]);
}
}
$count = $articles->count();
$articles = $articles->offset($per_page * $page - $per_page)->limit($per_page);
if ($count <= $per_page) {
$page = 1;
}
$articles = $articles->offset($per_page * $page - $per_page)->limit($per_page);
$html = $this->render('list_article_partial', ['articles' => $articles->all()]);
$pages_count = ceil($count / $per_page);
echo json_encode([
'html' => $html,
'pages_count' => $pages_count,
'current_page' => (int)$page
])
?>
@@ -0,0 +1,33 @@
<?php
/**
* @var \app\models\Articles[] $articles
*/
use app\services\ViewReg;
?>
<div class="flex-wrap">
<?php foreach ($articles as $article): ?>
<?php if ($article->article): ?>
<div class="cw6 flex">
<div class="cw6" style="height: 320px">
<a href="<?= ViewReg::generateDetailPageUrl($article) ?>" class="cell">
<div class="list-element-img cell-img"
style="background-image: url('<?= $article->article->image('16:11') ?>')"></div>
</a>
</div>
<div class="cw6">
<div class="cell">
<div class="list-label <?= $article->art_table ?>"><?= $article->label ?></div>
<div class="list-title top20">
<a href="<?= ViewReg::generateDetailPageUrl($article) ?>">
<?= $article->article->title() ?>
</a>
</div>
<div class="list-text text-limit-8 top20"><?= strip_tags($article->article->textShort()) ?></div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
@@ -0,0 +1,154 @@
<?php
use app\models\register\Collections;
use app\models\register\CollectionsObjects;
use app\models\register\Fields;
use app\models\register\ObjectTags;
use app\models\RegisterObjects;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1;
/**
* @var \yii\web\View $this
*/
if (!empty($_GET['advance_filter']) || !empty($_GET['tags'])) {
$objects = RegisterObjects::find();
$objects = $objects->select('register_objects.ref_num')->where(['lib_type' => 1]);
$conditionOr = ['or'];
//[ FILTER BY NAME ]
if (!empty($_GET['object_name'])) {
$conditionOr[] = ['=', 'name', $_GET['object_name']];
$conditionOr[] = ['=', 'ts_en_name', $_GET['object_name']];
}
//[ FILTER BY CREATOR ]
if (!empty($_GET['created_by'])) {
$conditionOr[] = ['=', 'created_by', $_GET['created_by']];
}
$conditionAnd = ['and'];
//[ FILTER BY YEAR FROM ]
if (!empty($_GET['year_from'])) {
$conditionAnd[] = ['>=', 'created_year', $_GET['year_from']];
}
//[ FILTER BY YEAR TO ]
if (!empty($_GET['year_to'])) {
$conditionAnd[] = ['<=', 'created_year', $_GET['year_to']];
}
//region [FILTER BY OBJECT FIELDS]
$fields = Fields::find()->where(['lib_type' => 1, 'active' => 1, 'deleted' => 0])->all();
$objectFieldIdArray = [];
$objectFieldValueTextArray = [];
foreach ($fields as $field) {
if (!empty($_GET['name_id_' . $field->id]))
$objectFieldIdArray[] = $_GET['name_id_' . $field->id];
if (!empty($_GET['name_text_' . $field->id]))
$objectFieldValueTextArray[] = $_GET['name_text_' . $field->id];
}
if (sizeof($objectFieldIdArray) > 0 || sizeof($objectFieldValueTextArray) > 0) {
$objects = $objects->joinWith('registerObjectFields');
}
if(sizeof($objectFieldIdArray) > 0) {
$conditionOr[] = ['IN', 'value_id', $objectFieldIdArray];
}
if(sizeof($objectFieldValueTextArray) > 0) {
foreach ($objectFieldValueTextArray as $value) {
$conditionOr[] = ['=', 'value_text', $value];
}
}
$objectIds = [];
if($conditionOr != ['or'] || $conditionAnd != ['and']) {
$objects = $objects->andWhere($conditionOr ?? [])->andWhere($conditionAnd ?? [])->all();
foreach ($objects as $object) {
$objectIds[] = $object->ref_num;
}
}
if(!empty($_GET['tags'])) {
$tags = explode(',', $_GET['tags']);
$objectTags = ObjectTags::find()->where(['IN', 'tag_id', $tags])->andWhere(['active' => 1, 'deleted' => 0])->all();
foreach ($objectTags as $objectTag) {
if(!in_array($objectTag->object_id, $objectIds)) {
$objectIds[] = $objectTag->object_id;
}
}
}
$collectionObjectConditionAnd = ['and'];
$collectionObjectConditionAnd[] = ['IN', 'object_id', $objectIds];
$collectionObjectConditionAnd[] = ['=', 'deleted', 0];
$collectionObjectConditionAnd[] = ['=', 'active', 1];
$collectionObjectConditionAnd[] = ['=', 'published', 1];
if (!empty($_GET['partner_id']))
$collectionObjectConditionAnd[] = ['=', 'partner_id', $_GET['partner_id']];
$collectionObjectConditionOr = ['or'];
$collectionObjectConditionOr[] = ['IS', 'is_payable', NULL];
$collectionObjectConditionOr[] = ['=', 'is_payable', 0];
$collectionObjects = CollectionsObjects::find()->joinWith('collection')
->where($collectionObjectConditionOr)
->andWhere($collectionObjectConditionAnd)
->groupBy('collection_id');
$count = $collectionObjects->count();
if ($count <= $per_page) $page = 1;
$collectionObjects->offset($per_page * $page - $per_page)->limit($per_page);
if (!empty($_GET['order_title'])) {
$collectionObjects = $collectionObjects->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$collectionObjects = $collectionObjects->orderBy(['id' => SORT_DESC]);
}
//region DISPLAY DATA
$count = $collectionObjects->count();
$html = $this->render('list_collection_sq_by_filter_partial', ['collectionObjects' => $collectionObjects->all()]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
]);
//endregion
} else {
$collections = Collections::find()->where(['or', ['=', 'is_payable', 0], ['IS', 'is_payable', null]])
->andWhere(['deleted' => 0, 'active' => 1, 'published' => 1]);
if (!empty($_GET['partner_id'])) {
$collections = $collections->andWhere(['partner_id' => $_GET['partner_id']]);
}
$collections = $collections->offset($per_page * $page - $per_page)->limit($per_page);
if (!empty($_GET['order_title'])) {
$collections = $collections->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$collections = $collections->orderBy(['id' => SORT_DESC]);
}
$count = $collections->count();
$html = $this->render('list_collection_sq_partial', ['collections' => $collections->all()]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
]);
}
@@ -0,0 +1,38 @@
<?php
/**
* @var \app\models\register\CollectionsObjects[] $collectionObjects
*/
use app\services\ViewReg;
use app\models\Ts;
?>
<link rel="stylesheet" href="/_public/assets/css/user.css">
<div class="content collection" style="position: relative; display: flex; flex-wrap: nowrap; flex-direction: row-reverse;">
<div class="collection-greed library <?= !empty($_GET['advance_filter']) ? 'filter-open' : '' ?>">
<div class="content-out gallery">
<?php for ($i = 0; $i < 9; $i++): ?>
<div class="gallery__item gallery__item--<?= $i ?>">
<?php if (!empty($collectionObjects[$i])):
$collectionObject = $collectionObjects[$i]; ?>
<a href="<?= $collectionObject->collection->getUrl() ?>">
<img style="width: 100%" src="<?= $collectionObject->collection->getImg() ?>" class="gallery__img"
alt="<?= $collectionObject->collection->title() ?>">
<div class="gallery__item_title">
<?= $collectionObject->collection->title() ?>
</div>
</a>
<?php endif; ?>
</div>
<?php endfor; ?>
</div>
</div>
<div class="filter-panel <?= !empty($_GET['advance_filter']) ? 'show' : '' ?>">
<div class="row ct">
<button onclick="filterApply()" class="profile-submit gradient ct"><?= Ts::get(164) ?></button>
<button onclick="filterClear()" class="profile-submit gradient ct"><?= Ts::get(165) ?></button>
</div>
<?= $this->render('list_collection_filter') ?>
</div>
</div>
@@ -0,0 +1,149 @@
<?php
use app\models\register\Tags;
use app\models\Ts;
use app\models\register\Fields;
$lg = Yii::$app->language;
$translateModule = [
'object_name' => [
'bg' => 'Име на обект',
'en' => 'Object name'
],
'object_creator' => [
'bg' => 'Създател на обект',
'en' => 'Object creator'
],
'year' => [
'bg' => 'Година',
'en' => 'Year'
],
'from' => ['bg' => 'От', 'en' => 'From'],
'to' => ['bg' => 'До', 'en' => 'To'],
];
?>
<div>
<p class="ct"><?= Ts::get(184) ?>:</p>
</div>
<!-- FROM OBJECT -->
<div class="row top10">
<label><?= $translateModule['object_name'][$lg]?></label>
<input data-filter-input="object_name"
value="<?= $_GET['object_name'] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['object_name'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
<div class="row top10">
<label><?= $translateModule['object_creator'][$lg] ?></label>
<input data-filter-input="created_by" value="<?= $_GET['created_by'] ?? '' ?>" placeholder="">
<?php if (!empty($_GET['created_by'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
<div class="row top10">
<label><?= $translateModule['year'][$lg] ?></label>
<div class="flex">
<div>
<div class="flex">
<input data-filter-input="year_from" value="<?= $_GET['year_from'] ?? '' ?>"
placeholder="<?= $translateModule['from'][$lg]?>">
<?php if (!empty($_GET['year_from'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div>
<div class="flex">
<input data-filter-input="year_to" value="<?= $_GET['year_to'] ?? '' ?>"
placeholder="<?=$translateModule['to'][$lg]?>">
<?php if (!empty($_GET['year_to'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- FROM FIELDS field_type = 2 (GENERAL) -->
<?php $general = Fields::find()->where(['lib_type' => 1, 'field_type' => 2])->andWhere(['>', 'level', 0])->all(); ?>
<?php foreach ($general as $item): ?>
<div class="row top10">
<label><?= $item->{$lg == 'en' ? 'name_en': 'name'} ?></label>
<div class="flex">
<?php if ($item->type == 1): ?>
<select class="category-field" onchange="loadSpecificCollectionFilter(this)"
data-filter-input="name_id_<?= $item->id ?>">
<option value=""></option>
<?php foreach ($item->fieldsValues as $fv): ?>
<?php if ($fv): ?>
<option <?= !empty($_GET['name_id_' . $item->id]) && $_GET['name_id_' . $item->id] == $fv->id ? 'selected' : '' ?>
value="<?= $fv['id'] ?? '' ?>"><?= $fv->getNameByLocale() ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php else: ?>
<input data-filter-input="name_text_<?= $item->id ?>"
value="<?= $_GET['name_text_' . $item->id] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['name_text_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<!-- FROM FIELDS field_type = 3 (CATEGORIES) -->
<?php $categories = Fields::find()->where(['lib_type' => 1, 'field_type' => 3])->andWhere(['>', 'level', 0])->all(); ?>
<?php foreach ($categories as $item): ?>
<div class="row top10">
<label><?= $item->{$lg == 'en' ? 'name_en': 'name'} ?></label>
<!-- DROP DOWN -->
<?php if ($item->type == 1): ?>
<div class="flex">
<select class="category-field" onchange="loadSpecificCollectionFilter(this)"
data-filter-input="name_id_<?= $item->id ?>">
<option value=""></option>
<?php foreach ($item->fieldsValues as $fv): ?>
<?php if ($fv): ?>
<option <?= !empty($_GET['name_id_' . $item->id]) && $_GET['name_id_' . $item->id] == $fv->id ? 'selected' : '' ?>
value="<?= $fv['id'] ?? '' ?>"><?= $fv->getNameByLocale() ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
<div data-content-id="name_id_<?= $item->id ?>">
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<?= $this->render('specific_filter', ['parent_id' => $_GET['name_id_' . $item->id], 'content_lib_type' => 1]) ?>
<?php endif; ?>
</div>
<?php else: ?>
<!-- /DROP DOWN -->
<!-- INPUT FIELD -->
<div class="flex">
<input data-filter-input="name_text_<?= $item->id ?>"
value="<?= $_GET['name_text_' . $item->id] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['name_text_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
<!-- /INPUT FIELD -->
<?php endif; ?>
</div>
<?php endforeach; ?>
@@ -0,0 +1,33 @@
<?php
use app\models\Articles;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1;
/**
* @var \yii\web\View $this
*/
?>
<?php
$collectionsObjects = \app\models\register\CollectionsObjects::find()->where(['collection_id' => $_GET['collection_id']]);
$collectionsObjects = $collectionsObjects->offset($per_page * $page - $per_page)->limit($per_page);
$count = $collectionsObjects->count();
$objects = [];
/** @var \app\models\register\CollectionsObjects $collectionsObject */
foreach ($collectionsObjects->all() as $collectionsObject) {
if ($collectionsObject->object)
$objects[] = $collectionsObject->object;
}
$html = $this->render('list_collection_objects_partial', ['objects' => $objects, 'collection' => \app\models\register\Collections::findOne($_GET['collection_id'])]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
])
?>
@@ -0,0 +1,41 @@
<?php
use app\models\Articles;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1;
/**
* @var $object_id
*/
/**
* @var \yii\web\View $this
*/
?>
<?php
$objectFiles = \app\models\RegisterObjectFiles::find()
->where(['object_id' => $object_id, 'file_content_type' => 4])
->andWhere(['IS NOT', 'streaming_url', NULL]);
$objectFiles = $objectFiles->offset($per_page * $page - $per_page)->limit($per_page);
$count = $objectFiles->count();
$files = [];
/** @var \app\models\RegisterObjectFiles $objectFile */
foreach ($objectFiles->all() as $objectFile) {
$files[] = $objectFile;
}
$html = $this->render('list_collection_objects_models_partial', ['files' => $files]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
])
?>
@@ -0,0 +1,23 @@
<?php
/**
* @var \app\models\RegisterObjectFiles[] $files
* @var $start
* @var $end
*/
use app\services\JWT;
$lg = Yii::$app->language;
?>
<?php foreach ($files as $video): ?>
<?php if ($video->file_url): ?>
<div onclick="load3dModel(this)" data-model-3d="<?= Yii::$app->params['media_server'] . '/api/render-model/' . JWT::encode(['id' => $video->id], JWT::SECRET_KEY) . '/?lg='.$lg ?>"
class="gallery__item video-thumb-container">
<div class="img-box">
<i class="play-icon la la-cube"></i>
</div>
<div class="video-thumb-title"><?= $video->video_title ?></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
@@ -0,0 +1,38 @@
<?php
/**
* @var \app\models\RegisterObjects[] $objects
* @var \app\models\register\Collections $collection
* @var $start
* @var $end
*/
use app\models\Ts;
Ts::set([40]);
?>
<?php
for ($index = 0; $index < 12; $index++): ?>
<?php if (!empty($objects[$index])): ?>
<div class="gallery__item">
<?php /** @var \app\models\RegisterObjects $object */
$object = $objects[$index]; ?>
<a href="<?= $object->getCollectionUrl($collection) ?>" class="img-box">
<img style="width: 100%" src="<?= $object->getImg() ?>" class="gallery__img"
alt="<?= $object->getTitle() ?>">
<div class="gallery__item_title">
<?= $object->getTitle() ?>
</div>
</a>
<div class="hidden-grid-part">
<div class="title"><a href="<?= $object->getCollectionUrl($collection) ?>"><?= $object->getTitle() ?></a></div>
<div class="annotation"><?= $object->getAnnotation() ?></div>
<div class="link"><?= Ts::get(40) ?></div>
</div>
</div>
<?php else: ?>
<?php endif; ?>
<?php endfor; ?>
@@ -0,0 +1,41 @@
<?php
use app\models\Articles;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1;
/**
* @var $object_id
*/
/**
* @var \yii\web\View $this
*/
?>
<?php
$objectFiles = \app\models\RegisterObjectFiles::find()
->where(['object_id' => $object_id, 'file_content_type' => 3])
->andWhere(['IS NOT', 'streaming_url', NULL]);
$objectFiles = $objectFiles->offset($per_page * $page - $per_page)->limit($per_page);
$count = $objectFiles->count();
$files = [];
/** @var \app\models\RegisterObjectFiles $objectFile */
foreach ($objectFiles->all() as $objectFile) {
$files[] = $objectFile;
}
$html = $this->render('list_collection_objects_videos_partial', ['files' => $files]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
])
?>
@@ -0,0 +1,24 @@
<?php
/**
* @var \app\models\RegisterObjectFiles[] $files
* @var $start
* @var $end
*/
use app\services\JWT;
?>
<?php foreach ($files as $video): ?>
<?php if ($video->streaming_url): ?>
<div data-id="<?= JWT::encode(['id' => $video->id], JWT::SECRET_KEY) ?>" onclick="streamFrame(this)"
class="gallery__item video-thumb-container">
<div class="img-box">
<img style="width: 100%" src="<?= $video->videoThumbnail() ?>" class="gallery__img video-thumb"
alt="<?= $video->video_title ?>">
<i class="play-icon la la-play-circle"></i>
</div>
<div class="video-thumb-title"><?= $video->video_title ?></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
@@ -0,0 +1,38 @@
<?php
/**
* @var \app\models\register\Collections[] $collections
*/
use app\services\ViewReg;
use app\models\Ts;
?>
<link rel="stylesheet" href="/_public/assets/css/user.css">
<div class="content collection" style="position: relative; display: flex; flex-wrap: nowrap; flex-direction: row-reverse;">
<div class="collection-greed library <?= !empty($_GET['advance_filter']) ? 'filter-open' : '' ?>">
<div class="content-out gallery">
<?php for ($i = 0; $i < 9; $i++): ?>
<div class="gallery__item gallery__item--<?= $i ?>">
<?php if (!empty($collections[$i])):
$collection = $collections[$i]; ?>
<a href="<?= $collection->getUrl() ?>">
<img style="width: 100%" src="<?= $collection->getImg() ?>" class="gallery__img"
alt="<?= $collection->title() ?>">
<div class="gallery__item_title">
<?= $collection->title() ?>
</div>
</a>
<?php endif; ?>
</div>
<?php endfor; ?>
</div>
</div>
<div class="filter-panel <?= !empty($_GET['advance_filter']) ? 'show' : '' ?>">
<div class="row ct">
<button onclick="filterApply()" class="profile-submit gradient ct"><?= Ts::get(164) ?></button>
<button onclick="filterClear()" class="profile-submit gradient ct"><?= Ts::get(165) ?></button>
</div>
<?= $this->render('list_collection_filter') ?>
</div>
</div>
@@ -0,0 +1,36 @@
<?php
/**
* @var \app\models\register\CollectionsObjects[] $collectionObjects
*/
use app\services\ViewReg;
use app\models\Ts;
?>
<link rel="stylesheet" href="/_public/assets/css/collection-objects-greed.css">
<div class="content collection" style="position: relative; display: flex; flex-wrap: nowrap; flex-direction: row-reverse;">
<div class="collection-greed library <?= !empty($_GET['advance_filter']) ? 'filter-open' : '' ?>">
<div class="content-out gallery" id="list-article">
<?php foreach ($collectionObjects as $i => $collectionObject):
$collection = $collectionObject->collection;
?>
<div class="gallery__item">
<a href="<?= $collection->getUrl() ?>" class="img-box">
<img style="width: 100%" src="<?= $collection->getImg() ?>" class="gallery__img"
alt="<?= $collection->title() ?>">
<div class="gallery__item_title">
<?= $collection->title() ?>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="filter-panel <?= !empty($_GET['advance_filter']) ? 'show' : '' ?>">
<div class="row ct">
<button onclick="filterApply()" class="profile-submit gradient ct"><?= Ts::get(164) ?></button>
<button onclick="filterClear()" class="profile-submit gradient ct"><?= Ts::get(165) ?></button>
</div>
<?= $this->render('list_collection_filter') ?>
</div>
</div>
@@ -0,0 +1,36 @@
<?php
/**
* @var \app\models\register\Collections[] $collections
*/
use app\services\ViewReg;
use app\models\Ts;
?>
<link rel="stylesheet" href="/_public/assets/css/collection-objects-greed.css">
<div class="content collection"
style="position: relative; display: flex; flex-wrap: nowrap; flex-direction: row-reverse;">
<div class="collection-greed library <?= !empty($_GET['advance_filter']) ? 'filter-open' : '' ?>">
<div class="content-out gallery" id="list-article">
<?php foreach ($collections as $i => $collection): ?>
<div class="gallery__item">
<a href="<?= $collection->getUrl() ?>" class="img-box">
<img style="width: 100%" src="<?= $collection->getImg() ?>" class="gallery__img"
alt="<?= $collection->title() ?>">
<div class="gallery__item_title">
<?= $collection->title() ?>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="filter-panel <?= !empty($_GET['advance_filter']) ? 'show' : '' ?>">
<div class="row ct">
<button onclick="filterApply()" class="profile-submit gradient ct"><?= Ts::get(164) ?></button>
<button onclick="filterClear()" class="profile-submit gradient ct"><?= Ts::get(165) ?></button>
</div>
<?= $this->render('list_collection_filter') ?>
</div>
</div>
@@ -0,0 +1,114 @@
<?php
use app\models\register\Fields;
use app\models\RegisterObjects;
//echo json_encode($_GET);
//exit;
$lg = Yii::$app->language;
$per_page = 9;
$page = $_GET['page'] ?? 1
/**
* @var \yii\web\View $this
*/
?>
<?php
$library = RegisterObjects::find()
->where(['lib_type' => 2, 'is_active' => 1]);
//if (!empty($_GET['partner_id'])) {
// $library = $library->joinWith('projectPartners')->where(['partner_id' => $_GET['partner_id']]);
//}
$filter = ['or'];
exit;
if(!empty($_GET['search'])) {
exit;
$library->andWhere(['LIKE', 'name', $_GET['search']]);
}
/*
if (!empty($_GET['book_name'])) {
$filter[] = ['like', 'name', $_GET['book_name']];
$filter[] = ['like', 'ts_en_name', $_GET['book_name']];
}
if(!empty($_GET['created_by'])) {
$filter[] = ['like', 'created_by', $_GET['created_by']];
}
$library = $library->andWhere($filter);
$filter2 = [];
if(!empty($_GET['year_from']) || !empty($_GET['year_to'])) {
$filter2[] = 'and';
}
if(!empty($_GET['year_from'])) {
$filter2[] = ['>=', 'created_year', $_GET['year_from']];
}
if(!empty($_GET['year_to'])) {
$filter2[] = ['<=', 'created_year', $_GET['year_to']];
}
$library = $library->andWhere($filter2);
$main = Fields::find()->where(['lib_type' => 2])->all();
$prepare = [
'field_id' => [],
'value_id' => [],
];
$prepare2 = [];
foreach ($main as $item) {
if(!empty($_GET['name_id_' . $item->id])) {
$prepare['field_id'][] = $item->id;
$prepare['value_id'][] = $_GET['name_id_' . $item->id];
}
if(!empty($_GET['name_text_' . $item->id])) {
$prepare2[$item->id] = $_GET['name_text_' . $item->id];
}
}
if(sizeof($prepare['value_id']) > 0 ) {
$library = $library->joinWith('registerObjectFields')->andWhere(['IN', 'value_id', $prepare['value_id']]);
}
if(sizeof($prepare2) > 0) {
$loop = ['or'];
foreach ($prepare2 as $field_id => $value) {
$loop[] = ['field_id' => $field_id, 'value_text' => $value];
}
$library = $library->joinWith('registerObjectFields')->andWhere($loop);
}
*/
if (!empty($_GET['order_title'])) {
$library = $library->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$library = $library->orderBy(['publish_date' => SORT_ASC]);
}
$count = $library->count();
$library = $library->offset($per_page * $page - $per_page)->limit($per_page);
if ($count <= $per_page) {
$page = 1;
}
$library = $library->offset($per_page * $page - $per_page)->limit($per_page);
$html = $this->render('list_e_library_partial', ['library' => $library->all()]);
$pages_count = ceil($count / $per_page);
echo json_encode([
'html' => $html,
'pages_count' => $pages_count,
'current_page' => (int)$page
])
?>
@@ -0,0 +1,148 @@
<?php
use app\models\Ts;
use app\models\register\Fields;
$lg = Yii::$app->language;
$translateModule = [
'object_name' => [
'bg' => 'Име на обект',
'en' => 'Object name'
],
'object_creator' => [
'bg' => 'Създател на обект',
'en' => 'Object creator'
],
'year' => [
'bg' => 'Година',
'en' => 'Year'
],
'from' => ['bg' => 'От', 'en' => 'From'],
'to' => ['bg' => 'До', 'en' => 'To'],
];
?>
<div class="row top10">
<label><?= Ts::get(155) ?></label>
<div class="flex">
<input data-filter-input="book_name" value="<?= $_GET['book_name'] ?? '' ?>"
placeholder="<?= Ts::get(155) ?>">
<?php if (!empty($_GET['book_name'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= Ts::get(162) ?></label>
<div class="flex">
<input data-filter-input="created_by" value="<?= $_GET['created_by'] ?? '' ?>"
placeholder="<?= Ts::get(162) ?>">
<?php if (!empty($_GET['created_by'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['year'][$lg] ?></label>
<div class="flex">
<div>
<div class="flex">
<input data-filter-input="year_from" value="<?= $_GET['year_from'] ?? '' ?>"
placeholder="<?= $translateModule['from'][$lg] ?>">
<?php if (!empty($_GET['year_from'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div>
<div class="flex">
<input data-filter-input="year_to" value="<?= $_GET['year_to'] ?? '' ?>"
placeholder="<?= $translateModule['to'][$lg] ?>">
<?php if (!empty($_GET['year_to'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="row top10">
<label><?= Ts::get(162) ?></label>
<div class="flex">
<input data-filter-input="description" value="<?= $_GET['description'] ?? '' ?>"
placeholder="<?= Ts::get(162) ?>">
<?php if (!empty($_GET['description'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<?php $general = Fields::find()->where(['lib_type' => 2, 'field_type' => 2])->all(); ?>
<?php foreach ($general as $item): ?>
<div class="row top10">
<label><?= $item->{$lg == 'en' ? 'name_en' : 'name'} ?></label>
<div class="flex">
<?php if ($item->type == 1): ?>
<select class="category-field" onchange="loadSpecificFilter(this)"
data-filter-input="name_id_<?= $item->id ?>">
<option value=""></option>
<?php foreach ($item->fieldsValues as $fv): ?>
<?php if ($fv): ?>
<option <?= !empty($_GET['name_id_' . $item->id]) && $_GET['name_id_' . $item->id] == $fv->id ? 'selected' : '' ?>
value="<?= $fv['id'] ?? '' ?>"><?= $fv->getNameByLocale() ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php else: ?>
<input data-filter-input="name_text_<?= $item->id ?>"
value="<?= $_GET['name_text_' . $item->id] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['name_text_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<?php $categories = Fields::find()->where(['lib_type' => 2, 'field_type' => 3])->all(); ?>
<?php foreach ($categories as $item): ?>
<div class="row top10">
<label><?= $item->{$lg == 'en' ? 'name_en' : 'name'} ?></label>
<?php if ($item->type == 1): ?>
<div class="flex">
<select class="category-field" onchange="loadSpecificFilter(this)"
data-filter-input="name_id_<?= $item->id ?>">
<option value=""></option>
<?php foreach ($item->fieldsValues as $fv): ?>
<?php if ($fv): ?>
<option <?= !empty($_GET['name_id_' . $item->id]) && $_GET['name_id_' . $item->id] == $fv->id ? 'selected' : '' ?>
value="<?= $fv['id'] ?? '' ?>"><?= $fv->getNameByLocale() ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
<div data-content-id="name_id_<?= $item->id ?>">
<?php if(!empty($_GET['name_id_' . $item->id])): ?>
<?= $this->render('specific_filter', ['parent_id' => $_GET['name_id_' . $item->id]]) ?>
<?php endif; ?>
</div>
<?php else: ?>
<div class="flex">
<input data-filter-input="name_text_<?= $item->id ?>"
value="<?= $_GET['name_text_' . $item->id] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['name_text_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
<?php
?>
@@ -0,0 +1,202 @@
<?php
use app\services\ELibraryModels;
$lg = Yii::$app->language;
$translateModule = [
'object_name' => [
'bg' => 'Име на обект',
'en' => 'Object name'
],
'object_creator' => [
'bg' => 'Създател на обект',
'en' => 'Object creator'
],
'year' => [
'bg' => 'Година на публикуване',
'en' => 'Year'
],
'from' => ['bg' => 'От', 'en' => 'From'],
'to' => ['bg' => 'До', 'en' => 'To'],
'type' => ['bg' => 'Вид издание', 'en' => 'Edition type'],
'format' => ['bg' => 'Формат', 'en' => 'Format'],
'identifier' => ['bg' => 'Идентификатор', 'en' => 'Identifier'],
'language' => ['bg' => 'Език', 'en' => 'Language'],
'license' => ['bg' => 'Лиценз', 'en' => 'License'],
'copyright' => ['bg' => 'Авторски права', 'en' => 'Copyright'],
'partner' => ['bg' => 'Партньор', 'en' => 'Partner']
];
$lIndex = $lg == 'en' ? 1 : 0;
?>
<div class="row top10">
<label><?= $lg == 'en' ? 'Search' : 'Търсене' ?></label>
<div class="flex"><input data-filter-input="search" value="<?= $_GET['search'] ?? '' ?>">
<?php if (!empty($_GET['search'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['year'][$lg] ?></label>
<div class="flex">
<input data-filter-input="year" value="<?= $_GET['year'] ?? '' ?>" placeholder="">
<?php if (!empty($_GET['year'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['type'][$lg] ?></label>
<div class="flex">
<select data-filter-input="lib_type">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (ELibraryModels::$lib_types as $key => $lib_type): ?>
<option <?= !empty($_GET['lib_type']) && $_GET['lib_type'] == $key ? 'selected' : '' ?>
value="<?= $key ?>"><?= $lib_type[$lIndex] ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['lib_type'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['format'][$lg] ?></label>
<div class="flex">
<select data-filter-input="lib_format">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (ELibraryModels::$lib_format_opt as $key => $lib_format): ?>
<option <?= !empty($_GET['lib_format']) && $_GET['lib_format'] == $key ? 'selected' : '' ?>
value="<?= $key ?>"><?= $lib_format[$lIndex] ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['lib_format'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['identifier'][$lg] ?></label>
<div class="flex">
<input data-filter-input="identifier" value="<?= $_GET['identifier'] ?? '' ?>" placeholder="">
<?php if (!empty($_GET['identifier'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['language'][$lg] ?></label>
<div class="flex">
<select data-filter-input="lib_language">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (ELibraryModels::$lib_language_opt as $key => $lib_language): ?>
<option <?= !empty($_GET['lib_language']) && $_GET['lib_language'] == $key ? 'selected' : '' ?>
value="<?= $key ?>"><?= $lib_language[$lIndex] ?? $lib_language[0] ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['lib_language'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['license'][$lg] ?></label>
<div class="flex">
<select data-filter-input="lib_license">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (ELibraryModels::$lib_licenses as $key => $lib_lic): ?>
<option <?= !empty($_GET['lib_license']) && $_GET['lib_license'] == $key ? 'selected' : '' ?>
value="<?= $key ?>"><?= $lib_lic[$lIndex] ?? $lib_lic[0] ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['lib_license'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<div class="row top10">
<label><?= $translateModule['copyright'][$lg] ?></label>
<div class="flex">
<select data-filter-input="lib_rights">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (ELibraryModels::$lib_rights as $key => $lib_right): ?>
<option <?= !empty($_GET['lib_rights']) && $_GET['lib_rights'] == $key ? 'selected' : '' ?>
value="<?= $key ?>"><?= $lib_right[$lIndex] ?? $lib_right[0] ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['lib_license'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<?php if(empty($_GET['partner_id'])): ?>
<div class="row top10">
<label><?= $translateModule['partner'][$lg] ?></label>
<div class="flex">
<select data-filter-input="partner">
<option value="">-<?= $lg == 'en' ? 'choose' : 'избери' ?>-</option>
<?php foreach (\app\models\register\Partner::partnerList() as $id => $partner): ?>
<option <?= !empty($_GET['partner']) && $_GET['partner'] == $id ? 'selected' : '' ?>
value="<?= $id ?>"><?= $partner ?></option>
<?php endforeach ?>
</select>
<?php if (!empty($_GET['partner'])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php
//търсенето е по Заглавие, Реф. N и Идентификатор (в 7-те идентификатора)
//В Портала:
//Търсенето в списъка да бъде реализирано като има общо поле за търсене, което търси написания текст едновременно в следните полета: Автор,
// Друга авторска отговорност, Заглавие, Допълнение към заглавието, Паралелно заглавие, Място на публикуване, Издател,
// Резюме, Ключови думи, Заглавие на източник (всички полета, които имат търсене по ключови думи в колонката Търсене)
?>
<?php
/*
foreach ($key_labels as $k => $l): ?>
<?php if ($k == 'lib_format_opt' || $k == 'lib_language_opt') continue ?>
<div class="row top10">
<label><?= $l[$lIndex] ?></label>
<div class="flex">
<?php if ($k == 'lib_format'): ?>
<select data-filter-input="<?= $k ?>">
<option value="">-- <?= $lg == 'en' ? 'format' : 'формат' ?> --</option>
<?php foreach ($lib_format_opt as $i => $opt): ?>
<option <?= !empty($_GET[$k]) && $_GET[$k] == $i ? 'selected' : '' ?>
value="<?= $i ?>"><?= $opt[$lIndex] ?></option>
<?php endforeach; ?>
</select>
<?php elseif ($k == 'lib_language'): ?>
<select data-filter-input="<?= $k ?>">
<option value="">--</option>
<?php foreach ($lib_language_opt as $i => $opt): ?>
<option <?= !empty($_GET[$k]) && $_GET[$k] == $i ? 'selected' : '' ?>
value="<?= $i ?>"><?= $opt[$lIndex] ?></option>
<?php endforeach; ?>
</select>
<?php else: ?>
<input data-filter-input="<?= $k ?>" value="<?= $_GET[$k] ?? '' ?>"
placeholder="">
<?php endif; ?>
<?php if (!empty($_GET[$k])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
*/
@@ -0,0 +1,163 @@
<?php
use app\models\register\Fields;
use app\models\RegisterObjects;
//echo json_encode($_GET);
//exit;
$lg = Yii::$app->language;
$per_page = 9;
$page = $_GET['page'] ?? 1;
/**
* @var \yii\web\View $this
*/
?>
<?php
$library = RegisterObjects::find()
->where(['lib_type' => 2, 'is_active' => 1]);
//if (!empty($_GET['partner_id'])) {
// $library = $library->joinWith('projectPartners')->where(['partner_id' => $_GET['partner_id']]);
//}
$key_labels = [
'lib_format',
'lib_identifier_isbn_print',
'lib_identifier_isbn_online',
'lib_identifier_issn_print',
'lib_identifier_issn_online',
'lib_identifier_doi',
'lib_identifier_ismn',
'lib_identifier_isan',
'lib_author_compiler',
'lib_language',
'lib_edition',
'lib_publisher_name',
'lib_publication_place'
];
$library->innerJoinWith('library');
if (!empty($_GET['search'])) {
$tags = \app\models\register\Tags::find()->where(['lib_type' => 2])->andWhere(['or',
['=', 'text', $_GET['search']],
['=', 'text_en', $_GET['search']],
])->all();
$tag_ref_nums = [];
foreach ($tags as $tag) {
foreach ($tag->objects as $tagObject) {
if (!in_array($tagObject->object_id, $tag_ref_nums)) {
$tag_ref_nums[] = $tagObject->object_id;
}
}
}
$search = [
'or',
['LIKE', 'name', $_GET['search']],
['LIKE', 'ts_en_name', $_GET['search']],
['LIKE', 'created_by', $_GET['search']],
['LIKE', 'annotation', $_GET['search']],
['LIKE', 'ts_en_annotation', $_GET['search']],
['LIKE', 'lib_author_compiler', $_GET['search']],
['LIKE', 'lib_author_translator', $_GET['search']],
['LIKE', 'lib_author_editor', $_GET['search']],
['LIKE', 'lib_author_reviewer', $_GET['search']],
['LIKE', 'lib_author_ilustrator', $_GET['search']],
['LIKE', 'lib_title_information', $_GET['search']],
['LIKE', 'lib_title_parallel', $_GET['search']],
['LIKE', 'lib_publisher_name', $_GET['search']],
['LIKE', 'lib_publication_place', $_GET['search']],
['LIKE', 'lib_article_source', $_GET['search']],
];
if (sizeof($tag_ref_nums) > 0) {
$search[] = ['IN', 'ref_num', $tag_ref_nums];
}
$library->andWhere($search);
}
if (!empty($_GET['year'])) {
$year_search = [
'or',
['=', 'created_year', $_GET['year']],
['=', 'lib_publication_date', $_GET['year']]
];
$library->andWhere($year_search);
}
if (!empty($_GET['lib_type'])) {
$library->andWhere(['lib_variant' => $_GET['lib_type']]);
}
if (!empty($_GET['lib_format'])) {
$library->andWhere(['lib_format' => $_GET['lib_format']]);
}
if (!empty($_GET['identifier'])) {
$library->andWhere([
'or',
['LIKE', 'lib_identifier_isbn_print', $_GET['identifier']],
['LIKE', 'lib_identifier_isbn_online', $_GET['identifier']],
['LIKE', 'lib_identifier_issn_print', $_GET['identifier']],
['LIKE', 'lib_identifier_issn_online', $_GET['identifier']],
['LIKE', 'lib_identifier_doi', $_GET['identifier']],
['LIKE','lib_identifier_ismn', $_GET['identifier']],
['LIKE', 'lib_identifier_isan', $_GET['identifier']],
]);
}
if(!empty($_GET['lib_language'])) {
$library->andWhere(
['like', 'lib_language', $_GET['lib_language']]
);
}
if(!empty($_GET['lib_license'])) {
$library->andWhere(['=', 'lib_license', $_GET['lib_license']]);
}
if(!empty($_GET['lib_rights'])) {
$library->andWhere(['=', 'lib_rights', $_GET['lib_rights']]);
}
if(!empty($_GET['partner'])) {
$library->andWhere(['partner_id' => $_GET['partner']]);
}
if(!empty($_GET['partner_id'])) {
$library->andWhere(['partner_id' => $_GET['partner_id']]);
}
if (!empty($_GET['order_title'])) {
$library = $library->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$library = $library->orderBy(['publish_date' => SORT_ASC]);
}
$count = $library->count();
$library = $library->offset($per_page * $page - $per_page)->limit($per_page);
if ($count <= $per_page) {
$page = 1;
}
$library = $library->offset($per_page * $page - $per_page)->limit($per_page);
$html = $this->render('list_e_library_partial', ['library' => $library->all()]);
$pages_count = ceil($count / $per_page);
echo json_encode([
'html' => $html,
'pages_count' => $pages_count,
'current_page' => (int)$page,
'get' => $_GET
])
?>
@@ -0,0 +1,47 @@
<?php
/**
* @var \app\models\RegisterObjects[] $library
*/
use app\models\Ts;
use app\services\ViewReg;
?>
<link rel="stylesheet" href="/_public/assets/css/user.css">
<div class="filter-panel <?= !empty($_GET['advance_filter']) ? 'show' : '' ?>">
<div class="row ct">
<button onclick="filterApply()" class="profile-submit gradient ct"><?= Ts::get(164) ?></button>
<button onclick="filterClear()" class="profile-submit gradient ct"><?= Ts::get(165) ?></button>
</div>
<?= $this->render('list_e_library_filter_new') ?>
</div>
<div class="flex-wrap library <?= !empty($_GET['advance_filter']) ? 'filter-open' : '' ?>">
<?php
/** @var \app\models\RegisterObjects $lib */
foreach ($library as $lib): ?>
<div class="flex bottom30 list-library">
<div class="poster">
<a href="
<?= ViewReg::generateDefaultDetailUrl('e-library', $lib->id, $lib->getTitle()) ?>"
class="cell">
<div class="list-element-img cell-img"
style="background-image: url('<?= $lib->getMainImgFile() ?>')"></div>
</a>
</div>
<div class="library-info">
<div class="list-title top20">
<a href="<?= ViewReg::generateDefaultDetailUrl('e-library', $lib->id, $lib->getTitle()) ?>">
<?= $lib->getTitle() ?>
</a>
</div>
<div class="list-text text-limit-8 top20"><?= strip_tags($lib->getAnnotation()) ?></div>
<div class="list-label news top15"><?= Ts::get(162) ?></div>
<div class="top10"><?= $lib->created_by ?></div>
<?php if ($lib->partner_id): ?>
<div class="list-label campaigns top15"><?= Ts::get(163) ?></div>
<div class="top10"><?= $lib->partner->getTsName() ?></div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
@@ -0,0 +1,55 @@
<?php
use app\models\Articles;
use app\models\Expositions;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1
/**
* @var \yii\web\View $this
*/
?>
<?php
$condition = [];
if(!empty($_GET['partner_id'])) {
$condition['on_partner_page'] = 1;
} else {
$condition['is_active'] = 1;
}
$expositions = Expositions::find()->where($condition);
if(!empty($_GET['partner_id'])) {
$expositions = $expositions->andWhere(['partner_id' => $_GET['partner_id']]);
}
$expositions = $expositions->offset($per_page * $page - $per_page)->limit($per_page);
if (!empty($_GET['category']))
$expositions = $expositions->andWhere(['category_id' => $_GET['category']]);
if (!empty($_GET['order_title'])) {
$expositions = $expositions->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$expositions = $expositions->orderBy(['publish_date' => SORT_DESC]);
}
if (!empty($_GET['tags'])) {
$tags = explode(',', $_GET['tags']);
if (sizeof($tags) > 0)
$expositions->joinWith('expositionTags')->andWhere(['IN', 'exposition_tag_id', $tags]);
}
$count = $expositions->count();
$html = $this->render('list_exposition_sq_partial', ['expositions' => $expositions->all()]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
])
?>
@@ -0,0 +1,33 @@
<?php
use app\models\Articles;
$lg = Yii::$app->language;
$per_page = 12;
$page = $_GET['page'] ?? 1;
/**
* @var \yii\web\View $this
*/
?>
<?php
$expositionObjects = \app\models\ExpositionsObjects::find()->where(['exposition_id' => $_GET['exposition_id']]);
$expositionObjects = $expositionObjects->offset($per_page * $page - $per_page)->limit($per_page);
$count = $expositionObjects->count();
$objects = [];
/** @var \app\models\ExpositionsObjects $expositionObject */
foreach ($expositionObjects->all() as $expositionObject) {
if ($expositionObject->object)
$objects[] = $expositionObject->object;
}
$html = $this->render('list_exposition_objects_partial', ['objects' => $objects, 'exposition' => \app\models\Expositions::findOne($_GET['exposition_id'])]);
echo json_encode([
'html' => $html,
'pages_count' => ceil($count / $per_page),
'current_page' => (int)$page
])
?>
@@ -0,0 +1,39 @@
<?php
/**
* @var \app\models\RegisterObjects[] $objects
* @var \app\models\Expositions $exposition
* @var $start
* @var $end
*/
use app\models\Ts;
use app\services\ViewReg;
Ts::set([40])
?>
<?php
for ($index = 0; $index < 12; $index++): ?>
<?php if (!empty($objects[$index])): ?>
<div class="gallery__item">
<?php /** @var \app\models\RegisterObjects $object */
$object = $objects[$index]; ?>
<a href="<?= $object->getExpositionUrl($exposition) ?>" class="img-box">
<img style="width: 100%" src="<?= $object->getImg() ?>" class="gallery__img"
alt="<?= $object->getTitle() ?>">
<div class="gallery__item_title">
<?= $object->getTitle() ?>
</div>
</a>
<div class="hidden-grid-part">
<div class="title"><a href="<?= $object->getExpositionUrl($exposition) ?>"><?= $object->getTitle() ?></a></div>
<div class="annotation"><?= $object->getAnnotation() ?></div>
<div class="link"><?= Ts::get(40) ?></div>
</div>
</div>
<?php else: ?>
<?php endif; ?>
<?php endfor; ?>
@@ -0,0 +1,23 @@
<?php
/**
* @var \app\models\Expositions[] $expositions
*/
use app\services\ViewReg;
?>
<?php for ($i = 0; $i < 9; $i++): ?>
<div class="gallery__item gallery__item--<?= $i ?>">
<?php if (!empty($expositions[$i])):
$exposition = $expositions[$i]; ?>
<a href="<?= $exposition->getUrl() ?>">
<img style="width: 100%" src="<?= $exposition->getImg() ?>" class="gallery__img"
alt="<?= $exposition->title() ?>">
<div class="gallery__item_title">
<?= $exposition->title() ?>
</div>
</a>
<?php endif; ?>
</div>
<?php endfor; ?>
@@ -0,0 +1,27 @@
<?php
/**
* @var \app\models\Expositions[] $expositions
*/
use app\services\ViewReg;
?>
<link rel="stylesheet" href="/_public/assets/css/collection-objects-greed.css">
<div class="content collection"
style="position: relative; display: flex; flex-wrap: nowrap; flex-direction: row-reverse;">
<div class="collection-greed library">
<div class="content-out gallery" id="list-article">
<?php foreach ($expositions as $exposition): ?>
<div class="gallery__item">
<a href="<?= $exposition->getUrl() ?>">
<img style="width: 100%" src="<?= $exposition->getSqImg() ?>" class="gallery__img"
alt="<?= $exposition->title() ?>">
<div class="gallery__item_title">
<?= $exposition->title() ?>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
@@ -0,0 +1,44 @@
<?php
use app\models\Projects;
$lg = Yii::$app->language;
$per_page = 10;
$page = $_GET['page'] ?? 1
/**
* @var \yii\web\View $this
*/
?>
<?php
$projects = Projects::find()->where(['is_active' => 1]);
if(!empty($_GET['partner_id'])) {
$projects = $projects->joinWith('projectPartners')->where(['partner_id' => $_GET['partner_id'], 'on_partner_page' => 1]);
}
if (!empty($_GET['order_title'])) {
$projects = $projects->orderBy([$_GET['order_title'] => SORT_ASC]);
} else {
$projects = $projects->orderBy(['publish_date' => SORT_ASC]);
}
$count = $projects->count();
$projects = $projects->offset($per_page * $page - $per_page)->limit($per_page);
if ($count <= $per_page) {
$page = 1;
}
$projects = $projects->offset($per_page * $page - $per_page)->limit($per_page);
$html = $this->render('list_project_partial', ['projects' => $projects->all()]);
$pages_count = ceil($count / $per_page);
echo json_encode([
'html' => $html,
'pages_count' => $pages_count,
'current_page' => (int)$page
])
?>
@@ -0,0 +1,37 @@
<?php
/**
* @var \app\models\Projects $projects
*/
use app\services\ViewReg;
?>
<div class="flex-wrap">
<?php
/** @var \app\models\Projects $project */
foreach ($projects as $project): ?>
<div class="cw6 flex bottom30">
<div class="cw6" style="height: 450px">
<a href="<?= ViewReg::generateDefaultDetailUrl('projects', $project->id, $project->title()) ?>"
class="cell">
<div class="list-element-img cell-img"
style="background-image: url('<?= $project->getSrcOfSingleImage('title_project_image', '11:14') ?>')"></div>
</a>
</div>
<div class="cw6">
<div class="cell" style="">
<div class="list-label date-label">
<?= date('d.m.Y/H:i', strtotime($project->publish_date)) ?>
</div>
<div class="list-title top20 left-right-15">
<a href="<?= ViewReg::generateDefaultDetailUrl('projects', $project->id, $project->title()) ?>">
<?= $project->title() ?>
</a>
</div>
<div class="list-text text-limit-8 top20 left-right-15"><?= strip_tags($project->textShort()) ?></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
@@ -0,0 +1,38 @@
<link rel="stylesheet" href="/_public/plugins/splitejs/css/splide.min.css">
<script src="/_public/plugins/splitejs/js/splide.min.js"></script>
<?php
$object_id = $_GET['object_id'];
$object = \app\models\RegisterObjects::findOne($object_id);
/* @var $this \yii\web\View */
?>
<div class="splide" id="main-slider">
<div class="splide__track">
<div class="splide__list">
<?php if ($object): ?>
<?php foreach ($object->registerObjectImages as $image): ?>
<?php $src = $image->getResizedImg(false, true); ?>
<div class="splide__slide" style="width: 100%; display: flex; justify-content: center">
<img src="<?= $src ?>" alt="" style="height: 700px; width: auto; display: block">
</div>
<?php endforeach; ?>
<?php endif ?>
</div>
</div>
</div>
<script>
var main = new Splide('#main-slider', {
type: 'loop',
pagination: false,
arrows: true,
center: true
});
main.mount();
</script>
@@ -0,0 +1,20 @@
<?php
/* @var $this \yii\web\View
*
* @var \app\models\parsed\SearchResultModel[] $data
*/
?>
<?php foreach ($data as $result): ?>
<div class="flex row">
<div class="cw3">
<?= $result->type ?>
</div>
<div class="cw9">
<a href="<?= $result->url ?>"><?= $result->text ?></a>
</div>
</div>
<?php endforeach; ?>
@@ -0,0 +1,53 @@
<?php use app\models\register\Fields;
use app\models\register\FieldsValuesRelations;
$lg = Yii::$app->language;
/**
* @var $parent_id
*/
$fieldsValuesRelations = FieldsValuesRelations::find()->where(['parent_value_id' => $parent_id])->all();
$ids = [];
foreach ($fieldsValuesRelations as $fieldsValuesRelation) {
if ($fieldsValuesRelation->child_field_id != 0)
$ids[] = $fieldsValuesRelation->child_field_id;
}
$lib_type = $_GET['lib_type'] ?? 2;
if (!empty($content_lib_type)) {
$lib_type = $content_lib_type;
}
$main = Fields::find()->where(['IN', 'id', $ids])->andWhere(['lib_type' => $lib_type])->all(); ?>
<?php foreach ($main as $item): ?>
<div class="row top10">
<label><?= $item->{$lg == 'en' ? 'name_en' : 'name'} ?></label>
<div class="flex">
<?php if ($item->type == 1): ?>
<select class="category-field" onchange="loadSpecificCollectionFilter(this)"
data-filter-input="name_id_<?= $item->id ?>">
<option value=""></option>
<?php foreach ($item->fieldsValues as $fv): ?>
<?php if ($fv): ?>
<option <?= !empty($_GET['name_id_' . $item->id]) && $_GET['name_id_' . $item->id] == $fv->id ? 'selected' : '' ?>
value="<?= $fv['id'] ?? '' ?>"><?= $fv->getNameByLocale() ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php else: ?>
<input data-filter-input="name_text_<?= $item->id ?>"
value="<?= $_GET['name_text_' . $item->id] ?? '' ?>"
placeholder="">
<?php if (!empty($_GET['name_text_' . $item->id])): ?>
<div onclick="clearSingle(this)" class="clear-single"><i onclick="" class="la la-times"></i></div>
<?php endif; ?>
<?php endif; ?>
</div>
<div data-content-id="name_id_<?= $item->id ?>">
<?php if (!empty($_GET['name_id_' . $item->id])): ?>
<?= $this->render('specific_filter', ['parent_id' => $_GET['name_id_' . $item->id], 'content_lib_type' => 1]) ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>