Skip to content

Commit

Permalink
Merge pull request #210 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
v1.23.0
  • Loading branch information
cassandre authored Jul 26, 2022
2 parents f7942bc + f5603c4 commit 33ca576
Show file tree
Hide file tree
Showing 20 changed files with 2,810 additions and 727 deletions.
14 changes: 14 additions & 0 deletions assets/css/_absatzklassen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,17 @@
color: $medium-blue;
}
}

.notice-thumbs-up {
@extend .fa-thumbs-up !optional;
&::before {
color: $green;
}
}
.notice-thumbs-down {
@extend .fa-thumbs-down !optional;
&::before {
color: $red;
}
}

16 changes: 16 additions & 0 deletions assets/css/_icons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
a {
& > i.fa.rrze-elements-icon {
padding: .2em .2em .15em;
border-radius: 50%;
color: var(--color-button-bg, #1f4c7a);
}
&:has(i.fa.rrze-elements-icon) {
box-shadow: none; // fix für FAU-Themes
}
}
a:hover, a:focus, a:active {
& > i.fa.rrze-elements-icon {
background-color: var(--color-button-bg, #1f4c7a);
color: var(--color-button-text, #ffffff);
}
}
6 changes: 2 additions & 4 deletions assets/css/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ Functions and Mixins
@function px2rem($font-size, $base-font-size: 16) {
@return $font-size / $base-font-size + rem;
}
@mixin px2rem($font-size, $line: $font-size * 1.4, $base-font-size: 16) {
font-size: $font-size + px; // für den IE8
line-height: ($line) + px;
@mixin px2rem($font-size, $line: 1.5, $base-font-size: 16) {
font-size: px2rem($font-size, $base-font-size);
line-height: ($line / $base-font-size) + rem;
line-height: $line;
}

@mixin border-radius($radius) {
Expand Down
12 changes: 7 additions & 5 deletions assets/css/_timeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,15 @@
text-align: center;
position: relative;
&:before {
@extend .fa;
@extend .fa-circle;
@extend .fa-xs;
content: '';
display: block;
border-radius: 50%;
height: 10px;
width: 10px;
background-color: #666;
position: absolute;
left: 45%;
bottom: -1px;
bottom: 0;
color: #666;
z-index: 1;
}
Expand All @@ -72,7 +75,6 @@
padding-bottom: 10px;
text-decoration: none;
opacity: 0.7;
text-decoration: none;
-webkit-transition: 0.5s;
-moz-transition: 0.5s;
-o-transition: 0.5s;
Expand Down
26 changes: 13 additions & 13 deletions assets/css/rrze-elements.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/rrze-elements.css.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion assets/css/rrze-elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@
@import "symbols";

// LaTeX
@import "latex";
@import "latex";

//Font-Awesome-Icons
@import "icons";
Binary file modified assets/fonts/fontawesome/FontAwesome.otf
Binary file not shown.
Binary file modified assets/fonts/fontawesome/fontawesome-webfont.eot
Binary file not shown.
3,350 changes: 2,668 additions & 682 deletions assets/fonts/fontawesome/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/fonts/fontawesome/fontawesome-webfont.ttf
Binary file not shown.
Binary file modified assets/fonts/fontawesome/fontawesome-webfont.woff
Binary file not shown.
Binary file modified assets/fonts/fontawesome/fontawesome-webfont.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion includes/Accordion/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static function enqueueScripts() {
plugins_url('assets/js/rrze-accordion.min.js', plugin_basename(__FILE__)),
//plugins_url('assets/js/rrze-accordion.js', plugin_basename(__FILE__)),
['jquery', 'wp-i18n'],
'1.0.0'
'1.23.0'
);
}

Expand Down
46 changes: 46 additions & 0 deletions includes/Icon/Icon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace RRZE\Elements\Icon;

defined('ABSPATH') || exit;
class Icon {

public function __construct() {
add_shortcode( 'icon', [ $this, 'shortcodeIcon' ] );
}

public function shortcodeIcon($atts, $content = '', $tag = '') {
$defaults = [
'icon' => '',
'style' => '',
'color' => ''];
$args = shortcode_atts($defaults, $atts);
array_walk($args, 'sanitize_text_field');
if ($args['icon'] == '') return '';
$styles = array_map('trim', explode(',', $args['style']));
$styleParams = '';
foreach ($styles as $style) {
if (in_array($style, ['2x', '3x', '4x', '5x', 'border', 'pull-right', 'pull-left']) ) {
$styleParams .= ' fa-'. $style;
}
}
$inlineCSS = '';
if (in_array($args['color'], ['fau', 'zuv', 'phil', 'nat', 'med', 'rw', 'tf']) ) {
// FAU Theme Colors
if ($args['color'] == 'fau' || $args['color'] == 'zuv') {
$args['color'] = 'zentral';
}
$inlineCSS = 'style="color: var(--color-'.$args['color'].'-basis, #04316A);"';
} elseif (strlen($args['color']) == 7 && strpos($args['color'], '#') == 0) {
// Hex Colors
$inlineCSS = 'style="color: '.$args['color'].';"';
}
$output = '<i class="rrze-elements-icon fa fa-'.$args['icon'].' ' . $styleParams . '" ' . $inlineCSS . 'aria-hidden="true" ></i>';

wp_enqueue_style('fontawesome');
wp_enqueue_style('rrze-elements');

return $output;

}
}
4 changes: 3 additions & 1 deletion includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use RRZE\Elements\HiddenText\HiddenText;
use RRZE\Elements\Gallery\Gallery;
use RRZE\Elements\Symbols\Symbols;
use RRZE\Elements\Icon\Icon;

/**
* [Main description]
Expand Down Expand Up @@ -63,7 +64,8 @@ public function __construct($pluginFile)
new HiddenText();
new LegalText();
new Assistant();
new Symbols();
new Symbols();
new Icon();

$theme = wp_get_theme();
if (in_array($theme->get('Name'), ['FAU Events', 'RRZE 2019'])) {
Expand Down
44 changes: 29 additions & 15 deletions includes/News/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function shortcodeCustomNews($atts) {
'fau_settings' => 'false',
'forcelandscape' => 'false',
'force_landscape' => 'false',
'sticky_only' => 'false'
], $atts);
$sc_atts = array_map('sanitize_text_field', $sc_atts);

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

$borderTop = '';
if ($sc_atts['fau_settings'] == 'true') {
Expand Down Expand Up @@ -128,6 +130,9 @@ function ($post_ID) {
'posts_per_page' => $num,
'ignore_sticky_posts' => 1
];
if ($stickyOnly === true) {
$args['post__in'] = get_option( 'sticky_posts' );
}

$c_id = [];
if ($cat != '') {
Expand Down Expand Up @@ -292,6 +297,7 @@ function ($post_ID) {
'postCols' => $postCols,
'thumbnailSize' => $thumbnailSize,
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= do_shortcode('[column]' . $this->display_news_teaser($args) . '[/column]');
} elseif (!empty($postCols)) {
Expand All @@ -307,6 +313,7 @@ function ($post_ID) {
'postCols' => $postCols,
'thumbnailSize' => $thumbnailSize,
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= do_shortcode($this->display_news_teaser($args));
} else {
Expand All @@ -321,6 +328,7 @@ function ($post_ID) {
'hstart' => $hstart,
'imgfloat' => $imgfloat,
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= do_shortcode($this->display_news_teaser($args));
}
Expand All @@ -335,6 +343,7 @@ function ($post_ID) {
'hstart' => $hstart,
'imgfloat' => $imgfloat,
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= $this->display_news_teaser($args);
}
Expand All @@ -349,6 +358,7 @@ function ($post_ID) {
'imgFirst' => $imgFirst,
'postCols' => $postCols,
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= $this->display_news_teaser($args);
}
Expand Down Expand Up @@ -470,21 +480,25 @@ private function display_news_teaser($argsRaw) {

if(!in_array('teaser', $hide)) {
// Content
$abstract = get_post_meta( $id, 'abstract', true );
if (strlen(trim($abstract))<3) {
if (function_exists('fau_custom_excerpt')) {
$abstract = fau_custom_excerpt($id, get_theme_mod('default_anleser_excerpt_length'),false,'',true, get_theme_mod('search_display_excerpt_morestring'));
if (function_exists('fau_create_readmore')) {
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
}
} else {
$abstract = get_the_excerpt($id);
}
} else {
if (function_exists('fau_create_readmore')) {
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
}
}
if ($args['showContent'] == true) {
$abstract = get_the_content(null, false, $id);
} else {
$abstract = get_post_meta( $id, 'abstract', true );
if (strlen(trim($abstract))<3) {
if (function_exists('fau_custom_excerpt')) {
$abstract = fau_custom_excerpt($id, get_theme_mod('default_anleser_excerpt_length'),false,'',true, get_theme_mod('search_display_excerpt_morestring'));
if (function_exists('fau_create_readmore')) {
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
}
} else {
$abstract = get_the_excerpt($id);
}
} else {
if (function_exists('fau_create_readmore')) {
$abstract .= fau_create_readmore($permalink, get_the_title(), false, true);
}
}
}
$output .= '<div class="entry-content" itemprop="description">' . $abstract . '</div>';
}
if ($columns) {
Expand Down
4 changes: 3 additions & 1 deletion includes/Notice/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function __construct()
add_shortcode('notice-audio', [$this, 'shortcodeNotice']);
add_shortcode('notice-download', [$this, 'shortcodeNotice']);
add_shortcode('notice-faubox', [$this, 'shortcodeNotice']);
add_shortcode('notice-thumbs-up', [$this, 'shortcodeNotice']);
add_shortcode('notice-thumbs-down', [$this, 'shortcodeNotice']);
/* Für die Abwärtskompatibilität der bereits in FAU-Einrichtungen
* abwärtskompatiblen Shortcodes noch folgendes: */
add_shortcode('attention', [$this, 'shortcodeNotice']);
Expand All @@ -50,7 +52,7 @@ public function shortcodeNotice($atts, $content = '', $tag = '')
'hstart' => '3'
], $atts));

$tag_array = explode('-', $tag);
$tag_array = explode('-', $tag, 2);

if (count($tag_array) > 1) {
$type = $tag_array[1];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrze-elements",
"version": "1.22.11",
"version": "1.23.0",
"description": "RRZE Elements: Gestalterische Erweiterungen für Webauftritte.",
"main": "rrze-elements.php",
"textdomain": "rrze-elements",
Expand Down
4 changes: 2 additions & 2 deletions rrze-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: RRZE Elements
Plugin URI: https://github.com/RRZE-Webteam/rrze-elements
Description: Advanced design elements for WordPress websites.
Version: 1.22.11
Version: 1.23.0
Author: RRZE Webteam
Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2
Expand All @@ -23,7 +23,7 @@

const RRZE_PHP_VERSION = '7.4';
const RRZE_WP_VERSION = '5.9';
const RRZE_ELEMENTS_VERSION = '1.22.9';
const RRZE_ELEMENTS_VERSION = '1.23.0';

spl_autoload_register(function ($class) {
$prefix = __NAMESPACE__;
Expand Down

0 comments on commit 33ca576

Please sign in to comment.