Fix various warnings in board configuration submenus

This commit is contained in:
Kijin Sung 2025-06-01 15:51:02 +09:00
parent eb76f9d8bb
commit 967f67ec99
8 changed files with 37 additions and 33 deletions

View file

@ -28,15 +28,15 @@
<div class="x_control-group">
<label for="include_days" class="x_control-label">{$lang->cmd_board_include_days}</label>
<div class="x_controls">
<input name="include_days" id="include_days" type="number" min="0" step="0.01" value="{$module_info->include_days ?: 0}" /> {$lang->unit_day}
<input name="include_days" id="include_days" type="number" min="0" step="0.01" value="{$module_info->include_days ?? 0}" /> {$lang->unit_day}
<p class="x_help-block">{$lang->about_board_include_days}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->cmd_board_include_notice}</label>
<div class="x_controls">
<label class="x_inline"><input name="include_notice" type="radio" value="Y" checked="checked"|cond="$module_info->include_notice !== 'N'" /> {$lang->cmd_yes} </label>
<label class="x_inline"><input name="include_notice" type="radio" value="N" checked="checked"|cond="$module_info->include_notice === 'N'" /> {$lang->cmd_no} </label>
<label class="x_inline"><input name="include_notice" type="radio" value="Y" checked="checked"|cond="!isset($module_info->include_notice) || $module_info->include_notice !== 'N'" /> {$lang->cmd_yes} </label>
<label class="x_inline"><input name="include_notice" type="radio" value="N" checked="checked"|cond="isset($module_info->include_notice) && $module_info->include_notice === 'N'" /> {$lang->cmd_no} </label>
</div>
</div>
<div class="btnArea">

View file

@ -9,7 +9,7 @@
<input type="hidden" name="act" value="procBoardAdminInsertBoard" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
<input cond="$mid || $module_srl" type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input cond="!empty($mid) || !empty($module_srl)" type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input cond="$logged_info->is_admin != 'Y'" type="hidden" name="board_name" value="{$module_info->mid}" />
<input type="hidden" name="xe_validator_id" value="modules/board/tpl/board_insert/1" />
<section class="section">
@ -201,7 +201,7 @@
<p style="padding:3px 0 0 0">{$lang->about_list_config}</p>
<div style="display:inline-block">
<select class="multiorder_show" size="8" multiple="multiple" style="width:220px;vertical-align:top;margin-bottom:8px">
<option loop="$extra_vars => $key, $val" cond="!$list_config[$key]" value="{$key}">{Context::replaceUserLang($val->name)}</option>
<option loop="$extra_vars => $key, $val" cond="empty($list_config[$key])" value="{$key}">{Context::replaceUserLang($val->name)}</option>
</select><br />
<button type="button" class="x_btn multiorder_add" style="vertical-align:top">{$lang->cmd_insert}</button>
</div>

View file

@ -147,8 +147,8 @@
<input type="radio" name="content_font" id="font_{$name}" value="{$detail}" checked="checked"|cond="$editor_config->content_font == $detail && $editor_config->font_defined != 'Y'" /> {$fontname_simplified}
</label>
<label>
<input type="radio" class="fontSelector" name="font_defined" id="font_defined" value="Y" checked="checked"|cond="$editor_config->font_defined== 'Y'" /> {$lang->by_you} :
<input type="text" name="content_font_defined" value="{$editor_config->content_font}"|cond="$editor_config->font_defined == 'Y'" />
<input type="radio" class="fontSelector" name="font_defined" id="font_defined" value="Y" checked="checked"|cond="isset($editor_config->font_defined) && $editor_config->font_defined == 'Y'" /> {$lang->by_you} :
<input type="text" name="content_font_defined" value="{$editor_config->content_font}"|cond="isset($editor_config->font_defined) && $editor_config->font_defined == 'Y'" />
</label>
</td>
</tr>

View file

