-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional options #6
base: master
Are you sure you want to change the base?
Conversation
description concerning b9bcaca should be "add description of TypoScript options" |
declare(strict_types=1); | ||
|
||
namespace GeorgRinger\Noopener\Hooks; | ||
|
||
ini_set('memory_limit','-1'); |
There was a problem hiding this comment.
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']) { |
There was a problem hiding this comment.
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'])) { |
There was a problem hiding this comment.
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?
@@ -42,6 +134,22 @@ public function run(array &$params) | |||
} | |||
} | |||
} | |||
|
|||
/** | |||
* initialize some basic variables from TypoScript configuration |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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
assumed the defaut values shall still be removed the code looks then like this: | ||
:: | ||
config.tx_noopener { | ||
useDefaultRelAttribute = false |
There was a problem hiding this comment.
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
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