<?php
/**
* Translator Revolution DropDown WP Plugin
* http://goo.gl/xrxDo
*
* LICENSE
*
* You need to buy a license if you want use this script.
* https://codecanyon.net/legal/market
*
* @package Translator Revolution WP Plugin
* @copyright Copyright (c) 2020, SurStudio, www.surstudio.net
* @license https://codecanyon.net/licenses/terms/regular
* @version 2.1
* @date 2020-10-25
*/
class SurStudioPluginTranslatorRevolutionDropDownConfig {
const NAME = 'TranslatorRevolutionDropDown';
const VERSION = '2.1';
const UI_NAME = 'Auto Translation';
const WIDGET_NAME = 'Translator Revolution DropDown';
const WELCOME_NAME = 'Dashboard';
const UI_WELCOME_NAME = 'Dashboard';
const SETTINGS_NAME = 'Settings';
const UI_SETTINGS_NAME = 'Settings';
const UI_TRANSLATIONS_NAME = 'Edit translations';
const ADMIN_TRANSLATIONS_NAME = 'surstudio-translator-revolution-dropdown-translations';
const WIDGET_INTERNAL_NAME = 'surstudio-translator-revolution-dropdown';
const ADMIN_LANGUAGE_DOMAIN = 'translator_revolution_dropdown';
const ADMIN_WELCOME_NAME = 'translator-revolution-dropdown-plugin-dashboard';
const ADMIN_SETTINGS_NAME = 'translator-revolution-dropdown-plugin-settings';
const ADMIN_SETTINGS_IMPORT_EXPORT_NAME = 'translator-revolution-dropdow-plugin-import-export-settings';
const DB_MAIN_NAME = 'translator-revolution-dropdown-main';
const DB_SETTINGS_NAME = 'translator-revolution-dropdown-settings';
const DB_CACHE_WRITABLE_FLAG_NAME = 'translator-revolution-dropdown-cache-validate';
const ENABLE_SUPPORT_TAB = true;
protected static $_settings = null;
protected static $_main_settings = null;
public static function getName($_to_lower=false, $_ui=false) {
if ($_ui)
return $_to_lower ? strtolower(self::UI_NAME) : self::UI_NAME;
else
return $_to_lower ? strtolower(self::NAME) : self::NAME;
}
public static function getWelcomeName($_to_lower=false, $_ui=false) {
if ($_ui)
return $_to_lower ? strtolower(self::UI_WELCOME_NAME) : self::UI_WELCOME_NAME;
else
return $_to_lower ? strtolower(self::WELCOME_NAME) : self::WELCOME_NAME;
}
public static function getSettingsName($_to_lower=false, $_ui=false) {
if ($_ui)
return $_to_lower ? strtolower(self::UI_SETTINGS_NAME) : self::UI_SETTINGS_NAME;
else
return $_to_lower ? strtolower(self::SETTINGS_NAME) : self::SETTINGS_NAME;
}
public static function getTranslationsName() {
return self::UI_TRANSLATIONS_NAME;
}
public static function getTranslationsHandle() {
return self::ADMIN_TRANSLATIONS_NAME;
}
public static function getWidgetName($_internal=false) {
return $_internal ? self::WIDGET_INTERNAL_NAME : self::WIDGET_NAME;
}
public static function getVersion() {
return self::VERSION;
}
public static function getAdminLanguageDomain() {
return self::ADMIN_LANGUAGE_DOMAIN;
}
public static function getAdminPageTitle() {
return __('Plugin Settings', SURSTUDIO_TRD_TEXTDOMAIN);
}
public static function getWelcomeHandle() {
return self::ADMIN_WELCOME_NAME;
}
public static function getAdminHandle() {
return self::ADMIN_SETTINGS_NAME;
}
public static function getAdminImportExportHandle() {
return self::ADMIN_SETTINGS_IMPORT_EXPORT_NAME;
}
public static function isSupportTabEnabled() {
return self::ENABLE_SUPPORT_TAB;
}
public static function getDbCacheWritableName() {
return self::DB_CACHE_WRITABLE_FLAG_NAME;
}
public static function getDbMainName() {
return self::DB_MAIN_NAME;
}
public static function getDbSettingsName() {
return self::DB_SETTINGS_NAME;
}
public static function setCacheFlag($_value) {
$name = SurStudioPluginTranslatorRevolutionDropDownConfig::getDbCacheWritableName();
$value = $_value ? 'true' : 'false';
if (!get_option($name))
add_option($name, $value);
else
update_option($name, $value);
}
public static function getCacheFlag() {
$option = get_option(SurStudioPluginTranslatorRevolutionDropDownConfig::getDbCacheWritableName());
if (!$option)
return false;
return $option == 'true';
}
public static function _get_main_settings() {
$option = get_option(SurStudioPluginTranslatorRevolutionDropDownConfig::getDbMainName());
return !$option ? array() : $option;
}
public static function _get_settings() {
$option = get_option(SurStudioPluginTranslatorRevolutionDropDownConfig::getDbSettingsName());
return !$option ? array() : $option;
}
public static function getMainSettings($_force=false) {
if (is_array(self::$_main_settings) && $_force == false)
return self::$_main_settings;
$defaults = self::getMainDefaults();
$current = self::_get_main_settings();
$result = SurStudioPluginTranslatorRevolutionDropDownCommon::mergeArrays($defaults, $current);
return self::$_settings = $result;
}
public static function getSettings($_force=false) {
if (is_array(self::$_settings) && $_force == false)
return self::$_settings;
$defaults = self::getDefaults();
$current = self::_get_settings();
$result = SurStudioPluginTranslatorRevolutionDropDownCommon::mergeArrays($defaults, $current);
$result = self::_adjust_languages($result, $current);
return self::$_settings = $result;
}
protected static function _adjust_languages($_settings, $_current) {
$result = $_settings;
if (array_key_exists('languages', $_current))
$result['languages']['value'] = $_current['languages']['value'];
return $result;
}
public static function getMainSetting($_name, $_force=false) {
$settings = self::getMainSettings($_force);
return array_key_exists($_name, $settings) ? $settings[$_name] : null;
}
public static function getSetting($_name, $_force=false) {
$settings = self::getSettings($_force);
return array_key_exists($_name, $settings) ? $settings[$_name] : null;
}
protected static function _compare_settings($_id, $_setting_1, $_setting_2) {
if (SurStudioPluginTranslatorRevolutionDropDownCommon::endsWith($_id, '_template'))
return SurStudioPluginTranslatorRevolutionDropDownCommon::stripBreakLinesAndTabs($_setting_1['value']) == SurStudioPluginTranslatorRevolutionDropDownCommon::stripBreakLinesAndTabs($_setting_2['value']);
if ($_id == 'override')
if ($_setting_1['value'] != $_setting_2['value'] && SurStudioPluginTranslatorRevolutionDropDownValidator::isEmpty($_setting_1['value']))
return true;
if ($_id == 'languages')
return $_setting_1['value'] === $_setting_2['value'];
return $_setting_1['value'] == $_setting_2['value'];
}
protected static function _get_settings_values_for_export() {
$settings = self::_get_settings();
return count($settings) > 0 ? base64_encode(serialize($settings)) : __('No settings to export. The current settings are the default ones.', SURSTUDIO_TRD_TEXTDOMAIN);
}
public static function getSettingsValues($_force=false, $_new=true) {
$result = array();
$settings = self::getSettings($_force);
$defaults = self::getDefaults();
foreach ($settings as $key => $setting)
if ($_new == false || !self::_compare_settings($key, $setting, $defaults[$key]))
$result[$key] = array(
'value' => $setting['value'],
'option_id' => array_key_exists('option_id', $setting) ? $setting['option_id'] : null
);
return $result;
}
public static function getMainSettingValue($_name, $_force=false) {
$setting = self::getMainSetting($_name, $_force);
$result = $setting['value'];
if (SurStudioPluginTranslatorRevolutionDropDownValidator::isBool($result))
$result = $result == 'true' || $result === true;
return $result;
}
public static function getSettingValue($_name, $_force=false) {
$setting = self::getSetting($_name, $_force);
if (is_null($setting))
return $setting;
$result = $setting['value'];
if (SurStudi
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v2.1 Nulled.zip
共177个文件
gif:111个
tpl:40个
png:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 155 浏览量
2022-04-17
18:30:14
上传
评论
收藏 259KB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v2.1 Nulled Ajax Translator Revolution DropDown WP Plugin Ajax翻译转速下拉WP插件" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v2.1 Nulled.zip (177个子文件)
admin.css 44KB
jquery.translator.css 9KB
loading.gif 2KB
Macedonian.gif 1KB
Sinhala.gif 1KB
English.gif 1KB
Bosnian.gif 1KB
Welsh.gif 1KB
Afrikaans.gif 1KB
Sesotho.gif 1KB
Xhosa.gif 1KB
Zulu.gif 1KB
Portuguese.gif 1KB
Scots_Gaelic.gif 1KB
Maori.gif 1KB
Sindhi.gif 1KB
Urdu.gif 1KB
Punjabi.gif 1KB
Bengali.gif 1KB
Kazakh.gif 1KB
Kyrgyz.gif 1KB
Pashto.gif 1KB
Turkish.gif 1KB
Korean.gif 1KB
Detect.gif 1KB
Basque.gif 1KB
Albanian.gif 1KB
Shona.gif 1KB
Hmong.gif 1KB
Vietnamese.gif 1KB
Croatian.gif 1KB
Tagalog.gif 1KB
Cebuano.gif 1KB
Filipino.gif 1KB
Galician.gif 1KB
loading.gif 787B
Burmese.gif 663B
Mongolian.gif 662B
Swahili.gif 660B
Somali.gif 660B
Romanian.gif 659B
Amharic.gif 658B
Khmer.gif 654B
Serbian.gif 646B
Malay.gif 645B
Spanish.gif 644B
Lao.gif 642B
Belarusian.gif 641B
Azerbaijani.gif 640B
Samoan.gif 639B
Icelandic.gif 639B
Norwegian.gif 635B
Hawaiian.gif 634B
Chinese_Traditional.gif 634B
Chichewa.gif 628B
Swedish.gif 626B
Arabic.gif 625B
Chinese.gif 623B
Chinese_Simplified.gif 623B
Slovak.gif 623B
Greek.gif 622B
Czech.gif 622B
Latin.gif 622B
Italian.gif 614B
Corsican.gif 614B
Irish.gif 614B
French.gif 614B
English_.gif 613B
Slovenian.gif 610B
Georgian.gif 608B
Tajik.gif 604B
Persian.gif 604B
Kurdish.gif 604B
Uzbek.gif 601B
Telugu.gif 597B
Hausa.gif 597B
Kannada.gif 597B
Hindi.gif 597B
Igbo.gif 597B
Marathi.gif 597B
Tamil.gif 597B
Gujarati.gif 597B
Malayalam.gif 597B
German.gif 597B
Haitian_Creole.gif 596B
Maltese.gif 595B
Armenian.gif 589B
Lithuanian.gif 589B
Japanese.gif 581B
Hebrew.gif 565B
Yiddish.gif 565B
Yoruba.gif 388B
Ukrainian.gif 386B
Catalan.gif 381B
Danish.gif 379B
Malagasy.gif 375B
Latvian.gif 369B
Estonian.gif 367B
Thai.gif 362B
Finnish.gif 361B
共 177 条
- 1
- 2
资源评论
Lee达森
- 粉丝: 1515
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功