Jake Vanderwerf
3 days ago ba1e1ccf869b818f7a7a897264dfea05563a7796
inc/registrar/Fields.php
@@ -17,7 +17,7 @@
class Fields {
   protected array $fields;
   protected Registrar $registrar;
   private Registrar $registrar;
   public function __construct(?string $type = null, ?Registrar $registrar = null) {
      $this->registrar = $registrar;
@@ -50,9 +50,56 @@
   public function addPostFields():void
   {
      $statuses = [
//             'all' => [
//                'icon' => 'infinity',
//                'label' => 'Everything',
//             ],
         'publish' => [
            'icon' => 'eye',
            'label' => 'Live',
         ],
         'draft' => [
            'icon' => 'eye-closed',
            'label' => 'Hidden',
         ],
         'trash' => [
            'label' => 'Scrapped',
            'icon' => 'trash',
         ],
//       'delete' => [
//          'label'  => 'Permanently Delete',
//          'icon'   => 'trash'
//       ]
      ];
      if ($this->registrar->hasFeature('is_calendar')) {
         $statuses = [
            'future' => [
               'icon'   => '',
               'label'  => 'Upcoming',
            ],
            'past'   => [
               'icon'   => '',
               'label'  => 'Past',
            ],
            'repeat' => [
               'icon'   => '',
               'label'  => 'Repeating',
            ],
            'draft' => [
               'icon' => 'eye-closed',
               'label' => 'Hidden',
            ],
            'trash' => [
               'label' => 'Scrapped',
               'icon' => 'trash',
            ],
         ];
      }
      $fields = [
         'post_thumbnail'  => [
            'type'   => 'upload',
            'subtype'   => 'image',
            'multiple'=> false,
            'label'  => 'Main Image',
         ],
@@ -60,6 +107,11 @@
            'type'   => 'datetime',
            'label'  => 'Date',
         ],
         'post_modified' => [
            'type'   => 'datetime',
            'label'  => 'Date Modified',
            'hidden' => true,
         ],
         'post_content' => [
            'type'   => 'textarea',
            'quill'  => true,
@@ -79,28 +131,7 @@
            'type'      => 'radio',
            'label'     => 'Status',
            'default'   => 'draft',
            'options'   => [
               'all' => [
                  'icon' => 'infinity',
                  'label' => 'Everything',
               ],
               'publish' => [
                  'icon' => 'eye',
                  'label' => 'Live',
               ],
               'draft' => [
                  'icon' => 'eye-closed',
                  'label' => 'Hidden',
               ],
               'trash' => [
                  'label' => 'Scrapped',
                  'icon' => 'trash',
               ],
               'delete' => [
                  'label'  => 'Permanently Delete',
                  'icon'   => 'trash'
               ]
            ]
            'options'   => $statuses
         ]
      ];