noalyss  Version-6.7.2
Public Member Functions
INum Class Reference

This class handles only the numeric input, the input will call a javascript to change comma to period and will round it (2 decimal), the precision is given by the attribute prec attribute extra = extra code (free) size = size of the field prec = precision default = 2 name = name of the html object javascript = javascript to execute (default = onchange="format_number(this,2);) value = value of the widget. More...

Inheritance diagram for INum:
IText HtmlInput

Public Member Functions

 __construct ($name='', $value='')
 display ()
 print in html the readonly value of the widget
 input ($p_name=null, $p_value=null)
 show the html input of the widget

Detailed Description

This class handles only the numeric input, the input will call a javascript to change comma to period and will round it (2 decimal), the precision is given by the attribute prec attribute extra = extra code (free) size = size of the field prec = precision default = 2 name = name of the html object javascript = javascript to execute (default = onchange="format_number(this,2);) value = value of the widget.

Definition at line 40 of file class_inum.php.


Constructor & Destructor Documentation

INum::__construct ( name = '',
value = '' 
)

Definition at line 42 of file class_inum.php.

References HtmlInput\$name, HtmlInput\$value, javascript, size, and style.

    {
        parent::__construct($name,$value);

        $this->size=9;
        $this->style='class="inum"';
        $this->javascript= 'onchange="format_number(this,2);"';
    }

Member Function Documentation

print in html the readonly value of the widget

Reimplemented from IText.

Definition at line 51 of file class_inum.php.

References $r, $style, javascript, name, table, and value.

Referenced by input().

    {

        $readonly=" readonly ";
                $this->id=($this->id=="")?$this->name:$this->id;

        //$style='style="border:solid 1px blue;color:black;background:#EDEDED;text-align:right"';
        $style=' class="inum input_text_ro"';
        $this->value=str_replace('"','',$this->value);
        $r='<INPUT '.$style.' TYPE="TEXT" id="'.
           $this->id.'"'.
           'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
           'SIZE="'.$this->size.'" '.$this->javascript." $readonly $this->extra >";

        /* add tag for column if inside a table */
        if ( $this->table == 1 )                  $r='<td>'.$r.'</td>';

        return $r;

    }
INum::input ( p_name = null,
p_value = null 
)

show the html input of the widget

Reimplemented from IText.

Definition at line 72 of file class_inum.php.

References HtmlInput\$extra, $r, css_size, display(), extra, javascript, name, readOnly, table, title, and value.

    {
                if ( isset ($this->prec)) {
                        $this->javascript= 'onchange="format_number(this,'.$this->prec.');"';
                }
        $this->name=($p_name==null)?$this->name:$p_name;
        $this->value=($p_value==null)?$this->value:$p_value;
                $this->id=($this->id=="")?$this->name:$this->id;

        if ( $this->readOnly==true) return $this->display();

        $t= ((isset($this->title)))?'title="'.$this->title.'"   ':' ';

        $extra=(isset($this->extra))?$this->extra:"";

        $this->value=str_replace('"','',$this->value);
        if ( ! isset ($this->css_size))
        {
        $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
           $this->id.'"'.$t.
           'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
           'SIZE="'.$this->size.'" '.$this->javascript."  $this->extra >";
        /* add tag for column if inside a table */
        } else {
           $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
           $this->id.'"'.$t.
           'NAME="'.$this->name.'" VALUE="'.$this->value.'"  '.
           ' style="width:'.$this->css_size.';" '.$this->javascript."  $this->extra >";

        }

        if ( $this->table == 1 )                  $r='<td>'.$r.'</td>';

        return $r;

    }

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations