Commit bf3df770 authored by Andreas Pattynama's avatar Andreas Pattynama
Browse files

[FEATURE] Number of constants to show in EditFile now selectable

Added a new field below "Select constant type" to make the number of constants to show selectable
parent c477ef07
......@@ -82,12 +82,13 @@ abstract class AbstractController extends ActionController {
* @param string $languageSelection
* @param string $constantTypeSelection
* @param string $bottomReferenceLanguageSelection
* @param string $numSiteConstsSelection
* @return void
*/
protected function saveSelectionsInSession(
$extensionSelection = NULL, $languageFileSelection = NULL, $referenceLanguageSelection = NULL,
$constantSelection = NULL, $languageSelection = NULL, $constantTypeSelection = NULL,
$bottomReferenceLanguageSelection = NULL
$bottomReferenceLanguageSelection = NULL, $numSiteConstsSelection = NULL
) {
/* Extension/language file select box can't be unselected.
Only situation when $extensionSelection === NULL is when the form is submitted by
......@@ -113,6 +114,9 @@ abstract class AbstractController extends ActionController {
if ($bottomReferenceLanguageSelection) {
$this->session->setDataByKey('bottomReferenceLanguageSelection', $bottomReferenceLanguageSelection);
}
if ($numSiteConstsSelection) {
$this->session->setDataByKey('numSiteConstsSelection', $numSiteConstsSelection);
}
}
/**
......
......@@ -94,16 +94,17 @@ class EditFileController extends AbstractBackendController {
* @param string $referenceLanguageSelection
* @param string $constantTypeSelection
* @param string $bottomReferenceLanguageSelection
* @param string $numSiteConstsSelection
* @throws UnsupportedRequestTypeException
* @return void
*/
public function changeSelectionAction(
$extensionSelection = NULL, $languageFileSelection = NULL, $languageSelection = NULL,
$referenceLanguageSelection = NULL, $constantTypeSelection = NULL, $bottomReferenceLanguageSelection = NULL
$referenceLanguageSelection = NULL, $constantTypeSelection = NULL, $bottomReferenceLanguageSelection = NULL, $numSiteConstsSelection = NULL
) {
$this->saveSelectionsInSession(
$extensionSelection, $languageFileSelection, $referenceLanguageSelection, NULL, $languageSelection,
$constantTypeSelection, $bottomReferenceLanguageSelection
$constantTypeSelection, $bottomReferenceLanguageSelection, $numSiteConstsSelection
);
$this->redirect('editFile', NULL, NULL, array('buttonType' => 0));
}
......@@ -127,7 +128,7 @@ class EditFileController extends AbstractBackendController {
*/
protected function prepareEditFileViewMainSectionContent(array $langData, $buttonType) {
$extConfig = $this->configurationService->getExtConfig();
$numConstantsPerPage = $extConfig['numSiteConsts'];
$numConstantsPerPage = $this->session->getDataByKey('numSiteConstsSelection');
$langList = $this->session->getDataByKey('languageSelection');
$patternList = $this->session->getDataByKey('referenceLanguageSelection');
......@@ -238,6 +239,7 @@ class EditFileController extends AbstractBackendController {
$this->view->assign('constValues', $constValues);
$this->view->assign('curConsts', $sessionLangDataConstantsIterator);
$this->view->assign('totalConsts', $numConsts);
$this->view->assign('numSiteConstsSelection', $numConstantsPerPage);
}
/**
......
......@@ -391,6 +391,9 @@ Tapio Markula --&gt; finnish translation</description>
<trans-unit id="select.referenceLanguage">
<source>Select reference language</source>
</trans-unit>
<trans-unit id="select.numConstants">
<source>Select # of constants to show</source>
</trans-unit>
<trans-unit id="table.backups">
<source>This table lists all backup files of the selected extension.</source>
</trans-unit>
......
{namespace lfe=SGalinski\Lfeditor\ViewHelpers}
<lfe:extendedIf condition="{extensionSelection}" and="{languageFileSelection}">
<h2 class="uppercase">
<f:translate key="select.numConstants" />
</h2>
<f:form.select name="numSiteConstsSelection"
value="{numSiteConstsSelection}"
options="{10: 10, 20: 20, 50: 50, 100: 100, 150: 150, 200: 200}"
additionalAttributes="{onchange: 'submitForm(\'mainMenuForm\')'}"
/>
</lfe:extendedIf>
......@@ -17,6 +17,7 @@
additionalAttributes="{onchange: 'submitForm(\'mainMenuForm\')'}"
/>
</f:if>
<f:render partial="SelectNumConstants" arguments="{_all}"/>
</f:form>
</f:section>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment