diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php index ff2f5c9f1..1336af80b 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/sections.php @@ -14,8 +14,10 @@ return [ 'google_statistic_code', 'ogImage', 'free_currencyconverterapi_key', + 'hide_price_categories', + 'tcmb_exchange_url', 'enabled_currencies', - 'tcmb_exchange_url' + 'disable_sentry', ], ], 'ads' => [ @@ -61,6 +63,7 @@ return [ 'ads_image' => [ 'title' => 'visiosoft.module.advs::section.ads_image', 'fields' => [ + 'watermark', 'image_resize_backend', 'full_image_width', 'full_image_height', diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 484b4981d..bff2f3562 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -94,6 +94,14 @@ return [ "default_value" => "1eea72940f3868c77420" ] ], + 'hide_price_categories' => [ + 'type' => 'anomaly.field_type.checkboxes', + 'config' => [ + 'options' => function (\Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface $categoryRepository) { + return $categoryRepository->mainCats()->pluck('name', 'id')->all(); + }, + ], + ], 'default_GET' => [ 'type' => 'anomaly.field_type.boolean', 'bind' => 'adv.default_GET', @@ -287,6 +295,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', @@ -407,5 +421,6 @@ return [ 'config' => [ 'default_value' => false, ] - ] + ], + 'disable_sentry' => 'anomaly.field_type.boolean', ]; diff --git a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php index 0a7c4e30d..2bf5e9497 100644 --- a/addons/default/visiosoft/advs-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/advs-module/resources/lang/en/setting.php @@ -61,6 +61,10 @@ return [ 'default_country' => [ 'name' => 'Default Ad Country', ], + 'hide_price_categories' => [ + 'name' => 'Hide Price On Categories', + 'instructions' => 'The price will be hidden when you create an ad or view an ad under these categories.' + ], 'free_currencyconverterapi_key' => [ 'name' => 'Currency Converter API Key' ], @@ -243,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?' + ], ]; diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig index 4939f0fd1..180820296 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig @@ -41,5 +41,4 @@ - {{ asset_script('visiosoft.module.advs::js/currency_format.js') }} {% endif %} \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/views/list/table.twig b/addons/default/visiosoft/advs-module/resources/views/list/table.twig index c4a94399b..6cbc99d3c 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/table.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/table.twig @@ -9,8 +9,10 @@ class="text-center align-middle">{{ trans('visiosoft.module.advs::field.advs_list_table_thead.name') }} {{ trans('visiosoft.module.advs::field.advs_list_table_thead.price') }} - {{ trans('visiosoft.module.advs::field.advs_list_table_thead.publish_at') }} + {% if not setting_value('visiosoft.module.advs::ads_date_hidden') %} + {{ trans('visiosoft.module.advs::field.advs_list_table_thead.publish_at') }} + {% endif %} {% if setting_value('visiosoft.module.location::list_page_location') %} {{ trans('visiosoft.module.advs::field.advs_list_table_thead.location_city') }} @@ -38,9 +40,11 @@ {{ currency_format(adv.price,adv.currency) }} - - {{ adv.created_at|date("d/m/Y") }} - + {% if not setting_value('visiosoft.module.advs::ads_date_hidden') %} + + {{ adv.created_at|date("d/m/Y") }} + + {% endif %} {% if setting_value('visiosoft.module.location::list_page_location') %} {{ adv.city_name }} / {{ adv.country_name }} diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index bb5ab25ad..9faa16334 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -90,8 +90,7 @@ -
+
@@ -53,7 +53,7 @@
- {{ form.fields.password.input|raw }} + {{ form.fields.password.setValue(app.request.get('password')).input|raw }}
diff --git a/addons/default/visiosoft/cats-module/src/CatsModule.php b/addons/default/visiosoft/cats-module/src/CatsModule.php index 6e1833f93..c6e5d958b 100644 --- a/addons/default/visiosoft/cats-module/src/CatsModule.php +++ b/addons/default/visiosoft/cats-module/src/CatsModule.php @@ -28,7 +28,7 @@ class CatsModule extends Module 'category' => [ 'buttons' => [ 'new_category', - ], + ] ] ]; diff --git a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php index 0fdc0bdf4..7ad894ff6 100644 --- a/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php +++ b/addons/default/visiosoft/media-field_type/src/Http/Controller/UploadController.php @@ -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") { diff --git a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss index 4fbfa1010..23affb0bd 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss +++ b/addons/default/visiosoft/profile-module/resources/assets/css/profile-nav.scss @@ -62,7 +62,7 @@ } } - img { + svg { margin-right: .75rem; width: 1.5rem; height: 1.5rem; diff --git a/addons/default/visiosoft/profile-module/resources/lang/en/field.php b/addons/default/visiosoft/profile-module/resources/lang/en/field.php index b914bb360..8bf5e6803 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/field.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/field.php @@ -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', + ], ]; diff --git a/addons/default/visiosoft/profile-module/resources/lang/nl/field.php b/addons/default/visiosoft/profile-module/resources/lang/nl/field.php index 730aabeb3..436e726d4 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/nl/field.php +++ b/addons/default/visiosoft/profile-module/resources/lang/nl/field.php @@ -2,7 +2,7 @@ return [ 'file' => [ - 'name' => 'foto\\'s' + 'name' => 'foto\'s' ], 'first_name' => [ 'name' => 'Voornaam' diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/index.twig b/addons/default/visiosoft/profile-module/resources/views/profile/index.twig index 2d5fd3fe5..7d48583db 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/index.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/index.twig @@ -2,7 +2,7 @@ {{ asset_style("visiosoft.module.profile::assets/css/profile-nav.scss") }} {% endblock %} -
+
{% include "visiosoft.module.profile::profile/partials/navigation" %} diff --git a/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig b/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig index 5c38fe95f..29b052248 100644 --- a/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig +++ b/addons/default/visiosoft/profile-module/resources/views/profile/partials/navigation.twig @@ -4,26 +4,26 @@
diff --git a/addons/default/visiosoft/profile-module/src/Seed/UsersFieldsSeeder.php b/addons/default/visiosoft/profile-module/src/Seed/UsersFieldsSeeder.php index 497108c1e..c4ec98c9b 100644 --- a/addons/default/visiosoft/profile-module/src/Seed/UsersFieldsSeeder.php +++ b/addons/default/visiosoft/profile-module/src/Seed/UsersFieldsSeeder.php @@ -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', ] diff --git a/app/Exceptions/ExceptionHandler.php b/app/Exceptions/ExceptionHandler.php index a789a8e71..79492d1b8 100644 --- a/app/Exceptions/ExceptionHandler.php +++ b/app/Exceptions/ExceptionHandler.php @@ -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); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c98476533..cf87ee4f4 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -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'])) {