LSformElement_select_object : Added filter parameter
authorBenjamin Renard <brenard@easter-eggs.com>
Fri, 15 Nov 2013 17:59:50 +0000 (18:59 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Fri, 15 Nov 2013 17:59:50 +0000 (18:59 +0100)
public_html/includes/class/class.LSformElement_select_object.php
public_html/includes/js/LSformElement_select_object_field.js

index 8fd3eba..8e10f81 100644 (file)
@@ -68,6 +68,7 @@ class LSformElement_select_object extends LSformElement {
           'addBtn' => _('Modify'),
           'deleteBtns' => _('Delete'),
           'multiple' => (($this -> params['multiple'])?1:0),
+          'filter64' => (($this -> params['html_options']['selectable_object']['filter'])?base64_encode($this -> params['html_options']['selectable_object']['filter']):''),
           'noValueLabel' => _('No set value'),
           'noResultLabel' => _('No result')
         )
@@ -150,7 +151,7 @@ class LSformElement_select_object extends LSformElement {
     if (is_array($this -> params['html_options']['selectable_object'])) {
       if (LSsession :: loadLSobject($this -> params['html_options']['selectable_object']['object_type'])) {
         $obj = new $this -> params['html_options']['selectable_object']['object_type']();
-        $ret = $obj -> getSelectArray($pattern,NULL,$this -> params['html_options']['selectable_object']['display_name_format']);
+        $ret = $obj -> getSelectArray($pattern,NULL,$this -> params['html_options']['selectable_object']['display_name_format'],false,true,$this -> params['html_options']['selectable_object']['filter']);
         if (is_array($ret)) {
           return $ret;
         }
index 8b3508f..911e98f 100644 (file)
@@ -108,7 +108,7 @@ var LSformElement_select_object_field = new Class({
         varLSsmoothbox.asNew();
         varLSsmoothbox.addEvent('valid',this.onLSsmoothboxValid.bind(this));
         varLSsmoothbox.displayValidBtn();
-        varLSsmoothbox.openURL('select.php?LSobject='+this.params['object_type']+((this.params['multiple'])?'&multiple=1':''),{width: 635});
+        varLSsmoothbox.openURL('select.php?LSobject='+this.params['object_type']+((this.params['multiple'])?'&multiple=1':'')+((this.params['filter64'])?'&filter64='+this.params['filter64']:''),{width: 635});
       }
     },