forked from lino/radar-wp
add custom functionality
This commit is contained in:
parent
75cb545d2b
commit
9d40e375bf
4 changed files with 126 additions and 76 deletions
|
@ -1,72 +1,72 @@
|
|||
.squat-radar.radar-event {
|
||||
margin-bottom: 1em;
|
||||
padding-bottom: 1em;
|
||||
border-bottom: 1px solid #ddd;
|
||||
text-align:left;
|
||||
}
|
||||
.squat-radar.radar-event::after {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
.squat-radar.rader-event:last-child {
|
||||
border-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.squat-radar.radar-event-cancelled {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-title {
|
||||
line-height: 1;
|
||||
font-size: 1.4em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-datetime {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-datetime.squat-radar-datetime-start::before {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-event-start-end::after,
|
||||
.squat-radar .squat-radar-event-start {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li {
|
||||
display: inline;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li:after {
|
||||
content: ", ";
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li:last-child:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.squat-radar a.squat-radar-url-more {
|
||||
padding: .4180469716em 1.11575em;
|
||||
margin-left: 10px;
|
||||
/* margin-bottom: 10px;*/
|
||||
float: right;
|
||||
}
|
||||
.squat-radar a.squat-radar-url-more:hover {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.squat_radar a.squat-radar-url-more:focus {
|
||||
outline: 0;
|
||||
}
|
||||
.squat-radar.radar-event {
|
||||
margin-bottom: 1em;
|
||||
padding-bottom: 1em;
|
||||
border-bottom: 1px solid #ddd;
|
||||
text-align:left;
|
||||
}
|
||||
.squat-radar.radar-event::after {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
.squat-radar.rader-event:last-child {
|
||||
border-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.squat-radar.radar-event-cancelled {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-title {
|
||||
line-height: 1;
|
||||
font-size: 1.4em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-datetime {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-datetime.squat-radar-datetime-start::before {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-event-start-end::after,
|
||||
.squat-radar .squat-radar-event-start {
|
||||
content: '';
|
||||
display: block;
|
||||
float: none;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li {
|
||||
display: inline;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li:after {
|
||||
content: ", ";
|
||||
}
|
||||
|
||||
.squat-radar .squat-radar-list li:last-child:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.squat-radar a.squat-radar-url-more {
|
||||
padding: .4180469716em 1.11575em;
|
||||
margin-left: 10px;
|
||||
/* margin-bottom: 10px;*/
|
||||
float: right;
|
||||
}
|
||||
.squat-radar a.squat-radar-url-more:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.squat_radar a.squat-radar-url-more:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,8 @@ class Squat_Radar_Formatter {
|
|||
|
||||
private static function field_date_format($time, $start_end, $time_only = FALSE) {
|
||||
|
||||
$date_format = get_option('squat_radar_date_format', 'j M Y');
|
||||
$date_format = get_option('squat_radar_date_format', 'd.m.');
|
||||
$year_format = get_option('squat_radar_date_format', 'Y');
|
||||
$time_format = get_option('squat_radar_time_format', 'H:i');
|
||||
|
||||
// Remove offset to stop time being converted to UTC.
|
||||
|
@ -220,6 +221,9 @@ class Squat_Radar_Formatter {
|
|||
$output .= '<span class="squat-radar-date">';
|
||||
$output .= date_i18n($date_format, strtotime($time));
|
||||
$output .= '</span> ';
|
||||
$output .= '<span class="squat-radar-year">';
|
||||
$output .= date_i18n($year_format, strtotime($time));
|
||||
$output .= '</span> ';
|
||||
}
|
||||
$output .= '<span class="squat-radar-time">';
|
||||
$output .= date_i18n($time_format, strtotime($time));
|
||||
|
@ -301,11 +305,11 @@ class Squat_Radar_Formatter {
|
|||
*/
|
||||
static public function field_link_html($value, $original, $field, $context) {
|
||||
if ( ($field[0] == 'title' || $field[0] == 'title_field') && ! empty($context['event']['url'])) {
|
||||
return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title">' . sanitize_text_field( $value ) . '</a>';
|
||||
return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title" target="_blank">' . sanitize_text_field( $value ) . '</a>';
|
||||
}
|
||||
|
||||
if ($field[0] == 'url' && count($field) == 1) {
|
||||
return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more">' . __('more…', 'squat-radar') . '</a>';
|
||||
return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more" target="_blank">' . __('more…', 'squat-radar') . '</a>';
|
||||
}
|
||||
elseif ($field[0] == 'url') {
|
||||
$title = esc_url($value);
|
||||
|
|
45
plugin-change-README.txt
Normal file
45
plugin-change-README.txt
Normal file
|
@ -0,0 +1,45 @@
|
|||
PATH: /wp-content/plugins/squat-radar-calendar-integration/includes/squat-radar-formatter.php
|
||||
|
||||
|
||||
|
||||
In dem Block der Datumsangabe wurde das Tag/Monat und Jahr separiert. (Und deutsche Zeitangaben)
|
||||
|
||||
private static function field_date_format($time, $start_end, $time_only = FALSE) {
|
||||
|
||||
$date_format = get_option('squat_radar_date_format', 'd.m.');
|
||||
$year_format = get_option('squat_radar_date_format', 'Y');
|
||||
$time_format = get_option('squat_radar_time_format', 'H:i');
|
||||
|
||||
// Remove offset to stop time being converted to UTC.
|
||||
$time = substr($time, 0, -6);
|
||||
|
||||
$output = '<span class="squat-radar-datetime squat-radar-datetime-' . $start_end .'">';
|
||||
if ( ! $time_only ) {
|
||||
$output .= '<span class="squat-radar-date">';
|
||||
$output .= date_i18n($date_format, strtotime($time));
|
||||
$output .= '</span> ';
|
||||
$output .= '<span class="squat-radar-year">';
|
||||
$output .= date_i18n($year_format, strtotime($time));
|
||||
$output .= '</span> ';
|
||||
}
|
||||
|
||||
|
||||
Links werden im anderen Tab geöffnet (target="_blank" hinzufügen)
|
||||
|
||||
static public function field_link_html($value, $original, $field, $context) {
|
||||
if ( ($field[0] == 'title' || $field[0] == 'title_field') && ! empty($context['event']['url'])) {
|
||||
return '<a href="' . esc_url($context['event']['url']) . '" class="squat-radar-url squat-radar-url-title" target="_blank">' . sanitize_text_field( $value ) . '</a>';
|
||||
}
|
||||
|
||||
if ($field[0] == 'url' && count($field) == 1) {
|
||||
return '<a href="' . esc_url_raw($value) . '" class="squat-radar-url squat-radar-url-more" target="_blank">' . __('more…', 'squat-radar') . '</a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
css squat-radar.css
|
||||
important entfernen
|
||||
.squat-radar a.squat-radar-url-more:hover {
|
||||
color: white !important;
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
* @package Squat_Radar
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: Squat Radar calendar integration
|
||||
* Plugin Name: Squat Radar calendar integration custom
|
||||
* Plugin URI: https://0xacab.org/radar/radar-wp
|
||||
* Description: Provides widget, and shortcode, integration for displaying events from https://radar.squat.net/ agenda.
|
||||
* Version: 2.0.9
|
||||
|
@ -17,6 +17,7 @@
|
|||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
* Text Domain: squat-radar
|
||||
* Domain Path: /languages
|
||||
* Gitea Plugin URI: https://git.systemausfall.org/newyorck/radar-wp-custom
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
Loading…
Reference in a new issue