[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5081 - phpcompta/tags/rel650/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5081 - phpcompta/tags/rel650/include |
Date: |
Sun, 29 Jul 2012 13:57:00 +0200 (CEST) |
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
address@hidden $ind the index to check
address@hidden $default the value to return
address@hidden $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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5081 - phpcompta/tags/rel650/include,
phpcompta-dev <=