noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 18/30: HtmlInput : add a new function to crea


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 18/30: HtmlInput : add a new function to create an empty anchor
Date: Tue, 02 Jun 2015 22:29:11 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 6c851b3dc15a7d919f71fb188f4705dab1d06e52
Author: Dany De Bontridder <address@hidden>
Date:   Tue Jun 2 00:17:55 2015 +0200

    HtmlInput : add a new function to create an empty anchor
---
 include/class_html_input.php |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/include/class_html_input.php b/include/class_html_input.php
index dae4029..fc820f6 100755
--- a/include/class_html_input.php
+++ b/include/class_html_input.php
@@ -724,6 +724,24 @@ class HtmlInput
                return $r;
        }
         /**
+         * @brief let you create only a link and set an id on it.
+         * After create a javascript for getting the event 
+         * onclick = function() {...}
+         * @param type $p_text Text to display
+         * @param type $p_id id of the link
+         * @code
+         * echo HtmlInput::anchor_empty('go','go_id');
+         * <script>$("go_id").onclick=function (e) { ...}</script>
+         * @endcode
+         */
+        static  function anchor_empty($p_text,$p_id)
+        {
+            $p_url="javascript:void(0)";
+            $str=sprintf('<a id="%s" href="javascript:void(0)" 
class="line">%s</a>',
+            $p_id,$p_text);
+            return $str;
+        }
+        /**
          *Return a simple anchor with a url or a javascript
          * if $p_js is not null then p_url will be javascript:void(0)
          * we don't add the event onclick. You must give p_url OR p_js



reply via email to

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