| | |
| | | public MetaForm $form; |
| | | protected int|null $object_id; |
| | | public object|null $data; |
| | | protected array $fields =[]; |
| | | protected string $field; |
| | | protected mixed $value; |
| | | protected string|null $object_type; |
| | |
| | | |
| | | protected function getFields(): array |
| | | { |
| | | if (!empty($this->fields)) { |
| | | return $this->fields; |
| | | } |
| | | $type = false; |
| | | switch ($this->object_type) { |
| | | case 'post': |
| | | $type = get_post_type((int)$this->object_id); |
| | |
| | | case 'options': |
| | | return jvbGetFields('options'); |
| | | } |
| | | if (!$type) { |
| | | return []; |
| | | } |
| | | |
| | | return jvbGetFields($type, $this->object_type); |
| | | } |
| | |
| | | |
| | | protected function getSections():array |
| | | { |
| | | $type = false; |
| | | switch ($this->object_type) { |
| | | case 'post': |
| | | $type = get_post_type((int)$this->object_id); |
| | |
| | | } |
| | | } |
| | | |
| | | public function setFieldConfig(array $fields):void |
| | | { |
| | | $this->fields = $fields; |
| | | } |
| | | |
| | | protected function getFieldConfig(string $name):array|false |
| | | { |
| | | $fields = $this->getFields(); |
| | |
| | | } |
| | | |
| | | |
| | | echo (jvbCheck('submit', $options)) ? '<button type="submit">'.jvbIcon('save').'Save</button>' : ''; |
| | | echo (jvbCheck('submit', $options)) ? '<button type="submit">'.jvbIcon('floppy-disk').'Save</button>' : ''; |
| | | echo '</form>'; |
| | | |
| | | $out = ob_get_clean(); |
| | |
| | | $out = '<p class="'.$name.'">'.jvbIcon('calendar').'<span></span></p>'; |
| | | break; |
| | | case 'time': |
| | | $out = '<p class="'.$name.'">'.jvbIcon('time').'<time></time></p>'; |
| | | $out = '<p class="'.$name.'">'.jvbIcon('clock').'<time></time></p>'; |
| | | break; |
| | | case 'true_false': |
| | | $out = '<p class="'.$name.'"></p>'; |