fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12124] add jquery translations


From: Sigurd Nes
Subject: [Fmsystem-commits] [12124] add jquery translations
Date: Thu, 09 Oct 2014 14:34:07 +0000

Revision: 12124
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12124
Author:   sigurdne
Date:     2014-10-09 14:34:06 +0000 (Thu, 09 Oct 2014)
Log Message:
-----------
add jquery translations

Modified Paths:
--------------
    branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php
    branches/dev-syncromind/phpgwapi/inc/class.uicommon_jquery.inc.php
    branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
    branches/dev-syncromind/property/templates/base/condition_survey.xsl

Added Paths:
-----------
    branches/dev-syncromind/phpgwapi/templates/base/jquery_phpgw_i18n.xsl

Modified: branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php   2014-10-08 
21:36:39 UTC (rev 12123)
+++ branches/dev-syncromind/phpgwapi/inc/class.jquery.inc.php   2014-10-09 
14:34:06 UTC (rev 12124)
@@ -129,9 +129,16 @@
                                        <ul>
 
 HTML;
+                       $disabled = array();
+                       $tab_map = array();
+                       $i = 1;
                        foreach($tabs as $id => $tab)
                        {
-                               $selected = $id == $selection ? ' 
class="selected"' : '';
+                               $tab_map[$id] = $i;
+                               $i++;
+
+                               $selected = in_array($selection,$tab_map) ? 
$tab_map[$selection] : 1;
+
                                $label = $tab['label'];
                                $_function = '';
                                if(isset($tab['function']))
@@ -141,6 +148,10 @@
 
                                if(!isset($tab['link']) && 
!isset($tab['function']))
                                {
+                                       if(in_array($selection,$tab_map))
+                                       {
+                                               $disabled[] = 
$tab_map[$selection];
+                                       }
                                        $selected = $selected ? $selected : ' 
class="disabled"';
                                        $output .= <<<HTML
                                                
<li{$selected}><a><em>{$label}</em></a></li>
@@ -154,6 +165,8 @@
                                
                                }
                        }
+                       $disabled_js = '[' . explode(',', $disabled) .']';
+
                        $output .= <<<HTML
                                        </ul>
                                </div>
@@ -166,6 +179,7 @@
                 startCollapsed: 'accordion',
                 collapsible: 'accordion',
                 setHash: true,
+                               disabled: $disabled_js,
                 activate: function(e, tab) {
                     $('.info').html('Tab <strong>' + tab.id + '</strong> 
activated!');
                 },
@@ -174,7 +188,7 @@
                     $('.info').html('Switched from <strong>' + state.oldState 
+ '</strong> state to <strong>' + state.newState + '</strong> state!');
                 }
             });
-                       $('#horizontalTab').responsiveTabs('activate', 1);
+                       $('#horizontalTab').responsiveTabs('activate', 
$selected);
 JS;
                        return $output;
                }

Modified: branches/dev-syncromind/phpgwapi/inc/class.uicommon_jquery.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.uicommon_jquery.inc.php  
2014-10-08 21:36:39 UTC (rev 12123)
+++ branches/dev-syncromind/phpgwapi/inc/class.uicommon_jquery.inc.php  
2014-10-09 14:34:06 UTC (rev 12124)
@@ -324,7 +324,7 @@
                }
                public function add_jquery_translation(&$data)
                {
-//                     $this->add_template_file('yui_phpgw_i18n');
+                       $this->add_template_file('jquery_phpgw_i18n');
                        $previous = lang('prev');
                        $next = lang('next');
                        $first = lang('first');
@@ -406,7 +406,7 @@
 
                        $this->reset_flash_msgs();
 
-                       //$this->add_yui_translation($data);
+//                     $this->add_yui_translation($data);
                        $this->add_jquery_translation($data);
                        $data['webserver_url'] = 
$GLOBALS['phpgw_info']['server']['webserver_url'];
 

Modified: branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl        
2014-10-08 21:36:39 UTC (rev 12123)
+++ branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl        
2014-10-09 14:34:06 UTC (rev 12124)
@@ -41,36 +41,7 @@
        <xsl:apply-templates select="form/list_actions"/>
 </xsl:template>
 
-       <xsl:template name="jquery_phpgw_i18n" xmlns:php="http://php.net/xsl";>
-               <xsl:if test="jquery_phpgw_i18n">
-                       <script type="text/javascript">
-                               //Namespacing
-                               ;var JqueryPortico = {};
 
-                               JqueryPortico.i18n = {
-                               <xsl:for-each select="jquery_phpgw_i18n/*">
-                                       <xsl:value-of select="local-name()"/>: 
function(cfg)
-                                       {
-                                               cfg = cfg || {};
-                                               <xsl:for-each select="./*">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="local-name() != '_'">
-                                                                       
cfg["<xsl:value-of select="local-name()"/>"] = <xsl:value-of 
disable-output-escaping="yes" select="."/>;
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       cfg = 
<xsl:value-of disable-output-escaping="yes" select="."/>;
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:for-each>
-                                               return cfg;
-                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
-                               </xsl:for-each>
-                               };
-                       </script>
-               </xsl:if>
-
-       </xsl:template>
-
 <xsl:template match="toolbar">
        <style id='toggle-box-css' type='text/css'>
 .toggle-box {

Added: branches/dev-syncromind/phpgwapi/templates/base/jquery_phpgw_i18n.xsl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/base/jquery_phpgw_i18n.xsl       
                        (rev 0)
+++ branches/dev-syncromind/phpgwapi/templates/base/jquery_phpgw_i18n.xsl       
2014-10-09 14:34:06 UTC (rev 12124)
@@ -0,0 +1,29 @@
+       <xsl:template name="jquery_phpgw_i18n" xmlns:php="http://php.net/xsl";>
+               <xsl:if test="jquery_phpgw_i18n">
+                       <script type="text/javascript">
+                               //Namespacing
+                               ;var JqueryPortico = {};
+
+                               JqueryPortico.i18n = {
+                               <xsl:for-each select="jquery_phpgw_i18n/*">
+                                       <xsl:value-of select="local-name()"/>: 
function(cfg)
+                                       {
+                                               cfg = cfg || {};
+                                               <xsl:for-each select="./*">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="local-name() != '_'">
+                                                                       
cfg["<xsl:value-of select="local-name()"/>"] = <xsl:value-of 
disable-output-escaping="yes" select="."/>;
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       cfg = 
<xsl:value-of disable-output-escaping="yes" select="."/>;
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </xsl:for-each>
+                                               return cfg;
+                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+                               </xsl:for-each>
+                               };
+                       </script>
+               </xsl:if>
+
+       </xsl:template>

Modified: branches/dev-syncromind/property/templates/base/condition_survey.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/condition_survey.xsl        
2014-10-08 21:36:39 UTC (rev 12123)
+++ branches/dev-syncromind/property/templates/base/condition_survey.xsl        
2014-10-09 14:34:06 UTC (rev 12124)
@@ -19,7 +19,7 @@
 
        <!-- add / edit -->
 <xsl:template match="data" xmlns:formvalidator="http://www.w3.org/TR/html4/"; 
xmlns:php="http://php.net/xsl";>
-               <xsl:call-template name="yui_phpgw_i18n"/>
+               <xsl:call-template name="jquery_phpgw_i18n"/>
 
                <div class="yui-navset" id="survey_edit_tabview">
 




reply via email to

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