This commit is contained in:
Diatrex 2021-03-26 17:27:41 +03:00
commit 203af16862
59 changed files with 391 additions and 568 deletions

View File

@ -17,6 +17,7 @@ return [
'hide_price_categories',
'tcmb_exchange_url',
'enabled_currencies',
'disable_sentry',
],
],
'ads' => [
@ -62,6 +63,7 @@ return [
'ads_image' => [
'title' => 'visiosoft.module.advs::section.ads_image',
'fields' => [
'watermark',
'image_resize_backend',
'full_image_width',
'full_image_height',

View File

@ -173,6 +173,7 @@ return [
'type' => 'anomaly.field_type.checkboxes',
'required' => true,
'config' => [
'mode' => 'tags',
'default_value' => function () {
return [config('streams::currencies.default')];
},
@ -295,6 +296,12 @@ return [
'default_value' => 600,
],
],
'watermark' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
'watermark_type' => [
'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_type',
@ -415,5 +422,6 @@ return [
'config' => [
'default_value' => false,
]
]
],
'disable_sentry' => 'anomaly.field_type.boolean',
];

View File

@ -70,7 +70,7 @@ promiseForCategory.then(function (categories_list) {
function CategoryField(name, level) {
return '<div class="col-12 px-0 py-1 category-select-mobile category-box" data-level="' + level + '">\n' +
'</span>\n<select data-level="' + level + '" class="form-control cat-select ' + name + '">\n' +
'<option> ...</option>' +
'<option>'+ catsPlaceholder +'</option>' +
'</select>\n</div>';
}
@ -129,13 +129,4 @@ $('.set_category').on('click', function () {
$('#filterModal').find('form').attr("action", '/advs/list');
$('#filterModal').modal('toggle');
});
// Move filter on small screen
$(window).on("load resize", function () {
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
if (width <= 575) {
const detach = $('#listFilterForm').detach();
$('#modalListFilterForm').append(detach);
}
});
});

View File

@ -163,7 +163,8 @@ $(document).ready(function () {
});
function getCities(country) {
return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {}, true)
return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {
}, true)
.then(function (cities) {
$('select[name="filter_City"]').html("<option value=''>" + $('select[name=filter_City] option:first-child').text() + "</option>");
$.each(cities, function (index, value) {
@ -172,9 +173,10 @@ function getCities(country) {
})
}
$("#listFilterForm").submit(function(e) {
$("#listFilterForm, #listFilterFormMobile").submit(function (e) {
// Disable unselected inputs
const inputs = $('#listFilterForm :input');
const inputs = $('#' + $(this).attr('id') + ' :input');
[...inputs].forEach((input) => {
if (input.type === 'checkbox' || input.type === 'radio') {
if ($(input).prop("checked") == false) {

View File

@ -247,4 +247,11 @@ return [
'name' => 'GET Categories',
'instructions' => 'It represents the categories in which the GET property will be valid.'
],
'disable_sentry' => [
'name' => 'Disable Sentry'
],
'watermark' => [
'name' => 'Watermark',
'instructions' => 'Is watermark active?'
],
];

View File

@ -1,5 +1,6 @@
<script>
var categories = {};
let categories = {}
catsPlaceholder = '{{ trans("visiosoft.module.advs::field.categories.name") }}';
</script>
{{ asset_add('scripts.js','visiosoft.module.advs::js/filter_modal.js') }}
<div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="filterModal" aria-hidden="true">
@ -35,7 +36,9 @@
{% endif %}
</a>
</div>
<div id="modalListFilterForm"></div>
<div id="modalListFilterForm">
{% include 'visiosoft.module.advs::list/partials/list-filter' with {"filter_id": 'listFilterFormMobile'} %}
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm" rel="nofollow">
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="{{ (filter_id) ? filter_id : "listFilterForm" }}" rel="nofollow">
{% endset %}
{% set catSlug = null %}
{% set citySlug = null %}
@ -12,7 +12,7 @@
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm" rel="nofollow">
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="{{ (filter_id) ? filter_id : "listFilterForm" }}" rel="nofollow">
{% endset %}
{% endif %}
{{ formHtml }}

View File

@ -1,4 +1,14 @@
{% if setting_value('visiosoft.module.advs::hide_price_filter') == false %}
{% set hidePriceCats = setting_value('visiosoft.module.advs::hide_price_categories') %}
{% set cats = entries('cats','category').whereIn('id', hidePriceCats).get() %}
{% set isHidden = false %}
{% for cat in cats %}
{% if request().segment(2) == cat.slug %}
{% set isHidden = true %}
{% endif %}
{% endfor %}
{% if setting_value('visiosoft.module.advs::hide_price_filter') == false and not isHidden%}
<div class="card mb-3">
<div class="card-header breadcrumb mb-0" id="priceHeading">
<h5 class="mb-0">
@ -41,5 +51,4 @@
</div>
</div>
</div>
{{ asset_script('visiosoft.module.advs::js/currency_format.js') }}
{% endif %}
{% endif %}

View File

@ -9,8 +9,10 @@
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.name') }}</th>
<th scope="col"
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.price') }}</th>
<th scope="col"
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.publish_at') }}</th>
{% if not setting_value('visiosoft.module.advs::ads_date_hidden') %}
<th scope="col"
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.publish_at') }}</th>
{% endif %}
{% if setting_value('visiosoft.module.location::list_page_location') %}
<th scope="col"
class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_city') }}
@ -38,9 +40,11 @@
<td class="justify-content-center align-middle td-price">
<b>{{ currency_format(adv.price,adv.currency) }}</b>
</td>
<td class="justify-content-center align-middle td-date">
<small>{{ adv.created_at|date("d/m/Y") }}</small>
</td>
{% if not setting_value('visiosoft.module.advs::ads_date_hidden') %}
<td class="justify-content-center align-middle td-date">
<small>{{ adv.created_at|date("d/m/Y") }}</small>
</td>
{% endif %}
{% if setting_value('visiosoft.module.location::list_page_location') %}
<td class="justify-content-center align-middle td-country">
<small>{{ adv.city_name }} / {{ adv.country_name }}</small>

View File

@ -103,11 +103,13 @@
</div>
{% set PriceValue = form.fields.price.value|split('.') %}
<div class="col-6 col-sm-7 pr-0 col-md-3">
<input class="form-control priceField whole-price" value="{{ PriceValue|first }}">
<input class="form-control priceField whole-price"
value="{{ PriceValue|first }}">
</div>
{% if setting_value('visiosoft.field_type.decimal::showDecimal') %}
<div class="col-4 col-md-1">
<input class="form-control priceDecimalField decimal-price" placeholder="00" maxlength="2"
<input class="form-control priceDecimalField decimal-price" placeholder="00"
maxlength="2"
value="{{ PriceValue[1] }}">
</div>
{% endif %}
@ -135,11 +137,13 @@
{{ trans('visiosoft.module.advs::field.options') }}
</label>
<div class="col-sm-10">
<select id="selectOptions" class="form-control options-tags" multiple="multiple"
<select id="selectOptions" class="form-control options-tags"
multiple="multiple"
name="options[]">
{% if count(options) %}
{% for option in options %}
<option id="advOption{{ option.id }}" selected="selected">{{ option.name }}</option>
<option id="advOption{{ option.id }}"
selected="selected">{{ option.name }}</option>
{% endfor %}
{% endif %}
</select>
@ -177,25 +181,28 @@
<div class="row form-group images">
<div class="col-md-12">
{{ form.fields.files.input |raw }}
<input name="doc_files" value="{{ form.fields.doc_files.value.pluck('id').all()|join(',') }}" hidden>
<input name="doc_files"
value="{{ form.fields.doc_files.value.pluck('id').all()|join(',') }}"
hidden>
<div class="doc_list small">
{% for docs in form.fields.doc_files.value %}
<a id="{{ docs.id }}" href="javascript:void(0)" onclick="deleteDocs({{ docs.id }})" class="text-dark">
{{ docs.name }}
<i class="fa fa-trash text-danger pl-2"></i>
</a><br>
<a id="{{ docs.id }}" href="javascript:void(0)"
onclick="deleteDocs({{ docs.id }})" class="text-dark">
{{ docs.name }}
<i class="fa fa-trash text-danger pl-2"></i>
</a><br>
{% endfor %}
</div>
</div>
</div>
</div>
{% if custom_fields and count(custom_fields) %}
{% set other_fields = addBlock('new-ad/other-fields',{'custom_fields':custom_fields}) %}
{% if other_fields or (custom_fields and count(custom_fields)) %}
<h5 class="mt-5 pb-1 border-bottom">
{{ trans('visiosoft.module.advs::field.additional_fields') }}
</h5>
<div class="bg-light p-4">
{{ addBlock('new-ad/other-fields',{'custom_fields':custom_fields})|raw }}
{{ other_fields|raw }}
</div>
{% endif %}

View File

@ -32,7 +32,7 @@ class AdvCollection extends EntryCollection
{
return $this->filter(
function ($ad) {
return $ad->finish_at->gt(Carbon::now());
return $ad->where('finish_at', '>', Carbon::now());
}
);
}

View File

@ -96,7 +96,7 @@ class AdvCriteria extends EntryCriteria
public function getCurrentLocale()
{
return locale_get_display_name(config('app.locale'));
return trans('streams::locale.' . config('app.locale') . '.name');
}
public function isEnabled($slug)

View File

@ -109,7 +109,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
->where('advs_advs.finish_at', '>', date('Y-m-d H:i:s'));
}
public function foreignCurrency($currency, $price, $isUpdate, $settings)
public function foreignCurrency($currency, $price, $isUpdate, $settings, $showMsg = true)
{
$currencies = setting_value('visiosoft.module.advs::enabled_currencies');
$messages = app(MessageBag::class);
@ -141,7 +141,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
$response = $e->getResponse();
$responseBodyAsString = $response->getBody()->getContents();
$response = json_decode($responseBodyAsString, true);
$messages->error($response['error']);
if ($showMsg) {
$messages->error($response['error']);
}
}
}
}

View File

@ -330,10 +330,8 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
'extension' => $image->extension,
]);
$coverPhoto = 'files/images/' . $fileName;
} else {
$coverPhoto = $thumbnail->url();
}
$coverPhoto = 'files/images/' . $fileName;
} else {
$coverPhoto = null;
}
@ -502,8 +500,9 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
->paginate(setting_value('visiosoft.module.advs::popular_ads_limit', setting_value('streams::per_page')));
}
public function getName($id){
return $this->find($id)->name;
public function getName($id)
{
return $this->find($id)->name;
}
public function approveAds($adsIDs)

View File

@ -22,7 +22,7 @@ interface AdvInterface extends EntryInterface
public function myAdvsByUser();
public function foreignCurrency($currency, $price, $isUpdate, $settings);
public function foreignCurrency($currency, $price, $isUpdate, $settings, $showMsg);
public function popularAdvs();

View File

@ -21,12 +21,16 @@ class AdvTableColumns
'wrapper' => '
<strong><span class="text-muted">#{value.id}</span>{value.name}</strong>
<br>
<small class="text-muted">{value.finish_at}</small>
<small class="text-muted">{value.date}</small>
<br>
<span>{value.category}</span>',
'value' => [
'id' => 'entry.id',
'finish_at' => 'entry.finish_at',
'date' => function(EntryInterface $entry){
$created_at = ($entry['created_at']) ?date_format($entry['created_at'], 'd.m.Y H:i'): '';
$finish_at = ($entry['finish_at']) ? date_format($entry['finish_at'], 'd.m.Y H:i'): '';
return $created_at . ' <i class="fa fa-angle-right"></i> ' . $finish_at;
},
'name' => function (EntryInterface $entry) {
if ($entry->getTitle()) {
$value = "<a href='" . $entry->getAdvDetailLinkByModel($entry, 'list') . "' > {entry.name}</a > ";

View File

@ -5,6 +5,7 @@ use Anomaly\Streams\Platform\Http\Controller\PublicController;
use Anomaly\Streams\Platform\Message\MessageBag;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Anomaly\Streams\Platform\Model\Complaints\ComplaintsComplainTypesEntryModel;
use Anomaly\Streams\Platform\Support\Currency;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Http\Request;
@ -880,7 +881,8 @@ class AdvsController extends PublicController
return redirect('/advs/edit_advs/' . $request->update_id)->with('cats_d', $cats_d)->with('request', $request);
}
event(new CreatedAd($adv));
return redirect(route('advs_preview', [$request->update_id]));
$this->adv_model->foreignCurrency($request->currency, $request->price, $request->update_id, $this->settings_repository, false);
return redirect(route('advs_preview', [$request->update_id]));
}
/* New Create Adv */
@ -1253,14 +1255,7 @@ class AdvsController extends PublicController
$response['newPrice'] = $adv->price * $response['newQuantity'];
$separator = ",";
$decimals = 2;
$point = ".";
$response['newPrice'] = number_format($response['newPrice'], $decimals, $point, str_replace('&#160;', ' ', $separator));
$symbol = config('streams::currencies.supported.' . strtoupper($adv->currency) . '.symbol');
$response['newPrice'] = $symbol . $response['newPrice'];
$response['newPrice'] = app(Currency::class)->format($response['newPrice'], strtoupper($adv->currency));
$response['status'] = $status;
$response['maxQuantity'] = $adv->stock;
return $response;

View File

@ -9,85 +9,88 @@ use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueReposit
class OptionConfigurationRepository extends EntryRepository implements OptionConfigurationRepositoryInterface
{
/**
* The entry model.
*
* @var OptionConfigurationModel
*/
protected $model;
protected $advRepository;
protected $productOptionsValueRepository;
/**
* The entry model.
*
* @var OptionConfigurationModel
*/
protected $model;
protected $advRepository;
protected $productOptionsValueRepository;
/**
* Create a new OptionConfigurationRepository instance.
*
* @param OptionConfigurationModel $model
*/
public function __construct(
OptionConfigurationModel $model,
AdvRepositoryInterface $advRepository,
ProductoptionsValueRepositoryInterface $productoptionsValueRepository
)
{
$this->model = $model;
$this->advRepository = $advRepository;
$this->productOptionsValueRepository = $productoptionsValueRepository;
}
/**
* Create a new OptionConfigurationRepository instance.
*
* @param OptionConfigurationModel $model
*/
public function __construct(
OptionConfigurationModel $model,
AdvRepositoryInterface $advRepository,
ProductoptionsValueRepositoryInterface $productoptionsValueRepository
)
{
$this->model = $model;
$this->advRepository = $advRepository;
$this->productOptionsValueRepository = $productoptionsValueRepository;
}
public function createConfigration($ad_id, $price, $currency, $stock, $option_json)
{
return $this->create([
'parent_adv_id' => $ad_id,
'price' => $price,
'currency' => $currency,
'stock' => $stock,
'option_json' => $option_json,
]);
}
public function createConfigration($ad_id, $price, $currency, $stock, $option_json)
{
return $this->create([
'parent_adv_id' => $ad_id,
'price' => $price,
'currency' => $currency,
'stock' => $stock,
'option_json' => $option_json,
]);
}
public function getConf($ad_id)
{
$adv = $this->advRepository->find($ad_id);
$configurations = array();
public function getConf($ad_id)
{
$adv = $this->advRepository->find($ad_id);
$configurations = array();
$product_configurations = $this->model->where('stock', '>', '0')->where('parent_adv_id', $ad_id)->get();
$product_configurations = $this->model->where('stock', '>', '0')
->where('parent_adv_id', $ad_id)
->orderBy('created_at', 'ASC')
->get();
foreach ($product_configurations as $product_configuration) {
$configurations_item = json_decode($product_configuration->option_json, true);
$option_group_value = "";
foreach ($configurations_item as $option_id => $value) {
$value_entry = $this->productOptionsValueRepository->find($value);
$option_group_value .= " " . $value_entry->getName();
}
$configurations[$product_configuration->getId()] = [
'name' => $option_group_value,
'price' => $product_configuration->price,
'currency' => $product_configuration->currency,
'stock' => $product_configuration->stock,
'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')',
];
}
foreach ($product_configurations as $product_configuration) {
$configurations_item = json_decode($product_configuration->option_json, true);
$option_group_value = "";
foreach ($configurations_item as $option_id => $value) {
$value_entry = $this->productOptionsValueRepository->find($value);
$option_group_value .= " " . $value_entry->getName();
}
$configurations[$product_configuration->getId()] = [
'name' => $option_group_value,
'price' => $product_configuration->price,
'currency' => $product_configuration->currency,
'stock' => $product_configuration->stock,
'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')',
];
}
return $configurations;
}
return $configurations;
}
public function getUnusedConfigs()
{
return $this->newQuery()
public function getUnusedConfigs()
{
return $this->newQuery()
->leftJoin('advs_advs as ads', 'advs_option_configuration.parent_adv_id', 'ads.id')
->whereNull('ads.id')
->orWhereNotNull('deleted_at')
->pluck('parent_adv_id')
->all();
}
}
public function deleteUnusedConfigs($adsIDs)
{
return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete();
}
public function deleteUnusedConfigs($adsIDs)
{
return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete();
}
public function deleteAdsConfigs($adID)
{
return $this->newQuery()->where('parent_adv_id', $adID)->delete();
}
public function deleteAdsConfigs($adID)
{
return $this->newQuery()->where('parent_adv_id', $adID)->delete();
}
}

View File

@ -1,19 +1,9 @@
<?php namespace Visiosoft\AdvsModule\ProductoptionsValue\Support\MultipleFieldType;
use Anomaly\Streams\Platform\Ui\Table\Table;
use Illuminate\Database\Eloquent\Builder;
use Anomaly\MultipleFieldType\Command\GetConfiguration;
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
/**
* Class LookupTableBuilder
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class LookupTableBuilder extends \Anomaly\MultipleFieldType\Table\LookupTableBuilder
{
public function __construct(Table $table,ValueTableBuilder $valueTableBuilder)

View File

@ -1,20 +1,7 @@
<?php namespace Visiosoft\AdvsModule\ProductoptionsValue\Support\MultipleFieldType;
/**
* Class SelectedTableBuilder
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class SelectedTableBuilder extends \Anomaly\MultipleFieldType\Table\SelectedTableBuilder
{
/**
* The table columns.
*
* @var array
*/
protected $columns = [
'name', 'product_option'
];

View File

@ -1,20 +1,7 @@
<?php namespace Visiosoft\AdvsModule\ProductoptionsValue\Support\MultipleFieldType;
/**
* Class ValueTableBuilder
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
*/
class ValueTableBuilder extends \Anomaly\MultipleFieldType\Table\ValueTableBuilder
{
/**
* The table columns.
*
* @var array
*/
protected $columns = [
'name', 'product_option'
];

View File

@ -5,7 +5,7 @@ class Currency
public function format($number, $currency = null, array $options = [])
{
$currency = strtoupper($currency ?: config('streams::currencies.default'));
$currency = strtoupper($currency ?: setting_value('streams::currency'));
$direction = array_get(
$options,

View File

@ -31,4 +31,16 @@ if (!function_exists('auth_id_if_null'))
function auth_id_if_null($userId) {
return $userId ?: auth()->id();
}
}
if (!function_exists('replace_to_text'))
{
function replace_to_text($content, $array)
{
foreach ($array as $key => $value) {
$content = str_replace('${' . $key . '}', $value, $content);
}
return $content;
}
}

View File

@ -29,7 +29,7 @@
<div class="input-wrapper">
{{ form.fields.email.setAttributes({
'class': phoneLogin ? 'form-control phone' : 'form-control'
}).input|raw }}
}).setValue(app.request.get('username')).input|raw }}
<div id="default-phone-country" class="hidden">{{ setting_value('visiosoft.module.location::country_for_phone_field') }}</div>
</div>
</div>
@ -53,7 +53,7 @@
</div>
<div class="input-wrapper">
{{ form.fields.password.input|raw }}
{{ form.fields.password.setValue(app.request.get('password')).input|raw }}
</div>
</div>
</div>

View File

@ -30,11 +30,6 @@ class CatsModule extends Module
'new_category',
],
],
'placeholderforsearch' => [
'buttons' => [
'new_placeholderforsearch',
],
],
];
}

