Skip to content

Commit acd7ada

Browse files
committed
Release 2.6
1 parent 20e9066 commit acd7ada

File tree

190 files changed

+3124
-3272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+3124
-3272
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Release Version](https://img.shields.io/github/v/release/rrze-webteam/FAU-RWFak?label=Release+Version)](https://github.com/rrze-webteam/fau-RWFak/releases/) [![GitHub License](https://img.shields.io/github/license/rrze-webteam/fau-RWFak?label=Lizenz)](https://github.com/RRZE-Webteam/FAU-RWFak/blob/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/rrze-webteam/fau-einrichtungen)](https://github.com/RRZE-Webteam/FAU-Einrichtungen/issues)
44

5-
Wordpress-Theme für die Rechts- und Wirtschaftswissenschaftliche der Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
5+
WordPress-Theme für die Rechts- und Wirtschaftswissenschaftliche der Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
66

77
## Screenshot
88

@@ -22,7 +22,7 @@ GNU General Public License (GPL) Version 3
2222
## Dokumentation
2323

2424
Eine Dokumentation des Themes und dessen Funktionen findet sich unter der Adresse
25-
https://wordpress.rrze.fau.de
25+
https://wp.rrze.fau.de
2626

2727
## Feedback
2828

css/fau-theme-admin.css

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

css/fau-theme-blockeditor.css

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

css/fau-theme-classiceditor.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
59.4 KB
Binary file not shown.
83.9 KB
Binary file not shown.
58.8 KB
Binary file not shown.
74 KB
Binary file not shown.
56.9 KB
Binary file not shown.
55.9 KB
Binary file not shown.
86.1 KB
Binary file not shown.
58.6 KB
Binary file not shown.
56.4 KB
Binary file not shown.
56 KB
Binary file not shown.
39.1 KB
Binary file not shown.
55.6 KB
Binary file not shown.
55 KB
Binary file not shown.
38.8 KB
Binary file not shown.

fonts/roboto/Roboto-Bold-500.ttf

67 KB
Binary file not shown.

fonts/roboto/Roboto-Bold-webfont.ttf

18.1 KB
Binary file not shown.

fonts/roboto/Roboto-Bold-webfont.woff

19.5 KB
Binary file not shown.

fonts/roboto/Roboto-Bold.woff2

51.5 KB
Binary file not shown.
66.9 KB
Binary file not shown.
22.1 KB
Binary file not shown.
22.7 KB
Binary file not shown.

fonts/roboto/Roboto-BoldItalic.woff2

55.7 KB
Binary file not shown.
80.6 KB
Binary file not shown.
72.8 KB
Binary file not shown.

fonts/roboto/Roboto-Italic.woff2

55.7 KB
Binary file not shown.

fonts/roboto/Roboto-Light-webfont.ttf

19.2 KB
Binary file not shown.
19.2 KB
Binary file not shown.
19.4 KB
Binary file not shown.
19.8 KB
Binary file not shown.

fonts/roboto/Roboto-Regular.woff2

51.3 KB
Binary file not shown.

fonts/slick/slick.eot

199 Bytes
Binary file not shown.

fonts/slick/slick.ttf

191 Bytes
Binary file not shown.

fonts/slick/slick.woff

837 Bytes
Binary file not shown.

footer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181
<a href="#pagewrapper" class="top-link"><span class="arrow-up"></span><span class="screen-reader-text"><?php echo __('Nach oben','fau'); ?></span></a>
8282
</footer>
8383
</div>
84-
<?php print_indented("wp_footer",2); ?>
84+
<?php wp_footer(); ?>
8585
</body>
8686
</html>

functions.php

+3-25
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
require_once( get_template_directory() . '/functions/menu.php');
3333
require_once( get_template_directory() . '/functions/custom-fields.php' );
34-
require_once( get_template_directory() . '/functions/posttype_imagelink.php' );
3534
require_once( get_template_directory() . '/functions/widgets.php' );
3635

3736

@@ -44,6 +43,8 @@
4443
// Comment handling
4544
require get_template_directory() . '/functions/comments.php';
4645

46+
// Imagelinks
47+
require_once( get_template_directory() . '/functions/posttype_imagelink.php' );
4748

4849

4950

@@ -150,29 +151,7 @@ function fau_custom_init() {
150151
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
151152
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
152153

153-
// Maybe the CustomCSS was set via Customizer
154-
// but its only allowed for partner websites.
155-
// So lets remove the custom part, if its the wrong website type.
156-
// Otherwiese people could first switch to partner website, then
157-
// change the css, and then switch back to a university site.
158-
// This would then not remove the custom css and display it.
159-
160-
$website_type = get_theme_mod('website_type');
161-
// website_type:
162-
// 0 = Fakultaetsportal;
163-
// 1 = Lehrstuehle, Departments
164-
// 2 = Zentrale Einrichtungen,
165-
// 3 = Kooperationen
166-
// -1 = fau.de Portal (4 Spalter in Bühne, kein Link zur FAU.
167-
168-
if (isset($website_type) && ($website_type != 3)) {
169-
// Wenn es keine Kooperationsseite ist, dann wird CustomCSS
170-
// verboten. Ausnahme: Der Admin ist Superadmin.
171-
if (!current_user_can('manage_sites')) {
172-
remove_action('wp_head', 'wp_custom_css_cb', 101);
173-
}
174-
}
175-
154+
176155

177156
}
178157
add_action( 'init', 'fau_custom_init' );
@@ -249,7 +228,6 @@ function fau_admin_header_style() {
249228
}
250229
add_action( 'admin_enqueue_scripts', 'fau_admin_header_style' );
251230

252-
253231
/*-----------------------------------------------------------------------------------*/
254232
/* Change default DNS prefetch
255233
/*-----------------------------------------------------------------------------------*/

functions/block-editor-support.php

+106-85
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,107 @@
11
<?php
2+
23
/**
3-
* @package WordPress
4-
* @subpackage FAU
5-
* @since FAU 1.10
6-
*/
4+
* @package WordPress
5+
* @subpackage FAU
6+
* @since FAU 1.10
7+
*/
8+
79
use \RRZE\THEME\EINRICHTUNGEN\Debugging;
810

911
/*-----------------------------------------------------------------------------------*/
1012
/* We use our own color set in this theme and dont want autors to change text colors
1113
/*-----------------------------------------------------------------------------------*/
12-
function fau_gutenberg_settings() {
14+
15+
function fau_editor_settings() {
1316
if (fau_blockeditor_is_active()) {
14-
return;
15-
}
16-
17-
// Disable color palette.
18-
add_theme_support( 'editor-color-palette' );
19-
20-
// Disable color picker.
21-
add_theme_support( 'disable-custom-colors' );
22-
23-
// Dont allow font sizes of gutenberg
24-
// https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#block-font-sizes
25-
add_theme_support('disable-custom-font-sizes');
26-
27-
// allow responsive embedded content
28-
add_theme_support( 'responsive-embeds' );
17+
// we handle the Block Editor settings with the hook
18+
// enqueue_block_editor_assets
19+
return;
20+
}
21+
22+
// Disable color palette.
23+
add_theme_support('editor-color-palette');
24+
25+
// Disable color picker.
26+
add_theme_support('disable-custom-colors');
27+
28+
// Dont allow font sizes of gutenberg
29+
// https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#block-font-sizes
30+
add_theme_support('disable-custom-font-sizes');
31+
32+
// allow responsive embedded content
33+
add_theme_support('responsive-embeds');
2934

3035
// Remove Gutenbergs Userstyle and SVGs Duotone injections from 5.9.2
31-
remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' );
32-
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
36+
remove_action('wp_enqueue_scripts', 'wp_enqueue_global_styles');
37+
remove_action('wp_body_open', 'wp_global_styles_render_svg_filters');
38+
3339

3440
}
35-
add_action( 'after_setup_theme', 'fau_gutenberg_settings' );
41+
add_action('after_setup_theme', 'fau_editor_settings');
3642

3743
/*-----------------------------------------------------------------------------------*/
3844
/* Activate scripts and style for backend use of Gutenberg
3945
/*-----------------------------------------------------------------------------------*/
4046
function fau_add_gutenberg_assets() {
41-
// Load the theme styles within Gutenberg.
42-
global $is_gutenberg_enabled;
47+
// Load the theme styles within Gutenberg.
48+
global $is_gutenberg_enabled;
49+
global $defaultoptions;
50+
51+
// if (fau_blockeditor_is_active()) {
52+
53+
// Add support for editor styles.
54+
add_theme_support('editor-styles');
55+
56+
// Enqueue the editor stylesheet.
57+
add_editor_style('css/fau-theme-blockeditor.css');
58+
59+
$theme_data = wp_get_theme();
60+
$theme_version = $theme_data->Version;
61+
62+
// Enqueue the JS needed for deregistering Block Variations
63+
wp_enqueue_script(
64+
'fau-blockeditor-styles-unregister',
65+
$defaultoptions['src-blockstyleregisterjs'],
66+
array('wp-blocks', 'wp-dom-ready', 'wp-edit-post'),
67+
$theme_version,
68+
true
69+
);
70+
// }
71+
}
72+
add_action('enqueue_block_editor_assets', 'fau_add_gutenberg_assets');
73+
74+
/*-----------------------------------------------------------------------------------*/
75+
/* Activate scripts and style for backend use of Classic Editor
76+
/*-----------------------------------------------------------------------------------*/
77+
function fau_add_classic_editor_assets() {
78+
// if (fau_blockeditor_is_active()) {
79+
// we handle the Block Editor settings with the hook
80+
// enqueue_block_editor_assets
81+
// return;
82+
// }
4383

44-
if (fau_blockeditor_is_active()) {
45-
wp_enqueue_style( 'fau-gutenberg', get_theme_file_uri( '/css/fau-theme-gutenberg.css' ), false );
46-
}
84+
// check if the classic editor is active
85+
if (fau_is_classic_editor_plugin_active()) {
86+
// Add support for editor styles.
87+
add_theme_support('editor-styles');
88+
// Enqueue the classic editor stylesheet.
89+
add_editor_style('css/fau-theme-classiceditor.css');
90+
}
4791
}
48-
// add_action( 'enqueue_block_editor_assets', 'fau_add_gutenberg_assets' );
49-
// derzeit noch keine eigene CSS File mit Anpassungen...
92+
add_action('admin_init', 'fau_add_classic_editor_assets');
5093

5194
/*-----------------------------------------------------------------------------------*/
5295
/* Remove Block Style from frontend as long wie dont use it
5396
/*-----------------------------------------------------------------------------------*/
5497
function fau_deregister_blocklibrary_styles() {
55-
if (!fau_blockeditor_is_active()) {
56-
wp_dequeue_style( 'wp-block-library');
57-
wp_dequeue_style( 'wp-block-library-theme' );
58-
wp_dequeue_style( 'wp-blocks-style' );
59-
}
98+
if (!fau_blockeditor_is_active()) {
99+
wp_dequeue_style('wp-block-library');
100+
wp_dequeue_style('wp-block-library-theme');
101+
wp_dequeue_style('wp-blocks-style');
102+
}
60103
}
61-
add_action( 'wp_enqueue_scripts', 'fau_deregister_blocklibrary_styles', 100 );
104+
add_action('wp_enqueue_scripts', 'fau_deregister_blocklibrary_styles', 100);
62105

63106

64107
/*-----------------------------------------------------------------------------------*/
@@ -67,76 +110,60 @@ function fau_deregister_blocklibrary_styles() {
67110
/*
68111
/* @return bool
69112
/*-----------------------------------------------------------------------------------*/
70-
function fau_blockeditor_is_active() {
113+
function fau_blockeditor_is_active() {
71114
global $is_gutenberg_enabled;
72115
$is_gutenberg_enabled = false;
73116

74-
117+
75118
if (has_filter('is_gutenberg_enabled')) {
76119
$is_gutenberg_enabled = apply_filters('is_gutenberg_enabled', false);
77120
if ($is_gutenberg_enabled) {
78121
return true;
79122
}
80-
// No public function yet.
81-
// } elseif (class_exists('RRZE\Settings\Main')) {
82-
// if (RRZE\Settings\Main::isClassicEditorEnabled()) {
83-
// Debugging::log("Info", "RRZE\Settings\Writing says no");
84-
// $is_gutenberg_enabled = false;
85-
// } else {
86-
// Debugging::log("Info", "RRZE\Settings\Writing says yes");
87-
// $is_gutenberg_enabled = true;
88-
// }
89-
90-
91-
} elseif ( fau_is_classic_editor_plugin_active() ) {
92-
$editor_option = get_option( 'classic-editor-replace' );
93-
$block_editor_active = array( 'no-replace', 'block' );
94-
$is_gutenberg_enabled = in_array( $editor_option, $block_editor_active, true );
95-
123+
} elseif (fau_is_classic_editor_plugin_active()) {
124+
$editor_option = get_option('classic-editor-replace');
125+
$block_editor_active = array('no-replace', 'block');
126+
$is_gutenberg_enabled = in_array($editor_option, $block_editor_active, true);
96127
} elseif (fau_is_newsletter_plugin_active()) {
97128
$is_gutenberg_enabled = true;
98-
99129
} else {
100-
101-
$rrze_settings_option = get_option( 'rrze_settings' );
130+
131+
$rrze_settings_option = get_option('rrze_settings');
102132
if (isset($rrze_settings_option->writing)) {
103-
if (isset($rrze_settings_option->writing->enable_classic_editor)) {
133+
if (isset($rrze_settings_option->writing->enable_classic_editor)) {
104134
if ($rrze_settings_option->writing->enable_classic_editor === 1) {
105135
$is_gutenberg_enabled = false;
106136
} else {
107-
$is_gutenberg_enabled = true;
137+
$is_gutenberg_enabled = true;
108138
}
109139
} elseif (isset($rrze_settings_option->writing->enable_block_editor)) {
110140
if ($rrze_settings_option->writing->enable_block_editor == 1) {
111141
$is_gutenberg_enabled = true;
112142
}
113143
}
114144
} else {
115-
116-
117-
$editor_option = get_option( 'classic-editor-replace' );
118-
$block_editor_active = array( 'no-replace', 'block' );
119-
if (in_array( $editor_option, $block_editor_active )) {
120-
$is_gutenberg_enabled = true;
145+
146+
$editor_option = get_option('classic-editor-replace');
147+
$block_editor_active = array('no-replace', 'block');
148+
if (in_array($editor_option, $block_editor_active)) {
149+
$is_gutenberg_enabled = true;
121150
}
122-
123151
}
124-
125152
}
126153

127-
if ($is_gutenberg_enabled ) {
128-
add_filter( 'is_gutenberg_enabled', 'fau_set_filter_gutenberg_state' );
154+
if ($is_gutenberg_enabled) {
155+
add_filter('is_gutenberg_enabled', 'fau_set_filter_gutenberg_state');
129156
}
130157
return $is_gutenberg_enabled;
131158
}
132159

133160
/*-----------------------------------------------------------------------------------*/
134161
/* Set is_gutenberg_enabled filter if not avaible
135162
/*-----------------------------------------------------------------------------------*/
136-
function fau_set_filter_gutenberg_state( $value ) {
163+
function fau_set_filter_gutenberg_state($value) {
137164
global $is_gutenberg_enabled;
138165
$is_gutenberg_enabled = true;
139-
166+
140167
return $is_gutenberg_enabled;
141168
}
142169
/*-----------------------------------------------------------------------------------*/
@@ -145,12 +172,12 @@ function fau_set_filter_gutenberg_state( $value ) {
145172
/* @return bool
146173
/*-----------------------------------------------------------------------------------*/
147174
function fau_is_classic_editor_plugin_active() {
148-
149-
if ( ! function_exists( 'is_plugin_active' ) ) {
175+
176+
if (! function_exists('is_plugin_active')) {
150177
include_once ABSPATH . 'wp-admin/includes/plugin.php';
151178
}
152179

153-
if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
180+
if (is_plugin_active('classic-editor/classic-editor.php')) {
154181
return true;
155182
}
156183

@@ -161,39 +188,33 @@ function fau_is_classic_editor_plugin_active() {
161188
/* Check if our Block Editor based Newsletter Plugin is active
162189
/*-----------------------------------------------------------------------------------*/
163190
function fau_is_newsletter_plugin_active() {
164-
if ( ! function_exists( 'is_plugin_active' ) ) {
191+
if (! function_exists('is_plugin_active')) {
165192
include_once ABSPATH . 'wp-admin/includes/plugin.php';
166193
}
167194

168-
if ( is_plugin_active( 'rrze-newsletter/rrze-newsletter.php' ) ) {
195+
if (is_plugin_active('rrze-newsletter/rrze-newsletter.php')) {
169196
return true;
170197
}
171198

172199
return false;
173200
}
174201

175-
176-
177202
/*-----------------------------------------------------------------------------------*/
178203
/* Outside-box image post block
179204
/*-----------------------------------------------------------------------------------*/
180205
function fau_custom_image_blocks() {
181206
wp_register_script(
182207
'my-custom-blocks',
183208
get_template_directory_uri() . '/js/fau-costum-image-block.min.js',
184-
array( 'wp-blocks', 'wp-editor' ),
209+
array('wp-blocks', 'wp-editor'),
185210
true
186211
);
187-
register_block_type( 'my-blocks/full-width-image', array(
212+
register_block_type('my-blocks/full-width-image', array(
188213
'editor_script' => 'my-custom-blocks',
189-
) );
214+
));
190215
}
191216
// add_action( 'init', 'fau_custom_image_blocks' );
192217

193-
194-
195-
196-
197218
/*-----------------------------------------------------------------------------------*/
198219
/* This is the end of the code as we know it
199220
/*-----------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)