private function generateFieldHtml($form, $field, $arr_options = array())
 {
     //make sure field does exist in form, form might have been manipulated since it has been received from the Core
     if (!$form->has($field)) {
         return;
     }
     //end if
     //extract element title for help sections
     $title = $form->get($field)->getAttribute("title");
     //set label classes
     $form->get($field)->setLabelAttributes(array("class" => "control-label"));
     //set tooltip
     if ($title != "") {
         $form->get($field)->setAttribute("data-toggle", "tooltip");
     }
     //end if
     //open form element
     if (strtolower($form->get($field)->getAttribute("type") == "hidden")) {
         //do nothing
         $html .= "<div style=\"display: none;\">";
     } else {
         $html .= "<div>";
     }
     //end if
     //set parent element classes
     //check for required elements
     if ($form->get($field)->getAttribute("required") == "required") {
         $parent_css_classes = "has-feedback";
     }
     //end if
     //check for element errors
     if (count($form->get($field)->getMessages()) > 0) {
         $parent_css_classes = "has-feedback has-error";
     }
     //end if
     //check for checkbox and radios
     if ($form->get($field)->getAttribute("type") == "checkbox") {
         $parent_css_classes .= "checkbox-inline";
     }
     //end if
     $html .= "<div class=\"form-group form-element-" . $field . " {$parent_css_classes}\">";
     switch (strtolower($form->get($field)->getAttribute("type"))) {
         default:
             if (strtolower($form->get($field)->getAttribute("name")) == "submit") {
                 //do nothing
                 $html .= "</div>";
             } else {
                 if ($form->get($field)->getLabel() != "") {
                     $html .= $this->view->formLabel($form->get($field));
                 }
                 //end if
                 $form->get($field)->setAttribute("class", "form-control");
                 $html .= $this->view->formElement($form->get($field));
                 if ($form->get($field)->getAttribute("required") == "required") {
                     $html .= "<span class=\"glyphicon glyphicon-asterisk form-control-feedback\"></span>";
                 }
                 //end if
                 //add help text
                 if ($title != "") {
                     if (is_array($arr_options) && (!isset($arr_options["disable_help_button"]) || $arr_options["disable_help_button"] !== TRUE)) {
                         $html .= "<span class=\"help-block\">{$title}</span>";
                     }
                     //end if
                 }
                 //end if
                 //add errors
                 $html .= $this->view->formElementerrors($form->get($field));
                 $html .= "</div>";
             }
             //end if
             break;
             $form->get($field)->setLabelAttributes(array("class" => "control-label", "class" => "selector-width"));
         case "checkbox":
         case "radio":
             $form->get($field)->setAttribute("class", "selector-width");
             $html .= $this->view->formElement($form->get($field));
             if ($form->get($field)->getLabel() != "") {
                 $html .= $this->view->formLabel($form->get($field));
             }
             //end if
             if ($form->get($field)->getAttribute("required") == "required") {
                 $html .= "<span class=\"glyphicon glyphicon-asterisk form-control-feedback\"></span>";
             }
             //end if
             //add help text
             if ($title != "") {
                 if (is_array($arr_options) && (!isset($arr_options["disable_help_button"]) || $arr_options["disable_help_button"] !== TRUE)) {
                     $html .= "<span class=\"help-block\">{$title}</span>";
                 }
                 //end if
             }
             //end if
             //add errors
             $html .= $this->view->formElementerrors($form->get($field));
             $html .= "</div>";
             break;
         case "textarea":
             if ($form->get($field)->getLabel() != "") {
                 $html .= $this->view->formLabel($form->get($field));
             }
             //end if
             $form->get($field)->setAttribute("class", "form-control");
             $html .= $this->view->formElement($form->get($field));
             if ($form->get($field)->getAttribute("required") == "required") {
                 $html .= "<span class=\"glyphicon glyphicon-asterisk form-control-feedback\"></span>";
             }
             //end if
             //add help text
             if ($title != "") {
                 if (is_array($arr_options) && (!isset($arr_options["disable_help_button"]) || $arr_options["disable_help_button"] !== TRUE)) {
                     $html .= "<span class=\"help-block\">{$title}</span>";
                 }
                 //end if
             }
             //end if
             //add errors
             $html .= $this->view->formElementerrors($form->get($field));
             $html .= "</div>";
             $arr_attributes = $form->get($field)->getAttributes();
             if (strpos($arr_attributes["class"], "text-editor") !== FALSE) {
                 $html .= "<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\t\t\tjQuery(document).ready(function () {\n\t\t\t\t\t\t\t\t\t\t\tjQuery(\"#" . $arr_attributes["id"] . "\").attr(\"required\", false);\n\t\t\t\t\t\t\t\t\t\t\ttinyMCE.init({\n\t\t\t\t\t\t\t\t\t\t\t\tselector: \"#" . $arr_attributes["id"] . "\",\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script>";
             }
             //end if
             break;
         case "hidden":
             $html .= $this->view->formElement($form->get($field));
             $html .= "</div>";
             break;
     }
     //end switch
     //close form element
     $html .= "</div>";
     return $html;
 }