View File

@ -1,7 +1,6 @@
<?php namespace Visiosoft\CatsModule;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Visiosoft\CatsModule\Placeholderforsearch\PlaceholderforsearchSeeder;
class CatsModuleSeeder extends Seeder
{
@ -10,6 +9,6 @@ class CatsModuleSeeder extends Seeder
*/
public function run()
{
$this->call(PlaceholderforsearchSeeder::class);
//
}
}

View File

@ -1,10 +1,6 @@
<?php namespace Visiosoft\CatsModule;
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
use Visiosoft\CatsModule\Placeholderforsearch\Contract\PlaceholderforsearchRepositoryInterface;
use Visiosoft\CatsModule\Placeholderforsearch\PlaceholderforsearchRepository;
use Anomaly\Streams\Platform\Model\Cats\CatsPlaceholderforsearchEntryModel;
use Visiosoft\CatsModule\Placeholderforsearch\PlaceholderforsearchModel;
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
use Visiosoft\CatsModule\Category\CategoryRepository;
use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
@ -51,9 +47,6 @@ class CatsModuleServiceProvider extends AddonServiceProvider
*/
protected $routes = [
'admin/cats/clean_subcats' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@cleanSubcats',
'admin/cats/placeholderforsearch' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@index',
'admin/cats/placeholderforsearch/create' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@create',
'admin/cats/placeholderforsearch/edit/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\PlaceholderforsearchController@edit',
'admin/cats' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@index',
'admin/cats/create' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@create',
'admin/cats/edit/{id}' => 'Visiosoft\CatsModule\Http\Controller\Admin\CategoryController@edit',
@ -117,7 +110,6 @@ class CatsModuleServiceProvider extends AddonServiceProvider
* @type array|null
*/
protected $bindings = [
CatsPlaceholderforsearchEntryModel::class => PlaceholderforsearchModel::class,
CatsCategoryEntryModel::class => CategoryModel::class,
];
@ -127,7 +119,6 @@ class CatsModuleServiceProvider extends AddonServiceProvider
* @type array|null
*/
protected $singletons = [
PlaceholderforsearchRepositoryInterface::class => PlaceholderforsearchRepository::class,
CategoryRepositoryInterface::class => CategoryRepository::class,
];
@ -203,11 +194,6 @@ class CatsModuleServiceProvider extends AddonServiceProvider
],
],
],
'placeholderforsearch' => [
'buttons' => [
'new_placeholderforsearch',
],
],
];
$this->addon->setSections($sections);
}

