Example #1
0
 /**
  * Render form object
  *
  * @param EasyForm $formObj
  * @return string result of rendering process
  */
 public static function render($formObj)
 {
     $tplEngine = $formObj->m_TemplateEngine;
     $tplAttributes = FormRenderer::buildTemplateAttributes($formObj);
     /*if (isset($formObj->m_jsClass)) {
           $subForms = ($formObj->m_SubForms) ? implode(";", $formObj->m_SubForms) : "";
           if ($formObj->m_StaticOutput != true) {
               $formScript = "\n<script>Openbiz.newFormObject('$formObj->m_Name','$formObj->m_jsClass','$subForms'); </script>\n";
           }
           if ($formObj->m_AutoRefresh > 0) {
               $formScript .= "\n<script>setTimeout(\"Openbiz.CallFunction('$formObj->m_Name.UpdateForm()');\",\"" . ($formObj->m_AutoRefresh * 1000) . "\") </script>\n";
           }
       }*/
     if ($tplEngine == "Smarty" || $tplEngine == null) {
         return FormRenderer::renderSmarty($formObj, $tplAttributes) . $formScript;
     } else {
         return FormRenderer::renderPHP($formObj, $tplAttributes) . $formScript;
     }
 }