mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Fix warning in PHP 8.0
This commit is contained in:
parent
375a71866d
commit
faea821e78
9 changed files with 103 additions and 131 deletions
|
|
@ -45,16 +45,8 @@ class communicationAdminModel extends communication
|
|||
$oModuleModel = getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir);
|
||||
Context::set('skin_info', $skin_info);
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$communication_config = $oModuleModel->getModuleConfig('communication');
|
||||
if(!is_object($communication_config)) $communication_config = new stdClass;
|
||||
if(!$communication_config->colorset)
|
||||
{
|
||||
$communication_config->colorset = "white";
|
||||
}
|
||||
Context::set('communication_config', $communication_config);
|
||||
|
||||
Context::set('communication_config', CommunicationModel::getConfig());
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('skin_info.colorset..title', 'skin_info.colorset..name');
|
||||
$security->encodeHTML('skin_info.colorset..name');
|
||||
|
|
|
|||
|
|
@ -30,42 +30,19 @@ class communicationModel extends communication
|
|||
{
|
||||
$config = new stdClass();
|
||||
}
|
||||
|
||||
if(!$config->skin)
|
||||
{
|
||||
$config->skin = 'default';
|
||||
}
|
||||
|
||||
if(!$config->colorset)
|
||||
{
|
||||
$config->colorset = 'white';
|
||||
}
|
||||
|
||||
if(!$config->editor_skin)
|
||||
{
|
||||
$config->editor_skin = 'ckeditor';
|
||||
}
|
||||
|
||||
if(!$config->mskin)
|
||||
{
|
||||
$config->mskin = 'default';
|
||||
}
|
||||
|
||||
if(!$config->grant_send)
|
||||
{
|
||||
$config->grant_send = array('default' => 'member');
|
||||
}
|
||||
|
||||
if(!$config->enable_message)
|
||||
{
|
||||
$config->enable_message = 'Y';
|
||||
}
|
||||
$config->enable_message = $config->enable_message ?? 'Y';
|
||||
$config->enable_friend = $config->enable_friend ?? 'Y';
|
||||
$config->enable_attachment = $config->enable_attachment ?? 'N';
|
||||
$config->editor_skin = $config->editor_skin ?? 'ckeditor';
|
||||
$config->layout_srl = $config->layout_srl ?? 0;
|
||||
$config->skin = $config->skin ?? 'default';
|
||||
$config->colorset = $config->colorset ?? 'white';
|
||||
$config->mlayout_srl = $config->mlayout_srl ?? 0;
|
||||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'white';
|
||||
$config->grant_send = $config->grant_send ?? array('default' => 'member');
|
||||
|
||||
if(!$config->enable_friend)
|
||||
{
|
||||
$config->enable_friend = 'Y';
|
||||
}
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -849,14 +849,14 @@ class moduleAdminController extends module
|
|||
$lang_supported = Context::loadLangSelected();
|
||||
$defaultLang = config('locale.default_lang');
|
||||
|
||||
if(!isset($langMap[$defaultLang]) || !is_array($langMap[$defaultLang]))
|
||||
if(!isset($langMap[$defaultLang]))
|
||||
{
|
||||
$langMap[$defaultLang] = array();
|
||||
}
|
||||
|
||||
foreach($lang_supported as $langCode => $langName)
|
||||
{
|
||||
if(!is_array($langMap[$langCode]))
|
||||
if(!isset($langMap[$langCode]))
|
||||
{
|
||||
$langMap[$langCode] = array();
|
||||
}
|
||||
|
|
@ -869,7 +869,7 @@ class moduleAdminController extends module
|
|||
continue;
|
||||
}
|
||||
|
||||
if(!isset($langMap[$targetLangCode]) || !is_array($langMap[$targetLangCode]))
|
||||
if(!isset($langMap[$targetLangCode]))
|
||||
{
|
||||
$langMap[$targetLangCode] = array();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,71 +18,62 @@ class ncenterliteModel extends ncenterlite
|
|||
$config = new stdClass();
|
||||
}
|
||||
|
||||
if(!is_array($config->use))
|
||||
$config->use = $config->use ?? array('message' => array('web' => 1));
|
||||
$config->display_use = $config->display_use ?? 'all';
|
||||
$config->always_display = $config->always_display ?? 'N';
|
||||
$config->user_config_list = $config->user_config_list ?? 'N';
|
||||
$config->user_notify_setting = $config->user_notify_setting ?? 'N';
|
||||
$config->document_read = $config->document_read ?? 'Y';
|
||||
$config->variable_name = $config->variable_name ?? 0;
|
||||
$config->mention_names = $config->mention_names ?? 'nick_name';
|
||||
$config->mention_suffixes = $config->mention_suffixes ?? array('님', '様', 'さん', 'ちゃん');
|
||||
$config->mention_suffix_always_cut = $config->mention_suffix_always_cut ?? 'N';
|
||||
$config->mention_limit = $config->mention_limit ?? 20;
|
||||
$config->anonymous_voter = $config->anonymous_voter ?? 'N';
|
||||
$config->anonymous_scrap = $config->anonymous_scrap ?? 'N';
|
||||
$config->highlight_effect = $config->highlight_effect ?? 'Y';
|
||||
$config->unsubscribe = $config->unsubscribe ?? 'N';
|
||||
$config->comment_all = $config->comment_all ?? 'N';
|
||||
$config->comment_all_notify_module_srls = $config->comment_all_notify_module_srls ?? array();
|
||||
$config->hide_module_srls = $config->hide_module_srls ?? array();
|
||||
$config->admin_notify_module_srls = $config->admin_notify_module_srls ?? array();
|
||||
$config->layout_srl = $config->layout_srl ?? 0;
|
||||
$config->mlayout_srl = $config->mlayout_srl ?? 0;
|
||||
$config->skin = $config->skin ?? 'default';
|
||||
$config->colorset = $config->colorset ?? 'black';
|
||||
$config->mskin = $config->mskin ?? 'default';
|
||||
$config->mcolorset = $config->mcolorset ?? 'black';
|
||||
$config->zindex = $config->zindex ?? '9999';
|
||||
$config->notify_count = $config->notify_count ?? 5;
|
||||
|
||||
if(!isset($config->hide_module_srls))
|
||||
{
|
||||
if($config->use == 'Y')
|
||||
{
|
||||
$config->use = array();
|
||||
foreach (self::getNotifyTypes() as $type => $srl)
|
||||
{
|
||||
$config->use[$type] = array('web' => 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->use = array('message' => array('web' => 1));
|
||||
}
|
||||
$config->hide_module_srls = array();
|
||||
}
|
||||
else
|
||||
elseif(!is_array($config->hide_module_srls))
|
||||
{
|
||||
if(count($config->use) && !is_array(array_first($config->use)))
|
||||
{
|
||||
foreach($config->use as $key => $value)
|
||||
{
|
||||
$config->use[$key] = array();
|
||||
$config->use[$key]['web'] = $value;
|
||||
}
|
||||
getController('module')->insertModuleConfig('ncenterlite', $config);
|
||||
}
|
||||
$config->hide_module_srls = explode('|@|', $config->hide_module_srls);
|
||||
}
|
||||
|
||||
if(!$config->display_use) $config->display_use = 'all';
|
||||
if(!$config->mention_names) $config->mention_names = 'nick_name';
|
||||
if(!$config->mention_suffixes)
|
||||
// Convert old config format
|
||||
if($config->use === 'Y')
|
||||
{
|
||||
$config->mention_suffixes = array('님', '様', 'さん', 'ちゃん');
|
||||
$config->use = array();
|
||||
foreach (self::getNotifyTypes() as $type => $srl)
|
||||
{
|
||||
$config->use[$type] = array('web' => 1);
|
||||
}
|
||||
}
|
||||
elseif(is_array($config->use) && !is_array(array_first($config->use)))
|
||||
{
|
||||
foreach($config->use as $key => $value)
|
||||
{
|
||||
$config->use[$key] = array();
|
||||
$config->use[$key]['web'] = $value;
|
||||
}
|
||||
getController('module')->insertModuleConfig('ncenterlite', $config);
|
||||
}
|
||||
unset($config->mention_format);
|
||||
if(!isset($config->mention_limit))
|
||||
{
|
||||
$config->mention_limit = 20;
|
||||
}
|
||||
if(!$config->hide_module_srls) $config->hide_module_srls = array();
|
||||
if(!is_array($config->hide_module_srls)) $config->hide_module_srls = explode('|@|', $config->hide_module_srls);
|
||||
if(!$config->document_read) $config->document_read = 'Y';
|
||||
if(!$config->skin) $config->skin = 'default';
|
||||
if(!$config->colorset) $config->colorset = 'black';
|
||||
if(!$config->zindex) $config->zindex = '9999';
|
||||
if(!$config->user_notify_setting)
|
||||
{
|
||||
$config->user_notify_setting = 'N';
|
||||
}
|
||||
if(!$config->anonymous_voter)
|
||||
{
|
||||
$config->anonymous_voter = 'N';
|
||||
}
|
||||
if(!$config->anonymous_scrap)
|
||||
{
|
||||
$config->anonymous_scrap = 'N';
|
||||
}
|
||||
if(!$config->highlight_effect)
|
||||
{
|
||||
$config->highlight_effect = 'Y';
|
||||
}
|
||||
if(!isset($config->notify_count) || !$config->notify_count)
|
||||
{
|
||||
$config->notify_count = 5;
|
||||
}
|
||||
|
||||
self::$_config = $config;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ class widgetController extends widget
|
|||
return $matches[0];
|
||||
}
|
||||
unset($vars->widget);
|
||||
|
||||
|
||||
return $this->execute($widget, $vars, $this->javascript_mode);
|
||||
}
|
||||
|
||||
|
|
@ -331,19 +331,16 @@ class widgetController extends widget
|
|||
{
|
||||
$buff = $matches[0][$i];
|
||||
$xml_doc = $oXmlParser->parse(trim($buff));
|
||||
|
||||
$args = $xml_doc->img->attrs;
|
||||
if(!$args) continue;
|
||||
// If you are not caching path
|
||||
$widget = $args->widget;
|
||||
$sequence = $args->widget_sequence;
|
||||
$cache = $args->widget_cache;
|
||||
if(!$cache) continue;
|
||||
if(!$sequence)
|
||||
if(!$args || !$widget || empty($args->widget_cache))
|
||||
{
|
||||
$sequence = sha1(json_encode($args));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
foreach($args as $k => $v)
|
||||
{
|
||||
$args->{$k} = urldecode($v);
|
||||
|
|
@ -351,7 +348,7 @@ class widgetController extends widget
|
|||
|
||||
foreach($lang_list as $lang_type => $val)
|
||||
{
|
||||
$this->getCache($widget, $args, $lang_type, true, $sequence);
|
||||
$this->getCache($widget, $args, $lang_type, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -368,7 +365,7 @@ class widgetController extends widget
|
|||
}
|
||||
|
||||
// Fix the widget sequence if it is missing
|
||||
$widget_sequence = $override_sequence ?: ($args->widget_sequence ?? 0);
|
||||
$widget_sequence = $override_sequence ?: $args->widget_sequence;
|
||||
if (!$widget_sequence)
|
||||
{
|
||||
$widget_sequence = sha1(json_encode($args));
|
||||
|
|
@ -463,8 +460,12 @@ class widgetController extends widget
|
|||
if($escaped) $args->{$key} = utf8RawUrlDecode($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Set default
|
||||
$args->widget_sequence = $args->widget_sequence ?? 0;
|
||||
$args->widget_cache = $args->widget_cache ?? 0;
|
||||
$args->colorset = $args->colorset ?? null;
|
||||
|
||||
/**
|
||||
* Widgets widgetContent/widgetBox Wanted If you are not content
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue