noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 07/30: Improve method HtmlInput::title_box


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 07/30: Improve method HtmlInput::title_box
Date: Tue, 02 Jun 2015 22:29:05 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 26e46a4aaec7ad72e72230bb7086bfd12915e3d9
Author: Dany De Bontridder <address@hidden>
Date:   Sat May 30 12:29:15 2015 +0200

    Improve method HtmlInput::title_box
---
 include/class_html_input.php |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/include/class_html_input.php b/include/class_html_input.php
index 28639c3..dae4029 100755
--- a/include/class_html_input.php
+++ b/include/class_html_input.php
@@ -424,11 +424,11 @@ class HtmlInput
      * Return a html string with an anchor which close the inside popup. 
(top-right corner)
      address@hidden name of the DIV to close
      */
-    static function anchor_close($div)
+    static function anchor_close($div,$p_js="")
     {
        $r='';
        $r.='<div style="position:absolute;right:2px;margin:2px;padding:0px;">';
-       $r.= '<A id="close_div" class="input_text" 
onclick="removeDiv(\''.$div.'\');">&#10761;</A>';
+       $r.= '<A id="close_div" class="input_text" 
onclick="removeDiv(\''.$div.'\');'.$p_js.'">&#10761;</A>';
        $r.='</div>';
        return $r;
     }
@@ -702,19 +702,24 @@ class HtmlInput
                return $_REQUEST[$ind];
        }
         /**
-         * Title for boxes
+         * Title for boxes, you can customize the symbol thanks symbol with
+         * the mode "custom"
          * @param type $name Title
-         * @param type $div element id
-         * @param type $mod hide or close
-         * @param type $p_js if $mod is hide then you can add a javascript
+         * @param type $div element id, except for mode none or custom
+         * @param type $mod hide , close , zoom , custom or none, with
+         * custom , the $name contains all the code
+         * @param type $p_js contains the javascript with "custom" contains 
button + code 
          * @return type
          */
        static function title_box($name,$div,$mod="close",$p_js="")
        {
-               if ($mod=='close')              
$r=HtmlInput::anchor_close($div);
-               if ($mod=='hide')               
$r=HtmlInput::anchor_hide("&#10761;","$('$div').hide();$p_js");
-               if ($mod=='zoom')               $r='<span  
style="float:right;margin-right:5px">'.HtmlInput::anchor("&#11036;","",$p_js,' 
id="close_div" class="input_text"  ').'</span>';
-                if ( $mod == 'none')    $r="";
+               if ($mod=='close')      
{$r=HtmlInput::anchor_close($div,$p_js); }else
+               if ($mod=='hide')       
{$r=HtmlInput::anchor_hide("&#10761;","$('$div').hide();$p_js");} else
+               if ($mod=='zoom')       {$r='<span  id="span_'.$div.'" 
style="float:right;margin-right:5px">'.HtmlInput::anchor("&#11036;","",$p_js,' 
name="small'.$div.'" id="close_div" class="input_text"  ').'</span>'; } else
+                if ( $mod == 'custom')  {$r='<span  id="span_'.$div.'" 
style="float:right;margin-right:5px">'.$p_js."</span>";} else
+                if ( $mod == 'none')    {$r="" ; }
+                    else 
+                            die (__FILE__.":".__LINE__._('Paramètre invaide'));
                $r.=h2($name,' class="title" ');
                return $r;
        }



reply via email to

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