children = array(); $this->name = $name; $this->form_id = $form_id; $this->form_method = $form_method; $this->form_action = $form_action; $this->form_nonce_action = $form_nonce_action; $this->form_nonce_name = $form_nonce_name; $this->button_label = $button_label; $this->button_args = $button_args; } public function hasChidren() { return (count($this->children) > 0)?true:false; } public function getChild($key) { return $this->children[$key]; } public function addChild($key, $value) { $this->children[$key] = $value; } public function render($factory) { $user_id = get_current_user_id(); $action_class = ''; //set default class for form if action is set if ($this->form_action !== '') { $action_class = 'eltdf-dashboard-form'; } ?>
children as $child) { $this->renderChild($child, $factory); } ?> $this->button_label, 'html_type' => 'button', 'custom_attrs' => $this->button_args ) ); } else { echo ''; } ?> form_nonce_action !== '' && $this->form_nonce_name !== '') { wp_nonce_field( $this->form_nonce_action, $this->form_nonce_name ); } else { wp_nonce_field( 'eltdf_validate_'.$this->name.'_'.$user_id, 'eltdf_nonce_'.$this->name.'_'.$user_id ); } ?>
render($factory); } } /* Class: CallaElatedDashboardGroup A class that initializes CallaElated Group Field */ class CallaElatedDashboardGroup implements iCallaElatedLayoutNode, iCallaElatedRender{ public $children; public $name; public $title; public $description; function __construct($name="", $title_label = "", $description = "") { $this->children = array(); $this->name = $name; $this->title = $title_label; $this->description = $description; } public function hasChidren() { return (count($this->children) > 0)?true:false; } public function getChild($key) { return $this->children[$key]; } public function addChild($key, $value) { $this->children[$key] = $value; } public function render($factory) { ?>

title); ?>

description); ?>

children as $child) { ?>
renderChild($child, $factory); ?>
render($factory); } } /* Class: CallaElatedDashboardTitle A class that initializes Dashboard Title */ class CallaElatedDashboardTitle implements iCallaElatedRender { private $name; private $title; function __construct($name="",$title_label="") { $this->title = $title_label; $this->name = $name; } public function render($factory) { ?>
title); ?>
type = $type; $this->name = $name; $this->label = $label; $this->description = $description; $this->options = $options; $this->args = $args; $this->value = $value; } public function render( $factory ) { $factory->render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args, $this->value); } } abstract class CallaElatedDashboardFieldType { abstract public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = "" ); } class CallaElatedDashboardFieldText extends CallaElatedDashboardFieldType { public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = '', $repeat = array() ) { $col_width = 12; if (isset($args['col_width'])) { $col_width = $args['col_width']; } $input_type = 'text'; if (isset($args['input_type'])) { $input_type = $args['input_type']; } if ($input_type == 'password') { $value = ''; } $suffix = !empty($args['suffix']) ? $args['suffix'] : false; $class = ''; if (!empty($repeat) && array_key_exists('name', $repeat) && array_key_exists('index', $repeat)) { $id = $name . '-' . $repeat['index']; $name = $repeat['name'] . '['.$repeat['index'].']['. $name .']'; } else { $id = $name; } if($description !== '') { $class .= ' eltdf-has-description'; } if(isset($args['custom_class']) && $args['custom_class'] != '') { $class .= ' ' . $args['custom_class']; } ?>

'.esc_html($value).''; } else { if (is_numeric($value)){ $value_html = ''; } else { $value_html = ''; } } ?>

$data_value) { $data_string .= $data_key . '=' . $data_value; $data_string .= ' '; } } ?>

getIconCollectionsEmpty(); $icons_collections = \CallaElatedIconCollections::get_instance()->getIconCollectionsKeys(); if (!empty($repeat) && array_key_exists('name', $repeat) && array_key_exists('index', $repeat)) { $id = $name . '-' . $repeat['index']; $name = $repeat['name'] . '['.$repeat['index'].']['. $name .']'; } else { $id = $name; } $class = ''; if($description !== '') { $class .= ' eltdf-has-description'; } if(isset($args['custom_class']) && $args['custom_class'] != '') { $class .= ' ' . $args['custom_class']; } $select2 = ''; if (isset($args['select2'])) { $select2 = 'eltdf-select2'; } ?>

