Preparing graphic links, changes
[fa-stable.git] / includes / ui / ui_controls.inc
index fd2fefb3474498153648790ef244950ac42e1ef9..4fbdb984b4b8ffaf3eb72d265f6e103cedccc15e 100644 (file)
@@ -185,43 +185,45 @@ function table_header($labels)
        end_row();
 }
 
-function edit_link_cell($param, $title=false)
-{
-    label_cell("<a href='" . $_SERVER['PHP_SELF']. "?" . "$param'"
-        .($title ? " title='$title'":'').">" . _("Edit") . "</a>", "nowrap");
-}
-
-function delete_link_cell($param, $title=false)
-{
-    label_cell("<a href='" . $_SERVER['PHP_SELF']. "?" . "$param'"
-       .($title ? " title='$title'":'') .">" . _("Delete") . "</a>", "nowrap");
-}
+//-----------------------------------------------------------------------------------
 
-function edit_button($name, $value, $title=false, $icon=false)
+function button($name, $value, $title=false, $icon=false)
 {
        // php silently changes dots,spaces,'[' and characters 128-159
        // to underscore in POST names, to maintain compatibility with register_globals
        if (user_graphic_links() && $icon)
        {
                global $path_to_root;
-               $name = htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')));
-               echo "<button type='submit' class='editbutton' name='$name' value='' /><img src='$path_to_root/themes/".user_theme().
-               "/images/$icon' width='14' height='14' border='0' ".($title ? "title='$title'" : "title='$value'")." />\n";
+               echo "<button type='submit' class='editbutton' name='".
+                       htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))).
+                       "' value='' /><img src='$path_to_root/themes/".user_theme().
+                       "/images/$icon' width='14' height='14' border='0' ".($title ? "title='$title'" : "title='$value'")." />\n";
        }
        else
-               echo "<input type=\"submit\" class=\"editbutton\" name=\""
+               echo "<input type='submit' class='editbutton' name='"
                        .htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
-                       ."\" value=\"$value\""
+                       ."' value='$value'"
                        .($title ? " title='$title'":'')." />\n";
+       
 }
 
-function edit_button_cell($name, $value, $title=false, $icon=false)
+function button_cell($name, $value, $title=false, $icon=false)
 {
        echo "<td>";
-       edit_button($name, $value, $title, $icon);
+       button($name, $value, $title, $icon);
        echo "</td>";
 }
 
+function delete_button_cell($name, $value, $title=false)
+{
+       button_cell($name, $value, $title, ICON_DELETE);
+}
+
+function edit_button_cell($name, $value, $title=false)
+{
+       button_cell($name, $value, $title, ICON_EDIT);
+}
+
 //-----------------------------------------------------------------------------------
 
 function start_row($param="")