noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 11/46: New : Icon_Action::icon_onoff : displa


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 11/46: New : Icon_Action::icon_onoff : display on or off
Date: Mon, 4 May 2020 13:38:44 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 813ea086e77e75d9ac69a72e78d2d5c400870ffd
Author: Dany De Bontridder <address@hidden>
AuthorDate: Fri Feb 14 10:57:32 2020 +0100

    New : Icon_Action::icon_onoff : display on or off
---
 include/lib/icon_action.class.php | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/lib/icon_action.class.php 
b/include/lib/icon_action.class.php
index 90cca74..9e4dede 100644
--- a/include/lib/icon_action.class.php
+++ b/include/lib/icon_action.class.php
@@ -342,4 +342,18 @@ class Icon_Action
                 $lock_cur);
         return $r;
     }    
+    
+    /**
+     * Display a icon ON is $p_value == 1 otherwise OFF
+     * @param string $p_div id of  element
+     * @param string $p_javascript
+     * @param string $p_style optionnal HTML code
+     * @param integer 0 or 1 , 0 means OFF and 1 means ON
+     * @return html string
+     */
+    static function icon_onoff($p_id,$p_javascript,$p_style,$p_value)
+    {
+        if ( $p_value == 1 ) { return \Icon_Action::iconon($p_id, 
$p_javascript,$p_style);}
+        if ( $p_value == 0 ) { return \Icon_Action::iconoff($p_id, 
$p_javascript,$p_style);}
+    }
 }



reply via email to

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