本文整理汇总了PHP中Tygh\Settings类的典型用法代码示例。如果您正苦于以下问题:PHP Settings类的具体用法?PHP Settings怎么用?PHP Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fn_em_get_managable_settings
fn_em_delete_subscribers((array) $_REQUEST['subscriber_id']);
}
$suffix = '.manage';
}
if ($mode == 'sync') {
EmailSync::instance()->sync();
$suffix = '.manage';
}
if ($mode == 'import') {
EmailSync::instance()->import();
$suffix = '.manage';
}
return array(CONTROLLER_STATUS_OK, 'em_subscribers' . $suffix);
}
if ($mode == 'manage') {
list($subscribers, $search) = fn_em_get_subscribers($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'));
// Get settings
$em_settings = array();
foreach (fn_em_get_managable_settings() as $option) {
$option_data = Settings::instance()->getSettingDataByName($option);
$em_settings[$option_data['object_id']] = $option_data;
}
Tygh::$app['view']->assign('em_settings', $em_settings);
Tygh::$app['view']->assign('em_support', EmailSync::instance()->supports());
Tygh::$app['view']->assign('subscribers', $subscribers);
Tygh::$app['view']->assign('search', $search);
}
function fn_em_get_managable_settings()
{
return array('em_show_on_checkout', 'em_checkout_enabled', 'em_double_opt_in', 'em_welcome_letter');
}
示例2: fn_yandex_metrika_sync_goals
/**
* Common functions
*/
function fn_yandex_metrika_sync_goals()
{
$oauth_token = Settings::instance()->getValue('auth_token', 'rus_yandex_metrika');
$counter_number = Settings::instance()->getValue('counter_number', 'rus_yandex_metrika');
if (empty($oauth_token) || empty($counter_number)) {
return false;
}
$goals_scheme = fn_get_schema('rus_yandex_metrika', 'goals');
$selected_goals = Settings::instance()->getValue('collect_stats_for_goals', 'rus_yandex_metrika');
$client = new RestClient('https://api-metrika.yandex.ru/');
$ext_goals = array();
$res = $client->get("/counter/{$counter_number}/goals.json", array('oauth_token' => $oauth_token));
if (!empty($res['goals'])) {
foreach ($res['goals'] as $goal) {
$ext_goals[$goal['name']] = $goal;
}
}
foreach ($goals_scheme as $goal_name => $goal) {
$ext_goal_name = '[auto] ' . $goal['name'];
if (!empty($ext_goals[$ext_goal_name])) {
if (empty($selected_goals[$goal_name]) || $selected_goals[$goal_name] == 'N') {
$client->delete("/counter/{$counter_number}/goal/" . $ext_goals[$ext_goal_name]['id'] . "?oauth_token={$oauth_token}");
}
} else {
if (!empty($selected_goals[$goal_name]) && $selected_goals[$goal_name] == 'Y') {
$goal['name'] = $ext_goal_name;
$client->post("/counter/{$counter_number}/goals?oauth_token={$oauth_token}", array('goal' => $goal));
}
}
}
return true;
}
示例3: fn_google_analytics_get_tracking_code
/**
* Gets Google Analytics tracking code
*
* @param mixed $company_id Company identifier to get code for
* @return string Google Analytics tracking code
*/
function fn_google_analytics_get_tracking_code($company_id = null)
{
if (!fn_allowed_for('ULTIMATE')) {
$company_id = null;
}
return Settings::instance()->getValue('tracking_code', 'google_analytics', $company_id);
}
示例4: fn_mp_update_settings
function fn_mp_update_settings($mp_settings, $company_id = null)
{
if (!($setting_id = Settings::instance()->getId('maps_provider_', ''))) {
$setting_id = Settings::instance()->update(array('name' => 'maps_provider_', 'section_id' => 0, 'section_tab_id' => 0, 'type' => 'A', 'position' => 0, 'is_global' => 'N', 'handler' => ''));
}
Settings::instance()->updateValueById($setting_id, serialize($mp_settings), $company_id);
}
示例5: fn_retargeting_get_domain_api_key
function fn_retargeting_get_domain_api_key($company_id = null)
{
if (!fn_allowed_for('ULTIMATE')) {
$company_id = null;
}
return Settings::instance()->getValue('retargeting_domain_api', 'google_analytics');
}
示例6: updateCompanySettings
protected function updateCompanySettings($params, $company_id)
{
$settings = array();
foreach ($this->setting_names as $setting_name) {
if (isset($params[$setting_name])) {
Settings::instance()->updateValue($setting_name, $params[$setting_name], '', false, $company_id);
}
}
}
示例7: fn_get_paypal_settings
function fn_get_paypal_settings($lang_code = DESCR_SL)
{
$pp_settings = Settings::instance()->getValues('paypal', 'ADDON');
if (!empty($pp_settings['general']['pp_statuses'])) {
$pp_settings['general']['pp_statuses'] = unserialize($pp_settings['general']['pp_statuses']);
}
$pp_settings['general']['main_pair'] = fn_get_image_pairs(fn_paypal_get_logo_id(), 'paypal_logo', 'M', false, true, $lang_code);
return $pp_settings['general'];
}
示例8: fn_settings_actions_addons_hidpi
function fn_settings_actions_addons_hidpi(&$new_value, $old_value)
{
Storage::instance('images')->deleteDir('thumbnails');
if ($new_value == 'A') {
$formats = fn_check_gd_formats();
// Set thumbnail generation format to png to improve quality
if (!empty($formats['png'])) {
Settings::instance()->updateValue('convert_to', 'png', 'Thumbnails');
}
}
}
示例9: fn_settings_variants_addons_hybrid_auth_icons_pack
function fn_settings_variants_addons_hybrid_auth_icons_pack()
{
$available_icons_packs = array();
$theme_name = Settings::instance()->getValue('theme_name', '');
$icons_dir = fn_get_theme_path('[themes]/', 'C') . $theme_name . '/media/images/addons/hybrid_auth/icons/';
$icons_packs = fn_get_dir_contents($icons_dir);
foreach ($icons_packs as $id => $icons_packs_name) {
$available_icons_packs[$icons_packs_name] = $icons_packs_name;
}
return $available_icons_packs;
}
示例10: fn_rus_ruble_install
function fn_rus_ruble_install()
{
$currencies = Registry::get('currencies');
if (empty($currencies)) {
$currencies = fn_get_currencies_list(array(), 'A', CART_LANGUAGE);
Registry::set('currencies', $currencies);
}
$magic_key = fn_rus_ruble_gen_magic_key();
Settings::instance()->updateValue('cron_key', $magic_key, 'rus_ruble');
RusCurrency::process_sbrf_currencies(CURRENCY_RUB);
}
示例11: fn_settings_actions_addons_hidpi
function fn_settings_actions_addons_hidpi(&$new_value, $old_value)
{
Storage::instance('images')->deleteDir('thumbnails');
if ($new_value == 'A') {
$formats = fn_get_supported_image_format_variants();
// Set thumbnail generation format to png to improve quality
if (!empty($formats['png'])) {
Settings::instance()->updateValue('convert_to', 'png', 'Thumbnails');
fn_set_notification('W', __('warning'), __('addons.hidpi.thumbnail_format_changed', array('[settings_url]' => fn_url('settings.manage?section_id=Thumbnails'))));
}
}
}
示例12: fn_mp_get_settings
function fn_mp_get_settings($company_id = null)
{
static $cache;
if (empty($cache['settings_' . $company_id])) {
$settings = Settings::instance()->getValue('maps_provider_', '', $company_id);
$settings = unserialize($settings);
if (empty($settings)) {
$settings = array();
}
$cache['settings_' . $company_id] = $settings;
}
return $cache['settings_' . $company_id];
}
示例13: auth
public function auth($code)
{
$client = new RestClient('https://oauth.yandex.ru/', Registry::get('addons.yandex_market.ym_application_id'), Registry::get('addons.yandex_market.ym_application_password'), 'basic', array(), '');
try {
$res = $client->post('token', array('grant_type' => 'authorization_code', 'code' => $code));
$result = json_decode($res, true);
if (!empty($result['access_token'])) {
Settings::instance()->updateValue('ym_auth_token', $result['access_token'], 'yandex_market');
}
} catch (Pest_Exception $e) {
throw $e;
}
}
示例14: getDefault
public function getDefault($theme_name = '')
{
$condition = '';
if (empty($theme_name)) {
$theme_name = Settings::instance()->getValue('theme_name', '');
}
if (fn_allowed_for('ULTIMATE')) {
$condition = $this->getCompanyCondition('?:bm_layouts.company_id');
}
$condition .= db_quote(" AND is_default = 1 AND theme_name = ?s", $theme_name);
$layout = db_get_row("SELECT * FROM ?:bm_layouts WHERE 1 ?p", $condition);
return $layout;
}
示例15: instance
/**
* Gets CDN object instance
*
* @return Cdn CDN object instance
*/
public static function instance()
{
if (empty(self::$_instance)) {
$backend = Registry::get('config.cdn_backend');
if (empty($backend)) {
throw new DeveloperException('CDN: undefined CDN backend');
}
$options = Settings::instance()->getValue('cdn', '');
$options = !empty($options) ? unserialize($options) : array();
$class = '\\Tygh\\Backend\\Cdn\\' . ucfirst($backend);
self::$_instance = new $class($options);
}
return self::$_instance;
}