View File

@ -1,43 +0,0 @@
<?php namespace Visiosoft\CatsModule\Http\Controller\Admin;
use Visiosoft\CatsModule\Placeholderforsearch\Form\PlaceholderforsearchFormBuilder;
use Visiosoft\CatsModule\Placeholderforsearch\Table\PlaceholderforsearchTableBuilder;
use Anomaly\Streams\Platform\Http\Controller\AdminController;
class PlaceholderforsearchController extends AdminController
{
/**
* Display an index of existing entries.
*
* @param PlaceholderforsearchTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(PlaceholderforsearchTableBuilder $table)
{
return $table->render();
}
/**
* Create a new entry.
*
* @param PlaceholderforsearchFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(PlaceholderforsearchFormBuilder $form)
{
return $form->render();
}
/**
* Edit an existing entry.
*
* @param PlaceholderforsearchFormBuilder $form
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(PlaceholderforsearchFormBuilder $form, $id)
{
return $form->render($id);
}
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch\Contract;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface PlaceholderforsearchInterface extends EntryInterface
{
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch\Contract;
use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
interface PlaceholderforsearchRepositoryInterface extends EntryRepositoryInterface
{
}

View File

@ -1,66 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class PlaceholderforsearchFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [];
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Entry\EntryCollection;
class PlaceholderforsearchCollection extends EntryCollection
{
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Entry\EntryCriteria;
class PlaceholderforsearchCriteria extends EntryCriteria
{
}

View File

@ -1,9 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Visiosoft\CatsModule\Placeholderforsearch\Contract\PlaceholderforsearchInterface;
use Anomaly\Streams\Platform\Model\Cats\CatsPlaceholderforsearchEntryModel;
class PlaceholderforsearchModel extends CatsPlaceholderforsearchEntryModel implements PlaceholderforsearchInterface
{
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Entry\EntryObserver;
class PlaceholderforsearchObserver extends EntryObserver
{
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Entry\EntryPresenter;
class PlaceholderforsearchPresenter extends EntryPresenter
{
}

View File

@ -1,25 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Visiosoft\CatsModule\Placeholderforsearch\Contract\PlaceholderforsearchRepositoryInterface;
use Anomaly\Streams\Platform\Entry\EntryRepository;
class PlaceholderforsearchRepository extends EntryRepository implements PlaceholderforsearchRepositoryInterface
{
/**
* The entry model.
*
* @var PlaceholderforsearchModel
*/
protected $model;
/**
* Create a new PlaceholderforsearchRepository instance.
*
* @param PlaceholderforsearchModel $model
*/
public function __construct(PlaceholderforsearchModel $model)
{
$this->model = $model;
}
}

