#3025 Making the announcement status flexible.

This commit is contained in:
Diatrex 2021-01-25 17:31:45 +03:00
parent c800657465
commit b802be85d4
13 changed files with 277 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@ -0,0 +1,66 @@
<?php namespace Visiosoft\AdvsModule\Status\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class StatusFormBuilder 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

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

View File

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

View File

@ -0,0 +1,9 @@
<?php namespace Visiosoft\AdvsModule\Status;
use Visiosoft\AdvsModule\Status\Contract\StatusInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsStatusEntryModel;
class StatusModel extends AdvsStatusEntryModel implements StatusInterface
{
}

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,15 @@
<?php namespace Visiosoft\AdvsModule\Status;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
class StatusSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php namespace Visiosoft\AdvsModule\Status\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class StatusTableBuilder 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 = [
'name',
];
/**
* 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 = [];
}