#431 add favicon for General Settings

This commit is contained in:
vedatakd 2019-10-10 20:03:05 +03:00
parent 9dbca4efb9
commit 1f8888b56b
4 changed files with 156 additions and 102 deletions

View File

@ -7,61 +7,68 @@ use Visiosoft\LocationModule\Country\CountryModel;
return [ return [
'site_address' => [ 'site_address' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.site_address', 'bind' => 'adv.site_address',
'env' => 'ADV_SITE_ADDRESS', 'env' => 'ADV_SITE_ADDRESS',
'config' => [ 'config' => [
'default_value' => 'visiosoft.com.tr', 'default_value' => 'visiosoft.com.tr',
'disabled' => true, 'disabled' => true,
], ],
], ],
"favicon" => [
"type" => "anomaly.field_type.file",
"config" => [
"folders" => ['favicon'],
"mode" => "upload",
]
],
'auto_approve' => [ 'auto_approve' => [
'type' => 'anomaly.field_type.boolean', 'type' => 'anomaly.field_type.boolean',
'bind' => 'adv.auto_approve', 'bind' => 'adv.auto_approve',
'env' => 'ADV_AUTO_APPROVE', 'env' => 'ADV_AUTO_APPROVE',
'config' => [ 'config' => [
'default_value' => true, 'default_value' => true,
], ],
], ],
'default_published_time' => [ 'default_published_time' => [
'type' => 'anomaly.field_type.integer', 'type' => 'anomaly.field_type.integer',
'bind' => 'adv.default_published_time', 'bind' => 'adv.default_published_time',
'env' => 'ADV_PUBLISH_TIME', 'env' => 'ADV_PUBLISH_TIME',
'required' => true, 'required' => true,
'config' => [ 'config' => [
'default_value' => 10, 'default_value' => 10,
], ],
], ],
'default_adv_limit' => [ 'default_adv_limit' => [
'type' => 'anomaly.field_type.integer', 'type' => 'anomaly.field_type.integer',
'bind' => 'adv.default_adv_limit', 'bind' => 'adv.default_adv_limit',
'env' => 'ADV_LIMIT', 'env' => 'ADV_LIMIT',
'required' => true, 'required' => true,
'config' => [ 'config' => [
'default_value' => 15, 'default_value' => 15,
], ],
], ],
'address' => [ 'address' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.address', 'bind' => 'adv.address',
'env' => 'ADV_ADDRESS', 'env' => 'ADV_ADDRESS',
'config' => [ 'config' => [
'default_value' => 'Basaksehir Istanbul', 'default_value' => 'Basaksehir Istanbul',
], ],
], ],
'phone' => [ 'phone' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.phone', 'bind' => 'adv.phone',
'env' => 'ADV_PHONE', 'env' => 'ADV_PHONE',
'config' => [ 'config' => [
'default_value' => '212 555 55 55', 'default_value' => '212 555 55 55',
], ],
], ],
'iban_numbers' => [ 'iban_numbers' => [
'type' => 'anomaly.field_type.wysiwyg', 'type' => 'anomaly.field_type.wysiwyg',
'bind' => 'adv.iban', 'bind' => 'adv.iban',
'env' => 'ADV_IBAN', 'env' => 'ADV_IBAN',
'config' => [ 'config' => [
'default_value' => '<h3>TR00 0000 0000 0000 0000 0000 00</h3>', 'default_value' => '<h3>TR00 0000 0000 0000 0000 0000 00</h3>',
], ],
@ -69,8 +76,8 @@ return [
'default_country' => [ 'default_country' => [
'type' => 'anomaly.field_type.relationship', 'type' => 'anomaly.field_type.relationship',
'bind' => 'adv.default_country', 'bind' => 'adv.default_country',
'env' => 'ADV_COUNTRY', 'env' => 'ADV_COUNTRY',
'config' => [ 'config' => [
'related' => CountryModel::class, 'related' => CountryModel::class,
"default_value" => 212, "default_value" => 212,
@ -78,8 +85,8 @@ return [
], ],
'default_city' => [ 'default_city' => [
'type' => 'anomaly.field_type.relationship', 'type' => 'anomaly.field_type.relationship',
'bind' => 'adv.default_city', 'bind' => 'adv.default_city',
'env' => 'ADV_CITY', 'env' => 'ADV_CITY',
'config' => [ 'config' => [
'related' => LocationCitiesEntryModel::class, 'related' => LocationCitiesEntryModel::class,
"default_value" => 34, "default_value" => 34,
@ -87,8 +94,8 @@ return [
], ],
'default_district' => [ 'default_district' => [
'type' => 'anomaly.field_type.relationship', 'type' => 'anomaly.field_type.relationship',
'bind' => 'adv.default_district', 'bind' => 'adv.default_district',
'env' => 'ADV_DISTRICT', 'env' => 'ADV_DISTRICT',
'config' => [ 'config' => [
'related' => LocationDistrictsEntryModel::class, 'related' => LocationDistrictsEntryModel::class,
"default_value" => 1091, "default_value" => 1091,
@ -97,46 +104,46 @@ return [
'contact_mail' => [ 'contact_mail' => [
'type' => 'anomaly.field_type.email', 'type' => 'anomaly.field_type.email',
'bind' => 'adv.contact_mail', 'bind' => 'adv.contact_mail',
'env' => 'ADV_MAIL', 'env' => 'ADV_MAIL',
], ],
'google_map_key' => [ 'google_map_key' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.google_map_key', 'bind' => 'adv.google_map_key',
'env' => 'ADV_MAP_KEY', 'env' => 'ADV_MAP_KEY',
'config' => [ 'config' => [
'default_value' => 'AIzaSyCAGc0z8kg9rKGVy2FizFKoz0FoWWWzoGQ', 'default_value' => 'AIzaSyCAGc0z8kg9rKGVy2FizFKoz0FoWWWzoGQ',
], ],
], ],
'google_statistic_code' => [ 'google_statistic_code' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.google_statistic_code', 'bind' => 'adv.google_statistic_code',
'env' => 'ADV_GOOGLE_STATISTIC_CODE', 'env' => 'ADV_GOOGLE_STATISTIC_CODE',
'config' => [ 'config' => [
'default_value' => '', 'default_value' => '',
], ],
], ],
'map_coordinates_long' => [ 'map_coordinates_long' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.map_coordinates_long', 'bind' => 'adv.map_coordinates_long',
'env' => 'ADV_MAP_LONG', 'env' => 'ADV_MAP_LONG',
'config' => [ 'config' => [
'default_value' => '28.74558607285155', 'default_value' => '28.74558607285155',
], ],
], ],
'map_coordinates_lat' => [ 'map_coordinates_lat' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.map_coordinates_lat', 'bind' => 'adv.map_coordinates_lat',
'env' => 'ADV_MAP_LAT', 'env' => 'ADV_MAP_LAT',
'config' => [ 'config' => [
'default_value' => '40.97817786299617', 'default_value' => '40.97817786299617',
], ],
], ],
'logo' => [ 'logo' => [
'type' => 'anomaly.field_type.file', 'type' => 'anomaly.field_type.file',
'bind' => 'adv.logo', 'bind' => 'adv.logo',
'env' => 'ADV_LOGO', 'env' => 'ADV_LOGO',
'config' => [ 'config' => [
'folders' => ["images"], 'folders' => ["images"],
'mode' => 'upload', 'mode' => 'upload',
@ -144,17 +151,17 @@ return [
], ],
'ogImage' => [ 'ogImage' => [
'type' => 'anomaly.field_type.file', 'type' => 'anomaly.field_type.file',
'bind' => 'adv.ogImage', 'bind' => 'adv.ogImage',
'env' => 'ADV_OG_IMAGE', 'env' => 'ADV_OG_IMAGE',
'config' => [ 'config' => [
'folders' => ["images"], 'folders' => ["images"],
'mode' => 'upload', 'mode' => 'upload',
] ]
], ],
'currencies' => [ 'currencies' => [
"type" => "anomaly.field_type.checkboxes", "type" => "anomaly.field_type.checkboxes",
'bind' => 'adv.currencies', 'bind' => 'adv.currencies',
'env' => 'ADV_CURRENCIES', 'env' => 'ADV_CURRENCIES',
'config' => [ 'config' => [
"default_value" => 'a:1:{i:0;s:1:"0";}', "default_value" => 'a:1:{i:0;s:1:"0";}',
'options' => Config::get('streams::currencies.enabled') 'options' => Config::get('streams::currencies.enabled')
@ -162,69 +169,69 @@ return [
], ],
'free_currencyconverterapi_key' => [ 'free_currencyconverterapi_key' => [
"type" => "anomaly.field_type.text", "type" => "anomaly.field_type.text",
'bind' => 'adv.free_currencyconverterapi_key', 'bind' => 'adv.free_currencyconverterapi_key',
'env' => 'ADV_CURRENCY_CONVERT_API_KEY', 'env' => 'ADV_CURRENCY_CONVERT_API_KEY',
'config' => [ 'config' => [
"default_value" => "1eea72940f3868c77420" "default_value" => "1eea72940f3868c77420"
] ]
], ],
'default_currency' => [ 'default_currency' => [
'type' => 'anomaly.field_type.select', 'type' => 'anomaly.field_type.select',
'bind' => 'adv.default_currency', 'bind' => 'adv.default_currency',
'env' => 'ADV_CURRENCY', 'env' => 'ADV_CURRENCY',
'config' => [ 'config' => [
'handler' => 'currencies', 'handler' => 'currencies',
"default_value" => 'USD', "default_value" => 'USD',
], ],
], ],
'default_GET' => [ 'default_GET' => [
'type' => 'anomaly.field_type.select', 'type' => 'anomaly.field_type.select',
'bind' => 'adv.default_GET', 'bind' => 'adv.default_GET',
'env' => 'ADV_GET', 'env' => 'ADV_GET',
'config' => [ 'config' => [
'default_value' => 0, 'default_value' => 0,
'options' => [ 'options' => [
0 => 'False', 0 => 'False',
1 => 'True', 1 => 'True',
], ],
], ],
], ],
'twitter' => [ 'twitter' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.twitter', 'bind' => 'adv.twitter',
'env' => 'ADV_TWITTER', 'env' => 'ADV_TWITTER',
'config' => [ 'config' => [
'default_value' => '/twitter.com/visiosoft' 'default_value' => '/twitter.com/visiosoft'
] ]
], ],
'facebook' => [ 'facebook' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.facebook', 'bind' => 'adv.facebook',
'env' => 'ADV_FACEBOOK', 'env' => 'ADV_FACEBOOK',
'config' => [ 'config' => [
'default_value' => '/facebook.com/visiosoft' 'default_value' => '/facebook.com/visiosoft'
] ]
], ],
'youtube' => [ 'youtube' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.youtube', 'bind' => 'adv.youtube',
'env' => 'ADV_YOUTUBE', 'env' => 'ADV_YOUTUBE',
'config' => [ 'config' => [
'default_value' => '/youtube.com/visiosoft' 'default_value' => '/youtube.com/visiosoft'
] ]
], ],
'google' => [ 'google' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.google', 'bind' => 'adv.google',
'env' => 'ADV_GOOGLE', 'env' => 'ADV_GOOGLE',
'config' => [ 'config' => [
'default_value' => '/plus.google.com/visiosoft' 'default_value' => '/plus.google.com/visiosoft'
] ]
], ],
'watermark_type' => [ 'watermark_type' => [
'type' => 'anomaly.field_type.select', 'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_type', 'bind' => 'adv.watermark_type',
'env' => 'ADV_WATERMARK_TYPE', 'env' => 'ADV_WATERMARK_TYPE',
'required' => true, 'required' => true,
'config' => [ 'config' => [
'options' => ['image' => 'Image', 'text' => 'Text'], 'options' => ['image' => 'Image', 'text' => 'Text'],
@ -232,22 +239,22 @@ return [
] ]
], ],
'watermark_text' => [ 'watermark_text' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.watermark_text', 'bind' => 'adv.watermark_text',
'env' => 'ADV_WATERMARK_TEXT', 'env' => 'ADV_WATERMARK_TEXT',
], ],
'watermark_image' => [ 'watermark_image' => [
'type' => 'anomaly.field_type.file', 'type' => 'anomaly.field_type.file',
'bind' => 'adv.watermark_image', 'bind' => 'adv.watermark_image',
'env' => 'ADV_WATERMARK_IMAGE', 'env' => 'ADV_WATERMARK_IMAGE',
'config' => [ 'config' => [
'default_value' => '', 'default_value' => '',
], ],
], ],
'watermark_position' => [ 'watermark_position' => [
'type' => 'anomaly.field_type.select', 'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_position', 'bind' => 'adv.watermark_position',
'env' => 'ADV_WATERMARK_POSITION', 'env' => 'ADV_WATERMARK_POSITION',
'required' => true, 'required' => true,
'config' => [ 'config' => [
'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right', 'bottom-left' => 'Bottom Left', 'center' => 'Middle'], 'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right', 'bottom-left' => 'Bottom Left', 'center' => 'Middle'],
@ -255,37 +262,37 @@ return [
] ]
], ],
'watermark_opacity' => [ 'watermark_opacity' => [
'type' => 'anomaly.field_type.text', 'type' => 'anomaly.field_type.text',
'bind' => 'adv.watermark_opacity', 'bind' => 'adv.watermark_opacity',
'env' => 'ADV_WATERMARK_OPACITY', 'env' => 'ADV_WATERMARK_OPACITY',
'config' => [ 'config' => [
'default_value' => '80', 'default_value' => '80',
], ],
], ],
'listing_page_image' => [ 'listing_page_image' => [
'type' => 'anomaly.field_type.file', 'type' => 'anomaly.field_type.file',
'bind' => 'adv.listing_page_image', 'bind' => 'adv.listing_page_image',
'env' => 'ADV_LISTING_PAGE_IMAGE', 'env' => 'ADV_LISTING_PAGE_IMAGE',
'config' => [ 'config' => [
'folders' => ["adv_listing_page"], 'folders' => ["adv_listing_page"],
'mode' => 'upload', 'mode' => 'upload',
] ]
], ],
'enabled_currencies' => [ 'enabled_currencies' => [
'bind' => 'streams::currencies.enabled', 'bind' => 'streams::currencies.enabled',
'env' => 'ADV_ENABLED_CURRENCIES', 'env' => 'ADV_ENABLED_CURRENCIES',
'type' => 'anomaly.field_type.checkboxes', 'type' => 'anomaly.field_type.checkboxes',
'required' => true, 'required' => true,
'config' => [ 'config' => [
'default_value' => function () { 'default_value' => function () {
return [config('streams::currencies.default')]; return [config('streams::currencies.default')];
}, },
'options' => function () { 'options' => function () {
$json = file_get_contents("https://openexchangerates.org/api/currencies.json"); $json = file_get_contents("https://openexchangerates.org/api/currencies.json");
$cur = array(); $cur = array();
foreach(json_decode($json, true) as $key => $value){ foreach (json_decode($json, true) as $key => $value) {
$cur[$key] = $value; $cur[$key] = $value;
} }
return $cur; return $cur;

View File

@ -16,6 +16,9 @@ return [
'phone' => [ 'phone' => [
'name' => 'Contact Phone', 'name' => 'Contact Phone',
], ],
'favicon' => [
'name' => 'Favicon',
],
'contact_mail' => [ 'contact_mail' => [
'name' => 'Contact Mail', 'name' => 'Contact Mail',
'warning' => 'Auto added sitename <strong>info</strong>@sitename ', 'warning' => 'Auto added sitename <strong>info</strong>@sitename ',

View File

@ -1,5 +1,7 @@
<?php namespace Visiosoft\AdvsModule; <?php namespace Visiosoft\AdvsModule;
use Anomaly\FilesModule\Disk\Contract\DiskRepositoryInterface;
use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface;
use Anomaly\Streams\Platform\Database\Seeder\Seeder; use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Anomaly\Streams\Platform\Model\Options\OptionsAdvertisementEntryModel; use Anomaly\Streams\Platform\Model\Options\OptionsAdvertisementEntryModel;
use Chumper\Zipper\Zipper; use Chumper\Zipper\Zipper;
@ -9,11 +11,53 @@ use Visiosoft\AdvsModule\Seed\BlockSeeder;
class AdvsModuleSeeder extends Seeder class AdvsModuleSeeder extends Seeder
{ {
/**
* The disk repository.
*
* @var DiskRepositoryInterface
*/
protected $disks;
/**
* The folder repository.
*
* @var FolderRepositoryInterface
*/
protected $folders;
/**
* Create a new FolderSeeder instance.
*
* @param DiskRepositoryInterface $disks
* @param FolderRepositoryInterface $folders
*/
public function __construct(DiskRepositoryInterface $disks, FolderRepositoryInterface $folders)
{
$this->disks = $disks;
$this->folders = $folders;
}
/** /**
* Run the seeder. * Run the seeder.
*/ */
public function run() public function run()
{ {
$disk = $this->disks->findBySlug('local');
$this->folders->create(
[
'en' => [
'name' => 'Favicon',
'description' => 'A folder for Favicon.',
],
'slug' => 'favicon',
'disk' => $disk,
'allowed_types' => [
'ico'
],
]
);
//Download demo SQL //Download demo SQL
$repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/"; $repository = "https://raw.githubusercontent.com/openclassify/Openclassify-Demo-Data/master/";

View File

@ -39,7 +39,7 @@
<!-- Favicon --> <!-- Favicon -->
{#{{ favicons("theme::img/favicon.png") }}#} {{ favicons(url('files/' ~ file(setting_value('visiosoft.module.advs::favicon')).path)) }}
{# Base Theme Components #} {# Base Theme Components #}
{{ asset_add("theme.css", "theme::scss/bootstrap/bootstrap.scss") }} {{ asset_add("theme.css", "theme::scss/bootstrap/bootstrap.scss") }}