/**
  * function that creates the popup editor. only used in classes that have a config array defined by the set_elements class
  * a child class that has the function declared automaticaly gets an edit button in the admin section
  */
 public function popup_editor($var)
 {
     if (empty($this->elements)) {
         die;
     }
     if (current_theme_supports('avia_template_builder_custom_css')) {
         $this->elements = $this->avia_custom_class_for_element($this->elements);
     }
     $elements = $this->elements;
     //if the ajax request told us that we are fetching the subfunction iterate over the array elements and
     if (!empty($_POST['params']['subelement'])) {
         foreach ($elements as $element) {
             if (isset($element['subelements'])) {
                 $elements = $element['subelements'];
                 break;
             }
         }
     }
     $elements = $this->set_default_values($elements);
     echo AviaHtmlHelper::render_multiple_elements($elements, $this);
     die;
 }