Author: danydb
Date: 2012-07-29 13:56:59 +0200 (Sun, 29 Jul 2012)
New Revision: 5081
Modified:
phpcompta/tags/rel650/include/class_html_input.php
Log:
add new function
default_value_get
default_value_post
default_value_request
Modified: phpcompta/tags/rel650/include/class_html_input.php
===================================================================
--- phpcompta/tags/rel650/include/class_html_input.php 2012-07-26 15:31:54 UTC
(rev 5080)
+++ phpcompta/tags/rel650/include/class_html_input.php 2012-07-29 11:56:59 UTC
(rev 5081)
@@ -575,7 +575,7 @@
return $r;
}
/**
- * return default if the value if the array doesn't exist
+ * return default if the value if the value doesn't exist in the array
*@param $ind the index to check
*@param $default the value to return
*@param $array the array
@@ -588,6 +588,48 @@
}
return $array[$ind];
}
+ /**
+ * return default if the value if the value doesn't exist in $_GET
+ * @param $ind name of the variable
+ * @param type $default
+ * @return type
+ */
+ static function default_value_get($ind, $default)
+ {
+ if (!isset($_GET[$ind]))
+ {
+ return $default;
+ }
+ return $_GET[$ind];
+ }
+ /**
+ * return default if the value if the value doesn't exist in $_POST
+ * @param $ind name of the variable
+ * @param type $default
+ * @return type
+ */
+ static function default_value_post($ind, $default)
+ {
+ if (!isset($_POST[$ind]))
+ {
+ return $default;
+ }
+ return $_POST[$ind];
+ }
+ /**
+ * return default if the value if the value doesn't exist in $_REQUEST
+ * @param $ind name of the variable
+ * @param type $default
+ * @return type
+ */
+ static function default_value_request($ind, $default)
+ {
+ if (!isset($_REQUEST[$ind]))
+ {
+ return $default;
+ }
+ return $_REQUEST[$ind];
+ }
static function title_box($name,$div,$mod="close")
{
if ($mod=='close')
$r=HtmlInput::anchor_close($div);
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
_______________________________________________
Phpcompta est un logiciel libre de comptabilité en ligne
(http://www.phpcompta.eu)
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev