noalyss Version-9
Public Member Functions | Static Public Member Functions | Data Fields
ICheckBox Class Reference

Html Input. More...

+ Inheritance diagram for ICheckBox:
+ Collaboration diagram for ICheckBox:

Public Member Functions

 __construct ($p_name="", $p_value="", $p_id="")
 
 display ()
 print in html the readonly value of the widget More...
 
 get_range ($p_name)
 
 input ($p_name=null, $p_value=null, $id="")
 show the html input of the widget More...
 
 set_check ($p_value)
 set selected to true (checked) if the value equal the parameter More...
 
 set_range ($p_name)
 
- Public Member Functions inherited from HtmlInput
 __construct ($p_name="", $p_value="", $p_id="")
 
 __toString ()
 
 get_js_attr ()
 you can add attribute to this in javascript this function is a wrapper and create a script (in js) to modify "this" (in javascript) with the value of obj->attribute from PHP. More...
 
 get_node_attribute ()
 Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element.getAttribute or changed with element.setAttribute example insert my_attribute into a checkbox <input type="checkbox" "my_attribute"="XX"> More...
 
 get_value ()
 Return the value of input (IText, INum,...) More...
 
 make_object_deprecated ($p_name=null)
 Make a JSON object, this method create a javascript object with the attribute set, it returns a javascript string with the object. More...
 
 set_attribute ($p_name, $p_value)
 set the extra javascript property for the INPUT field More...
 
 set_value ($p_string)
 Set the value of input (IText, INum,...) More...
 
 setReadOnly ($p_read)
 

Static Public Member Functions

static javascript_set_range ($p_name)
 Before calling this function , you must set a range with the function set_range. More...
 
static toggle_checkbox ($p_name, $p_form)
 
