Skip to content

Commit 33ca576

Browse files
authored
Merge pull request #210 from RRZE-Webteam/dev
v1.23.0
2 parents f7942bc + f5603c4 commit 33ca576

20 files changed

+2810
-727
lines changed

assets/css/_absatzklassen.scss

+14
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,17 @@
137137
color: $medium-blue;
138138
}
139139
}
140+
141+
.notice-thumbs-up {
142+
@extend .fa-thumbs-up !optional;
143+
&::before {
144+
color: $green;
145+
}
146+
}
147+
.notice-thumbs-down {
148+
@extend .fa-thumbs-down !optional;
149+
&::before {
150+
color: $red;
151+
}
152+
}
153+

assets/css/_icons.scss

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
a {
2+
& > i.fa.rrze-elements-icon {
3+
padding: .2em .2em .15em;
4+
border-radius: 50%;
5+
color: var(--color-button-bg, #1f4c7a);
6+
}
7+
&:has(i.fa.rrze-elements-icon) {
8+
box-shadow: none; // fix für FAU-Themes
9+
}
10+
}
11+
a:hover, a:focus, a:active {
12+
& > i.fa.rrze-elements-icon {
13+
background-color: var(--color-button-bg, #1f4c7a);
14+
color: var(--color-button-text, #ffffff);
15+
}
16+
}

assets/css/_mixins.scss

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ Functions and Mixins
55
@function px2rem($font-size, $base-font-size: 16) {
66
@return $font-size / $base-font-size + rem;
77
}
8-
@mixin px2rem($font-size, $line: $font-size * 1.4, $base-font-size: 16) {
9-
font-size: $font-size + px; // für den IE8
10-
line-height: ($line) + px;
8+
@mixin px2rem($font-size, $line: 1.5, $base-font-size: 16) {
119
font-size: px2rem($font-size, $base-font-size);
12-
line-height: ($line / $base-font-size) + rem;
10+
line-height: $line;
1311
}
1412

1513
@mixin border-radius($radius) {

assets/css/_timeline.scss

+7-5
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@
5252
text-align: center;
5353
position: relative;
5454
&:before {
55-
@extend .fa;
56-
@extend .fa-circle;
57-
@extend .fa-xs;
55+
content: '';
56+
display: block;
57+
border-radius: 50%;
58+
height: 10px;
59+
width: 10px;
60+
background-color: #666;
5861
position: absolute;
5962
left: 45%;
60-
bottom: -1px;
63+
bottom: 0;
6164
color: #666;
6265
z-index: 1;
6366
}
@@ -72,7 +75,6 @@
7275
padding-bottom: 10px;
7376
text-decoration: none;
7477
opacity: 0.7;
75-
text-decoration: none;
7678
-webkit-transition: 0.5s;
7779
-moz-transition: 0.5s;
7880
-o-transition: 0.5s;

assets/css/rrze-elements.css

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/rrze-elements.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/rrze-elements.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,7 @@
5353
@import "symbols";
5454

5555
// LaTeX
56-
@import "latex";
56+
@import "latex";
57+
58+
//Font-Awesome-Icons
59+
@import "icons";
11.4 KB
Binary file not shown.
88.4 KB
Binary file not shown.

assets/fonts/fontawesome/fontawesome-webfont.svg

+2,668-682
Loading
14.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

includes/Accordion/Accordion.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function enqueueScripts() {
172172
plugins_url('assets/js/rrze-accordion.min.js', plugin_basename(__FILE__)),
173173
//plugins_url('assets/js/rrze-accordion.js', plugin_basename(__FILE__)),
174174
['jquery', 'wp-i18n'],
175-
'1.0.0'
175+
'1.23.0'
176176
);
177177
}
178178

includes/Icon/Icon.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace RRZE\Elements\Icon;
4+
5+
defined('ABSPATH') || exit;
6+
class Icon {
7+
8+
public function __construct() {
9+
add_shortcode( 'icon', [ $this, 'shortcodeIcon' ] );
10+
}
11+
12+
public function shortcodeIcon($atts, $content = '', $tag = '') {
13+
$defaults = [
14+
'icon' => '',
15+
'style' => '',
16+
'color' => ''];
17+
$args = shortcode_atts($defaults, $atts);
18+
array_walk($args, 'sanitize_text_field');
19+
if ($args['icon'] == '') return '';
20+
$styles = array_map('trim', explode(',', $args['style']));
21+
$styleParams = '';
22+
foreach ($styles as $style) {
23+
if (in_array($style, ['2x', '3x', '4x', '5x', 'border', 'pull-right', 'pull-left']) ) {
24+
$styleParams .= ' fa-'. $style;
25+
}
26+
}
27+
$inlineCSS = '';
28+
if (in_array($args['color'], ['fau', 'zuv', 'phil', 'nat', 'med', 'rw', 'tf']) ) {
29+
// FAU Theme Colors
30+
if ($args['color'] == 'fau' || $args['color'] == 'zuv') {
31+
$args['color'] = 'zentral';
32+
}
33+
$inlineCSS = 'style="color: var(--color-'.$args['color'].'-basis, #04316A);"';
34+
} elseif (strlen($args['color']) == 7 && strpos($args['color'], '#') == 0) {
35+
// Hex Colors
36+
$inlineCSS = 'style="color: '.$args['color'].';"';
37+
}
38+
$output = '<i class="rrze-elements-icon fa fa-'.$args['icon'].' ' . $styleParams . '" ' . $inlineCSS . 'aria-hidden="true" ></i>';
39+
40+
wp_enqueue_style('fontawesome');
41+
wp_enqueue_style('rrze-elements');
42+
43+
return $output;
44+
45+
}
46+
}

includes/Main.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use RRZE\Elements\HiddenText\HiddenText;
2323
use RRZE\Elements\Gallery\Gallery;
2424
use RRZE\Elements\Symbols\Symbols;
25+
use RRZE\Elements\Icon\Icon;
2526

2627
/**
2728
* [Main description]
@@ -63,7 +64,8 @@ public function __construct($pluginFile)
6364
new HiddenText();
6465
new LegalText();
6566
new Assistant();
66-
new Symbols();
67+
new Symbols();
68+
new Icon();
6769

6870
$theme = wp_get_theme();
6971
if (in_array($theme->get('Name'), ['FAU Events', 'RRZE 2019'])) {

includes/News/News.php

+29-15
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function shortcodeCustomNews($atts) {
5151
'fau_settings' => 'false',
5252
'forcelandscape' => 'false',
5353
'force_landscape' => 'false',
54+
'sticky_only' => 'false'
5455
], $atts);
5556
$sc_atts = array_map('sanitize_text_field', $sc_atts);
5657

@@ -72,6 +73,7 @@ public function shortcodeCustomNews($atts) {
7273
$thumbnailSize = 'post-thumbnail';
7374
$hideDuplicates = ($sc_atts['hideduplicates'] == 'true' || $sc_atts['hide_duplicates'] == 'true') ? true : false;
7475
$forceLandscape = ($sc_atts['forcelandscape'] == 'true' || $sc_atts['force_landscape'] == 'true') ? true : false;
76+
$stickyOnly = ($sc_atts['sticky_only'] == 'true' || $sc_atts['sticky_only'] == 'true') ? true : false;
7577

7678
$borderTop = '';
7779
if ($sc_atts['fau_settings'] == 'true') {
@@ -128,6 +130,9 @@ function ($post_ID) {
128130
'posts_per_page' => $num,
129131
'ignore_sticky_posts' => 1
130132
];
133+
if ($stickyOnly === true) {
134+
$args['post__in'] = get_option( 'sticky_posts' );
135+
}
131136

132137
$c_id = [];
133138
if ($cat != '') {
@@ -292,6 +297,7 @@ function ($post_ID) {
292297
'postCols' => $postCols,
293298
'thumbnailSize' => $thumbnailSize,
294299
'forceLandscape' => $forceLandscape,
300+
'showContent' => (in_array('show_content', $mode) ? true : false),
295301
];
296302
$output .= do_shortcode('[column]' . $this->display_news_teaser($args) . '[/column]');
297303
} elseif (!empty($postCols)) {
@@ -307,6 +313,7 @@ function ($post_ID) {
307313
'postCols' => $postCols,
308314
'thumbnailSize' => $thumbnailSize,
309315
'forceLandscape' => $forceLandscape,
316+
'showContent' => (in_array('show_content', $mode) ? true : false),
310317
];
311318
$output .= do_shortcode($this->display_news_teaser($args));
312319
} else {
@@ -321,6 +328,7 @@ function ($post_ID) {
321328
'hstart' => $hstart,
322329
'imgfloat' => $imgfloat,
323330
'forceLandscape' => $forceLandscape,
331+
'showContent' => (in_array('show_content', $mode) ? true : false),
324332
];
325333
$output .= do_shortcode($this->display_news_teaser($args));
326334
}
@@ -335,6 +343,7 @@ function ($post_ID) {
335343
'hstart' => $hstart,
336344
'imgfloat' => $imgfloat,
337345
'forceLandscape' => $forceLandscape,
346+
'showContent' => (in_array('show_content', $mode) ? true : false),
338347
];
339348
$output .= $this->display_news_teaser($args);
340349
}
@@ -349,6 +358,7 @@ function ($post_ID) {
349358
'imgFirst' => $imgFirst,
350359
'postCols' => $postCols,
351360
'forceLandscape' => $forceLandscape,
361+
'showContent' => (in_array('show_content', $mode) ? true : false),
352362
];
353363
$output .= $this->display_news_teaser($args);
354364
}
@@ -470,21 +480,25 @@ private function display_news_teaser($argsRaw) {
470480

471481
if(!in_array('teaser', $hide)) {
472482
// Content
473-
$abstract = get_post_meta( $id, 'abstract', true );
474-
if (strlen(trim($abstract))<3) {
475-
if (function_exists('fau_custom_excerpt')) {
476-
$abstract = fau_custom_excerpt($id, get_theme_mod('default_anleser_excerpt_length'),false,'',true, get_theme_mod('search_display_excerpt_morestring'));
477-
if (function_exists('fau_create_readmore')) {
478-
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
479-
}
480-
} else {
481-
$abstract = get_the_excerpt($id);
482-
}
483-
} else {
484-
if (function_exists('fau_create_readmore')) {
485-
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
486-
}
487-
}
483+
if ($args['showContent'] == true) {
484+
$abstract = get_the_content(null, false, $id);
485+
} else {
486+
$abstract = get_post_meta( $id, 'abstract', true );
487+
if (strlen(trim($abstract))<3) {
488+
if (function_exists('fau_custom_excerpt')) {
489+
$abstract = fau_custom_excerpt($id, get_theme_mod('default_anleser_excerpt_length'),false,'',true, get_theme_mod('search_display_excerpt_morestring'));
490+
if (function_exists('fau_create_readmore')) {
491+
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
492+
}
493+
} else {
494+
$abstract = get_the_excerpt($id);
495+
}
496+
} else {
497+
if (function_exists('fau_create_readmore')) {
498+
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
499+
}
500+
}
501+
}
488502
$output .= '<div class="entry-content" itemprop="description">' . $abstract . '</div>';
489503
}
490504
if ($columns) {

includes/Notice/Notice.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public function __construct()
2626
add_shortcode('notice-audio', [$this, 'shortcodeNotice']);
2727
add_shortcode('notice-download', [$this, 'shortcodeNotice']);
2828
add_shortcode('notice-faubox', [$this, 'shortcodeNotice']);
29+
add_shortcode('notice-thumbs-up', [$this, 'shortcodeNotice']);
30+
add_shortcode('notice-thumbs-down', [$this, 'shortcodeNotice']);
2931
/* Für die Abwärtskompatibilität der bereits in FAU-Einrichtungen
3032
* abwärtskompatiblen Shortcodes noch folgendes: */
3133
add_shortcode('attention', [$this, 'shortcodeNotice']);
@@ -50,7 +52,7 @@ public function shortcodeNotice($atts, $content = '', $tag = '')
5052
'hstart' => '3'
5153
], $atts));
5254

53-
$tag_array = explode('-', $tag);
55+
$tag_array = explode('-', $tag, 2);
5456

5557
if (count($tag_array) > 1) {
5658
$type = $tag_array[1];

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rrze-elements",
3-
"version": "1.22.11",
3+
"version": "1.23.0",
44
"description": "RRZE Elements: Gestalterische Erweiterungen für Webauftritte.",
55
"main": "rrze-elements.php",
66
"textdomain": "rrze-elements",

rrze-elements.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: RRZE Elements
55
Plugin URI: https://github.com/RRZE-Webteam/rrze-elements
66
Description: Advanced design elements for WordPress websites.
7-
Version: 1.22.11
7+
Version: 1.23.0
88
Author: RRZE Webteam
99
Author URI: https://blogs.fau.de/webworking/
1010
License: GNU General Public License v2
@@ -23,7 +23,7 @@
2323

2424
const RRZE_PHP_VERSION = '7.4';
2525
const RRZE_WP_VERSION = '5.9';
26-
const RRZE_ELEMENTS_VERSION = '1.22.9';
26+
const RRZE_ELEMENTS_VERSION = '1.23.0';
2727

2828
spl_autoload_register(function ($class) {
2929
$prefix = __NAMESPACE__;

0 commit comments

Comments
 (0)