noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 53/107: Select_Box new Object


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 53/107: Select_Box new Object
Date: Mon, 26 Aug 2019 10:31:57 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 3b22021fd649ce7d6690d2438ce64d03be3064e3
Author: Dany De Bontridder <address@hidden>
Date:   Mon Jul 29 10:56:45 2019 +0200

    Select_Box new Object
---
 html/do.php                                  |  2 +-
 include/lib/icon_action.class.php            | 12 +++++++++---
 include/lib/select_box.class.php             |  2 +-
 include/template/result_cat_card_summary.php |  9 +++++----
 scenario/select-box-test.php                 | 14 +++++++-------
 5 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/html/do.php b/html/do.php
index c8ea494..715dcf8 100644
--- a/html/do.php
+++ b/html/do.php
@@ -356,7 +356,7 @@ else
         record_log($exc->getTraceAsString());
         throw $exc;
     }
-    
+
 }
 
 
diff --git a/include/lib/icon_action.class.php 
b/include/lib/icon_action.class.php
index a23ba44..070a201 100644
--- a/include/lib/icon_action.class.php
+++ b/include/lib/icon_action.class.php
@@ -243,10 +243,16 @@ class Icon_Action
                 $p_javascript);
         return $r;
     }
-    
-    static function menu($p_id,$p_javascript)
+    /**
+     * When a mouse is over this or if you click on it , it will trigger the 
javascript
+     * @param domid $p_id
+     * @param string $p_javascript 
+     * @return html string
+     */
+    static function menu_click($p_id,$p_javascript)
     {
-        $r=sprintf('<span id="%s" onclick="%s" class="smallicon icon" 
style="font-size:150%%;margin-left:5px">&#9776;</span>',
+        
+        $r=sprintf('<input type="button"  id="%s" onclick="%s" 
class="smallbutton icon" value="&#xf142;" style="font-weigth:bolder">',
                 $p_id,
                 $p_javascript);
         return $r;
diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php
index 4ce7e28..9e07d6e 100644
--- a/include/lib/select_box.class.php
+++ b/include/lib/select_box.class.php
@@ -78,7 +78,7 @@ class Select_Box
        }',$this->id,$this->id);
 
         // display the button
-        printf('<input type="button" id="%s_bt" value="%s &#x25BE;">',
+        printf('<input type="button" class="smallbutton icon" id="%s_bt" 
value="%s &#x25BE;">',
                 $this->id, $this->value);
         printf('<input type="hidden" id="%s" name="%s" value="%s">', $this->id,
                 $this->id, $this->default_value);
diff --git a/include/template/result_cat_card_summary.php 
b/include/template/result_cat_card_summary.php
index 6fc97b4..3b1c406 100644
--- a/include/template/result_cat_card_summary.php
+++ b/include/template/result_cat_card_summary.php
@@ -27,9 +27,10 @@ $e=0;
 foreach ($array as $row ) :
  $e++;
    if ($e%2==0)
-   echo '<tr class="odd">';
-   else
-   echo '<tr class="even">';
+   printf('<tr id="card%s" class="odd">',$row['f_id']);
+   else 
+   printf('<tr id="card%s" class="even">',$row['f_id']);
+   
    $fiche=new Fiche($cn);
    $fiche->id=$row['f_id'];
  $fiche->getAttribut();
@@ -37,7 +38,7 @@ 
$detail=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE));
 echo td($detail);
  foreach($fiche->attribut as $attr) :
          $sort="";
-         
+
         if ( $attr->ad_type != 'select'):
                 if ($attr->ad_type=="date") :
                     // format YYYYMMDD
diff --git a/scenario/select-box-test.php b/scenario/select-box-test.php
index 991c6fc..3c23ff6 100644
--- a/scenario/select-box-test.php
+++ b/scenario/select-box-test.php
@@ -44,19 +44,19 @@ div.select_box a:hover,div.select_box ul li:hover {
             Le CSS est important , surtout la position, il faut qu'il soit 
dans 
             un élément positionné en absolu.
         </p>
-        <p style="position: absolute">
+        <p style="float : static">
   <?php
      require NOALYSS_INCLUDE.'/lib/select_box.class.php';
      $a=new Select_Box("test","click me !");
-     $a->add_url("List","?id=5");
-     $a->add_javascript("Hello","alert('hello')");
-     $a->add_value("Value = 10",10);
-     $a->add_value("Value = 1",1);
-     $a->add_value("Value = 15",15);
+     $a->add_url("List (link)","?id=5&".Dossier::get());
+     $a->add_javascript("Hello (Javascript)","alert('hello')");
+     $a->add_value("Value = 10 (set value)",10);
+     $a->add_value("Value = 1 (set value)",1);
+     $a->add_value("Value = 15 (set value)",15);
 
      echo $a->input();
      
-     ?>
+     ?>   
         </p>
         </div>
 </body>



reply via email to

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