Skip to content

Commit

Permalink
Erweiterung um das Feld "Farbe des Link"
Browse files Browse the repository at this point in the history
sofern dies nicht gesetzt ist, z.B. nach dem Updaten, wird der CSS Tag auf initial gesetzt (abwärtskompatibilität)
  • Loading branch information
Markus Schnieder committed May 22, 2018
1 parent c9765d1 commit d8dc962
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion classes/class.consent.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class consent {
var $position;
var $moreinfo;
var $link;
var $target;
var $linkfarbe;
var $btn_fontcolor;
var $btn_bg;

Expand All @@ -37,6 +39,7 @@ public function __construct() {
$this->link = '';
$this->moreinfo = 'Mehr Informationen';
$this->target = '_self';
$this->linkfarbe = 'initial';
}
}

Expand All @@ -55,9 +58,12 @@ public static function removeCookies() {
}

public static function addCookiePopup($content) {
$a = new consent();
$linkfarbe = ($a->linkfarbe != '' ? $a->linkfarbe : 'initial');
$daten = '<style>
.cc-window{opacity:1;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{transition:transform 1s ease}.cc-animate.cc-revoke.cc-top{transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-bottom,.cc-animate.cc-revoke.cc-active.cc-top,.cc-revoke:hover{transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;transition:max-height 1s}
.cc-link,.cc-revoke:hover{text-decoration:underline}.cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}
.cc-link,.cc-revoke:hover{text-decoration:underline}.cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}
.cc-link:active,.cc-link:visited{color:'.$linkfarbe.'}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}
.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-banner{-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{-ms-flex:1;flex:1}.cc-compliance{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-compliance>.cc-btn{-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em}
@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-ms-flex-align:unset;align-items:unset}}
.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block}
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.1.0';
$REX['ADDON']['version'][$mypage] = '1.2.0';
$REX['ADDON']['author'][$mypage] = 'Markus Schnieder';
$REX['ADDON']['supportpage'][$mypage] = 'https://github.com/mschnieder';

Expand Down
5 changes: 5 additions & 0 deletions pages/ausgabe.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
?>
</p>

<p class="rex-form-col-a rex-form-select">
<label for="host" style="width: 240px;">Farbe des Link</label>
<input type="text" name="linkfarbe" value="<?php echo $cfg['linkfarbe'] ?>" style="width: 120px;" />
</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
3 changes: 2 additions & 1 deletion pages/settings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$cfg['moreinfo'] = rex_post('moreinfo', 'string', $consent->moreinfo);
$cfg['link'] = rex_post('link', 'string', $consent->link);
$cfg['target'] = rex_post('target', 'string', $consent->target);
$cfg['linkfarbe'] = rex_post('linkfarbe', 'string', $consent->linkfarbe);

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

if(class_exists('rex_file')) {
Expand Down Expand Up @@ -84,7 +86,6 @@
$target->addOption($val, $id);
}


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

0 comments on commit d8dc962

Please sign in to comment.