PDFFormsAdminController
class PDFFormsAdminController extends BaseAdminController
The PDFFormsAdminController class is the controller that handles all actions of the PDF Forms management interface.
Traits
Properties
protected mixed | $projectDir | from BaseAdminController | |
protected mixed | $translator | from BaseAdminController | |
protected mixed | $kernel | from BaseAdminController | |
protected mixed | $userManager | from BaseAdminController | |
protected mixed | $authorizationChecker | from BaseAdminController | |
protected mixed | $fileUploader | from BaseAdminController | |
protected mixed | $deployer | from BaseAdminController | |
string | $databasesDir | from BaseAdminController | |
string | $simulatorsDir | from BaseAdminController | |
string | $publicDir | from BaseAdminController | |
string | $viewsDir | from BaseAdminController | |
private string | |||
private int | $script |
Methods
Constructor of class BaseAdminController
Returns a JSON response formed with the data of a form and an error message.
Returns the browser engine from the user agent
Populates the list of values of a data item of type choice from a data source.
Populates the list of values of a data item of type choice from a data source where columns are in the given ChoiceSource object.
Returns the formatted value of the data item where the ID is in the first element of the given array.
Replaces all data ID by their corresponding value into the given text.
Prefix with a # and returns the prefixed ID of the data item where the ID is in the first element of the given array.
Replaces all the html tag data containing the ID of a data item by # followed by the ID
Composes a footnote reference string [text^ID(title)] with the elements of the given array.
Replaces all the html tag dfn containing the ID of a footnote by [text^ID(title)]
Replaces all the html tag dfn and data with their text equivalent
Returns the list of available widgets by type (g6k type).
Returns the list of available widgets by form input type.
Retrieves the Data object of a data item of the current simulator by its ID.
Retrieves an action node by its name in the actions tree from the supplied node
Retrieves an action field node in the given fields list for the given current option node
Retrieves an action field option node by its value in the field list of the given action node
Makes a date string from an array [year, month, day], according to the date format.
Return a relative path to a file or directory using base directory.
Run a console command.
Run a streamed console command.
Determines whether the symfony kernel is in development mode or not.
Entry point for the route paths begining by /admin/pdfforms
Dispatches the index action to the appropriate processing based on the value of the crud parameter.
Shows the PDF Forms management interface.
Returns the default mapping of a PDF Form
Returns the current mapping of a PDF Form
Constructs the default mapping of a PDF Form
array_merge_recursive does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does. I.e., with array_merge_recursive, this happens (documented behavior):
Makes the header for an action report on PDF Forms
Makes the footer for an action report on PDF Forms
function doCreatePDFForm
function dropPDFForm
function doEditPDFForm
function saveInfo
function getUsedBy
Details
in BaseAdminController at line 150
void
__construct(TranslatorInterface $translator, KernelInterface $kernel, AuthorizationCheckerInterface $authorizationChecker, UserManagerInterface $userManager, FileUploader $fileUploader, Deployer $deployer, mixed $projectDir)
Constructor of class BaseAdminController
in BaseAdminController at line 169
protected Response
errorResponse(array $form, string $error)
Returns a JSON response formed with the data of a form and an error message.
in BaseAdminController at line 189
protected
zip(array $contents)
Zip file creation function.
Makes zip files. Derivated from PhpMyAdmin package The $contents parameter is an array of associative array where keys are : - name: name of the zip - modtime: modification time - data: data to compress
in BaseAdminController at line 264
protected int
unix2DosTime(int $unixtime = 0)
Converts unix time to MS DOS time
in ControllersTrait at line 66
protected void
initialize()
Initialization of common directories
in ControllersTrait at line 81
KernelInterface
getKernel()
Returns the Symfony kernel
in ControllersTrait at line 92
TranslatorInterface
getTranslator()
Returns the translator interface
in ControllersTrait at line 103
bool
hasParameter($parameters)
Checks if a parameter exists or not
in ControllersTrait at line 119
string
getLocale()
Returns the 'locale' from config parameters
in ControllersTrait at line 130
string
getLanguage()
Returns the 'app_language' from config parameters
in ControllersTrait at line 142
protected string
getBrowserEngine(Request $request)
Returns the browser engine from the user agent
in ControllersTrait at line 187
protected string|null
formatParamValue(Parameter $param)
Formats a source parameter value
in ControllersTrait at line 247
protected DataSource
getDatasource(Source $source)
Returns the data source accessed by a source query
in ControllersTrait at line 265
mixed
processSource(Source $source)
Process a source query and returns the result of that query.
in ControllersTrait at line 442
void
populateChoiceWithSource(Data $data)
Populates the list of values of a data item of type choice from a data source.
in ControllersTrait at line 466
protected void
populateChoice(Data $data, ChoiceSource $choiceSource)
Populates the list of values of a data item of type choice from a data source where columns are in the given ChoiceSource object.
in ControllersTrait at line 505
protected string
replaceVariable(array $matches)
Returns the formatted value of the data item where the ID is in the first element of the given array.
If the second element of the given array is 'L' and if the data item is a choice, the label is returned instead of the value.
in ControllersTrait at line 559
RichText|string
replaceVariables(RichText|string $target)
Replaces all data ID by their corresponding value into the given text.
in ControllersTrait at line 587
protected string
replaceDataTag(array $matches)
Prefix with a # and returns the prefixed ID of the data item where the ID is in the first element of the given array.
in ControllersTrait at line 604
RichText|string
replaceDataTagByVariable(RichText|string $target)
Replaces all the html tag data containing the ID of a data item by # followed by the ID
in ControllersTrait at line 627
protected string
replaceDfnTag(array $matches)
Composes a footnote reference string [text^ID(title)] with the elements of the given array.
in ControllersTrait at line 643
RichText|string
replaceDfnTagByFootnote(RichText|string $target)
Replaces all the html tag dfn containing the ID of a footnote by [text^ID(title)]
in ControllersTrait at line 666
string
replaceSpecialTags(string $target)
Replaces all the html tag dfn and data with their text equivalent
in ControllersTrait at line 679
array
getWidgets()
Returns the list of available widgets.
in ControllersTrait at line 696
array
getWidgetsByType()
Returns the list of available widgets by type (g6k type).
in ControllersTrait at line 726
array
getWidgetsByInputType()
Returns the list of available widgets by form input type.
in ControllersTrait at line 756
array
getFunctions()
Returns the label of available functions.
in ControllersTrait at line 783
Data|null
getDataById(int $id)
Retrieves the Data object of a data item of the current simulator by its ID.
in ControllersTrait at line 796
array|null
findAction(string $name, array $fromNode)
Retrieves an action node by its name in the actions tree from the supplied node
in ControllersTrait at line 814
array|null
findActionField(array $fields, array $currentNode)
Retrieves an action field node in the given fields list for the given current option node
in ControllersTrait at line 837
array|null
findActionOption(string $name, string $value, array $node)
Retrieves an action field option node by its value in the field list of the given action node
in ControllersTrait at line 860
protected string|null
makeDateString(array $dateArray)
Makes a date string from an array [year, month, day], according to the date format.
in ControllersTrait at line 898
private String
getRelativePath(String $base, String $path)
Return a relative path to a file or directory using base directory.
in ControllersTrait at line 916
private bool
runConsoleCommand(array $command, array|null $report = null)
Run a console command.
in ControllersTrait at line 954
private StreamedResponse
runStreamedConsoleCommand(array $command, callable $start, callable $end)
Run a streamed console command.
in ControllersTrait at line 980
bool
isDevelopmentEnvironment()
Determines whether the symfony kernel is in development mode or not.
in ControllersTrait at line 991
string
getEnvironment()
Returns the current environment
at line 83
Response|RedirectResponse
index(Request $request, string|null $pdf = null, string|null $crud = null)
Entry point for the route paths begining by /admin/pdfforms
These route paths are :
- /admin/pdfforms
- /admin/pdfforms/{pdf}
- /admin/pdfforms/{pdf}/{crud}
at line 103
protected Response|RedirectResponse
runIndex(Request $request, string|null $pdfform, string|null $crud)
Dispatches the index action to the appropriate processing based on the value of the crud parameter.
If the crud parameter contains no value, shows the views management interface.
at line 126
protected Response
showPDFForms(Request $request, string|null $pdfform, string|null $crud)
Shows the PDF Forms management interface.
at line 220
protected array
getDefaultMapping(string $pdfform)
Returns the default mapping of a PDF Form
at line 240
protected array
getCurrentMapping(string $pdfform)
Returns the current mapping of a PDF Form
at line 260
protected array
makeDefaultMapping(AcroForm $acroform)
Constructs the default mapping of a PDF Form
at line 289
private array
deepArrayMerge(array $array1, array $array2)
array_merge_recursive does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does. I.e., with array_merge_recursive, this happens (documented behavior):
at line 310
protected string
makeReportHeader(Request $request, string $pdfform, string $heading)
Makes the header for an action report on PDF Forms
at line 346
protected string
makeReportFooter(Request $request, string $pdfform)
Makes the footer for an action report on PDF Forms
at line 369
protected RedirectResponse|StreamedResponse
doCreatePDFForm(Request $request, mixed $form)
function doCreatePDFForm
at line 420
protected RedirectResponse|StreamedResponse
dropPDFForm(Request $request, mixed $pdfform)
function dropPDFForm
at line 459
protected RedirectResponse
doEditPDFForm(mixed $request, mixed $form, mixed $pdfform)
function doEditPDFForm
at line 485
private void
saveInfo(mixed $pdfform, mixed $category, mixed $title, mixed $mapping)
function saveInfo
at line 506
private mixed
getUsedBy(mixed $pdfform)
function getUsedBy
get the value of usedBy