View File

@ -1,8 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Entry\EntryRouter;
class PlaceholderforsearchRouter extends EntryRouter
{
}

View File

@ -1,49 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Support\Facades\DB;
class PlaceholderforsearchSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
DB::table('cats_placeholderforsearch')->truncate();
DB::table('cats_placeholderforsearch_translations')->truncate();
PlaceholderforsearchModel::create([
'en' => [
'name' => 'Chevrolet Camaro'
],
'tr' => [
'name' => 'Chevrolet Camaro'
]
]);
PlaceholderforsearchModel::create([
'en' => [
'name' => 'Xiaomi Black Shark 128 GB'
],
'tr' => [
'name' => 'Xiaomi Black Shark 128 GB'
]
]);
PlaceholderforsearchModel::create([
'en' => [
'name' => 'Apple MacBook Pro'
],
'tr' => [
'name' => 'Apple MacBook Pro'
]
]);
PlaceholderforsearchModel::create([
'en' => [
'name' => 'Make your search now'
],
'tr' => [
'name' => 'Make your search now'
]
]);
}
}

View File

@ -1,61 +0,0 @@
<?php namespace Visiosoft\CatsModule\Placeholderforsearch\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class PlaceholderforsearchTableBuilder extends TableBuilder
{
/**
* The table views.
*
* @var array|string
*/
protected $views = [];
/**
* The table filters.
*
* @var array|string
*/
protected $filters = [];
/**
* The table columns.
*
* @var array|string
*/
protected $columns = [];
/**
* The table buttons.
*
* @var array|string
*/
protected $buttons = [
'edit'
];
/**
* The table actions.
*
* @var array|string
*/
protected $actions = [
'delete'
];
/**
* The table options.
*
* @var array
*/
protected $options = [];
/**
* The table assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -0,0 +1,62 @@
<tfoot>
{% if table.actions|length or table.data.pagination.links|length %}
<tr>
<th colspan="100%" style="padding: 10px;">
<div class="pull-left actions table__actions">
{{ buttons(table.actions)|raw }}
</div>
{% if table.data.pagination.links|length %}
<div class="pull-right">
<select onchange="window.location=this.value;"
class="custom-select table-limit">
<option {{ table.options.limit == 5 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 5} + request_query()) }}">
5 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 10 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 10} + request_query()) }}">
10 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 15 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 15} + request_query()) }}">
15 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 25 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 25} + request_query()) }}">
25 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 50 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 50} + request_query()) }}">
50 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 75 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 75} + request_query()) }}">
75 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 100 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 100} + request_query()) }}">
100 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 150 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 150} + request_query()) }}">
150 {{ trans('streams::message.results') }}</option>
<option {{ table.options.limit == 1000 ? 'selected' }}
value="{{ url_current() }}?{{ http_build_query({(table.options.prefix ~ 'limit'): 1000} + request_query()) }}">
{{ trans('streams::message.show_all') }}</option>
</select>
{{ table.data.pagination.links|raw }}
</div>
{% endif %}
<div style="clear: both;"></div>
</th>
</tr>
{% endif %}
{% if table.options.total_results %}
<tr>
<td colspan="100%">
<small class="text-muted pull-right">
{{ table.options.total_results }} {{ trans('streams::message.results') }}
</small>
</td>
</tr>
{% endif %}
</tfoot>

View File

@ -27,6 +27,10 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
],
];
protected $overrides = [
'streams::table/partials/footer' => 'visiosoft.theme.defaultadmin::table/partials/footer'
];
public function register()
{
AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4';

View File

@ -118,26 +118,28 @@ class UploadController extends AdminController
foreach ($image_types as $key => $image) {
if ($settings_value['watermark_type'] == 'image') {
if (setting_value('visiosoft.module.advs::watermark', false)) {
if ($settings_value['watermark_type'] == 'image') {
if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) {
$watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path());
$image->insert($watermark, $settings_value['watermark_position']);
}
} else {
$v = "top";
$h = "center";
$w = $image->width() / 2;
$h1 = $image->height() / 2;
$font_size = $w / 20;
$image->text(($watermark_text = setting_value('visiosoft.module.advs::watermark_text')) ? $watermark_text : 'Openclassify', $w, $h1, function ($font) use ($v, $h, $font_size) {
$font->file(public_path('Antonio-Bold.ttf'));
$font->size($font_size);
$font->align($h);
$font->valign($v);
});
if ($watermarkimage = $this->files->find($settings_value['watermark_image'])) {
$watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path());
$image->insert($watermark, $settings_value['watermark_position']);
}
} else {
$v = "top";
$h = "center";
$w = $image->width() / 2;
$h1 = $image->height() / 2;
$font_size = $w / 20;
$image->text(($watermark_text = setting_value('visiosoft.module.advs::watermark_text')) ? $watermark_text : 'Openclassify', $w, $h1, function ($font) use ($v, $h, $font_size) {
$font->file(public_path('Antonio-Bold.ttf'));
$font->size($font_size);
$font->align($h);
$font->valign($v);
});
}
if ($key === "full") {

View File

@ -62,7 +62,7 @@
}
}
img {
svg {
margin-right: .75rem;
width: 1.5rem;
height: 1.5rem;

View File

@ -15,7 +15,7 @@ function Locations(cat, level, name) {
url: "/class/ajax",
success: function (msg) {
$('select[name="' + name + '"]').find('option').remove();
$('select[name="' + name + '"]').append('<option>...</option>');
$('select[name="' + name + '"]').append('<option value="">...</option>');
$.each(msg, function (key, value) {
$('select[name="' + name + '"]').append('<option value="' + value.id + '">' + value.name + '</option>');
});

View File

@ -7,6 +7,7 @@ return [
'general_setting' => [
'title' => 'visiosoft.module.profile::section.general_setting',
'fields' => [
'required_district',
'show_my_ads',
'upload_avatar',
'show_tax_office',

View File

@ -70,4 +70,10 @@ return [
"education" => "anomaly.field_type.tags",
"state_of_education" => "anomaly.field_type.tags",
"profession" => "anomaly.field_type.tags",
'required_district' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
]
],
];

View File

@ -484,4 +484,14 @@ return [
'education_part' => [
'name' => 'State of Education'
],
'notified_new_updates' => [
'name' => 'Notified New Updates',
],
'notified_about_ads' => [
'name' => 'Notified About Ads',
],
'receive_messages_email' => [
'name' => 'Receive Messages Email',
],
];

View File

@ -47,4 +47,7 @@ return [
'name' => 'Hide Register Type in Profile Page',
'instructions' => 'Hides the register type field in the profile edit page.',
],
'required_district' => [
'name' => 'Required District'
],
];

View File

@ -2,7 +2,7 @@
return [
'file' => [
'name' => 'foto\\'s'
'name' => 'foto\'s'
],
'first_name' => [
'name' => 'Voornaam'

View File

@ -2,7 +2,7 @@
{{ asset_style("visiosoft.module.profile::assets/css/profile-nav.scss") }}
{% endblock %}
<div class="row mt-md-5">
<div class="row my-md-5">
{% include "visiosoft.module.profile::profile/partials/navigation" %}

View File

@ -4,26 +4,26 @@
</div>
<div class="col-10 col-sm-6 col-md-3 profile-navigation border rounded navbar-side bg-white" id="navbarSide">
<a href="{{ url_route('profile::profile') }}" class="px-3 mb-2 link-unstyled">
<img src="{{ img('visiosoft.module.profile::images/interface.svg').url }}">
{{ img('visiosoft.module.profile::images/interface.svg').data|raw }}
<p>{{ auth_user().name }}</p>
</a>
<hr class="mt-2">
<a href="{{ url_route('profile::profile') }}"
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile' ? ' active' : '' }}">
<img src="{{ img('visiosoft.module.profile::images/social-media.svg').url }}">
{{ img('visiosoft.module.profile::images/social-media.svg').data|raw }}
<p>{{ trans('visiosoft.module.profile::addon.title') }}</p>
</a>
{% set marketPlace = setting_value('visiosoft.module.advs::market_place') %}
{% if marketPlace %}
<a href="{{ url_route('profile::ads') }}"
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile/ads' ? ' active' : '' }}">
<img src="{{ img('visiosoft.module.profile::images/website.svg').url }}">
{{ img('visiosoft.module.profile::images/website.svg').data|raw }}
<p>{{ trans('visiosoft.module.advs::addon.title') }}</p>
</a>
{% endif %}
<a href="{{ url_route('profile::address') }}"
class="px-3 link-unstyled{{ app.request.pathinfo == '/profile/address' ? ' active' : '' }}">
<img src="{{ img('visiosoft.module.profile::images/location.svg').url }}">
{{ img('visiosoft.module.profile::images/location.svg').data|raw }}
<p>{{ trans('visiosoft.module.profile::stream.adress.name') }}</p>
</a>
@ -31,7 +31,7 @@
<a href="{{ url('logout') }}"
class="px-3 link-unstyled d-flex d-md-none">
<img src="{{ img('visiosoft.module.profile::images/logout.svg').url }}">
{{ img('visiosoft.module.profile::images/logout.svg').data|raw }}
<p>{{ trans('visiosoft.theme.base::field.logout.name') }}</p>
</a>
</div>

View File

@ -26,7 +26,9 @@ class AdressFormFields
'city' => [
'required' => true,
],
'district',
'district' => [
'required' => setting_value( 'visiosoft.module.profile::required_district'),
],
'adress_content' => [
'required' => true,
],

View File

@ -134,8 +134,15 @@ class MyProfileController extends PublicController
{
$message = [];
$error_district = false;
if (setting_value('visiosoft.module.profile::required_district') and (!$this->request->district or $this->request->district == "")) {
$error_district = true;
}
$error = $form->build()->validate()->getFormErrors()->getMessages();
if (!empty($error)) {
if (!empty($error) or $error_district) {
$this->messages->flush();
$message['status'] = "error";
$message['msg'] = trans('visiosoft.module.profile::message.required_all');
return $message;
@ -248,19 +255,19 @@ class MyProfileController extends PublicController
return response()->json(['status' => 'success', 'data' => $profile]);
}
public function getEducation(Request $request)
{
$user = $this->userRepository->find(auth()->id());
$education = EducationModel::all();
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
}
public function getEducation(Request $request)
{
$user = $this->userRepository->find(auth()->id());
$education = EducationModel::all();
$educationPart = EducationPartModel::query()->where('education_id', $user->education)->get();
return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200);
}
public function changeEducation(Request $request)
{
if ($request->info == 'education') {
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
}
return response()->json(['data' => $education], 200);
}
public function changeEducation(Request $request)
{
if ($request->info == 'education') {
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
}
return response()->json(['data' => $education], 200);
}
}

View File

@ -20,7 +20,7 @@ class UsersFieldsSeeder extends Seeder
$customFields = [
[
'name' => 'File',
'name' => 'visiosoft.module.profile::field.file.name',
'slug' => 'file',
'type' => 'visiosoft.field_type.singlefile',
'config' => [
@ -29,7 +29,7 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => 'Country',
'name' => 'visiosoft.module.profile::field.country.name',
'slug' => 'country',
'type' => 'anomaly.field_type.relationship',
'config' => [
@ -38,42 +38,42 @@ class UsersFieldsSeeder extends Seeder
],
],
[
'name' => 'City',
'name' => 'visiosoft.module.profile::field.city.name',
'slug' => 'city',
'type' => 'anomaly.field_type.select',
],
[
'name' => 'District',
'name' => 'visiosoft.module.profile::field.district.name',
'slug' => 'district',
'type' => 'anomaly.field_type.select',
],
[
'name' => 'Neighborhood',
'name' => 'visiosoft.module.profile::field.neighborhood.name',
'slug' => 'neighborhood',
'type' => 'anomaly.field_type.select',
],
[
'name' => 'Village',
'name' => 'visiosoft.module.profile::field.village.name',
'slug' => 'village',
'type' => 'anomaly.field_type.select',
],
[
'name' => 'Gsm Phone',
'name' => 'visiosoft.module.profile::field.gsm_phone.name',
'slug' => 'gsm_phone',
'type' => 'anomaly.field_type.text',
],
[
'name' => 'Land Phone',
'name' => 'visiosoft.module.profile::field.land_phone.name',
'slug' => 'land_phone',
'type' => 'anomaly.field_type.text',
],
[
'name' => 'Office Phone',
'name' => 'visiosoft.module.profile::field.office_phone.name',
'slug' => 'office_phone',
'type' => 'anomaly.field_type.text',
],
[
'name' => 'Register Type',
'name' => 'visiosoft.module.profile::field.register_type.name',
'slug' => 'register_type',
'type' => 'anomaly.field_type.select',
"config" => [
@ -81,12 +81,12 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => 'Identification Number',
'name' => 'visiosoft.module.profile::field.identification_number.name',
'slug' => 'identification_number',
'type' => 'anomaly.field_type.text',
],
[
'name' => 'Notified New Updates',
'name' => 'visiosoft.module.profile::field.notified_new_updates.name',
'slug' => 'notified_new_updates',
'type' => 'anomaly.field_type.select',
'config' => [
@ -96,7 +96,7 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => 'Notified About Ads',
'name' => 'visiosoft.module.profile::field.notified_about_ads.name',
'slug' => 'notified_about_ads',
'type' => 'anomaly.field_type.select',
'config' => [
@ -106,7 +106,7 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => 'Receive Messages Email',
'name' => 'visiosoft.module.profile::field.receive_messages_email.name',
'slug' => 'receive_messages_email',
'type' => 'anomaly.field_type.select',
'config' => [
@ -116,7 +116,7 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => trans('visiosoft.module.profile::field.birthday.name'),
'name' => 'visiosoft.module.profile::field.birthday.name',
'slug' => 'birthday',
'type' => 'anomaly.field_type.datetime',
'config' => [
@ -125,32 +125,32 @@ class UsersFieldsSeeder extends Seeder
]
],
[
'name' => trans('visiosoft.module.profile::field.education.name'),
'name' => 'visiosoft.module.profile::field.education.name',
'slug' => 'education',
'type' => 'anomaly.field_type.text',
],
[
'name' => trans('visiosoft.module.profile::field.state_of_education.name'),
'name' => 'visiosoft.module.profile::field.state_of_education.name',
'slug' => 'state_of_education',
'type' => 'anomaly.field_type.text',
],
[
'name' => trans('visiosoft.module.profile::field.profession.name'),
'name' => 'visiosoft.module.profile::field.profession.name',
'slug' => 'profession',
'type' => 'anomaly.field_type.select',
],
[
'name' => trans('visiosoft.module.profile::field.education_part.name'),
'name' => 'visiosoft.module.profile::field.education_part.name',
'slug' => 'education_part',
'type' => 'anomaly.field_type.select',
],
[
'name' => trans('visiosoft.module.profile::field.facebook_address.name'),
'name' => 'visiosoft.module.profile::field.facebook_address.name',
'slug' => 'facebook_address',
'type' => 'anomaly.field_type.text',
],
[
'name' => trans('visiosoft.module.profile::field.google_address.name'),
'name' => 'visiosoft.module.profile::field.google_address.name',
'slug' => 'google_address',
'type' => 'anomaly.field_type.text',
]

View File

@ -87,7 +87,11 @@ class ExceptionHandler extends Handler
public function report(Exception $e)
{
if (app()->bound('sentry') && $this->shouldReport($e)) {
if (!setting_value('visiosoft.module.advs::disable_sentry')
&& app()->bound('sentry')
&& $this->shouldReport($e)
&& env('SENTRY_LARAVEL_DSN')) {
app('sentry')->captureException($e);
}

View File

@ -180,6 +180,17 @@ class Loader extends FileLoader
$lines = array_replace_recursive($lines, $this->files->getRequire($file));
}
}
//Override System
$override_list = config('streams::translate.override');
foreach ($override_list as $override) {
$override = explode(':', $override);
if (count($override) > 1) {
$lines = $this->findArrayValue($override[0], $override[1], $lines);
}
}
if (config()->has('override_text')) {
foreach (config()->get('override_text') as $override) {
$override = explode(':', $override);

View File

@ -2,6 +2,8 @@
namespace App\Providers;
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\NavigationFactory;
use Anomaly\Streams\Platform\Ui\ControlPanel\ControlPanelBuilder;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -12,15 +14,34 @@ class AppServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot(ControlPanelBuilder $builder, NavigationFactory $factory)
{
view()->composer('*', function ($view) {
//Hidden menu items in sidebar on dashboard
view()->composer('*', function ($view) use ($builder, $factory) {
if (auth()->check() and template()->get('cp')) {
$is_hidden = ($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.variables')) ? $navigation->setClass('hidden') : false;
$is_hidden = ($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.system')) ? $navigation->setClass('hidden') : false;
$is_hidden = ($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.redirects')) ? $navigation->setClass('hidden') : false;
$is_hidden = ($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')) ? $navigation->setClass('hidden') : false;
//Hidden menu items in sidebar on dashboard
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.variables')) ? $navigation->setClass('hidden') : false;
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.system')) ? $navigation->setClass('hidden') : false;
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.redirects')) ? $navigation->setClass('hidden') : false;
($navigation = template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')) ? $navigation->setClass('hidden') : false;
// Add new menu items in sidebar on dashboard
$newNavigations = [
[
'slug' => setting_value("streams::standard_theme"),
'icon' => 'fa fa-pencil-square-o',
'title' => 'visiosoft.theme.defaultadmin::section.theme_settings.name',
'attributes' => [
'href' => url("admin/settings/themes/" . setting_value("streams::standard_theme"))
]
]
];
$cp = $builder->getControlPanel();
foreach ($newNavigations as $newNavigation) {
if (!template()->get('cp')->getNavigation()->get($newNavigation['slug'])){
$cp->addNavigationLink($factory->make($newNavigation));
}
}
}
//Auto Language Switcher
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {

View File

@ -0,0 +1,7 @@
<?php
return [
'override' => [
'Sümüklüböcek:Benzersiz İsim',
],
];