From 9adbbdd1649ce678471f2e1b8c047e6382b6a4ce Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Mon, 11 Mar 2024 15:27:47 +0100 Subject: [PATCH 01/17] fix typing and doc --- conlite/includes/functions.general.php | 446 ++++++++++++++----------- 1 file changed, 260 insertions(+), 186 deletions(-) diff --git a/conlite/includes/functions.general.php b/conlite/includes/functions.general.php index f4cb963..750363f 100644 --- a/conlite/includes/functions.general.php +++ b/conlite/includes/functions.general.php @@ -1,10 +1,10 @@ * @copyright four for business AG */ -function getAvailableContentTypes($idartlang) { +function getAvailableContentTypes($idartlang) +{ global $db, $cfg, $a_content, $a_description; $sql = "SELECT @@ -60,10 +61,11 @@ function getAvailableContentTypes($idartlang) { /** * Checks if an article is assigned to multiple categories * - * @param int $idart Article-Id + * @param int $idart Article-Id * @return bool Article assigned to multiple categories */ -function isArtInMultipleUse($idart) { +function isArtInMultipleUse($idart) +{ global $cfg, $client; $db = new DB_ConLite; @@ -76,11 +78,12 @@ function isArtInMultipleUse($idart) { /** * Checks if a value is alphanumeric * - * @param mixed $test Value to test - * @param bool $umlauts [Use german Umlaute] Optional + * @param mixed $test Value to test + * @param bool $umlauts [Use german Umlaute] Optional * @return bool Value is alphanumeric */ -function is_alphanumeric($test, $umlauts = true) { +function is_alphanumeric($test, $umlauts = true) +{ if ($umlauts == true) { $match = "/^[a-z0-9������� ]+$/i"; @@ -94,10 +97,11 @@ function is_alphanumeric($test, $umlauts = true) { /** * Returns multi-language month name (canonical) by its numeric value * - * @param int $month + * @param int $month * @return string */ -function getCanonicalMonth($month) { +function getCanonicalMonth($month) +{ switch ($month) { case 1 : return (i18n("January")); @@ -140,11 +144,12 @@ function getCanonicalMonth($month) { /** * Get multi-language day - * - * @param int $iDay The day number of date(w) + * + * @param int $iDay The day number of date(w) * @return string Dayname of current language */ -function getCanonicalDay($iDay) { +function getCanonicalDay($iDay) +{ switch ($iDay) { case 1 : return (i18n("Monday")); @@ -167,17 +172,19 @@ function getCanonicalDay($iDay) { case 0 : return (i18n("Sunday")); break; - default: break; + default: + break; } } /** * Returns the id of passed area * - * @param mixed $area Area name + * @param mixed $area Area name * @return int */ -function getIDForArea($area) { +function getIDForArea($area) +{ global $client, $lang, $cfg, $sess; $db = new DB_ConLite; @@ -202,10 +209,11 @@ function getIDForArea($area) { /** * Returns the parent id of passed area * - * @param mixed $area + * @param mixed $area * @return int */ -function getParentAreaId($area) { +function getParentAreaId($area) +{ global $client, $lang, $cfg, $sess; $db = new DB_ConLite; @@ -247,7 +255,8 @@ function getParentAreaId($area) { * @author Jan Lengowski * @copyright four for business AG */ -function markSubMenuItem($menuitem, $return = false) { +function markSubMenuItem($menuitem, $return = false) +{ $str = '