@ -172,6 +172,7 @@ class ModuleAdminModel extends Module
$grant_list->manager->default = 'manager';
Context::set('grant_list', $grant_list);
// Get a permission group granted to the current module
$selected_group = array();
$default_grant = array();
$args = new stdClass();
$args->module_srl = $module_srl;
@ -375,21 +376,24 @@ class ModuleAdminModel extends Module
$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
}
if($skin_info->extra_vars)
if($skin_info && $skin_info->extra_vars)
{
foreach($skin_info->extra_vars as $key => $val)
{
$group = $val->group;
$name = $val->name;
$type = $val->type;
if($skin_vars[$name])
if (isset($skin_vars[$name]) && $skin_vars[$name])
{
$value = $skin_vars[$name]->value;
}
else $value = '';
if($type=="checkbox")
else
{
$value = $value?unserialize($value):array();
$value = '';
}
if ($type === 'checkbox')
{
$value = $value ? unserialize($value) : [];
}
$value = empty($value) ? $val->default : $value;

View file

@ -424,14 +424,14 @@ class ModuleModel extends Module
*
* @param stdClass $moduleInfo Module information
*/
private static function _applyDefaultSkin(&$module_info)
private static function _applyDefaultSkin($module_info)
{
if($module_info->is_skin_fix == 'N')
if(isset($module_info->is_skin_fix) && $module_info->is_skin_fix == 'N')
{
$module_info->skin = '/USE_DEFAULT/';
}
if($module_info->is_mskin_fix == 'N' && $module_info->mskin !== '/USE_RESPONSIVE/')
if(isset($module_info->is_mskin_fix) && $module_info->is_mskin_fix == 'N' && $module_info->mskin !== '/USE_RESPONSIVE/')
{
$module_info->mskin = '/USE_DEFAULT/';
}

View file

@ -58,16 +58,16 @@
<label for="{$grant_name}_default" class="x_control-label">{$grant_item->title}</label>
<div class="x_controls">
<select name="{$grant_name}_default" id="{$grant_name}_default" class="grant_default">
<option value="0" <!--@if($default_grant[$grant_name]=='all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option>
<option value="-1" <!--@if($default_grant[$grant_name]=='member' || $default_grant[$grant_name]=='site')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option>
<option value="-4" <!--@if($default_grant[$grant_name]=='not_member')-->selected="selected"<!--@end-->>{$lang->grant_to_non_login_user}</option>
<option value="-3" <!--@if($default_grant[$grant_name]=='manager')-->selected="selected"<!--@end-->>{$lang->grant_to_admin}</option>
<option value="" <!--@if($default_grant[$grant_name]=='group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
<option value="0" <!--@if(($default_grant[$grant_name] ?? '') == 'all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option>
<option value="-1" <!--@if(($default_grant[$grant_name] ?? '') == 'member' || ($default_grant[$grant_name] ?? '') == 'site')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option>
<option value="-4" <!--@if(($default_grant[$grant_name] ?? '') == 'not_member')-->selected="selected"<!--@end-->>{$lang->grant_to_non_login_user}</option>
<option value="-3" <!--@if(($default_grant[$grant_name] ?? '') == 'manager')-->selected="selected"<!--@end-->>{$lang->grant_to_admin}</option>
<option value="" <!--@if(($default_grant[$grant_name] ?? '') == 'group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
</select>
<div id="zone_{$grant_name}" hidden style="margin:8px 0 0 0">
<!--@foreach($group_list as $group_srl => $group_item)-->
<label for="grant_{$grant_name}_{$group_srl}" class="x_inline">
<input type="checkbox" class="checkbox" name="{$grant_name}" value="{$group_item->group_srl}" id="grant_{$grant_name}_{$group_srl}" checked="checked"|cond="is_array($selected_group[$grant_name])&&in_array($group_srl,$selected_group[$grant_name])" />
<input type="checkbox" class="checkbox" name="{$grant_name}" value="{$group_item->group_srl}" id="grant_{$grant_name}_{$group_srl}" checked="checked"|cond="is_array($selected_group[$grant_name] ?? null) && in_array($group_srl, $selected_group[$grant_name])" />
{Context::replaceUserLang($group_item->title, true)}
</label>
<!--@end-->

View file

@ -25,7 +25,7 @@
{$lang->skin_author}
</label>
<div class="x_controls" style="padding-top:3px">
<block loop="$skin_info->author=>$author">
<block loop="$skin_info->author ?? [] => $author">
{$author->name}
<block cond="$author->homepage || $author->email_address">
(<a href="{$author->homepage}" target="_blank" cond="$author->homepage">{$author->homepage}</a>
@ -41,16 +41,16 @@
</div>
<div class="x_control-group">
<label class="x_control-label">{$lang->date}</label>
<div class="x_controls" style="padding-top:3px">{zdate($skin_info->date, 'Y-m-d')}</div>
<div class="x_controls" style="padding-top:3px">{zdate($skin_info->date ?? '', 'Y-m-d')}</div>
</div>
<div class="x_control-group" cond="$skin_info->license || $skin_info->license_link">
<div class="x_control-group" cond="!empty($skin_info->license) || !empty($skin_info->license_link)">
<label class="x_control-label">{$lang->skin_license}</label>
<div class="x_controls" style="padding-top:3px">
{nl2br(trim($skin_info->license))}
<p cond="$skin_info->license_link"><a href="{$skin_info->license_link}" target="_blank">{$skin_info->license_link}</a></p>
</div>
</div>
<div class="x_control-group" cond="$skin_info->description">
<div class="x_control-group" cond="!empty($skin_info->description)">
<label class="x_control-label">{$lang->description}</label>
<div class="x_controls" style="padding-top:3px">{nl2br(trim($skin_info->description))}</div>
</div>
@ -79,7 +79,7 @@
</div>
</div>
<block loop="$skin_info->extra_vars => $key, $val">
<block cond="$val->group && ((!$group) || $group != $val->group)">
<block cond="$val->group && (empty($group) || $group != $val->group)">
{@$group = $val->group}
</section>
<section class="section">
@ -90,10 +90,10 @@
<label class="x_control-label" for="{$val->name}"|cond="$val->type!='text'&&$val->type!='textarea'" for="lang_{$val->name}"|cond="$val->type=='text'||$val->type=='textarea'">{$val->title}</label>
<div class="x_controls">
<!--// text -->
<input cond="$val->type == 'text'" type="text" name="{$val->name}" id="{$val->name}" value="<!--@if(strpos($val->value, '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}<!--@end-->" class="lang_code" />
<input cond="$val->type == 'text'" type="text" name="{$val->name}" id="{$val->name}" value="<!--@if(strpos($val->value ?? '', '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}<!--@end-->" class="lang_code" />
<!--// textarea -->
<textarea cond="$val->type == 'textarea'" rows="8" cols="42" name="{$val->name}" id="{$val->name}" class="lang_code"><!--@if(strpos($val->value, '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}<!--@end--></textarea>
<textarea cond="$val->type == 'textarea'" rows="8" cols="42" name="{$val->name}" id="{$val->name}" class="lang_code"><!--@if(strpos($val->value ?? '', '$user_lang->') === false)-->{$val->value}<!--@else-->{htmlspecialchars($val->value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}<!--@end--></textarea>
<!--// select -->
<select cond="$val->type == 'select'" name="{$val->name}" id="{$val->name}">
@ -130,6 +130,6 @@
<button class="x_btn x_btn-primary x_pull-right" type="submit">{$lang->cmd_registration}</button>
</div>
</form>
<!--@if($use_colorpicker)-->
<!--@if($use_colorpicker ?? false)-->
<!--%load_js_plugin("spectrum")-->
<!--@end-->

View file

@ -1,13 +1,13 @@
<section class="section">
<h1>{$lang->open_rss}</h1>
<p>{$lang->about_open_rss}</p>
<form ruleset="insertRssModuleConfig" action="./" method="post" class="x_form-horizontal">
<input type="hidden" name="module" value="rss" />
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="target_module_srl" value="{$module_config->module_srl ?: $module_srls}" />
<div class="x_control-group">
<label for="open_rss" class="x_control-label">{$lang->open_rss}</label>
<div class="x_controls">
@ -28,14 +28,14 @@
<div class="x_control-group">
<label for="feed_description" class="x_control-label">{$lang->description}</label>
<div class="x_controls">
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_description)}</textarea>
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_description ?? '')}</textarea>
<p class="x_help-block">{$lang->about_feed_description}</p>
</div>
</div>
<div class="x_control-group">
<label for="feed_copyright" class="x_control-label">{$lang->feed_copyright}</label>
<div class="x_controls">
<textarea name="feed_copyright" id="feed_copyright" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_copyright)}</textarea>
<textarea name="feed_copyright" id="feed_copyright" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_copyright ?? '')}</textarea>
<p class="x_help-block">{$lang->about_feed_copyright}</p>
</div>
</div>