added type hinting
This commit is contained in:
parent
166c9b285a
commit
d7f967352b
|
@ -177,7 +177,7 @@ $_SESSION['header'] .= "<meta http-equiv=\"pragma\" content=\"no-cache\">\n <me
|
||||||
* @param \LAM\ENV\LAMLicenseValidator $licenseValidator license validator
|
* @param \LAM\ENV\LAMLicenseValidator $licenseValidator license validator
|
||||||
* @param string $error_message error message to display
|
* @param string $error_message error message to display
|
||||||
*/
|
*/
|
||||||
function display_LoginPage($config_object, $cfgMain, $licenseValidator, $error_message) {
|
function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licenseValidator, $error_message) {
|
||||||
logNewMessage(LOG_DEBUG, "Display login page");
|
logNewMessage(LOG_DEBUG, "Display login page");
|
||||||
// generate 256 bit key and initialization vector for user/passwd-encryption
|
// generate 256 bit key and initialization vector for user/passwd-encryption
|
||||||
if(function_exists('openssl_random_pseudo_bytes') && ($cfgMain->encryptSession == 'true')) {
|
if(function_exists('openssl_random_pseudo_bytes') && ($cfgMain->encryptSession == 'true')) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ use \htmlInputFileUpload;
|
||||||
use \htmlHelpLink;
|
use \htmlHelpLink;
|
||||||
use \htmlInputField;
|
use \htmlInputField;
|
||||||
use \htmlHiddenInput;
|
use \htmlHiddenInput;
|
||||||
|
use \LAM\TYPES\TypeManager;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ if(isset($_POST['createNewTemplate'])) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeManager = new \LAM\TYPES\TypeManager();
|
$typeManager = new TypeManager();
|
||||||
$types = $typeManager->getConfiguredTypes();
|
$types = $typeManager->getConfiguredTypes();
|
||||||
$sortedTypes = array();
|
$sortedTypes = array();
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
|
@ -319,7 +320,7 @@ include '../main_header.php';
|
||||||
$scope = $templateClasses[$i]['scope'];
|
$scope = $templateClasses[$i]['scope'];
|
||||||
$importOptions = array();
|
$importOptions = array();
|
||||||
foreach ($configProfiles as $profile) {
|
foreach ($configProfiles as $profile) {
|
||||||
$typeManagerImport = new \LAM\TYPES\TypeManager($serverProfiles[$profile]);
|
$typeManagerImport = new TypeManager($serverProfiles[$profile]);
|
||||||
$typesImport = $typeManagerImport->getConfiguredTypesForScope($scope);
|
$typesImport = $typeManagerImport->getConfiguredTypesForScope($scope);
|
||||||
foreach ($typesImport as $typeImport) {
|
foreach ($typesImport as $typeImport) {
|
||||||
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
|
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
|
||||||
|
@ -374,7 +375,7 @@ include '../main_header.php';
|
||||||
$container->addElement(new htmlOutputText(_("Target server profile")), true);
|
$container->addElement(new htmlOutputText(_("Target server profile")), true);
|
||||||
$exportOptions = array();
|
$exportOptions = array();
|
||||||
foreach ($configProfiles as $profile) {
|
foreach ($configProfiles as $profile) {
|
||||||
$typeManagerExport = new \LAM\TYPES\TypeManager($serverProfiles[$profile]);
|
$typeManagerExport = new TypeManager($serverProfiles[$profile]);
|
||||||
$typesExport = $typeManagerExport->getConfiguredTypesForScope($scope);
|
$typesExport = $typeManagerExport->getConfiguredTypesForScope($scope);
|
||||||
foreach ($typesExport as $typeExport) {
|
foreach ($typesExport as $typeExport) {
|
||||||
if (($profile != $_SESSION['config']->getName()) || ($typeExport->getId() != $typeId)) {
|
if (($profile != $_SESSION['config']->getName()) || ($typeExport->getId() != $typeId)) {
|
||||||
|
@ -430,15 +431,15 @@ include '../main_footer.php';
|
||||||
* @param string $typeId type id
|
* @param string $typeId type id
|
||||||
* @param array $options options
|
* @param array $options options
|
||||||
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
||||||
* @param \LAM\TYPES\TypeManager $typeManager type manager
|
* @param TypeManager $typeManager type manager
|
||||||
* @return \htmlStatusMessage message or null
|
* @return \htmlStatusMessage message or null
|
||||||
*/
|
*/
|
||||||
function importStructures($typeId, $options, &$serverProfiles, &$typeManager) {
|
function importStructures($typeId, $options, &$serverProfiles, TypeManager &$typeManager) {
|
||||||
foreach ($options as $option) {
|
foreach ($options as $option) {
|
||||||
$sourceConfName = $option['conf'];
|
$sourceConfName = $option['conf'];
|
||||||
$sourceTypeId = $option['typeId'];
|
$sourceTypeId = $option['typeId'];
|
||||||
$sourceName = $option['name'];
|
$sourceName = $option['name'];
|
||||||
$sourceTypeManager = new \LAM\TYPES\TypeManager($serverProfiles[$sourceConfName]);
|
$sourceTypeManager = new TypeManager($serverProfiles[$sourceConfName]);
|
||||||
$sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId);
|
$sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId);
|
||||||
$targetType = $typeManager->getConfiguredType($typeId);
|
$targetType = $typeManager->getConfiguredType($typeId);
|
||||||
if (($sourceType != null) && ($targetType != null)) {
|
if (($sourceType != null) && ($targetType != null)) {
|
||||||
|
@ -460,10 +461,10 @@ function importStructures($typeId, $options, &$serverProfiles, &$typeManager) {
|
||||||
* @param string $name profile name
|
* @param string $name profile name
|
||||||
* @param array $options options
|
* @param array $options options
|
||||||
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
||||||
* @param \LAM\TYPES\TypeManager $typeManager type manager
|
* @param TypeManager $typeManager type manager
|
||||||
* @return \htmlStatusMessage message or null
|
* @return \htmlStatusMessage message or null
|
||||||
*/
|
*/
|
||||||
function exportStructures($typeId, $name, $options, &$serverProfiles, &$typeManager) {
|
function exportStructures($typeId, $name, $options, &$serverProfiles, TypeManager &$typeManager) {
|
||||||
$sourceType = $typeManager->getConfiguredType($typeId);
|
$sourceType = $typeManager->getConfiguredType($typeId);
|
||||||
if ($sourceType == null) {
|
if ($sourceType == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -480,7 +481,7 @@ function exportStructures($typeId, $name, $options, &$serverProfiles, &$typeMana
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$targetTypeId = $option['typeId'];
|
$targetTypeId = $option['typeId'];
|
||||||
$targetTypeManager = new \LAM\TYPES\TypeManager($serverProfiles[$targetConfName]);
|
$targetTypeManager = new TypeManager($serverProfiles[$targetConfName]);
|
||||||
$targetType = $targetTypeManager->getConfiguredType($targetTypeId);
|
$targetType = $targetTypeManager->getConfiguredType($targetTypeId);
|
||||||
if ($targetType != null) {
|
if ($targetType != null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -496,7 +496,7 @@ function translateFieldIDToName($id, $scope, $availablePDFFields) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function updateBasicSettings(&$structure) {
|
function updateBasicSettings(PDFStructure &$structure) {
|
||||||
// set headline
|
// set headline
|
||||||
if (isset($_POST['headline'])) {
|
if (isset($_POST['headline'])) {
|
||||||
$structure->setTitle(str_replace('<', '', str_replace('>', '', $_POST['headline'])));
|
$structure->setTitle(str_replace('<', '', str_replace('>', '', $_POST['headline'])));
|
||||||
|
@ -516,7 +516,7 @@ function updateBasicSettings(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function updateSectionTitles(&$structure) {
|
function updateSectionTitles(PDFStructure &$structure) {
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
foreach ($_POST as $key => $value) {
|
foreach ($_POST as $key => $value) {
|
||||||
if (strpos($key, 'section_') === 0) {
|
if (strpos($key, 'section_') === 0) {
|
||||||
|
@ -531,7 +531,7 @@ function updateSectionTitles(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function addSection(&$structure) {
|
function addSection(PDFStructure &$structure) {
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
// add a new text field
|
// add a new text field
|
||||||
if(isset($_POST['add_text'])) {
|
if(isset($_POST['add_text'])) {
|
||||||
|
@ -570,7 +570,7 @@ function addSection(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function addSectionEntry(&$structure) {
|
function addSectionEntry(PDFStructure &$structure) {
|
||||||
if(isset($_POST['add_new_field'])) {
|
if(isset($_POST['add_new_field'])) {
|
||||||
$field = new PDFSectionEntry($_POST['new_field']);
|
$field = new PDFSectionEntry($_POST['new_field']);
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
|
@ -587,7 +587,7 @@ function addSectionEntry(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function removeItem(&$structure) {
|
function removeItem(PDFStructure &$structure) {
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
foreach ($_POST as $key => $value) {
|
foreach ($_POST as $key => $value) {
|
||||||
// remove section
|
// remove section
|
||||||
|
@ -617,7 +617,7 @@ function removeItem(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function moveUp(&$structure) {
|
function moveUp(PDFStructure &$structure) {
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
foreach ($_POST as $key => $value) {
|
foreach ($_POST as $key => $value) {
|
||||||
// move section
|
// move section
|
||||||
|
@ -649,7 +649,7 @@ function moveUp(&$structure) {
|
||||||
*
|
*
|
||||||
* @param PDFStructure $structure
|
* @param PDFStructure $structure
|
||||||
*/
|
*/
|
||||||
function moveDown(&$structure) {
|
function moveDown(PDFStructure &$structure) {
|
||||||
$sections = $structure->getSections();
|
$sections = $structure->getSections();
|
||||||
foreach ($_POST as $key => $value) {
|
foreach ($_POST as $key => $value) {
|
||||||
// move section
|
// move section
|
||||||
|
|
|
@ -14,6 +14,7 @@ use \htmlOutputText;
|
||||||
use \htmlHelpLink;
|
use \htmlHelpLink;
|
||||||
use \htmlHiddenInput;
|
use \htmlHiddenInput;
|
||||||
use \htmlInputField;
|
use \htmlInputField;
|
||||||
|
use \LAM\TYPES\TypeManager;
|
||||||
/*
|
/*
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ if (!empty($_POST)) {
|
||||||
validateSecurityToken();
|
validateSecurityToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeManager = new \LAM\TYPES\TypeManager();
|
$typeManager = new TypeManager();
|
||||||
$types = $typeManager->getConfiguredTypes();
|
$types = $typeManager->getConfiguredTypes();
|
||||||
$profileClasses = array();
|
$profileClasses = array();
|
||||||
$profileClassesTemp = array();
|
$profileClassesTemp = array();
|
||||||
|
@ -274,7 +275,7 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
|
||||||
$scope = $profileClasses[$i]['scope'];
|
$scope = $profileClasses[$i]['scope'];
|
||||||
$importOptions = array();
|
$importOptions = array();
|
||||||
foreach ($configProfiles as $profile) {
|
foreach ($configProfiles as $profile) {
|
||||||
$typeManagerImport = new \LAM\TYPES\TypeManager($serverProfiles[$profile]);
|
$typeManagerImport = new TypeManager($serverProfiles[$profile]);
|
||||||
$typesImport = $typeManagerImport->getConfiguredTypesForScope($scope);
|
$typesImport = $typeManagerImport->getConfiguredTypesForScope($scope);
|
||||||
foreach ($typesImport as $typeImport) {
|
foreach ($typesImport as $typeImport) {
|
||||||
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
|
if (($profile != $_SESSION['config']->getName()) || ($typeImport->getId() != $typeId)) {
|
||||||
|
@ -329,7 +330,7 @@ for ($i = 0; $i < sizeof($profileClasses); $i++) {
|
||||||
$container->addElement(new htmlOutputText(_("Target server profile")), true);
|
$container->addElement(new htmlOutputText(_("Target server profile")), true);
|
||||||
$exportOptions = array();
|
$exportOptions = array();
|
||||||
foreach ($configProfiles as $profile) {
|
foreach ($configProfiles as $profile) {
|
||||||
$typeManagerExport = new \LAM\TYPES\TypeManager($serverProfiles[$profile]);
|
$typeManagerExport = new TypeManager($serverProfiles[$profile]);
|
||||||
$typesExport = $typeManagerExport->getConfiguredTypesForScope($scope);
|
$typesExport = $typeManagerExport->getConfiguredTypesForScope($scope);
|
||||||
foreach ($typesExport as $typeExport) {
|
foreach ($typesExport as $typeExport) {
|
||||||
if (($profile != $_SESSION['config']->getName()) || ($typeExport->getId() != $typeId)) {
|
if (($profile != $_SESSION['config']->getName()) || ($typeExport->getId() != $typeId)) {
|
||||||
|
@ -385,15 +386,15 @@ include '../main_footer.php';
|
||||||
* @param string $typeId type id
|
* @param string $typeId type id
|
||||||
* @param array $options options
|
* @param array $options options
|
||||||
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
||||||
* @param \LAM\TYPES\TypeManager $typeManager type manager
|
* @param TypeManager $typeManager type manager
|
||||||
* @return \htmlStatusMessage message or null
|
* @return \htmlStatusMessage message or null
|
||||||
*/
|
*/
|
||||||
function importProfiles($typeId, $options, &$serverProfiles, &$typeManager) {
|
function importProfiles($typeId, $options, &$serverProfiles, TypeManager &$typeManager) {
|
||||||
foreach ($options as $option) {
|
foreach ($options as $option) {
|
||||||
$sourceConfName = $option['conf'];
|
$sourceConfName = $option['conf'];
|
||||||
$sourceTypeId = $option['typeId'];
|
$sourceTypeId = $option['typeId'];
|
||||||
$sourceName = $option['name'];
|
$sourceName = $option['name'];
|
||||||
$sourceTypeManager = new \LAM\TYPES\TypeManager($serverProfiles[$sourceConfName]);
|
$sourceTypeManager = new TypeManager($serverProfiles[$sourceConfName]);
|
||||||
$sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId);
|
$sourceType = $sourceTypeManager->getConfiguredType($sourceTypeId);
|
||||||
$targetType = $typeManager->getConfiguredType($typeId);
|
$targetType = $typeManager->getConfiguredType($typeId);
|
||||||
if (($sourceType != null) && ($targetType != null)) {
|
if (($sourceType != null) && ($targetType != null)) {
|
||||||
|
@ -415,10 +416,10 @@ function importProfiles($typeId, $options, &$serverProfiles, &$typeManager) {
|
||||||
* @param string $name profile name
|
* @param string $name profile name
|
||||||
* @param array $options options
|
* @param array $options options
|
||||||
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
* @param \LAMConfig[] $serverProfiles server profiles (name => profile object)
|
||||||
* @param \LAM\TYPES\TypeManager $typeManager type manager
|
* @param TypeManager $typeManager type manager
|
||||||
* @return \htmlStatusMessage message or null
|
* @return \htmlStatusMessage message or null
|
||||||
*/
|
*/
|
||||||
function exportProfiles($typeId, $name, $options, &$serverProfiles, &$typeManager) {
|
function exportProfiles($typeId, $name, $options, &$serverProfiles, TypeManager &$typeManager) {
|
||||||
$sourceType = $typeManager->getConfiguredType($typeId);
|
$sourceType = $typeManager->getConfiguredType($typeId);
|
||||||
if ($sourceType == null) {
|
if ($sourceType == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -435,7 +436,7 @@ function exportProfiles($typeId, $name, $options, &$serverProfiles, &$typeManage
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$targetTypeId = $option['typeId'];
|
$targetTypeId = $option['typeId'];
|
||||||
$targetTypeManager = new \LAM\TYPES\TypeManager($serverProfiles[$targetConfName]);
|
$targetTypeManager = new TypeManager($serverProfiles[$targetConfName]);
|
||||||
$targetType = $targetTypeManager->getConfiguredType($targetTypeId);
|
$targetType = $targetTypeManager->getConfiguredType($targetTypeId);
|
||||||
if ($targetType != null) {
|
if ($targetType != null) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -282,7 +282,7 @@ include '../main_footer.php';
|
||||||
* @param array $selectedModules selected modules for upload
|
* @param array $selectedModules selected modules for upload
|
||||||
* @param htmlTable $container table container
|
* @param htmlTable $container table container
|
||||||
*/
|
*/
|
||||||
function massPrintBackButton($typeId, $selectedModules, &$container) {
|
function massPrintBackButton($typeId, $selectedModules, htmlTable &$container) {
|
||||||
$backButton = new htmlButton('submit', _('Back'));
|
$backButton = new htmlButton('submit', _('Back'));
|
||||||
$backButton->setIconClass('backButton');
|
$backButton->setIconClass('backButton');
|
||||||
$container->addElement($backButton);
|
$container->addElement($backButton);
|
||||||
|
|
|
@ -256,7 +256,7 @@ include '../main_footer.php';
|
||||||
* @param \LAM\TYPES\ConfiguredType $type account type
|
* @param \LAM\TYPES\ConfiguredType $type account type
|
||||||
* @param array $selectedModules list of selected account modules
|
* @param array $selectedModules list of selected account modules
|
||||||
*/
|
*/
|
||||||
function showMainPage($type, $selectedModules) {
|
function showMainPage(\LAM\TYPES\ConfiguredType $type, $selectedModules) {
|
||||||
$scope = $type->getScope();
|
$scope = $type->getScope();
|
||||||
echo '<div class="' . $scope . '-bright smallPaddingContent">';
|
echo '<div class="' . $scope . '-bright smallPaddingContent">';
|
||||||
// get input fields from modules
|
// get input fields from modules
|
||||||
|
|
Loading…
Reference in New Issue