fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [12147] add jquery validator


From: Alejandro
Subject: [Fmsystem-commits] [12147] add jquery validator
Date: Fri, 10 Oct 2014 19:55:47 +0000

Revision: 12147
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12147
Author:   nudrick
Date:     2014-10-10 19:55:44 +0000 (Fri, 10 Oct 2014)
Log Message:
-----------
add jquery validator 

Modified Paths:
--------------
    branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php

Modified: branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php   2014-10-10 
19:54:47 UTC (rev 12146)
+++ branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php   2014-10-10 
19:55:44 UTC (rev 12147)
@@ -75,6 +75,15 @@
 //                                             "js/jquery-migrate-1.2.1"
                                        );
                                        break;
+                                    
+                                case 'validator':
+                                       $load = array
+                                       (
+                                            "js/jquery-2.1.1{$_type}",
+                                            
"validator/jquery.form-validator{$_type}"
+                                       );
+                                        
$GLOBALS['phpgw']->css->add_external_file("phpgwapi/js/jquery/validator/css/main.css");
+                                       break;
 
                                case 'menu':
                                case 'autocomplete':
@@ -120,6 +129,25 @@
                        }
                        return "phpgroupware.{$widget}" . ++self::$counter;
                }
+                
+                public static function formvalidator_generate($modules=array())
+                {
+                    self::load_widget('validator');
+                    $modules_js = '"' . implode(',', $modules). '"';
+                    
+                    $js = <<<JS
+                            
+                       $(document).ready(function () 
+                       {
+                            $.validate({
+                                modules : $modules_js,
+                                form: '#form'
+                            });
+                       });
+JS;
+                       $GLOBALS['phpgw']->js->add_code('', $js);
+                       return $output;
+                }
 
                public static function tabview_generate($tabs, $selection)
                {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]