| 1 |
<?php |
| 2 |
/** |
| 3 |
* Will be included in the shariff.php only, when Info is requested as a service. |
| 4 |
* |
| 5 |
* @package Shariff Wrapper |
| 6 |
*/ |
| 7 |
|
| 8 |
// Prevent direct calls. |
| 9 |
if ( ! class_exists( 'WP' ) ) { die(); } |
| 10 |
// and again the same because the WP Plugin Check does not understand what the line above does ;-) |
| 11 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
// Check if we need the frontend or the backend part. |
| 14 |
if ( isset( $frontend ) && 1 === $frontend ) { |
| 15 |
// Set custom info url or default one. |
| 16 |
if ( array_key_exists( 'info_url', $atts ) ) { |
| 17 |
$service_url = esc_url( $atts['info_url'] ); |
| 18 |
} else { |
| 19 |
$service_url = esc_url( 'http://ct.de/-2467514' ); |
| 20 |
} |
| 21 |
|
| 22 |
// Build button URL. |
| 23 |
$button_url = $service_url; |
| 24 |
|
| 25 |
// Colors. |
| 26 |
$main_color = '#999'; |
| 27 |
$secondary_color = '#a8a8a8'; |
| 28 |
$wcag_color = '#595959'; |
| 29 |
|
| 30 |
// Replace $main_color with $wcag_color and $secondary_color with #000, if $wacg_theme is selected. |
| 31 |
if ( isset( $atts['theme'] ) && 'wcag' === $atts['theme'] && isset( $wcag_color ) && '' !== $wcag_color ) { |
| 32 |
$main_color = $wcag_color; |
| 33 |
$secondary_color = '#000'; |
| 34 |
} |
| 35 |
|
| 36 |
// SVG icon. |
| 37 |
$svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 32"><path fill="' . $main_color . '" d="M11.4 24v2.3q0 0.5-0.3 0.8t-0.8 0.4h-9.1q-0.5 0-0.8-0.4t-0.4-0.8v-2.3q0-0.5 0.4-0.8t0.8-0.4h1.1v-6.8h-1.1q-0.5 0-0.8-0.4t-0.4-0.8v-2.3q0-0.5 0.4-0.8t0.8-0.4h6.8q0.5 0 0.8 0.4t0.4 0.8v10.3h1.1q0.5 0 0.8 0.4t0.3 0.8zM9.2 3.4v3.4q0 0.5-0.4 0.8t-0.8 0.4h-4.6q-0.4 0-0.8-0.4t-0.4-0.8v-3.4q0-0.4 0.4-0.8t0.8-0.4h4.6q0.5 0 0.8 0.4t0.4 0.8z"/></svg>'; |
| 38 |
|
| 39 |
// Button text label. |
| 40 |
$button_text_array = array( |
| 41 |
'de' => 'info', |
| 42 |
'en' => 'info', |
| 43 |
); |
| 44 |
|
| 45 |
// Button alt label. |
| 46 |
if ( array_key_exists( 'info_text', $atts ) ) { |
| 47 |
$button_title_array = array( 'en' => esc_html( $atts['info_text'] ) ); |
| 48 |
} else { |
| 49 |
$button_title_array = array( |
| 50 |
'bg' => 'Повече информация', |
| 51 |
'cs' => 'Více informací', |
| 52 |
'da' => 'Flere oplysninger', |
| 53 |
'de' => 'Weitere Informationen', |
| 54 |
'en' => 'More information', |
| 55 |
'es' => 'Más informaciones', |
| 56 |
'fi' => 'Lisätietoja', |
| 57 |
'fr' => 'Plus d\'informations', |
| 58 |
'hr' => 'Više informacija', |
| 59 |
'hu' => 'Több információ', |
| 60 |
'it' => 'Maggiori informazioni', |
| 61 |
'ja' => '詳しい� |
| 62 |
報', |
| 63 |
'ko' => '추가 정보', |
| 64 |
'nl' => 'Verdere informatie', |
| 65 |
'no' => 'Mer informasjon', |
| 66 |
'pl' => 'Więcej informacji', |
| 67 |
'pt' => 'Mais informações', |
| 68 |
'ro' => 'Mai multe informatii', |
| 69 |
'ru' => 'Больше информации', |
| 70 |
'sk' => 'Viac informácií', |
| 71 |
'sl' => 'Več informacij', |
| 72 |
'sr' => 'Više informacija', |
| 73 |
'sv' => 'Mer information', |
| 74 |
'tr' => 'Daha fazla bilgi', |
| 75 |
'zh' => '更多信息', |
| 76 |
); |
| 77 |
} |
| 78 |
} |
| 79 |
|