Skip to content

Commit

Permalink
[TASK] Further improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
georgringer committed Jan 3, 2018
1 parent 2d9cfc5 commit ad81c77
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
preset: psr2

enabled:
- no_leading_import_slash
- no_trailing_comma_in_singleline_array
- no_singleline_whitespace_before_semicolons
- no_unused_imports
- concat_with_spaces
- no_whitespace_in_blank_line
- ordered_imports
- single_quote
- no_extra_consecutive_blank_lines
- phpdoc_no_package
- phpdoc_scalar
- no_blank_lines_after_phpdoc
- short_array_syntax
- whitespace_after_comma_in_array
- function_typehint_space
- hash_to_slash_comment
- no_alias_functions
- lowercase_cast
- no_leading_namespace_whitespace
- native_function_casing
- no_empty_statement
- self_accessor
- no_short_bool_cast
- no_unneeded_control_parentheses

finder:
name:
- "*.php"
not-path:
- ".Build"
- "Documentation"
12 changes: 10 additions & 2 deletions Classes/Xclass/PaletteAndSingleContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
namespace GeorgRinger\BackendDebug\Xclass;

use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;

class PaletteAndSingleContainer extends \TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer {

/**
* Wrap a single element
*
* @param array $element Given element as documented above
* @param array $additionalPaletteClasses Additional classes to be added to HTML
* @return string Wrapped element
*/
protected function wrapSingleFieldContentWithLabelAndOuterDiv(array $element, array $additionalPaletteClasses = [])
{
$fieldName = $element['fieldName'];
Expand All @@ -22,7 +30,7 @@ protected function wrapSingleFieldContentWithLabelAndOuterDiv(array $element, ar
$label = BackendUtility::wrapInHelp($this->data['tableName'], $fieldName, htmlspecialchars($element['fieldLabel']));

if ($this->getBackendUser()->isAdmin()) {
$label .= '<code>[' . $fieldName . ']</code>';
$label .= '<code>[' . htmlspecialchars($fieldName) . ']</code>';
}
$content = [];
$content[] = '<div class="' . implode(' ', $paletteFieldClasses) . '">';
Expand All @@ -38,7 +46,7 @@ protected function wrapSingleFieldContentWithLabelAndOuterDiv(array $element, ar
/**
* Returns the current BE user.
*
* @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
* @return BackendUserAuthentication
*/
protected function getBackendUser()
{
Expand Down

0 comments on commit ad81c77

Please sign in to comment.