Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

DavidBruchmann
Copy link

@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
Author

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

declare(strict_types=1);

namespace GeorgRinger\Noopener\Hooks;

ini_set('memory_limit','-1');
Copy link
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
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
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?

@@ -42,6 +134,22 @@ public function run(array &$params)
}
}
}

/**
* initialize some basic variables from TypoScript configuration
Copy link
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
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

assumed the defaut values shall still be removed the code looks then like this:
::
config.tx_noopener {
useDefaultRelAttribute = false
Copy link
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