Skip to content
Snippets Groups Projects
Commit ba8ac11a authored by damjan's avatar damjan
Browse files

[BUGFIX] Showing 'TypoScript group' and rename Typo3Group -> 'TypoScript group'

parent 6b69b43e
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ class TsrefController extends \TYPO3\Flow\Mvc\Controller\ActionController {
$properties = $this->tsrefRestService->getPropertiesByParentId($selectedType->id);
$this->view->assign('properties', $properties);
$this->view->assign('selectedType', $selectedType);
$this->view->assign('typo3Groups', $this->tsrefRestService->getAllTypo3Groups());
// If the type extends a type (superType), the superType name is being fetched among other fields
if (isset($selectedType->parent_id)) {
......@@ -111,10 +112,9 @@ class TsrefController extends \TYPO3\Flow\Mvc\Controller\ActionController {
}
$this->prepareTypeMenu($theType->getUrlName(), $typo3Version);
$typo3Groups = $this->tsrefRestService->getAllTypo3Groups();
$selectMenuTypes = $this->tsrefRestService->getTypesWithNull($typo3Version);
$this->view->assign('typo3Groups', $typo3Groups);
$this->view->assign('typo3Groups', $this->tsrefRestService->getAllTypo3Groups());
$this->view->assign('theType', $theType);
$this->view->assign('editForm', ($typeId !== NULL));
$this->view->assign('selectMenuTypes', $selectMenuTypes);
......@@ -169,10 +169,9 @@ class TsrefController extends \TYPO3\Flow\Mvc\Controller\ActionController {
$parentType = $this->tsrefRestService->getAttributeById($parentTypeId);
$this->prepareTypeMenu(($parentType ? $parentType->urlName : NULL), $typo3Version);
$typo3Groups = $this->tsrefRestService->getAllTypo3Groups();
$selectMenuTypes = Conversion::toAssociativeIdArray($this->tsrefRestService->getTypes(TRUE, $typo3Version));
$this->view->assign('typo3Groups', $typo3Groups);
$this->view->assign('typo3Groups', $this->tsrefRestService->getAllTypo3Groups());
$this->view->assign('theProperty', $theProperty);
$this->view->assign('editForm', ($thePropertyId !== NULL));
$this->view->assign('selectMenuTypes', $selectMenuTypes);
......
<?php
namespace SGalinski\TypoScriptReferenceFrontend\ViewHelpers;
use TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Class AccessArrayViewHelper renders value of the specified array at the specified index position.
*
* @package SGalinski\TypoScriptReferenceFrontend\ViewHelpers
*/
class AccessArrayViewHelper extends AbstractViewHelper {
/**
* Renders content of $array's element with index $index
*
* @param array $array
* @param string|int $index
*/
public function render(array $array, $index) {
return $array[$index];
  • @sgalinski If fluid already has view helper for this, let me know, pls. I couldn't find it. I know that you can access array element in fluid if you know index value {array.index}, but I think that there is no way to access array value if you have index as variable.

  • Owner

    Fabi said that this is the way to go.

  • :thumbsup:

  • Please register or sign in to reply
}
}
......@@ -31,9 +31,9 @@
</div>
<div class="form-group">
<label for="typo3Group" class="col-sm-2 control-label">Typo3Group</label>
<label for="typoScriptGroup" class="col-sm-2 control-label">TypoScript Group</label>
<div class="col-sm-10">
<f:form.select property="typo3Group" options="{typo3Groups}" id="typo3Group" class="form-control" />
<f:form.select property="typo3Group" options="{typo3Groups}" id="typoScriptGroup" class="form-control" />
</div>
</div>
\ No newline at end of file
{namespace sg=SGalinski\TypoScriptReferenceFrontend\ViewHelpers}
<f:layout name="Default" />
<f:section name="Javascripts"></f:section>
......@@ -40,6 +42,14 @@
<td class="table-left-col"><h4>TYPO3 version range</h4></td>
<td class="table-right-col">{selectedType.minVersion} - {f:if( condition: '{selectedType.maxVersion}', then: '{selectedType.maxVersion}', else: 'current')}</td>
</tr>
<tr class="no-borders">
<td class="table-left-col"><h4>TypoScript Group</h4></td>
<td class="table-right-col">
<sg:accessArray array="{typo3Groups}" index="{selectedType.typo3Group}" />
</td>
</tr>
<tr class="no-borders">
<td class="table-left-col"><h4>Extends</h4></td>
<td class="table-right-col">
......@@ -102,6 +112,14 @@
- {f:if( condition: '{propertyIterator.property.maxVersion}', then: '{propertyIterator.property.maxVersion}', else: 'current')}
</td>
</tr>
<tr class="no-borders">
<td class="table-left-col"><h4>TypoScript Group</h4></td>
<td class="table-right-col">
<sg:accessArray array="{typo3Groups}" index="{propertyIterator.property.typo3Group}" />
</td>
</tr>
<tr class="no-borders">
<td class="table-left-col"><h4>Type</h4></td>
<td class="table-right-col">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment