noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 140/151: ManageTable use icon


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 140/151: ManageTable use icon
Date: Sat, 4 Feb 2017 17:14:35 +0000 (UTC)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 426d5b549fefa330464c576e8747a36837971b2f
Author: Dany De Bontridder <address@hidden>
Date:   Wed Jan 25 22:36:38 2017 +0100

    ManageTable use icon
---
 html/image/edit.png                    |  Bin 0 -> 745 bytes
 include/lib/class_html_input.php       |   13 +++++++++++++
 include/lib/class_manage_table_sql.php |    8 ++++----
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/html/image/edit.png b/html/image/edit.png
new file mode 100644
index 0000000..54b5c9a
Binary files /dev/null and b/html/image/edit.png differ
diff --git a/include/lib/class_html_input.php b/include/lib/class_html_input.php
index e5d1e2f..c4dad1f 100755
--- a/include/lib/class_html_input.php
+++ b/include/lib/class_html_input.php
@@ -469,6 +469,19 @@ class HtmlInput
 
     }
     /**
+     * Image to click , 
+     * @param string $p_image filename of the image under image/
+     * @param string $p_js javascript when the image is clicked
+     * @param string $p_message Message 
+     */
+    static  function image_click($p_image,$p_js,$p_message)
+    {
+        $ret=sprintf('<a class="nav" style="display:inline" href="#" 
title="%s"><img src="image/%s" onclick="%s"></a>',
+                $p_message,$p_image,$p_js);
+        return $ret;
+
+    }
+    /**
      * button Html image
      address@hidden $javascript javascript to execute
      * @param $id id of the button
diff --git a/include/lib/class_manage_table_sql.php 
b/include/lib/class_manage_table_sql.php
index c1019e2..8dc931e 100644
--- a/include/lib/class_manage_table_sql.php
+++ b/include/lib/class_manage_table_sql.php
@@ -490,19 +490,19 @@ class Manage_Table_SQL
         echo "<td>";
         if ($this->can_update_row())
         {
-            $js=sprintf("onclick=\"%s.input('%s','%s');\"", $this->object_name,
+            $js=sprintf("%s.input('%s','%s');", $this->object_name,
                     $p_row[$this->table->primary_key], $this->object_name
             );
-            echo HtmlInput::anchor(_("Modifier"), "", $js);
+            echo HtmlInput::image_click("edit.png",$js,_("Modifier"));
         }
         echo "</td>";
         echo "<td>";
         if ($this->can_delete_row())
         {
-            $js=sprintf("onclick=\"%s.delete('%s','%s');\"", 
$this->object_name,
+            $js=sprintf("%s.delete('%s','%s');", $this->object_name,
                     $p_row[$this->table->primary_key], $this->object_name
             );
-            echo HtmlInput::anchor(_("Effacer"), "", $js);
+            echo HtmlInput::image_click("delete.gif", $js,_("effacer"));
         }
         echo "</td>";
         echo '</tr>';



reply via email to

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