Skip to content

Add additional options#6

Open
DavidBruchmann wants to merge 12 commits into
georgringer:masterfrom
DavidBruchmann:master
Open

Add additional options#6
DavidBruchmann wants to merge 12 commits into
georgringer:masterfrom
DavidBruchmann:master

Conversation

@DavidBruchmann
Copy link
Copy Markdown

@DavidBruchmann DavidBruchmann commented Dec 21, 2019

Additional options are described in the enriched Readme.rst
Used methods are TypoScript and CSS-classes where those can be configured for links.
See #4

@DavidBruchmann
Copy link
Copy Markdown
Author

description concerning b9bcaca should be "add description of TypoScript options"


namespace GeorgRinger\Noopener\Hooks;

ini_set('memory_limit','-1');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't like that too much

$relAttributeArray = $this->defaultRelAttributeArray;
}

if ($this->conf['relAttribute']) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the upper useDefault be just an else part?

$relAttributeArray = array_merge($relAttributeArray, explode(' ', $this->conf['relAttribute']));
}

if ($this->conf['useCssClass'] && isset($params['tagAttributes']['class'])) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason for that? don't get the feature?

}

/**
* initialize some basic variables from TypoScript configuration
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be then in the __construct()

$this->conf = $tsConfig['tx_noopener'];

if (isset($this->conf['useDefaultRelAttribute'])
&& strtolower($this->conf['useDefaultRelAttribute']) === 'false'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check with bool instead of string compare with false

Comment thread Readme.rst
assumed the defaut values shall still be removed the code looks then like this:
::
config.tx_noopener {
useDefaultRelAttribute = false
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either it is the given attributes or fallback, there is no need for a setting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants