projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merged changes form stabel branch up to the current state (2.3.22+).
[fa-stable.git]
/
includes
/
ui
/
ui_controls.inc
diff --git
a/includes/ui/ui_controls.inc
b/includes/ui/ui_controls.inc
index d2e094ae45e7e462bb2d67a7969e42c4182f9ea5..e184277f6ce0d06ff01f3855c21ea43f79b067af 100644
(file)
--- a/
includes/ui/ui_controls.inc
+++ b/
includes/ui/ui_controls.inc
@@
-32,10
+32,15
@@
function get_post($name, $dflt='')
((!isset($_POST[$name]) || $_POST[$name] === '') ? $dflt : $_POST[$name]);
}
//---------------------------------------------------------------------------------
((!isset($_POST[$name]) || $_POST[$name] === '') ? $dflt : $_POST[$name]);
}
//---------------------------------------------------------------------------------
+$form_nested = -1;
function start_form($multi=false, $dummy=false, $action="", $name="")
{
// $dummy - leaved for compatibility with 2.0 API
function start_form($multi=false, $dummy=false, $action="", $name="")
{
// $dummy - leaved for compatibility with 2.0 API
+ global $form_nested;
+
+ if (++$form_nested) return;
+
if ($name != "")
$name = "name='$name'";
if ($name != "")
$name = "name='$name'";
@@
-53,7
+58,9
@@
function start_form($multi=false, $dummy=false, $action="", $name="")
function end_form($breaks=0)
{
function end_form($breaks=0)
{
- global $Ajax;
+ global $Ajax, $form_nested;
+
+ if ($form_nested-- > 0) return;
$_SESSION['csrf_token'] = hash('sha256', uniqid(mt_rand(), true));
if ($breaks)
$_SESSION['csrf_token'] = hash('sha256', uniqid(mt_rand(), true));
if ($breaks)
@@
-62,7
+69,7
@@
function end_form($breaks=0)
hidden('_modified', get_post('_modified', 0));
hidden('_token', $_SESSION['csrf_token']);
echo "</form>\n";
hidden('_modified', get_post('_modified', 0));
hidden('_token', $_SESSION['csrf_token']);
echo "</form>\n";
- $Ajax->activate('token');
+ $Ajax->activate('
_
token');
}
function check_csrf_token()
}
function check_csrf_token()
@@
-177,14
+184,14
@@
function hyperlink_back($center=true, $no_menu=true, $type_no=0, $trans_no=0, $f
{
include_once($path_to_root."/admin/db/attachments_db.inc");
$id = has_attachment($type_no, $trans_no);
{
include_once($path_to_root."/admin/db/attachments_db.inc");
$id = has_attachment($type_no, $trans_no);
- }
+ $attach = get_attachment_string($type_no, $trans_no);
+ echo $attach;
+ }
$width = ($id != 0 ? "30%" : "20%");
start_table(false, "width=$width");
start_row();
if ($no_menu)
{
$width = ($id != 0 ? "30%" : "20%");
start_table(false, "width=$width");
start_row();
if ($no_menu)
{
- if ($id != 0)
- echo "<td align=center><a href='$path_to_root/admin/attachments.php?vw=$id' target='blanc_'>"._("View Attachment")."</a></td>\n";
echo "<td align=center><a href='javascript:window.print();'>"._("Print")."</a></td>\n";
}
echo "<td align=center><a href='javascript:goBack(".($final ? '-2' : '').");'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";
echo "<td align=center><a href='javascript:window.print();'>"._("Print")."</a></td>\n";
}
echo "<td align=center><a href='javascript:goBack(".($final ? '-2' : '').");'>".($no_menu ? _("Close") : _("Back"))."</a></td>\n";
@@
-306,18
+313,20
@@
function hyperlink_params_separate_td($target, $label, $params)
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-function alt_table_row_color(&$k)
+function alt_table_row_color(&$k
, $extra_class=null
)
{
{
+ $classes = $extra_class ? array($extra_class) : array();
if ($k == 1)
{
if ($k == 1)
{
-
echo "<tr class='oddrow'>\n"
;
+
array_push($classes, 'oddrow')
;
$k = 0;
}
else
{
$k = 0;
}
else
{
-
echo "<tr class='evenrow'>\n"
;
+
array_push($classes, 'evenrow')
;
$k++;
}
$k++;
}
+ echo "<tr class='".implode(' ', $classes)."'>\n";
}
function table_section_title($msg, $colspan=2)
}
function table_section_title($msg, $colspan=2)