fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17421] API: allow tailored javascript per template s


From: sigurdne
Subject: [Fmsystem-commits] [17421] API: allow tailored javascript per template set
Date: Sun, 10 Dec 2017 07:04:04 -0500 (EST)

Revision: 17421
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17421
Author:   sigurdne
Date:     2017-12-10 07:04:04 -0500 (Sun, 10 Dec 2017)
Log Message:
-----------
API: allow tailored javascript per template set

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.js.inc.php
    trunk/phpgwapi/inc/class.uicommon_jquery.inc.php

Modified: trunk/phpgwapi/inc/class.js.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.js.inc.php 2017-12-09 18:18:42 UTC (rev 17420)
+++ trunk/phpgwapi/inc/class.js.inc.php 2017-12-10 12:04:04 UTC (rev 17421)
@@ -291,11 +291,18 @@
                */
                public function validate_file($package, $file, $app='phpgwapi')
                {
-                       if(is_readable(PHPGW_INCLUDE_ROOT . 
"/$app/js/$package/$file.js"))
+                       $template_set = 
$GLOBALS['phpgw_info']['server']['template_set'];
+
+                       if(is_readable(PHPGW_INCLUDE_ROOT . 
"/$app/js/$template_set/$file.js"))
                        {
                                $this->files[$app][$package][$file] = True;
                                return True;
                        }
+                       else if(is_readable(PHPGW_INCLUDE_ROOT . 
"/$app/js/$package/$file.js"))
+                       {
+                               $this->files[$app][$package][$file] = True;
+                               return True;
+                       }
                        elseif($app != 'phpgwapi')
                        {
                                if(is_readable(PHPGW_INCLUDE_ROOT . 
"/phpgwapi/js/$package/$file.js"))

Modified: trunk/phpgwapi/inc/class.uicommon_jquery.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.uicommon_jquery.inc.php    2017-12-09 18:18:42 UTC 
(rev 17420)
+++ trunk/phpgwapi/inc/class.uicommon_jquery.inc.php    2017-12-10 12:04:04 UTC 
(rev 17421)
@@ -252,6 +252,15 @@
                        $GLOBALS['phpgw']->css->add_external_file($path);
                }
 
+
+               /**
+                *
+                * @param type $app
+                * @param type $pkg will always look within template set, then 
fallback to $pkg
+                * @param type $name name of the javascript file to include
+                * @return type
+                */
+
                public function add_javascript( $app, $pkg, $name )
                {
                        return $GLOBALS['phpgw']->js->validate_file($pkg, 
str_replace('.js', '', $name), $app);




reply via email to

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