- Static Public Member Functions inherited from HtmlInput
static anchor ($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
 Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:void(0) we don't add the event onclick. More...
 
static anchor_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 Anchor Html with javascript. More...
 
static anchor_close ($div, $p_js="")
 Return a html string with an anchor which close the inside popup. More...
 
static anchor_empty ($p_text, $p_id, $p_title="")
 let you create only a link and set an id on it. More...
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner. More...
 
static array_to_hidden ($array, $global_array)
 transform request data to hidden More...
 
static array_to_string ($array, $global_array, $start="?")
 transform request data to string More...
 
static button ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static button_action ($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
 button Html with javascript More...
 
static button_action_add ()
 
static button_action_remove_operation ($p_operation)
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="", $p_class="smallbutton")
 create a button with a ref More...
 
static button_choice_ledger ($p_array)
 
static button_close ($div_name, $class='smallbutton')
 close button for the HTML popup More...
 
static button_hide ($div_name)
 Hide the HTML popup. More...
 
static button_image ($javascript, $id="xx", $p_class='class="button"', $p_image="")
 button Html image More...
 
static calendar_zoom ($obj)
 Zoom the calendar. More...
 
static card_detail ($p_qcode, $pname='', $p_style="", $p_nohistory=false, $nofollowup=false)
 show the detail of a card More...
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array More...
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET use HttpInput instead More...
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST use HttpInput instead More...
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST use HttpInput instead More...
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action More...
 
static detail_modele_document ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument More...
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation More...
 
static display_periode ($p_id)
 
static errorbulle ($p_comment)
 
static extension ()
 
static filter_list ($p_list_id)
 Display a field for searching an element in a list, the searchable text must be in an element with the className search-content. More...
 
static filter_table ($p_table_id, $p_col, $start_row)
 filter the rows in a table and keep the colored row in alternance More...
 
static filter_table_form ($p_table_id, $p_col, $start_row, $p_name, $p_old_value)
 
static followup_card_button ($f_id, $p_mesg)
 display a div with the history of the card More...
 
static generate_id ($p_prefix)
 generate an unique id for a widget, More...
 
static get_to_hidden ($array)
 transform $_GET data to hidden More...
 
static get_to_string ($array, $start="?")
 transform $_GET data to string More...
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the account More...
 
static history_anc_account ($p_account, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the analytic account More...
 
static history_card ($f_id, $p_mesg, $p_style="", $p_exercice="")
 display a div with the history of the card More...
 
static history_card_button ($f_id, $p_mesg, $p_exercice="")
 display a div with the history of the card More...
 
static image_click ($p_image, $p_js, $p_message, $p_class="")
 Image to click ,. More...
 
static json_to_hidden ($p_json)
 transform a json to hidden More...
 
static post_to_hidden ($array)
 transform $_POST data to hidden More...
 
static post_to_string ($array)
 transform $_POST data to string More...
 
static print_window ()
 Javascript to print the current window. More...
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock More...
 
static request_to_hidden (array $array)
 transform $_REQUEST data to hidden More...
 
static request_to_string ($array, $start="?")
 transform $_REQUEST data to string More...
 
static reset ($p_value)
 
static select_cat ($array_cat)
 create a hidden plus button to select the cat of ledger More...
 
static select_stock ($p_cn, $p_name, $p_mode)
 Create an ISelect object containing the available repository for reading or writing. More...
 
static show_receipt_document ($p_jr_id, $p_name="")
 Returns HTML code for displaying a icon with a link to a receipt document from the ledger. More...
 
static show_reconcile ($p_div, $let, $span="")
 
static simple_array_to_hidden ($array)
 Transform a double array as a HTML string with hidden html value array has the formarray ["name"]="x",array['value']="y") the key name will be the hidden input name;. More...
 
static submit ($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
 
static title_box ($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
 Title for boxes, you can customize the symbol thanks symbol with the mode "custom". More...
 
static warnbulle ($p_comment)
 

Data Fields

 $range
 
- Data Fields inherited from HtmlInput
 $attribute
 
 $css_size
 
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $heigh
 
 $id
 
 $javascript
 
 $label
 
 $name
 
 $readOnly
 
 $require
 
 $selected
 
 $size
 
 $style
 
 $tabindex
 
 $table
 
 $type
 
 $value
 
 $width
 

Detailed Description

Html Input.

Definition at line 30 of file icheckbox.class.php.

Constructor & Destructor Documentation

◆ __construct()

ICheckBox::__construct (   $p_name = "",
  $p_value = "",
  $p_id = "" 
)

Reimplemented from HtmlInput.

Definition at line 34 of file icheckbox.class.php.

35 {
36 parent::__construct($p_name, $p_value, $p_id);
37 $this->range="";
38 }

References $p_id.

Member Function Documentation

◆ display()

ICheckBox::display ( )

print in html the readonly value of the widget

Definition at line 68 of file icheckbox.class.php.

69 {
70 $check=( $this->selected==true )?"checked":"unchecked";
71 $r='<input type="CHECKBOX" id="'.$this->name.'" name="'.$this->name.'"';
72 $r.=" $check";
73 $r.=' disabled>';
74
75 return $r;
76
77 }
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
$select selected
$from_poste name
$check

References $check, $r, name, and selected.

Referenced by input().

◆ get_range()

ICheckBox::get_range (   $p_name)

Definition at line 40 of file icheckbox.class.php.

40 {
41 return $this->range;
42 }

References $range.

◆ input()

ICheckBox::input (   $p_name = null,
  $p_value = null,
  $id = "" 
)

show the html input of the widget

Definition at line 47 of file icheckbox.class.php.

48 {
49 $this->name=($p_name==null)?$this->name:$p_name;
50 $this->value=($p_value==null)?$this->value:$p_value;
51 if ( $this->readOnly==true) return $this->display();
52 $this->id=($this->id=="")?$this->name:$this->id;
53
54 $check=( $this->selected==true )?"checked":"unchecked";
55 $r='<input type="CHECKBOX" id="'.$this->id.'" name="'.$this->name.'"'.' value="'.$this->value.'"';
56 $r.=" $check";
58 $r.=$this->get_node_attribute();
59 $r.=' '.$this->disabled." ".$this->javascript.'>';
60
61 $r=$r." $this->label";
62
63 return $r;
64
65
66 }
$ret javascript
get_node_attribute()
Insert attribute inside a INPUT TYPE, these attribute can be retrieved in javascript with element....
display()
print in html the readonly value of the widget
$icard readOnly

References $check, $r, $range, display(), HtmlInput\get_node_attribute(), javascript, name, readOnly, selected, and value.

+ Here is the call graph for this function:

◆ javascript_set_range()

static ICheckBox::javascript_set_range (   $p_name)
static

Before calling this function , you must set a range with the function set_range.

It will add the event on click (checkbox_set_range)

Parameters
string$p_name
Returns
javascript to execute string

Definition at line 98 of file icheckbox.class.php.

98 {
99 $js=sprintf("(function () {activate_checkbox_range('%s');})();",$p_name);
100 return create_script($js);
101 }
create_script($p_string)
create the HTML for adding the script tags around of the script

Referenced by Anc_GrandLivre\display_html(), and Follow_Up\myList().

◆ set_check()

ICheckBox::set_check (   $p_value)

set selected to true (checked) if the value equal the parameter

Parameters
$p_valuevalue to compare

Definition at line 82 of file icheckbox.class.php.

83 {
84 if ($this->value==$p_value)$this->selected=true;
85 }

References selected, and value.

◆ set_range()

ICheckBox::set_range (   $p_name)

Definition at line 43 of file icheckbox.class.php.

43 {
44 $this->range=' class="'.$p_name.'" ';
45 }

◆ toggle_checkbox()

static ICheckBox::toggle_checkbox (   $p_name,
  $p_form 
)
static

Definition at line 86 of file icheckbox.class.php.

86 {
87 $a=new ICheckBox($p_name);
88 $a->javascript='onclick="toggle_checkbox(\''.$p_form.'\')"';
89 return $a->input();
90 }
Html Input.

References $a.

Field Documentation

◆ $range

ICheckBox::$range

Definition at line 32 of file icheckbox.class.php.

Referenced by get_range(), and input().


The documentation for this class was generated from the following file: