mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
use helper file instead of private function for building dropdown entry
This commit is contained in:
@@ -515,3 +515,45 @@ function has_permissions_for_stg($studiengang_kz, $permissions = '')
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* is building an array for Dropdown Entry in Print Dropdown
|
||||
* @param $id id for the Document to add to the Document Array
|
||||
* @param $name title of the dropdownEntry
|
||||
* @param $parameterUrl url of parameters xml, xsl, format etc as needed
|
||||
* WITHOUT BASEURL eg. "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf"
|
||||
* @param $uid default parameter, if null only parameterurl will be added
|
||||
* additional needed parameter: put in the parameterUrl
|
||||
* @param $alternativeBaseUrl: if baseUrl not pdfExport.php, put here alternative without ? char, eg. "zutrittskarte.php"
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
function buildDropdownEntryPrintArray($id, $name, $parameterurl, $uid=null, $order=null, $alternativeBaseUrl=null)
|
||||
{
|
||||
//DEFAULT BASEURL
|
||||
$baseurl = "pdfExport.php?";
|
||||
|
||||
$uidString = $uid ? "&uid=" . $uid : "";
|
||||
|
||||
|
||||
|
||||
if($alternativeBaseUrl)
|
||||
{
|
||||
return [
|
||||
"id" => $id,
|
||||
"type" => "documenturl",
|
||||
"name" => $name,
|
||||
"url" => $alternativeBaseUrl . "?" . $parameterurl . $uidString,
|
||||
"order" => $order
|
||||
];
|
||||
}
|
||||
else
|
||||
return [
|
||||
"id" => $id,
|
||||
"type" => "documenturl",
|
||||
"name" => $name,
|
||||
"url" => $baseurl . $parameterurl . "&uid=" . $uid,
|
||||
"order" => $order
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user