#3231 [recommendedads-module] Table buttons disappear if recommended-module is active

This commit is contained in:
Diatrex 2021-02-24 16:32:56 +03:00
parent 3463ba8f68
commit f8de9a4462
3 changed files with 7 additions and 22 deletions

View File

@ -1,13 +1,12 @@
<?php namespace Visiosoft\AdvsModule\Adv\Table;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
use Anomaly\Streams\Platform\Entry\EntryModel;
class AdvTableButtons
{
public function handle(AdvTableBuilder $builder)
{
$builder->setButtons([
$buttons = [
'status' => [
'text' => function (EntryInterface $entry) {
$text_type = ($entry->getStatus() == 'approved') ? 'decline' : 'approve';
@ -50,9 +49,13 @@ class AdvTableButtons
'create_configration' => [
'text' => trans('visiosoft.module.advs::button.create_configurations'),
'href' => route('visiosoft.module.advs::configrations.create') . "?ad={entry.id}"]
]
]
]
]);
];
$builder->setButtons($buttons);
return $buttons;
}
}

View File

@ -43,15 +43,6 @@ class AdvsController extends AdminController
$table->addAsset("styles.css", "visiosoft.module.advs::css/custom.css");
$table->addAsset('scripts.js', 'visiosoft.module.advs::js/list.js');
if ($this->model->is_enabled('recommendedads')) {
$table->addButton('add_recommended', [
'type' => 'default',
'icon' => 'fa fa-gg',
'text' => 'Add Recommended',
'href' => '/admin/recommendedads/create/{entry.id}',
]);
}
return $table->render();
}

View File

@ -17,12 +17,6 @@ use Visiosoft\DefaultadminTheme\Listener\ApplySorting;
*/
class DefaultadminThemeServiceProvider extends AddonServiceProvider
{
/**
* The addon listeners.
*
* @var array
*/
protected $listeners = [
SortNavigation::class => [
ApplySorting::class,
@ -33,9 +27,6 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider
],
];
/**
* Register the addon.
*/
public function register()
{
AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4';