mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge branch 'master' of https://github.com/openclassify/openclassify
This commit is contained in:
commit
213aca2311
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'view_ads' => 'View Ads',
|
||||
];
|
||||
@ -4,9 +4,8 @@ use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
|
||||
use Anomaly\Streams\Platform\Ui\ControlPanel\Component\Navigation\Event\SortNavigation;
|
||||
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
|
||||
use Illuminate\Pagination\AbstractPaginator;
|
||||
use Visiosoft\DefaultadminTheme\Http\Controller\Admin\PreferencesController;
|
||||
use Visiosoft\DefaultadminTheme\Http\Controller\Admin\SettingsController;
|
||||
use Visiosoft\DefaultadminTheme\Listener\AddGsmFilter;
|
||||
use Visiosoft\DefaultadminTheme\Listener\AddViewAdsButton;
|
||||
use Visiosoft\DefaultadminTheme\Listener\ApplySorting;
|
||||
|
||||
/**
|
||||
@ -29,8 +28,9 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
|
||||
ApplySorting::class,
|
||||
],
|
||||
TableIsQuerying::class => [
|
||||
AddGsmFilter::class
|
||||
]
|
||||
AddGsmFilter::class,
|
||||
AddViewAdsButton::class
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
<?php namespace Visiosoft\DefaultadminTheme\Listener;
|
||||
|
||||
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
|
||||
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||
use Anomaly\UsersModule\User\Table\UserTableBuilder;
|
||||
|
||||
class AddViewAdsButton
|
||||
{
|
||||
|
||||
/**
|
||||
* @var UserRepositoryInterface
|
||||
*/
|
||||
protected $userRepository;
|
||||
|
||||
/**
|
||||
* AddViewAdsAction constructor.
|
||||
* @param UserRepositoryInterface $userRepository
|
||||
*/
|
||||
public function __construct(UserRepositoryInterface $userRepository)
|
||||
{
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TableIsQuerying $event
|
||||
*/
|
||||
public function handle(TableIsQuerying $event)
|
||||
{
|
||||
$builder = $event->getBuilder();
|
||||
|
||||
if (get_class($builder) == UserTableBuilder::class) {
|
||||
$this->addViewAdsButton($builder);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a button to view ads.
|
||||
*
|
||||
* @param UserTableBuilder $builder
|
||||
*/
|
||||
protected function addViewAdsButton(UserTableBuilder $builder)
|
||||
{
|
||||
$buttons = $builder->getButtons();
|
||||
$dropdown = array_merge($buttons['settings']['dropdown'], [
|
||||
"ads" => [
|
||||
"text" => trans('visiosoft.theme.defaultadmin::button.view_ads'),
|
||||
"href" => "admin/advs?filter_User={entry.id}"
|
||||
]
|
||||
]);
|
||||
$buttons['settings']['dropdown'] = $dropdown;
|
||||
$builder->setButtons($buttons);
|
||||
}
|
||||
}
|
||||
@ -91,4 +91,4 @@ return [
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
];
|
||||
@ -71,7 +71,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'ssl'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@ -15,7 +15,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SCOUT_DRIVER', 'tntsearch'),
|
||||
'driver' => env('SCOUT_DRIVER', 'search'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@ -58,7 +58,7 @@ return [
|
||||
'id' => env('ALGOLIA_APP_ID'),
|
||||
'secret' => env('ALGOLIA_SECRET'),
|
||||
],
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| TNT Configuration
|
||||
@ -79,4 +79,4 @@ return [
|
||||
],
|
||||
'searchBoolean' => env('TNTSEARCH_BOOLEAN', true),
|
||||
],
|
||||
];
|
||||
];
|
||||
Loading…
Reference in New Issue
Block a user