Skip to content

Commit

Permalink
Merge pull request #331 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
v1.28.0
  • Loading branch information
cassandre authored Jun 5, 2024
2 parents 4c66b83 + 9e65203 commit 6b6ef78
Show file tree
Hide file tree
Showing 19 changed files with 70 additions and 54 deletions.
23 changes: 11 additions & 12 deletions assets/css/_flexslider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,17 @@ aside .content-slider.flexslider,
border-bottom:none;
color:#1559A6;
}
&:before {
font-family: "FontAwesome";
font-size: 40px;
display: inline-block;
content: '\f104';
&.flex-prev:before {
@include mask-icon(url('../svg/solid/angle-left.svg'), #1559A6, 36px);
position: relative;
left: -8px;
margin-right: 0;
}
&.flex-next:before {
content: '\f105';
@include mask-icon(url('../svg/solid/angle-right.svg'), #1559A6, 36px);
position: relative;
left: 8px;
margin-right: 0;
}
}
.flex-prev {
Expand Down Expand Up @@ -387,11 +390,7 @@ aside .content-slider.flexslider,
}

&:before {
font-family: "FontAwesome";
font-size: 20px;
display: inline-block;
content: '\f04c';
color: #1559a6;
@include mask-icon(url('../svg/solid/pause.svg'), #1559A6, 30px);
}

&:hover, &:focus {
Expand All @@ -401,7 +400,7 @@ aside .content-slider.flexslider,
}

&.flex-play:before {
content: '\f04b';
@include mask-icon(url('../svg/solid/play.svg'), #1559A6, 30px);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions assets/css/_news.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
}
}

.rrze-elements-news p.more-posts,
#content .rrze-elements-news p.more-posts {
.rrze-elements-news div.more-posts,
#content .rrze-elements-news div.more-posts {
text-align: right;
padding: 10px 0 22px;
hyphens: none;
Expand Down
4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 deletions includes/Accordion/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace RRZE\Elements\Accordion;

use RRZE\Elements\Icon\Icon;
use const RRZE\Elements\RRZE_ELEMENTS_VERSION;
use RRZE\Elements\Helper;

Expand Down Expand Up @@ -141,7 +142,7 @@ public function shortcodeCollapse($atts, $content, $tag)

$icon_html = '';
if (!empty($icon)) {
$icon_html .= do_shortcode('[icon icon="'.$icon.'"]');
$icon_html = (new Icon($this->pluginFile))->shortcodeIcon(['icon' => $icon]);
}
$suffix_hmtl = '';
if (!empty($suffix)) {
Expand All @@ -164,7 +165,6 @@ public function shortcodeCollapse($atts, $content, $tag)
$output .= '</div></div>'; // .accordion-inner & .accordion-body
$output .= '</div>'; // . accordion-group

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

Expand Down
1 change: 0 additions & 1 deletion includes/Alert/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function shortcodeAlert($atts, $content = '')
$output .= '</div>';
}

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

return wpautop($output);
Expand Down
1 change: 0 additions & 1 deletion includes/Assistant/Assistant.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public function assistant( $atts, $content = null) {
$collapsibles = sprintf('[collapsibles expand-all-link="%1$s"]%2$s[/collapsibles]', $atts['expand-all-link'], $shortcode_data);
$return .= do_shortcode($collapsibles);

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

Expand Down
5 changes: 3 additions & 2 deletions includes/Button/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

defined('ABSPATH') || exit;

use RRZE\Elements\Alert\Alert;

use function RRZE\Elements\Config\calculateContrastColor;

/**
Expand Down Expand Up @@ -43,7 +45,7 @@ public function shortcodeButton($atts, $content = '')

$arialabel = $atts['aria-label'] != '' ? ' aria-label="' . sanitize_text_field($atts['aria-label']) . '"' : '';
/*if ($arialabel != '' && stripos($arialabel, $content) === false) {
return do_shortcode('[alert style="danger"]' . __('<strong>Button shortcode error</strong>: The button text ("' . $content . '") has to be included in the aria label ("' . sanitize_text_field($atts['aria-label']) . '"). ' , 'rrze-elements') . '[/alert]');
return (new Alert())->shortcodeAlert(['style' => 'danger'], __('<strong>Button shortcode error</strong>: The button text ("' . $content . '") has to be included in the aria label ("' . sanitize_text_field($atts['aria-label']) . '"). ' , 'rrze-elements'));
}*/
$classesArr = ['standard-btn'];
$stylesArr = [];
Expand Down Expand Up @@ -82,7 +84,6 @@ public function shortcodeButton($atts, $content = '')

$output = '<a' . $target . $title . $arialabel . ' class="' . implode(' ', $classesArr) . '" href="' . $link . '" style="' . implode('; ', $stylesArr) . '"><span>' . do_shortcode($content) . '</span></a>';

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

return $output;
Expand Down
3 changes: 2 additions & 1 deletion includes/CTA/CTA.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace RRZE\Elements\CTA;

use RRZE\Elements\Alert\Alert;
use RRZE\Elements\Icon\Icon;

use function RRZE\Downloads\Shortcodes\downloads;
Expand All @@ -23,7 +24,7 @@ public function __construct($pluginFile) {

public function shortcodeCTA($atts, $content = '') {
if ((!isset($atts['search']) || $atts['search'] == '') && (!isset($atts['url']) || $atts['url'] == '')) {
return do_shortcode('[alert style="danger"]' . sprintf(__('%1$sURL missing.%2$s Please provide the %3$surl%4$s attribute in your CTA shortcode.', 'rrze-elements'), '<strong>', '</strong>', '<code>', '</code>') . '[/alert]');
return (new Alert)->shortcodeAlert(['style' => 'danger'], sprintf(__('%1$sURL missing.%2$s Please provide the %3$surl%4$s attribute in your CTA shortcode.', 'rrze-elements'), '<strong>', '</strong>', '<code>', '</code>'));
}
$atts = shortcode_atts([
'title' => '',
Expand Down
1 change: 0 additions & 1 deletion includes/ContentSlider/ContentSlider.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ public function shortcodeContentSlider($atts, $content = '', $tag = '')
wp_localize_script('rrze-flexslider', 'object_name', $localizeScript);
}

wp_enqueue_style('fontawesome');
wp_enqueue_style('rrze-elements');
wp_enqueue_script('jquery-flexslider');
wp_enqueue_script('rrze-flexslider');
Expand Down
11 changes: 9 additions & 2 deletions includes/HiddenText/HiddenText.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@

namespace RRZE\Elements\HiddenText;

use RRZE\Elements\Notice\Notice;

defined('ABSPATH') || exit;

/**
* [HiddenText description]
*/
class HiddenText
{

protected $pluginFile;

/**
* [__construct description]
*/
public function __construct()
public function __construct($pluginFile)
{
add_shortcode('hidden-text', [$this, 'shortcodeHiddenText']);

$this->pluginFile = $pluginFile;
}

/**
Expand All @@ -36,7 +43,7 @@ public function shortcodeHiddenText($atts, $content = '')
$t_end = $end != '' ? strtotime($end, $now) : $now;

if ($t_start === false || $t_end === false) {
return do_shortcode('[notice-attention]' . __('Please use a valid date format: Y-m-d H:i:s.', 'rrze-elements') . '[/notice-attention]' . $content);
return (new Notice($this->pluginFile))->shortcodeNotice([], __('Please use a valid date format: Y-m-d H:i:s.', 'rrze-elements'), 'notice-attention') . do_shortcode($content);
}

if (($start != '' && $now <= $t_start) || ($end != '' && $now >= $t_end)) {
Expand Down
2 changes: 0 additions & 2 deletions includes/Icon/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ public function shortcodeIcon($atts, $content = '', $tag = '') {
$style = ' style="' . implode(' ', $CSSstyles) .'" ';

$output = str_replace('<svg ', '<svg height="1em" width="1em" class="rrze-elements-icon"' . $style . $a11yTags, $svg);
//$output = str_replace('<svg ', '<svg ' . $style, $svg);

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

return $output;
Expand Down
8 changes: 4 additions & 4 deletions includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public function __construct($pluginFile)
new ContentSlider();
new LaTeX();
new News();
new Notice();
new Notice($this->pluginFile);
new PullDiv();
new TimeLine();
new TimeLine($this->pluginFile);
new ContentIndex();
new HiddenText();
new HiddenText($pluginFile);
new LegalText();
new Assistant();
new Symbols();
new Icon($this->pluginFile);
new TextColumns();
new Tabs();
new Tabs($this->pluginFile);
new Table();
new CTA($this->pluginFile);

Expand Down
8 changes: 4 additions & 4 deletions includes/News/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

defined('ABSPATH') || exit;

use RRZE\Elements\Columns\Columns;
use RRZE\Elements\Helper;

use function RRZE\Elements\Config\getThemeGroup;
Expand Down Expand Up @@ -253,9 +254,9 @@ function ($post_ID) {
$moreLink = '';
if (in_array('show_more', $mode)) {
if ($cat != '') {
$moreLink = '<p class="more-posts"><a class="standard-btn xsmall-btn primary-btn" href="'.get_category_link($c_id[0]).'" aria-label="' . __('More news', 'rrze-elements') . ': ' . $cat . '">' . __('More news', 'rrze-elements') . '</a></p>';
$moreLink = '<div class="more-posts"><a class="standard-btn xsmall-btn primary-btn" href="'.get_category_link($c_id[0]).'" aria-label="' . __('More news', 'rrze-elements') . ': ' . $cat . '">' . __('More news', 'rrze-elements') . '</a></div>';
} elseif ($tag != '') {
$moreLink = '<p class="more-posts"><a class="standard-btn xsmall-btn primary-btn" href="'.get_tag_link($t_id[0]).'" aria-label="' . __('More news', 'rrze-elements') . ': ' . $tag . '">' . __('More news', 'rrze-elements') . '</a></p>';
$moreLink = '<div class="more-posts"><a class="standard-btn xsmall-btn primary-btn" href="'.get_tag_link($t_id[0]).'" aria-label="' . __('More news', 'rrze-elements') . ': ' . $tag . '">' . __('More news', 'rrze-elements') . '</a></div>';
}
}

Expand Down Expand Up @@ -306,7 +307,7 @@ function ($post_ID) {
'forceLandscape' => $forceLandscape,
'showContent' => (in_array('show_content', $mode) ? true : false),
];
$output .= do_shortcode('[column]' . $this->display_news_teaser($args) . '[/column]');
$output .= (new Columns())->shortcodeColumn([], $this->display_news_teaser($args));
} elseif (!empty($postCols)) {
if (array_sum($postCols) / $postCols['left'] > .3) {
$thumbnailSize = 'large';
Expand Down Expand Up @@ -387,7 +388,6 @@ function ($post_ID) {
<?php
}

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

wp_reset_postdata();
Expand Down
10 changes: 7 additions & 3 deletions includes/Notice/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

namespace RRZE\Elements\Notice;

use RRZE\Elements\Icon\Icon;

defined('ABSPATH') || exit;

/**
* [Notice description]
*/
class Notice
{
protected $pluginFile;
/**
* [__construct description]
*/
public function __construct()
public function __construct($pluginFile)
{
add_shortcode('notice-alert', [$this, 'shortcodeNotice']);
add_shortcode('notice-attention', [$this, 'shortcodeNotice']);
Expand All @@ -36,6 +39,8 @@ public function __construct()
add_shortcode('plus', [$this, 'shortcodeNotice']);
add_shortcode('minus', [$this, 'shortcodeNotice']);
add_shortcode('question', [$this, 'shortcodeNotice']);

$this->pluginFile = $pluginFile;
}

/**
Expand Down Expand Up @@ -116,13 +121,12 @@ public function shortcodeNotice($atts, $content = '', $tag = '')
}

$output = '<div class="notice notice-' . $type . $class . '"><div>'
. do_shortcode('[icon icon="'.$icon.'" style="2x" alt="' . $alt . '"]') . '</div>';
. (new Icon($this->pluginFile))->shortcodeIcon(['icon' => $icon, 'style' => '2x', 'alt' => $alt]) . '</div>';
if (isset($title) && $title != '') {
$output .= "<h$hstart>" . $title . "</h$hstart>";
}
$output .= '<p>' . wpautop(do_shortcode($content)) . '</p></div>';

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

return $output;
Expand Down
13 changes: 9 additions & 4 deletions includes/Tabs/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace RRZE\Elements\Tabs;

use RRZE\Elements\Icon\Icon;

use const RRZE\Elements\RRZE_ELEMENTS_VERSION;

defined( 'ABSPATH') || exit;
Expand All @@ -11,15 +13,19 @@
*/
class Tabs
{
protected $pluginFile;

/**
* [__construct description]
*/
public function __construct()
public function __construct($pluginFile)
{
add_shortcode('tabs', [$this, 'shortcodeTabs']);
add_shortcode('tab', [$this, 'shortcodeTab']);

add_action('wp_enqueue_scripts', [$this, 'enqueueScripts']);

$this->pluginFile = $pluginFile;
}

/**
Expand Down Expand Up @@ -65,7 +71,7 @@ public function shortcodeTabs($atts, $content = '', $tag = '')
$title = $matchesTitle[1];
$slug = sanitize_title($title);
if (isset($matchesIcons[$i][1]) && $matchesIcons[$i][1] != '') {
$icon = do_shortcode('[icon icon="'.$matchesIcons[$i][1].'"]');
$icon = (new Icon($this->pluginFile))->shortcodeIcon(['icon' => $matchesIcons[$i][1]]);;
} else {
$icon = '';
}
Expand Down Expand Up @@ -140,7 +146,7 @@ public function shortcodeTab($atts, $content, $tag)

$icon_html = '';
if (!empty($icon)) {
$icon_html .= do_shortcode('[icon icon="'.$icon.'"] ');
$icon_html = (new Icon($this->pluginFile))->shortcodeIcon(['icon' => $icon]);
}
$suffix_hmtl = '';
if (!empty($suffix)) {
Expand All @@ -162,7 +168,6 @@ public function shortcodeTab($atts, $content, $tag)
$output .= do_shortcode($content);
$output .= '</div>';

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

Expand Down
Loading

0 comments on commit 6b6ef78

Please sign in to comment.