| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.9/wp-content/plugins/duplicator/classes/ui/ |
Upload File : |
<?php
use Duplicator\Libs\Snap\SnapUtil;
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
/**
* The base class for all screen.php files. This class is used to control items that are common
* among all screens, namely the Help tab and Screen Options drop down items. When creating a
* screen object please extent this class.
*
* Standard: PSR-2
*
* @link http://www.php-fig.org/psr/psr-2
*
* @package Duplicator
* @subpackage classes/ui
* @copyright (c) 2017, Snapcreek LLC
*/
// Exit if accessed directly
if (!defined('DUPLICATOR_VERSION')) {
exit;
}
class DUP_UI_Screen
{
/**
* Used as a placeholder for the current screen object
*/
public $screen;
/**
* Init this object when created
*/
public function __construct()
{
}
public static function getCustomCss()
{
$screen = get_current_screen();
if (
!in_array($screen->id, array(
'toplevel_page_duplicator',
'duplicator_page_duplicator-tools',
'duplicator_page_duplicator-settings',
'duplicator_page_duplicator-gopro'))
) {
return;
}
$colorScheme = self::getCurrentColorScheme();
$primaryButtonColor = self::getPrimaryButtonColorByScheme();
if ($colorScheme !== false) { ?>
<style>
.link-style {
color: <?php echo $colorScheme->colors[2]; ?>;
}
.link-style:hover {
color: <?php echo $colorScheme->colors[3]; ?>;
}
.dup-radio-button-group-wrapper input[type="radio"] + label {
color: <?php echo $primaryButtonColor; ?>;
}
.dup-radio-button-group-wrapper input[type="radio"] + label:hover,
.dup-radio-button-group-wrapper input[type="radio"]:focus + label,
.dup-radio-button-group-wrapper input[type="radio"]:checked + label {
background: <?php echo $primaryButtonColor; ?>;
border-color: <?php echo $primaryButtonColor; ?>;
}
</style>
<?php
}
}
/**
* Unfortunately not all color schemes take the same color as the buttons so you need to make a custom switch/
*
* @return string
*/
public static function getPrimaryButtonColorByScheme()
{
$colorScheme = self::getCurrentColorScheme();
$name = strtolower($colorScheme->name);
switch ($name) {
case 'blue':
return '#e3af55';
case 'light':
case 'midnight':
return $colorScheme->colors[3];
case 'ocean':
case 'ectoplasm':
case 'coffee':
case 'sunrise':
case 'default':
default:
return $colorScheme->colors[2];
}
}
public static function getCurrentColorScheme()
{
global $_wp_admin_css_colors;
if (!isset($_wp_admin_css_colors) || !is_array($_wp_admin_css_colors)) {
return false;
}
$colorScheme = get_user_option('admin_color');
if (isset($_wp_admin_css_colors[$colorScheme])) {
return $_wp_admin_css_colors[$colorScheme];
} else {
return $_wp_admin_css_colors[SnapUtil::arrayKeyFirst($_wp_admin_css_colors)];
}
}
}