Exemplo n.º 1
0
Arquivo: Mtpl.php Projeto: demental/m
 private function rf(&$form, $type = 'dynamic')
 {
     if (is_array($form)) {
         return $form;
     }
     $args = func_get_args();
     M::Hook(__CLASS__, __FUNCTION__, $args);
     if ($type == 'dynamic') {
         $r = new HTML_QuickForm_Renderer_Array(true, true);
         if (!is_object($form)) {
             throw new Exception('Object is not a form object');
         }
         $form->accept($r);
         $ret = $r->toArray();
         if (!count($ret['sections'])) {
             $ret['sections'] = array(array('elements' => $ret['elements']));
         }
     } else {
         $r = new HTML_QuickForm_Renderer_ArrayStatic(true, true);
         $form->accept($r);
         $ret = $r->toArray();
     }
     return $ret;
 }