Skip to content

Commit

Permalink
Erweiterung um Zielfensterbasis => target des datenschutz Links
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Schnieder committed May 22, 2018
1 parent 2e53d4d commit c9765d1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion classes/class.consent.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct() {
$this->position = 'unten';
$this->link = '';
$this->moreinfo = 'Mehr Informationen';
$this->target = '_self';
}
}

Expand Down Expand Up @@ -83,7 +84,7 @@ function acceptCookies() {
public function getBanner() {
$d = '<div class="cc-window cc-banner cc-type-info cc-theme-classic '.($this->position == 'oben' ? 'cc-top' : 'cc-bottom').'" id="cookieconsent" style="background: '.$this->bg.';">
<div id="cookieconsent:desc" class="cc-message" style="color: '.$this->fontcolor.'">'.$this->hinweistext.'&nbsp;
<a aria-label="learn more about cookies" role="button" tabindex="0" class="cc-link" href="'.rex_getUrl($this->link).'" target="_blank">'.$this->moreinfo.'</a>
<a aria-label="learn more about cookies" role="button" tabindex="0" class="cc-link" href="'.rex_getUrl($this->link).'" target="'.$this->target.'">'.$this->moreinfo.'</a>
</div>
<div class="cc-compliance" style="border-radius: 5px; background: '.$this->btn_bg.'">
<a tabindex="0" class="cc-btn cc-dismiss" style="border: 0px; color: '.$this->fontcolor.';" href="javascript:acceptCookies();">'.$this->buttontxt.'</a>
Expand Down
2 changes: 1 addition & 1 deletion config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

$REX['ADDON']['name'][$mypage] = 'Cookieconsent';
$REX['ADDON']['perm'][$mypage] = 'cookieconsent[]';
$REX['ADDON']['version'][$mypage] = '1.0.5';
$REX['ADDON']['version'][$mypage] = '1.1.0';
$REX['ADDON']['author'][$mypage] = 'Markus Schnieder';
$REX['ADDON']['supportpage'][$mypage] = 'https://github.com/mschnieder';

Expand Down
9 changes: 9 additions & 0 deletions pages/ausgabe.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@

<p class="rex-form-col-a rex-form-select">
<label for="wordwrap" style="width: 240px;">Link zum Datenschutz</label>
<div style="margin-left: 95px">
<?php
echo $datenschutz->getHtml();
?>
</div>
</p>

<p class="rex-form-col-a rex-form-select">
<label for="wordwrap" style="width: 240px;">Zielfensterbasis</label>
<?php
echo $target->show();
?>
</p>

<p class="rex-form-col-a rex-form-submit">
<input class="rex-form-submit" type="submit" name="btn_save" value="speichern" />
</p>
Expand Down
11 changes: 11 additions & 0 deletions pages/settings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$cfg['position'] = rex_post('position', 'string', $consent->position);
$cfg['moreinfo'] = rex_post('moreinfo', 'string', $consent->moreinfo);
$cfg['link'] = rex_post('link', 'string', $consent->link);
$cfg['target'] = rex_post('target', 'string', $consent->target);

$btn['fontcolor'] = rex_post('btn_fontcolor', 'string', $consent->btn_fontcolor);
$btn['bg'] = rex_post('btn_bg', 'string', $consent->btn_bg);
Expand All @@ -42,6 +43,7 @@
$this->link = ' . var_export($cfg['link'], true) . ';
$this->btn_fontcolor = ' . var_export($btn['fontcolor'], true) . ';
$this->btn_bg = ' . var_export($btn['bg'], true) . ';
$this->target = ' . var_export($cfg['target'], true) . ';
';

if(class_exists('rex_file')) {
Expand Down Expand Up @@ -73,6 +75,15 @@
$datenschutz->setValue($consent->link);
$datenschutz->setAttribute('name', 'link');

$target = new rex_select();
$target->setId('target');
$target->setName('target');
$target->setSize(1);
$target->setSelected($cfg['target']);
foreach(array('_self' => 'gleicher Tab oder Seite (_self)', '_blank' => 'Neuer Tab oder Fenster (_blank)', '_parent' => 'Elternfenster (_parent)', '_top' => 'ganzes Fenster (_top)') as $id => $val) {
$target->addOption($val, $id);
}


if ($message != '') {
echo rex_info($message);
Expand Down

0 comments on commit c9765d1

Please sign in to comment.