id = $type_id;
$this->post_id = $post_id;
$this->categories = $this->getCategories();
$this->types = $this->getTypes();
$this->custom_fields = $this->getTypeCustomFields();
}
private function getCategories() {
return mkdf_listing_resume_get_resume_categories_array();
}
private function getTypes() {
return mkdf_listing_resume_get_resume_types_array();
}
private function getTypeCustomFields() {
return mkdf_listing_resume_get_resume_type_custom_fields($this->id);
}
private function getResumeTypeTitle() {
$type = mkdf_listing_resume_get_resume_type_by_id($this->id);
return esc_html__('Resume Type', 'mkdf-listing') . ' "' . esc_attr($type->name) . '"';
}
private function contentFlag() {
$flag = false;
if ((is_array($this->categories) && count($this->categories)) || (is_array($this->custom_fields) && count($this->custom_fields))) {
$flag = true;
}
return $flag;
}
public function renderResumeFormFields() {
?>
contentFlag()) { ?>
getResumeTypeTitle()); ?>
renderResumeCategoryField();
$this->renderResumeCustomFields();
?>
renderTypeField('search');
return $html;
}
private function renderTypeField($html_type = '') {
if (is_array($this->types) && count($this->types)) {
new FrontFieldCheckBoxGroup('resume_type', '', $this->types, $html_type);
}
}
public function getSingleResumeCategoryField() {
return $this->renderResumeCategoryField('single');
}
public function getSingleResumeCustomFields() {
return $this->renderResumeCustomFields('single');
}
private function renderResumeCategoryField($html_type = '') {
if (is_array($this->categories) && count($this->categories)) { ?>
post_id !== '') {
$saved_value = get_post_meta($this->post_id, 'mkdf_listing_resume_type_categories', true);
}
new FrontFieldSelect('job_type_categories', '', $this->categories, $html_type, $saved_value);
}
}
private function renderResumeCustomFields($html_type = '') {
if (is_array($this->custom_fields) && count($this->custom_fields)) { ?>
custom_fields as $custom_field) {
$options = array();
if ($custom_field['field_type'] === 'select') {
$options = mkdf_listing_resume_get_resume_type_options_array($custom_field);
}
$saved_value = '';
if ($this->post_id !== '') {
$saved_value = get_post_meta($this->post_id, $custom_field['meta_key'], true);
}
switch ($custom_field['field_type']) {
case 'text' :
new FrontFieldText($custom_field['meta_key'], $custom_field['title'], $html_type, $saved_value);
break;
case 'textarea' :
new FrontFieldTextArea($custom_field['meta_key'], $custom_field['title'], $html_type, $saved_value);
break;
case 'select' :
new FrontFieldSelect($custom_field['meta_key'], $custom_field['title'], $options, $html_type, $saved_value);
break;
case 'checkbox' :
new FrontFieldCheckBox($custom_field['meta_key'], $custom_field['title'], $html_type, false, $saved_value);
break;
}
}
}
}
private function renderSubmitButton() {
echo staffscout_mikado_get_button_html(array(
'size' => 'medium',
'type' => 'solid',
'custom_class' => 'mkdf-adv-search-submit',
'text' => esc_html__('Filter Results', 'mkdf-listing'),
'html_type' => 'button',
'fullwidth' => 'yes'
));
}
}
class FrontFieldCheckBoxGroup
{
private $name;
private $label;
private $options;
private $html_type;
private $value;
public function __construct($name, $label, $options, $html_type, $value = '') {
$this->name = $name;
$this->label = $label;
$this->options = $options;
$this->html_type = $html_type;
$this->value = $value;
switch ($html_type) {
case 'search':
$this->renderAdvSearchHtml();
break;
case 'single':
$this->renderSingleResumeHtml();
break;
default:
$this->renderResumeFieldHtml();
break;
}
}
private function renderResumeFieldHtml() {
if (!(is_array($this->options) && count($this->options))) {
return;
}
?>
value) && count($this->value)) {
?>
value as $item_key => $item_value) {
if ($item_value !== '') {
$term = get_term_by('slug', $item_value, 'resume_category');
?>
name); ?>
name = $name;
$this->label = $label;
$this->options = $options;
$this->html_type = $html_type;
$this->value = $value;
switch ($html_type) {
case 'search':
$this->renderAdvSearchHtml();
break;
case 'single':
$this->renderSingleResumeHtml();
break;
default:
$this->renderResumeFieldHtml();
break;
}
}
private function renderResumeFieldHtml() { ?>
value !== '') { ?>
value); ?>
name = $name;
$this->label = $label;
$this->html_type = $html_type;
$this->value = $value;
switch ($html_type) {
case 'search':
$this->renderAdvSearchHtml();
break;
case 'single':
$this->renderSingleResumeHtml();
break;
default:
$this->renderResumeFieldHtml();
break;
}
}
private function renderResumeFieldHtml() { ?>
value !== '') { ?>
value); ?>
name = $name;
$this->label = $label;
$this->html_type = $html_type;
$this->value = $value;
switch ($html_type) {
case 'search':
$this->renderAdvSearchHtml();
break;
case 'single':
$this->renderSingleResumeHtml();
break;
default:
$this->renderResumeFieldHtml();
break;
}
}
private function renderResumeFieldHtml() { ?>
value !== '') { ?>
value); ?>
name = $name;
$this->label = $label;
$this->html_type = $html_type;
$this->value = $value;
$this->icon_pack = $icon_pack;
$this->icon = $icon;
switch ($this->html_type) {
case 'search':
$this->renderAdvSearchHtml();
break;
case 'archive_search_html':
$this->renderArchiveSearchHtml();
break;
case 'single':
$this->renderSingleResumeHtml();
break;
default:
$this->renderResumeFieldHtml();
break;
}
}
private function renderResumeFieldHtml() {
$checked = "";
if ('1' == $this->value) {
$checked = "checked";
}
?>
value === '1') { ?>
renderIcon($this->icon, $this->icon_pack);
?>
label); ?>