晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/rainic/public_html/setupTZh/plugins/becustom/ |
Upload File : |
<?php
/**
* Plugin Name: BeCustom
* Plugin URI: https://muffingroup.com/betheme/features/be-custom/
* Description: Rebrand Be & WordPress Admin And Take Your Business To The Next Level. Be like PRO!
* Version: 1.0.2
* Author: Muffin Group
* Author URI: https://muffingroup.com
*/
class Be_custom {
public $becustom_subpages = array('branding', 'built_in_features', 'wp_login', 'be_dashboard', 'advanced'); //always must be in proper setup, LTR in tabs
public $betheme_fields;
/* Subpages above fields used */
public $branding = array(
'betheme_label' => array(
'type' => 'text',
'filter_name' => 'betheme_label',
'title' => 'Default BeTheme text',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option changes default <strong>Betheme</strong> text located in main WP dashboard and just after the Welcome text in <i>Betheme > Dashboard</i> section.',
)
),
'replaced_logo_url' => array(
'type' => 'upload',
'filter_name' => 'betheme_logo',
'title' => 'Betheme & Muffin group logo',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option changes any Betheme & Muffin group logo (some located in <i>Betheme > Dashboard</i> section, other in Muffin Builder.)',
)
),
'replaced_theme_image' => array(
'type' => 'upload',
'filter_name' => 'betheme_image',
'title' => 'Default Betheme theme image',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default Betheme image in <i>Appearance > Themes</i> section.',
)
),
'replaced_theme_desc' => array(
'type' => 'text',
'filter_name' => 'betheme_desc',
'title' => 'Theme description WP',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default Betheme description in <i>Appearance > Themes</i> section.',
)
),
'replaced_theme_author' => array(
'type' => 'text',
'filter_name' => 'betheme_author',
'title' => 'Default Betheme author',
'value' => 'Muffin Group',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default Betheme author in <i>Appearance > Themes</i> section.',
)
),
'betheme_url_slug' => array(
'type' => 'text',
'filter_name' => 'betheme_slug',
'title' => 'be friendly URL',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces each occurance of default <b>be</b> in URL.',
)
),
//FIELDS WHERE USERS CANNOT CHANGE ANYTHING
'betheme_dynamic_slug' => array(
'type' => 'text',
'filter_name' => 'betheme_dynamic_slug',
),
'betheme_input_options' => array( //theme options input value
'type' => 'text',
'filter_name' => 'betheme_options_filed_options',
),
'betheme_input_title' => array( //theme options title value
'type' => 'text',
'filter_name' => 'betheme_options_filed_title',
),
'betheme_input_desc' => array( //theme options desc value
'type' => 'text',
'filter_name' => 'betheme_options_filed_desc',
),
'betheme_replaced_logo_nohtml' => array(
'type' => 'upload',
'filter_name' => 'betheme_logo_nohtml',
),
);
public $built_in_features = array(
'disable_theme_version' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_theme_version',
'title' => 'Theme version',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes theme version visible or hidden in <i>Betheme > Theme Options</i>.',
)
),
'disable_support_link' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_support',
'title' => 'Manual & Support tab',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes Betheme <b>Manual & Support</b> tab visible or hidden in <i>Betheme > Dashboard</i>.',
)
),
'disable_changelog_link' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_changelog',
'title' => 'Changelog tab',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes Betheme <b>Changelog</b> tab visible or hidden in <i>Betheme > Dashboard</i>.',
)
),
'disable_theme_update' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_theme_update',
'title' => 'Theme Update',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option disable/enable <b>Betheme Update</b> button in <i>Betheme > Dashboard</i>.',
)
),
'disable_advanced_tab' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_advanced',
'title' => 'Advanced tab',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes <b>Advanced</b> tab visible or hidden in <i>Betheme > Theme Options</i>.',
)
),
'disable_hooks_tab' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_hooks',
'title' => 'Hooks tab',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes <b>Hooks</b> tab visible or hidden in <i>Betheme > Theme Options</i>.',
)
),
'disable_footer_copy' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_footer',
'title' => 'Footer copyright',
'value' => false,
'popup_content' => array(
'image' => '',
'text' => 'This option makes <b>Footer copyright</b> visible or hidden in front-end.',
)
),
);
public $wp_login = array(
'enable_custom_login' => array(
'type' => 'switch',
'filter_name' => 'betheme_disable_custom_login',
'title' => 'Enable the custom WP-Login page',
'value' => false
),
'custom_wplogin_logo' => array(
'type' => 'upload',
'filter_name' => 'betheme_wplogin_logo',
'title' => 'Custom WP-Login logo',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'this option replaces default WP logo on WP-Login page with your own.',
)
),
'custom_background_color' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_bg_color',
'title' => 'WP-Login page background color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default background color on WP-Login page.',
)
),
'custom_font_color' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_font_color',
'title' => 'WP-Login page font color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default font color on WP-Login page for texts like <i>Lost your password?</i> or <i><- Go to XYZ</i>.',
)
),
'custom_background_image' => array(
'type' => 'upload',
'filter_name' => 'betheme_wplogin_bg_image',
'title' => 'WP-Login page background image',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default background color on WP-Login page with custom background image.',
)
),
'custom_background_size' => array(
'type' => 'select',
'filter_name' => 'betheme_wplogin_bg_size',
'title' => 'WP-Login page background image size',
'value' => 'Auto',
'popup_content' => array(
'image' => 'https://upload.wikimedia.org/wikipedia/commons/c/ce/Example_image.png',
'text' => 'Oh boy',
)
),
'custom_background_position' => array(
'type' => 'select',
'filter_name' => 'betheme_wplogin_bg_position',
'title' => 'WP-Login page background image position',
'value' => 'no-repeat;left top;;',
'popup_content' => array(
'image' => 'https://upload.wikimedia.org/wikipedia/commons/c/ce/Example_image.png',
'text' => 'Oh boy',
)
),
'custom_login_container_position' => array(
'type' => 'select',
'filter_name' => 'betheme_wplogin_container_position',
'title' => 'WP-Login Container position',
'value' => 'unset',
'std' => 'unset',
'popup_content' => array(
'image' => 'https://upload.wikimedia.org/wikipedia/commons/c/ce/Example_image.png',
'text' => 'Oh boy',
)
),
'custom_login_container_background' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_container_bg',
'title' => 'WP-Login container background color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default background color on WP-Login page container with custom background color.',
)
),
'custom_login_container_font_color' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_container_font_color',
'title' => 'WP-Login container font color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default font color inside container on WP-Login page.',
)
),
'custom_login_container_input_background' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_container_input_bg',
'title' => 'WP-Login container input background color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default input background color inside container on WP-Login page.',
)
),
'custom_login_container_input_font_color' => array(
'type' => 'text',
'filter_name' => 'betheme_wplogin_container_input_color',
'title' => 'WP-Login container input font color',
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces default input font color inside container on WP-Login page.',
)
),
'enable_forgot_password' => array(
'type' => 'switch',
'filter_name' => 'betheme_wplogin_enable_forgot_password',
'title' => 'Forgot Password',
'value' => true,
'popup_content' => array(
'image' => '',
'text' => 'This option enable/disable <b>Forgot Password</b> feature located under container on WP-Login page.',
)
),
'enable_goto_link' => array(
'type' => 'switch',
'filter_name' => 'betheme_wplogin_enable_gotolink',
'title' => '"Go TO XYZ"',
'value' => true,
'popup_content' => array(
'image' => '',
'text' => 'This option enable/disable <b>Go to XYZ</b> feature located under container on WP-Login page.',
)
),
);
public $be_dashboard = array(
'content' => array(
'type' => 'text',
'filter_name' => 'betheme_dashboard_content',
'title' => "Change content in <i>Welcome</i> tab.",
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces content located in <i>Welcome</i> tab in <i>Betheme > Dashboard</i>.',
)
),
'below_welcome_text' => array(
'type' => 'text',
'filter_name' => 'betheme_dashboard_below_welcome',
'title' => "Change text below the <i>Welcome to Betheme</i>",
'value' => '',
'popup_content' => array(
'image' => '',
'text' => 'This option replaces content just underneath <i>Welcome to Betheme</i>.',
)
)
);
public $advanced = array(
);
/**
* Register the templates, required to tabs work
*/
public function get_template() {
include_once( plugin_dir_path( __DIR__ ) . 'becustom/templates/general.php' );
}
public function load_subpages() {
if( defined('MFN_THEME_VERSION') ){
foreach($this->becustom_subpages as $page){
include_once( plugin_dir_path( __DIR__ ) . 'becustom/becustom_'.$page.'.php');
//to clear all records
//delete_option('be_custom_'.$page);
}
}
}
public function add_menu() {
$default_theme_slug = 'be';
$default_theme_label = 'betheme';
$this->page = add_submenu_page(
apply_filters('betheme_dynamic_slug', 'betheme'),
__( 'BeCustom', 'mfn-translate' ),
'BeCustom',
'edit_theme_options',
'be_custom',
array( $this, 'get_template')
);
add_action('admin_print_scripts-'. $this->page, array( $this, 'becustom_mfn_essentials'));
add_action('admin_print_styles-'. $this->page, array( $this, 'enqueue' ));
}
/**
* Register or display tables
* It will iterate and check the form values and names
*/
public function iterate_merge_array(string $page_name) {
$user_settings = get_option( 'be_custom_'.$page_name );
$db_schema = $this->$page_name;
$merge_first_dimension = shortcode_atts( $db_schema, $user_settings);
$merged_array = array();
foreach($db_schema as $tableName => $tableValue){
$merged_array[$tableName] = shortcode_atts($db_schema[$tableName], $merge_first_dimension[$tableName]);
}
return $merged_array;
}
/*
Provide popup html
*/
public function popup($attribute_name){
$roll_uid = uniqid();
return '<a href="#popup-'. $roll_uid .'" class="popup-link mfn-option-btn"><span class="mfn-icon mfn-icon-information"></span></a>
<div id="popup-'. $roll_uid .'" class="popup-content">
<div class="popup-inner" style="padding:10px;">
<div class="becustom-popup-image">
<img src="'. $this->get_attributes[$attribute_name]['popup_content']['image'] .'" />
</div>
<div class="becustom-popup-text">
'. $this->get_attributes[$attribute_name]['popup_content']['text'] .'
</div>
</div>
</div>';
}
/*
Pass values straight from the array
*/
public function get_page_attributes($page_name){
return $this->$page_name;
}
/**
* Enqueue styles and scripts
*/
public function enqueue()
{
wp_register_script('be_custom_js', '/wp-content/plugins/becustom/assets/script.js', array('jquery'), '', true);
wp_register_style('be_custom_css', '/wp-content/plugins/becustom/assets/style.css');
wp_enqueue_script('be_custom_js');
wp_enqueue_style('be_custom_css');
}
/**
* BeTheme fields + CSS/JS files
*/
public function becustom_mfn_essentials() {
//do not load, when the theme is not betheme!
if( defined('MFN_THEME_VERSION') ){
require_once(get_template_directory().'/functions/builder/class-mfn-builder-admin.php');
wp_register_script('be_custom_mfn_js', get_theme_file_uri('/muffin-options/js/options.js'), array('jquery'), time(), true);
wp_register_style('be_custom_mfn_css', get_theme_file_uri('/muffin-options/css/options.css'), false, time(), 'all');
wp_enqueue_script('be_custom_mfn_js');
wp_enqueue_style('be_custom_mfn_css');
}
}
/**
* Registration | Is hosted
*/
function mfn_is_hosted()
{
return defined( 'ENVATO_HOSTED_KEY' ) ? true : false;
}
/**
* Registration | Is registered
*/
function mfn_is_registered()
{
if ( $this->mfn_is_hosted() ) {
return $this->mfn_is_hosted();
}
if ( $this->mfn_get_purchase_code() ) {
return strlen( $this->mfn_get_purchase_code() );
}
return true;
}
/**
* Registration | Get purchase code
*/
function mfn_get_purchase_code()
{
if ( $this->mfn_is_hosted() ) {
return SUBSCRIPTION_CODE;
}
$code = get_site_option( 'envato_purchase_code_7758048' );
if( ! $code ){
// BeTheme < 21.0.8 backward compatibility
$code = get_site_option( 'betheme_purchase_code' );
if( $code ){
update_site_option( 'envato_purchase_code_7758048', $code );
delete_site_option( 'betheme_purchase_code' );
delete_site_option( 'betheme_registered' );
}
}
return $code;
}
/*
This function is used only when theme is not
registered, to check, if label is changed (proper redirect after registering)
*/
public function becustom_check_without_register(string $default){
$theme_slug = $this->iterate_merge_array( 'branding' )['betheme_url_slug']['value'];
if(($theme_slug)){
$default = preg_replace('/betheme/', $theme_slug, $default);
}
return $default;
}
public function __construct() {
if( $this->mfn_is_registered() ) {
//menu & subpages
add_action( 'admin_menu', array( $this, 'add_menu'), 20);
add_action( 'load_textdomain', array( $this, 'load_subpages' ), 1 );
}else{
add_filter( 'becustom_check_without_register', array( $this, 'becustom_check_without_register' ), 1, 3);
}
}
}
new Be_custom();