fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13039] initate layout


From: Sigurd Nes
Subject: [Fmsystem-commits] [13039] initate layout
Date: Mon, 20 Apr 2015 12:22:44 +0000

Revision: 13039
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13039
Author:   sigurdne
Date:     2015-04-20 12:22:43 +0000 (Mon, 20 Apr 2015)
Log Message:
-----------
initate layout

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   2015-04-20 
12:22:08 UTC (rev 13038)
+++ branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php   2015-04-20 
12:22:43 UTC (rev 13039)
@@ -137,23 +137,45 @@
                                );
 
                                break;
+                       case 'layout':
+                               $load = array
+                               (
+                                       "js/jquery-2.1.1{$_type}",
+                                       "js/jquery-ui-1.11.1{$_type}",
+                                       'layout'=> 
array("jquery.layout{$_type}", "plugins/jquery.layout.state")
+                               );
+                               break;
                        
                        default:
-                               $err = "Unsupported YUI widget '%1' supplied to 
phpgwapi_yui::load_widget()";
+                               $err = "Unsupported jQuery widget '%1' supplied 
to phpgwapi_jquery::load_widget()";
                                trigger_error(lang($err, $widget), 
E_USER_WARNING);
                                return '';
                }
-
-               foreach ($load as $script)
+               foreach ($load as $key => $scripts)
                {
-                       $test = $GLOBALS['phpgw']->js->validate_file('jquery', 
$script);
 
-                       if (!$test)
+                       $package = 'jquery';
+
+                       if(!$key == intval($key))
                        {
-                               $err = "Unable to load jQuery script '%1' when 
attempting to load widget: '%2'";
-                               trigger_error(lang($err, $script, $widget), 
E_USER_WARNING);
-                               return '';
+                               $package = $key;
                        }
+
+                       if(!is_array($scripts))
+                       {
+                               $scripts = array($scripts);
+                       }
+
+                       foreach($scripts as $script)
+                       {
+                               $test = 
$GLOBALS['phpgw']->js->validate_file($package, $script);
+                               if (!$test)
+                               {
+                                       $err = "Unable to load jQuery script 
'%1' when attempting to load widget: '%2'";
+                                       trigger_error(lang($err, $script, 
$widget), E_USER_WARNING);
+                                       return '';
+                               }
+                       }
                }
                return "phpgroupware.{$widget}" . ++self::$counter;
        }




reply via email to

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