~oh-dev/openhealth/phit-tools

« back to all changes in this revision

Viewing changes to ihris-suite/lib/i2ce/modules/Forms/lib/fields/I2CE_FormField_STRING_LINE.php

  • Committer: litlfred at ibiblio
  • Date: 2009-10-23 12:59:28 UTC
  • Revision ID: litlfred@ibiblio.org-20091023125928-u5lkafz0urm9t8eq
updated ihris-suite to 4.0.1-prerelease -- not debugged

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
/*
3
 
 * © Copyright 2007, 2008 IntraHealth International, Inc.
4
 
 * 
5
 
 * This File is part of iHRIS
6
 
 * 
7
 
 * iHRIS is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
 
2
/**
 
3
 * @copyright © 2007, 2008, 2009 Intrahealth International, Inc.
 
4
 * This File is part of I2CE
 
5
 *
 
6
 * I2CE is free software; you can redistribute it and/or modify it
 
7
 * under the terms of the GNU General Public License as published by
9
8
 * the Free Software Foundation; either version 3 of the License, or
10
9
 * (at your option) any later version.
11
10
 * 
16
15
 * 
17
16
 * You should have received a copy of the GNU General Public License
18
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
 *//**
20
18
    * @package I2CE
21
19
    * @author Luke Duncan <lduncan@intrahealth.org>
22
 
    * @copyright Copyright &copy; 2007, 2008 IntraHealth International, Inc. 
23
20
    * @since v2.0.0
24
21
    * @version v2.0.0
25
22
    */
42
39
        } else {
43
40
            $value = $this->getValue();
44
41
        }
45
 
        if ( $this->isMap() ) {
46
 
            return $this->mapLookup( $value );
47
 
        } else {
48
 
            return $value;                      
49
 
        }
 
42
        return $value;                      
50
43
    }
51
44
 
52
45
    /**
53
 
     * Check to see if this form field should call createDropDown to create it's editable node.
54
 
     * This form field will if it is a mapped field.
55
 
     *
56
 
     * @return boolean
57
 
     */
58
 
    protected function useCreateDropDown() {
59
 
        return $this->isMap();
60
 
    }
61
 
    
62
 
    /*
63
46
     * @return array of DOMNode
64
47
     */
65
 
    protected function processDOMEditable($node,$template,$showError,$form_node) {
66
 
        $node_list = array();
 
48
    public function processDOMEditable($node,$template,$form_node) {
67
49
        $ele_name = $this->getHTMLName();
68
 
        if ( $this->useCreateDropDown() ) {
69
 
            $node_list = $this->createDropDown( $node, $template, $form_node, !$showError );
70
 
        } else {
71
 
            $element = $template->createElement( "input", array( "name" => $ele_name, "id" => $ele_name, "type" => "text", "value" => $this->getDBValue() ) );
72
 
            $this->setElement($element);
73
 
            $node_list[]= $element ;
74
 
        }
75
 
        return $node_list;
76
 
 
 
50
        $element = $template->createElement( "input", array( "name" => $ele_name, "id" => $ele_name, "type" => "text", "value" => $this->getDBValue() ) );
 
51
        $this->setElement($element);
 
52
        $node->appendChild( $element) ;
77
53
    }
78
54
 
79
55