Button_image Add button with icon

This commit is contained in:
Dany De Bontridder 2014-10-13 00:49:57 +02:00
parent cdda613318
commit df70c11251

View file

@ -445,6 +445,23 @@ class HtmlInput
$r.='<input type="button" id="'.$id.'" class="'.$p_class.'" onclick="'.$javascript.'" value="'.h($action).'">';
return $r;
}
/**
* button Html image
*@param $javascript javascript to execute
* @param $id id of the button
* @param $class class of the button
* @param $p_image image
*/
static function button_image($javascript,$id="xx",$p_class='class="button"',$p_image="")
{
if ($id=="xx"){
$id=HtmlInput::generate_id("xx");
}
$r="";
$r.='<image id="'.$id.'" '.$p_class.' onclick="'.$javascript.'" src="'.$p_image.'" />';
return $r;
}
/**
* Return a html string with an anchor to hide a div, put it in the right corner