|
|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
class core
|
|
|
{
|
|
|
- public static function ifGet(string $_string = NULL)
|
|
|
+ public static function ifGet(?string $_string = NULL)
|
|
|
{
|
|
|
if($_string == NULL){
|
|
|
return (empty($_GET)) ? FALSE : TRUE;
|
|
|
@@ -15,7 +15,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function ifPost(string $_string = NULL)
|
|
|
+ public static function ifPost(?string $_string = NULL)
|
|
|
{
|
|
|
if($_string == NULL){
|
|
|
return (empty($_POST)) ? FALSE : TRUE;
|
|
|
@@ -28,7 +28,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function ifFiles(string $_string = NULL)
|
|
|
+ public static function ifFiles(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string == NULL) {
|
|
|
return (empty($_FILES)) ? FALSE : TRUE;
|
|
|
@@ -41,7 +41,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function getGet(string $_string = NULL)
|
|
|
+ public static function getGet(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string == NULL) {
|
|
|
return $_GET;
|
|
|
@@ -54,7 +54,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function getPost(string $_string = NULL)
|
|
|
+ public static function getPost(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string == NULL) {
|
|
|
return $_POST;
|
|
|
@@ -67,7 +67,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function getFiles(string $_string = NULL)
|
|
|
+ public static function getFiles(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string == NULL) {
|
|
|
return $_FILES;
|
|
|
@@ -80,7 +80,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function isInArrayString(array $_array, string $_string, int $_exact = NULL)
|
|
|
+ public static function isInArrayString(array $_array, string $_string, ?int $_exact = NULL)
|
|
|
{
|
|
|
foreach ($_array as $value) {
|
|
|
if (strripos($_string, $value) !== FALSE and $_exact == NULL) {
|
|
|
@@ -156,7 +156,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function dateFr(string $_timestampMysql = NULL)
|
|
|
+ public static function dateFr(?string $_timestampMysql = NULL)
|
|
|
{
|
|
|
if ($_timestampMysql == NULL) {
|
|
|
$Now = new DateTime('now', new DateTimeZone(TIME_ZONE));
|
|
|
@@ -166,7 +166,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function dateFromTimestamp(int $_timestamp = NULL)
|
|
|
+ public static function dateFromTimestamp(?int $_timestamp = NULL)
|
|
|
{
|
|
|
if ($_timestamp == NULL) {
|
|
|
return NULL;
|
|
|
@@ -205,17 +205,17 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function elementMenu(string $_id, string $_href, string $_titre, string $_style = NULL)
|
|
|
+ public static function elementMenu(string $_id, string $_href, string $_titre, ?string $_style = NULL, ?string $_icon = NULL)
|
|
|
{
|
|
|
if (access::ifAccesss($_id)) {
|
|
|
($_style != NULL) ? $_style = ' style="' . $_style . '"' : NULL;
|
|
|
echo '<li class="nav-item" style="margin:5px 0;"><a style="display:unset;" class="nav-link' . get::currentPage($_id) . '" aria-current="page" href="' . $_href . '"' . $_style . '>';
|
|
|
- echo icon::getFont(["type" => $_id, "size" => "18px"]);
|
|
|
+ echo (preg_match('/^compte-\d+$/', $_id)) ? icon::getFont(["type" => $_icon, "size" => "18px"]) : icon::getFont(["type" => $_id, "size" => "18px"]);
|
|
|
echo ' ' . $_titre . '</a></li>';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function elementMenuLink(string $_id, string $_href, string $_titre, string $_style = NULL, string $_target = "_blank")
|
|
|
+ public static function elementMenuLink(string $_id, string $_href, string $_titre, ?string $_style = NULL, string $_target = "_blank")
|
|
|
{
|
|
|
if (access::ifAccesss($_id)) {
|
|
|
($_style != NULL) ? $_style = ' style="' . $_style . '"' : NULL;
|
|
|
@@ -225,7 +225,7 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function elementMenuH6(string $_id, string $_titre, string $_style = NULL, string $_collapse = NULL)
|
|
|
+ public static function elementMenuH6(string $_id, string $_titre, ?string $_style = NULL, ?string $_collapse = NULL)
|
|
|
{
|
|
|
if (access::ifAccesss($_id)) {
|
|
|
($_style != NULL) ? $_style = $_style : NULL;
|
|
|
@@ -340,21 +340,21 @@ class core
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function printFormSelectOption(string $_string = NULL, $_value)
|
|
|
+ public static function printFormSelectOption(?string $_string = NULL, $_value)
|
|
|
{
|
|
|
if ($_string != NULL and $_string == $_value) {
|
|
|
echo " selected";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function getFormValue(string $_string = NULL)
|
|
|
+ public static function getFormValue(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string != NULL) {
|
|
|
return $_string;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static function printFormValue(string $_string = NULL)
|
|
|
+ public static function printFormValue(?string $_string = NULL)
|
|
|
{
|
|
|
if ($_string != NULL) {
|
|
|
echo $_string;
|