noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 08/27: New : icon_action:slider icon_action:c


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 08/27: New : icon_action:slider icon_action:comment and fix single quote issue in icon_action:tips
Date: Wed, 4 Sep 2019 15:24:53 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 5e291fc48fb98b114dd05e211cee5406a555225f
Author: Dany De Bontridder <address@hidden>
Date:   Tue Aug 27 19:28:38 2019 +0200

    New : icon_action:slider icon_action:comment
    and fix single quote issue in icon_action:tips
---
 include/lib/icon_action.class.php | 37 ++++++++++++++++++++++++++++++++++++-
 scenario/icon_actionTest.php      |  6 ++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/include/lib/icon_action.class.php 
b/include/lib/icon_action.class.php
index 485e480..cc24a32 100644
--- a/include/lib/icon_action.class.php
+++ b/include/lib/icon_action.class.php
@@ -96,7 +96,7 @@ 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.="&#xf086;";
         $r.='</span>';
@@ -104,6 +104,24 @@ class Icon_Action
         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.="&#xf0e5;";
+        $r.='</span>';
+
+        return $r;
+    }
+    /**
      * Display a icon ON
      * @param string $p_div id of  element
      * @param string $p_javascript
@@ -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="&#xf1de;";
+        
+        $r=sprintf( '<span id="%s" onclick="%s" class="icon 
smallicon">%s</span>',
+                $p_id,
+                $p_javascript, 
+                $lock_cur);
+        return $r;
+    }    
 }
diff --git a/scenario/icon_actionTest.php b/scenario/icon_actionTest.php
index 4682d7e..35c33a9 100644
--- a/scenario/icon_actionTest.php
+++ b/scenario/icon_actionTest.php
@@ -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>
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]