fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8196] api: custom attrib groups


From: Sigurd Nes
Subject: [Fmsystem-commits] [8196] api: custom attrib groups
Date: Thu, 24 Nov 2011 21:50:37 +0000

Revision: 8196
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8196
Author:   sigurdne
Date:     2011-11-24 21:50:37 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
api: custom attrib groups

Modified Paths:
--------------
    trunk/admin/inc/class.bo_custom.inc.php
    trunk/admin/inc/class.ui_custom.inc.php
    trunk/admin/templates/base/custom.xsl

Modified: trunk/admin/inc/class.bo_custom.inc.php
===================================================================
--- trunk/admin/inc/class.bo_custom.inc.php     2011-11-24 14:43:05 UTC (rev 
8195)
+++ trunk/admin/inc/class.bo_custom.inc.php     2011-11-24 21:50:37 UTC (rev 
8196)
@@ -405,4 +405,35 @@
                        }
                        return $entry_list;
                }
+
+               function get_attrib_group_list($app,$location, $selected)
+               {
+                       $group_list = $this->read_attrib_group($app, $location, 
true);
+
+                       foreach($group_list as &$group)
+                       {
+                               if( $group['id'] == $selected )
+                               {
+                                       $group['selected'] = true;
+                               }
+                       }
+                       //_debug_array($group_list);die();
+                       return $group_list;
+               }
+
+               function read_attrib_group($app, $location, $allrows = false)
+               {
+                       if($allrows)
+                       {
+                               $this->allrows = $allrows;
+                       }
+
+                       $attrib = $this->so->find_group($app, $location, 
$this->start, $this->query, $this->sort, $this->order, $this->allrows);
+
+                       $this->total_records = $this->so->total_records;
+
+                       return $attrib;
+               }
+
+
        }

Modified: trunk/admin/inc/class.ui_custom.inc.php
===================================================================
--- trunk/admin/inc/class.ui_custom.inc.php     2011-11-24 14:43:05 UTC (rev 
8195)
+++ trunk/admin/inc/class.ui_custom.inc.php     2011-11-24 21:50:37 UTC (rev 
8196)
@@ -412,7 +412,7 @@
                                'lang_datatype_statustext'                      
=> lang('Select a datatype'),
                                'lang_no_datatype'                              
        => lang('No datatype'),
                                'datatype_list'                                 
        => 
$this->bo->select_datatype((isset($values['column_info']['type'])?$values['column_info']['type']:'')),
-
+                               'attrib_group_list'                             
        => array('options' => 
$this->bo->get_attrib_group_list($this->appname,$this->location, 
$values['group_id'])),
                                'lang_precision'                                
        => lang('Precision'),
                                'lang_precision_statustext'                     
=> lang('enter the record length'),
                                'value_precision'                               
        => 
(isset($values['column_info']['precision'])?$values['column_info']['precision']:''),

Modified: trunk/admin/templates/base/custom.xsl
===================================================================
--- trunk/admin/templates/base/custom.xsl       2011-11-24 14:43:05 UTC (rev 
8195)
+++ trunk/admin/templates/base/custom.xsl       2011-11-24 21:50:37 UTC (rev 
8196)
@@ -178,7 +178,7 @@
 
 <!-- add attribute / edit attribute -->
 
-       <xsl:template match="edit_attrib">
+       <xsl:template match="edit_attrib" xmlns:php="http://php.net/xsl";>
                <div align="left">
                
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
@@ -277,6 +277,22 @@
                        </tr>
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="php:function('lang', 'group')" />
+                               </td>
+                               <td valign="top">
+                                       <select name="values[group_id]" 
class="forms">
+                                               <xsl:attribute name="title">
+                                                       <xsl:value-of 
select="php:function('lang', 'select a group')" />
+                                               </xsl:attribute>
+                                                       <option value="">
+                                                       <xsl:value-of 
select="php:function('lang', 'no group')" />
+                                               </option>
+                                               <xsl:apply-templates 
select="attrib_group_list/options"/>
+                                       </select>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_datatype"/>
                                </td>
                                <td valign="top">
@@ -900,3 +916,11 @@
                        </tr>
                        </table>
        </xsl:template>
+       <xsl:template match="options">
+               <option value="{id}">
+                       <xsl:if test="selected != 0">
+                               <xsl:attribute name="selected" value="selected" 
/>
+                       </xsl:if>
+                       <xsl:value-of disable-output-escaping="yes" 
select="name"/>
+               </option>
+       </xsl:template>




reply via email to

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