Skip to content
Permalink
Browse files

Add Target function

  • Loading branch information...
nielsnuebel committed Jun 4, 2018
1 parent 0b3c023 commit bcef84077a8689f76ad6602e53518ec888e75d69
Showing with 18 additions and 9 deletions.
  1. +12 −2 kickgdpr.php
  2. +1 −1 kickgdpr.xml
  3. +3 −4 langlinks.xml
  4. +2 −2 update.xml
@@ -158,6 +158,7 @@ public function onBeforeCompileHead()
$expiryDays = $this->params->get('expiryDays', 365);
$customcode = $this->params->get('customcode', false);
$customcss = $this->params->get('customcss', false);
$target = $this->params->get('target', '_blank');
$message = $this->_prepareMessageText($message);
@@ -173,8 +174,14 @@ public function onBeforeCompileHead()
{
$href = $lang_link->link;
$link_url = $lang_link->link_url;
$target = $lang_link->link_url_target;
$href = (isset($href) && '' != $href) ? JRoute::_("index.php?Itemid={$href}") : false;
$href = (isset($link_url) && '' != $link_url && !$href) ? $link_url : $href;
if ($target == "")
{
$target = '_blank';
}
}
}
}
@@ -226,6 +233,9 @@ public function onBeforeCompileHead()
$js[] = ' "cookie": {';
$js[] = ' "expiryDays": ' . (int) $expiryDays;
$js[] = ' },';
$js[] = ' "elements": {';
$js[] = ' "messagelink": \'<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="' . JText::_($href) . '" target="' . $target . '">{{link}}</a></span>\'';
$js[] = ' },';
$js[] = ' onInitialise: function (status) {';
$js[] = ' handleCookies(status);';
$js[] = ' },';
@@ -321,7 +331,7 @@ public function onBeforeCompileHead()
$js[] = ' ' . $trigger_content;
$js[] = ' // End Plugin Trigger Code';
}
// $js[] = 'PUT your Code here';
// $js[] = 'PUT your Code here';
if ($type != '' && ($type == 'opt-out' || $type == 'opt-in'))
{
@@ -422,7 +432,7 @@ protected function _prepareMessageText($message)
}
/**
* Plugin Trigger
* Plugin Trigger
*
* @param string $cookieConsentCode
*/
@@ -7,7 +7,7 @@
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>info@kicktemp.com</authorEmail>
<authorUrl>www.kicktemp.com</authorUrl>
<version>2.2.4</version>
<version>2.3.0</version>
<description>PLG_SYSTEM_KICKGDPR_XML_DESCRIPTION</description>
<files>
<folder>language</folder>
@@ -23,12 +23,11 @@
/>
<field name="link_url_target"
type="list"
default="0"
default="_blank"
label="PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_LABEL"
description="PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_DESC">
<option value="">JSELECT</option>
<option value="0">PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_NEW</option>
<option value="1">PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_SAME</option>
<option value="_blank">PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_NEW</option>
<option value="_self">PLG_SYSTEM_KICKGDPR_LEARNMORE_LINK_URL_TARGET_SAME</option>
</field>
</fieldset>
</form>
@@ -7,10 +7,10 @@
<type>plugin</type>
<folder>system</folder>
<client>0</client>
<version>2.2.4</version>
<version>2.3.0</version>
<infourl title="KickGDPR Plugin">https://github.com/nielsnuebel/kickgdpr/</infourl>
<downloads>
<downloadurl type="upgrade" format="zip">https://github.com/nielsnuebel/kickgdpr/archive/2.2.4.zip</downloadurl>
<downloadurl type="upgrade" format="zip">https://github.com/nielsnuebel/kickgdpr/archive/2.3.0.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

0 comments on commit bcef840

Please sign in to comment.
You can’t perform that action at this time.