if ($icon===false) $icon=ICON_ESCAPE; break;
case 'nonajax':
+ case 'download':
$atype = false;
}
}
global $path_to_root;
if (basename($icon) === $icon) // standard icons does not contain path separator
$icon = "$path_to_root/themes/".user_theme()."/images/$icon";
- return "<img src='$icon' width='12' height='12' border='0'".($title ? " title='$title'" : "")." >\n";
+ return "<img src='$icon' style='vertical-align:middle;width:12px;height:12px;border:0;'".($title ? " title='$title'" : "")." >\n";
}
function button($name, $value, $title=false, $icon=false, $aspect='')
if ($value == _("Delete")) // Helper during implementation
$icon = ICON_DELETE;
return "<button type='submit' class='editbutton' name='"
- .htmlentities(strtr($name, array('.'=>'=2E', '='=>'=3D',// ' '=>'=20','['=>'=5B'
+ .html_specials_encode(strtr($name, array('.'=>'=2E', '='=>'=3D',// ' '=>'=20','['=>'=5B'
)))
."' value='1'" . ($title ? " title='$title'":" title='$value'")
. ($aspect ? " aspect='$aspect'" : '')
function check_value($name)
{
- if (!isset($_POST[$name]) || $_POST[$name]=='')
- return 0;
- return 1;
+ return (empty($_POST[$name]) ? 0 : 1);
}
function checkbox($label, $name, $value=null, $submit_on_change=false, $title=false)
$calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ?
"$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
$post_label = "<a tabindex='-1' href=\"javascript:date_picker(document.getElementsByName('$name')[0]);\">"
- . " <img src='$calc_image' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+ . " <img src='$calc_image' style='vertical-align:middle;padding-bottom:4px;width:16px;height:16px;border:0;' alt='"._('Click Here to Pick up the date')."'></a>\n";
}
else
$post_label = "";
if (empty($_POST[$name.'_list'])) // restore refline id
$_POST[$name.'_list'] = $Refs->reflines->find_refline_id(empty($_POST[$name]) ? $init : $_POST[$name], $type);
- if (empty($_POST[$name]) || ($_SERVER['REQUEST_METHOD'] == 'GET')) // initialization
+ if (empty($_POST[$name])) // initialization
{
if (isset($init))
{
$_POST[$name] = $init;
} else {
- $_POST[$name] = $Refs->get_next($type, $_POST[$name.'_list'], $context); // set default
+ $_POST[$name] = $Refs->get_next($type, $_POST[$name.'_list'], $context);
}
$Ajax->addUpdate(true, $name, $_POST[$name]);
}
if (check_ui_refresh($name)) { // call context changed
- $_POST[$name] = $Refs->normalize($init, $type, $context, $_POST[$name.'_list']);
+ $_POST[$name] = $Refs->normalize($_POST[$name], $type, $context, $_POST[$name.'_list']);
$Ajax->addUpdate(true, $name, $_POST[$name]);
}
."</a>", $parms);
}
+function ahref($label, $href, $target="", $onclick="") {
+ echo "<a href='$href' target='$target' onclick='$onclick'>$label</a>";
+}
+
+function ahref_cell($label, $href, $target="", $onclick="") {
+ echo "<td align='center'> ";
+ ahref($label, $href, $target, $onclick);
+ echo " </td>";
+}