Пример #1
0
 public function get_submit_form_js_by_name($form_name, $submited, $indicator, $queue = false)
 {
     if (!is_array($form_name)) {
         $form_name = array($form_name);
     }
     if (!isset($indicator)) {
         $indicator = __('Processing...');
     }
     $fast = "+'&" . http_build_query(array('__action_module__' => $this->get_parent_path())) . "'";
     $pre = '';
     $chj = '';
     $post = '';
     foreach ($form_name as $f) {
         if ($submited) {
             $pre .= 'Epesi.confirmLeave.freeze(\'' . addslashes($f) . '\');';
             $pre .= "\$('" . addslashes($f) . "').submited.value=1;";
         }
         $pre .= "Event.fire(document,'e:submit_form','" . $f . "');";
         $pre .= str_replace('this', "\$('" . addslashes($f) . "')", Libs_QuickFormCommon::get_on_submit_actions());
         if ($chj) {
             $chj .= "+'&'+";
         }
         $chj .= "\$('" . addslashes($f) . "').serialize()";
         if ($submited) {
             $post .= "\$('" . addslashes($f) . "').submited.value=0;";
         }
     }
     $s = $pre . "_chj(" . $chj . $fast . ",'" . Epesi::escapeJS($indicator) . "','" . ($queue ? 'queue' : '') . "');" . $post;
     return $s;
 }