getIconCollectionParamNameByKey( $icons_collection ); $style = 'display: none'; if ( !empty($value) && $value['icon_pack'] == $icons_collection ) { $style = 'display: block'; } ?>

$option_label) { $i = 1; $checked = is_array($value) && in_array($option_key, $value); $checked_attr = $checked ? 'checked' : ''; ?>

label = $label; $this->description = $description; $this->fields = $fields; $this->name = $name; $this->num_of_rows = 1; $this->button_text = ! empty( $button_text ) ? $button_text : esc_html__( 'Add New Item', 'calla' ); $this->table_layout = $table_layout; $this->value = $value; $counter = 0; foreach ( $this->fields as $field ) { if ( ! isset( $this->fields[ $counter ]['options'] ) ) { $this->fields[ $counter ]['options'] = array(); } if ( ! isset( $this->fields[ $counter ]['args'] ) ) { $this->fields[ $counter ]['args'] = array(); } if ( ! isset( $this->fields[ $counter ]['label'] ) ) { $this->fields[ $counter ]['label'] = ''; } if ( ! isset( $this->fields[ $counter ]['description'] ) ) { $this->fields[ $counter ]['description'] = ''; } if ( ! isset( $this->fields[ $counter ]['default_value'] ) ) { $this->fields[ $counter ]['default_value'] = ''; } $counter ++; } } public function render( $factory ) { global $post; $clones = array(); $wrapper_classes = array(); if ( ! empty( $this->value ) ) { $clones = $this->value; } $sortable_class = 'sortable'; foreach ( $this->fields as $field ) { if ( $field['type'] == 'textareahtml' ) { $sortable_class = ''; break; } } if ($this->table_layout){ $wrapper_classes[] = 'eltdf-dashboard-repeater-table'; } ?>
label !== '') { ?>

label); ?>

description != ''){ ?>

description); ?>

table_layout) { ?>
fields as $field ) { $col_width_class = 'col-lg-12'; if ( ! empty($field['col_width']) ) { $col_width_class = 'col-lg-'.$field['col_width']; } ?>
0) { $counter = 0; foreach($clones as $clone) { ?>
fields as $field) { $col_width_class = 'col-lg-12'; if ( ! empty($field['col_width']) ) { $col_width_class = 'col-lg-'.$field['col_width']; } ?>

0) { $counter2 = 0; foreach($clone[$field['name']] as $clone_inner) { ?>
render($field_inner['type'], $field_inner['name'], $field_inner['label'], $field_inner['description'], $field_inner['options'], $field_inner['args'], $repeater_inner_field_value, array('name'=> $this->name . '['.$counter.']['.$field['name'].']', 'index' => $counter2)); ?>
render($field['type'], $field['name'], $field['label'], $field['description'], $field['options'], $field['args'], $repeater_field_value, array('name'=> $this->name, 'index' => $counter)); } ?>
fields as $field) { if($field['type'] == 'repeater') { ?>
button_text ); ?>
render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'textarea': $field = new CallaElatedDashboardFieldTextArea(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'date': $field = new CallaElatedDashboardFieldDate(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'image': $field = new CallaElatedDashboardFieldImage(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'gallery': $field = new CallaElatedDashboardFieldGallery(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'select': $field = new CallaElatedDashboardFieldSelect(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'icon': $field = new CallaElatedDashboardFieldIcon(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'color': $field = new CallaElatedDashboardFieldColor(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'checkboxgroup': $field = new CallaElatedDashboardFieldCheckBoxGroup(); $field->render( $name, $label, $description, $options, $args, $value, $repeat ); break; case 'address': $field = new CallaElatedDashboardFieldAddress(); $field->render( $name, $label, $description, $options, $args, $value ); break; default: break; } } }