~vcs-imports/almidon/trunk

« back to all changes in this revision

Viewing changes to core/pub2/ajax/livefillcombo.class.php2

  • Committer: christian
  • Date: 2010-09-11 20:55:52 UTC
  • Revision ID: svn-v4:924a4236-293c-0410-b38f-c0813de1d4fd:trunk:381
Change name to pub directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/**
3
 
 * Simple test class for doing fake livesearch
4
 
 *
5
 
 * @category   HTML
6
 
 * @package    AJAX
7
 
 * @author     Joshua Eichorn <josh@bluga.net>
8
 
 * @copyright  2005 Joshua Eichorn
9
 
 * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
10
 
 * @version    Release: 0.5.2
11
 
 * @link       http://pear.php.net/package/HTML_AJAX
12
 
 */
13
 
class livefillcombo {
14
 
        /**
15
 
         * Items to search against
16
 
         */
17
 
        var $livesearch = array(
18
 
                'Orange',
19
 
                'Apple',
20
 
                'Pear',
21
 
                'Banana',
22
 
                'Blueberry',
23
 
                'Fig',
24
 
                'Apricot',
25
 
                'Cherry',
26
 
                'Peach',
27
 
                'Plum',
28
 
                'Nectarine',
29
 
                'Boysenberry',
30
 
                'Cranberry',
31
 
                'Blackberry',
32
 
                'Clementine',
33
 
                'Grapefruit',
34
 
                'Lemon',
35
 
                'Lime',
36
 
                'Tangerine'
37
 
                );
38
 
        
39
 
        /**
40
 
         * Perform a search
41
 
         *
42
 
         * @return array
43
 
         */
44
 
        function filter_data($parent, $son, $id, $idselected=null) {
45
 
                $input = 'a';
46
 
                $ret = array();
47
 
                require_once("/www/".$_SERVER['SERVER_NAME']."/classes/app.class2.php");
48
 
                if(empty($input)) {
49
 
                        return $ret;
50
 
                }
51
 
                if (isset($_SESSION['sleep'])) {
52
 
                        $ret['Latency Added'] = $_SESSION['sleep'];
53
 
                }
54
 
                foreach($this->livesearch as $key => $value) {
55
 
                        if (stristr($value,$input)) {
56
 
                                $ret[$key] = $value;
57
 
                        }
58
 
                }
59
 
                return $ret;
60
 
        }
61
 
}
62
 
?>