New : icon_action:slider icon_action:comment
and fix single quote issue in icon_action:tips
This commit is contained in:
parent
7de5af784c
commit
5e291fc48f
2 changed files with 42 additions and 1 deletions
|
|
@ -96,13 +96,31 @@ class Icon_Action
|
|||
*/
|
||||
static function tips($p_comment)
|
||||
{
|
||||
$p_comment=htmlentities($p_comment);
|
||||
$p_comment=str_replace("'",' ',$p_comment);
|
||||
$r='<span tabindex="-1" class="icon" style="cursor:pointer;display:inline;text-decoration:none;" onmouseover="displayBulle(\''.$p_comment.'\')" onclick="displayBulle(\''.$p_comment.'\')" onmouseout="hideBulle(0)">';
|
||||
$r.="";
|
||||
$r.='</span>';
|
||||
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Display a info in a bubble, text is given as parameter
|
||||
* @param string $p_comment
|
||||
*
|
||||
* @return html string
|
||||
*/
|
||||
static function comment($p_comment)
|
||||
{
|
||||
$p_comment=str_replace("'",' ',$p_comment);
|
||||
$js=sprintf("displayBulle('%s')",$p_comment);
|
||||
|
||||
$r=sprintf('<span tabindex="-1" class="icon" style="cursor:pointer;display:inline;text-decoration:none;" onmouseover="%s" onclick="%s" onmouseout="hideBulle(0)">',
|
||||
$js,$js);
|
||||
$r.="";
|
||||
$r.='</span>';
|
||||
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Display a icon ON
|
||||
* @param string $p_div id of element
|
||||
|
|
@ -307,4 +325,21 @@ class Icon_Action
|
|||
$lock_cur);
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Display the icon of a slider
|
||||
* @param string $p_id DOMid
|
||||
* @param string $p_javascript
|
||||
* @return htmlString
|
||||
*/
|
||||
static function slider($p_id,$p_javascript)
|
||||
{
|
||||
|
||||
$lock_cur="";
|
||||
|
||||
$r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon">%s</span>',
|
||||
$p_id,
|
||||
$p_javascript,
|
||||
$lock_cur);
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,10 @@ include_once NOALYSS_INCLUDE."/lib/icon_action.class.php";
|
|||
</p>
|
||||
<p>
|
||||
Tips <?php echo Icon_Action::tips("Allo ?")?>
|
||||
</p>
|
||||
<p>
|
||||
Slider <?php echo Icon_Action::slider(uniqid(), "alert('test')")?>
|
||||
</p>
|
||||
<p>
|
||||
Comment<?php echo Icon_Action::comment("Allo ? l'heure d'été ?")?>
|
||||
</p>
|
||||
Loading…
Add table
Add a link
Reference in a new issue