projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better color in data picker
[fa-stable.git]
/
includes
/
ui
/
ui_input.inc
diff --git
a/includes/ui/ui_input.inc
b/includes/ui/ui_input.inc
index a122b48790cf52e83e62b6a5c881883f58e21c27..3da07206ac88c05321bf6260661bc22f5f0839c5 100644
(file)
--- a/
includes/ui/ui_input.inc
+++ b/
includes/ui/ui_input.inc
@@
-1,13
+1,13
@@
<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU
Affero General Public License,
- AGPL, as published by the Free Software Foundation, either version
-
3
of the License, or (at your option) any later version.
+ Released under the terms of the GNU
General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License here <http://www.gnu.org/licenses/
a
gpl-3.0.html>.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
function get_post($name, $dflt='')
***********************************************************************/
function get_post($name, $dflt='')
@@
-221,7
+221,7
@@
function button($name, $value, $title=false, $icon=false)
$icon = ICON_DELETE;
return "<button type='submit' class='editbutton' name='".
htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))).
$icon = ICON_DELETE;
return "<button type='submit' class='editbutton' name='".
htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))).
- "' value=''" . ($title ? " title='$title'":" title='$value'")." />".set_icon($icon)."\n";
+ "' value='
1
'" . ($title ? " title='$title'":" title='$value'")." />".set_icon($icon)."\n";
}
else
return "<input type='submit' class='editbutton' name='"
}
else
return "<input type='submit' class='editbutton' name='"
@@
-255,24
+255,36
@@
function check_value($name)
return 1;
}
return 1;
}
-function check($label, $name, $value=null, $submit_on_change=false, $title=false)
+function check
box
($label, $name, $value=null, $submit_on_change=false, $title=false)
{
global $Ajax;
{
global $Ajax;
+ $str = '';
default_focus($name);
if ($label)
default_focus($name);
if ($label)
- echo $label . " ";
-
+ $str .= $label . " ";
+ if ($submit_on_change !== false) {
+ if ($submit_on_change === true)
+ $submit_on_change =
+ "JsHttpRequest.request(\"_{$name}_update\", this.form);";
+ }
if ($value === null)
$value = get_post($name,0);
if ($value === null)
$value = get_post($name,0);
- echo "<input"
- .($value == 1 ? ' checked':'')
- ." type='checkbox' name='$name' value='1'"
- .($submit_on_change ? " onclick='JsHttpRequest.request(\"_{$name}_update\", this.form);'" : '')
- .($title ? " title='$title'" : '')
- ." >\n";
+ $str .= "<input"
+ .($value == 1 ? ' checked':'')
+ ." type='checkbox' name='$name' value='1'"
+ .($submit_on_change ? " onclick='$submit_on_change'" : '')
+ .($title ? " title='$title'" : '')
+ ." >\n";
+
$Ajax->addUpdate($name, $name, $value);
$Ajax->addUpdate($name, $name, $value);
+ return $str;
+}
+
+function check($label, $name, $value=null, $submit_on_change=false, $title=false)
+{
+ echo checkbox($label, $name, $value, $submit_on_change, $title);
}
function check_cells($label, $name, $value, $submit_on_change=false, $title=false)
}
function check_cells($label, $name, $value, $submit_on_change=false, $title=false)
@@
-280,14
+292,14
@@
function check_cells($label, $name, $value, $submit_on_change=false, $title=fals
if ($label != null)
echo "<td>$label</td>\n";
echo "<td>";
if ($label != null)
echo "<td>$label</td>\n";
echo "<td>";
- check(null, $name, $value, $submit_on_change, $title);
+
echo
check(null, $name, $value, $submit_on_change, $title);
echo "</td>";
}
function check_row($label, $name, $value, $submit_on_change=false, $title=false)
{
echo "<tr>";
echo "</td>";
}
function check_row($label, $name, $value, $submit_on_change=false, $title=false)
{
echo "<tr>";
- check_cells($label, $name, $value, $submit_on_change, $title);
+
echo
check_cells($label, $name, $value, $submit_on_change, $title);
echo "</tr>\n";
}
echo "</tr>\n";
}