示例#1
0
 public static function placeForm($form, $dom_id)
 {
     $html = $js = array();
     if (count($form) == 1) {
         foreach ($form as $key => $object) {
             if (isset($object->html)) {
                 $html[] = $object->html;
             }
         }
     } else {
         $html[] = CardKitHTML::contentRowDivider();
         foreach ($form as $key => $object) {
             if (isset($object->html)) {
                 $html[] = $object->html;
                 $html[] = CardKitHTML::contentRowDivider();
             }
         }
     }
     $js[] = self::addIntoDom($dom_id, implode('', $html), 'replace');
     foreach ($form as $key => $object) {
         if (isset($object->js)) {
             $js[] = $object->js;
         }
     }
     $js[] = '$(\'.focus-input\').focus();';
     $js[] = '$(\'.focus-input\').select();';
     return implode(' ', $js);
 }