54 $this->
value=$p_value;
57 $this->json=json_encode([
'name'=>$p_name,
"value"=>$p_value], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
58 $this->callback=
"ajax.php";
76 throw new Exception(_(
"Invalide value"));
79 $r=sprintf(
'<span style="text-decoration: none;color:%s" class="inplace_edit icon" id="%s">',
$color,$this->
name);
84{$this->
name}.onclick=
function() {
new Ajax.Updater({$this->
name},
'{$this->callback}',{method:
"get",parameters:{$this->json},evalScripts:
true} );
165 $x=json_decode($this->json,TRUE);
166 $x[$p_attribute]=$p_value;
167 $this->json=json_encode($x, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_NUMERIC_CHECK);
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
static iconoff($p_id, $p_javascript, $p_style="")
Display a icon OFF.
static iconon($p_id, $p_javascript, $p_style="")
Display a icon ON.
A switch let you switch between 2 values : 0 and 1, it is used to replace the check.
__construct($p_name, $p_value)
add_json_param($p_attribute, $p_value)
Add json parameter to the current one, if there attribute already exists it will be overwritten.
$jscript
Supplemental javascript command, execute after the ajax script.
$name
name of the widget, javascript id must be unique
if( $delta< 0) elseif( $delta==0)