+}
+
+function submit_return($name, $value, $title=false, $async=false)
+{
+ if (count($_SESSION['Context'])) {
+ submit($name, $value, true, $title, $async);
+ }
+}
+//-----------------------------------------------------------------------------------
+
+function set_icon($icon, $title=false)
+{
+ global $path_to_root;
+ return "<img src='$path_to_root/themes/".user_theme()."/images/$icon' width='14' height='14' border='0'".($title ? " title='$title'" : "")." />\n";
+}
+
+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)
+ {
+ if ($value == _("Delete")) // Helper during implementation
+ $icon = ICON_DELETE;
+ return "<button type='submit' class='editbutton' name='".
+ htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))).
+ "' value='1'" . ($title ? " title='$title'":" title='$value'")." />".set_icon($icon)."\n";
+ }
+ else
+ return "<input type='submit' class='editbutton' name='"
+ .htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
+ ."' value='$value'"
+ .($title ? " title='$title'":'')." />\n";
+}
+
+function button_cell($name, $value, $title=false, $icon=false)
+{
+ echo "<td>";
+ echo 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);
+}